Documentation ¶
Index ¶
- Constants
- Variables
- func PairIsEuqal(g1 *GT, g2 *GT) bool
- func PairingCheck(a []*G1, b []*G2) bool
- type G1
- func (g *G1) Add(a, b *G1) *G1
- func (g *G1) HashToPoint(m []byte) error
- func (g *G1) IsNil() bool
- func (g *G1) IsValid() bool
- func (g *G1) Marshal() []byte
- func (g *G1) Neg(a *G1) *G1
- func (g *G1) ScalarBaseMult(k *big.Int) *G1
- func (g *G1) ScalarMult(a *G1, k *big.Int) *G1
- func (g *G1) Set(a *G1) *G1
- func (g *G1) String() string
- func (g *G1) Unmarshal(m []byte) ([]byte, error)
- type G2
- func (e *G2) Add(a, b *G2) *G2
- func (e *G2) IsEmpty() bool
- func (e *G2) Marshal() []byte
- func (e *G2) Neg(a *G2) *G2
- func (e *G2) ScalarBaseMult(k *big.Int) *G2
- func (e *G2) ScalarMult(a *G2, k *big.Int) *G2
- func (e *G2) Set(a *G2) *G2
- func (e *G2) String() string
- func (e *G2) Unmarshal(m []byte) ([]byte, error)
- type GT
Constants ¶
const PREFIX = "0x"
Variables ¶
var Order = bigFromBase10("21888242871839275222246405745257275088548364400416034343698204186575808495617")
Order is the number of elements in both G₁ and G₂: 36u⁴+36u³+18u²+6u+1.
var OrderP = &gfP{0x43E1F593F0000001, 0x2833E84879B97091, 0xB85045B68181585D, 0x30644E72E131A029}
var P = bigFromBase10("21888242871839275222246405745257275088696311157297823662689037894645226208583")
P is a prime over which we form a basic field: 36u⁴+36u³+24u²+6u+1.
var Pu = bigFromBase10("5472060717959818805561601436314318772174077789324455915672259473661306552145")
Pu is (P-3)/4.
Functions ¶
func PairIsEuqal ¶
func PairingCheck ¶
PairingCheck calculates the Optimal Ate pairing for a set of points.
Types ¶
type G1 ¶
type G1 struct {
// contains filtered or unexported fields
}
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.
func (*G1) HashToPoint ¶
func (*G1) ScalarBaseMult ¶
ScalarBaseMult sets e to g*k where g is the generator of the group and then returns e.
func (*G1) ScalarMult ¶
ScalarMult sets e to a*k and then returns e.
type G2 ¶
type G2 struct {
// contains filtered or unexported fields
}
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.
func (*G2) ScalarBaseMult ¶
ScalarBaseMult sets e to g*k where g is the generator of the group and then returns out.
func (*G2) ScalarMult ¶
ScalarMult sets e to a*k and then returns e.
type GT ¶
type GT struct {
// contains filtered or unexported fields
}
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.
func Miller ¶
Miller applies Miller's algorithm, which is a bilinear function from the source groups to F_p^12. Miller(g1, g2).Finalize() is equivalent to Pair(g1, g2).
func (*GT) ScalarMult ¶
ScalarMult sets e to a*k and then returns e.