File: parameters.go

package info (click to toggle)
golang-debian-vasudev-gospake2 0.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 248 kB
  • sloc: makefile: 19; sh: 15
file content (20 lines) | stat: -rw-r--r-- 420 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package integergroup

import (
	"math/big"
)

// GroupParameters defines a cyclic abelian group
type GroupParameters struct {
	p, q, g                                       *big.Int
	elementSizeBytes, elementSizeBits, scalarSize int
}

func (i *GroupParameters) equal(other *GroupParameters) bool {
	if (i.p.Cmp(other.p) != 0) &&
		(i.q.Cmp(other.q) != 0) &&
		(i.g.Cmp(other.g) != 0) {
		return false
	}
	return true
}