Order is the number of elements in both G₁ and G₂: 36u⁴+36u³+18u²+6u+1.
var Order = bigFromBase10("65000549695646603732796438742359905742570406053903786389881062969044166799969")
G1 is an abstract cyclic group. The zero value is suitable for use as the output of an operation, but cannot be used as an input.
type G1 struct {
// contains filtered or unexported fields
}
func RandomG1(r io.Reader) (*big.Int, *G1, error)
RandomG1 returns x and g₁ˣ where x is a random, non-zero number read from r.
func (e *G1) Add(a, b *G1) *G1
Add sets e to a+b and then returns e.
Warning: this function is not complete, it fails for a equal to b.
func (e *G1) Marshal() []byte
Marshal converts n to a byte slice.
func (e *G1) Neg(a *G1) *G1
Neg sets e to -a and then returns e.
func (e *G1) ScalarBaseMult(k *big.Int) *G1
ScalarBaseMult sets e to g*k where g is the generator of the group and then returns e.
func (e *G1) ScalarMult(a *G1, k *big.Int) *G1
ScalarMult sets e to a*k and then returns e.
func (e *G1) String() string
func (e *G1) Unmarshal(m []byte) (*G1, bool)
Unmarshal sets e to the result of converting the output of Marshal back into a group element and then returns e.
G2 is an abstract cyclic group. The zero value is suitable for use as the output of an operation, but cannot be used as an input.
type G2 struct {
// contains filtered or unexported fields
}
func RandomG2(r io.Reader) (*big.Int, *G2, error)
RandomG2 returns x and g₂ˣ where x is a random, non-zero number read from r.
func (e *G2) Add(a, b *G2) *G2
Add sets e to a+b and then returns e.
Warning: this function is not complete, it fails for a equal to b.
func (n *G2) Marshal() []byte
Marshal converts n into a byte slice.
func (e *G2) ScalarBaseMult(k *big.Int) *G2
ScalarBaseMult sets e to g*k where g is the generator of the group and then returns out.
func (e *G2) ScalarMult(a *G2, k *big.Int) *G2
ScalarMult sets e to a*k and then returns e.
func (e *G2) String() string
func (e *G2) Unmarshal(m []byte) (*G2, bool)
Unmarshal sets e to the result of converting the output of Marshal back into a group element and then returns e.
GT is an abstract cyclic group. The zero value is suitable for use as the output of an operation, but cannot be used as an input.
type GT struct {
// contains filtered or unexported fields
}
func Pair(g1 *G1, g2 *G2) *GT
Pair calculates an Optimal Ate pairing.
▹ Example
func (e *GT) Add(a, b *GT) *GT
Add sets e to a+b and then returns e.
func (n *GT) Marshal() []byte
Marshal converts n into a byte slice.
func (e *GT) Neg(a *GT) *GT
Neg sets e to -a and then returns e.
func (e *GT) ScalarMult(a *GT, k *big.Int) *GT
ScalarMult sets e to a*k and then returns e.
func (e *GT) String() string
func (e *GT) Unmarshal(m []byte) (*GT, bool)
Unmarshal sets e to the result of converting the output of Marshal back into a group element and then returns e.