Documentation ¶
Index ¶
- Variables
- type G1Elt
- func (p *G1Elt) Add(a, b kyber.Point) kyber.Point
- func (p *G1Elt) Base() kyber.Point
- func (p *G1Elt) Clone() kyber.Point
- func (p *G1Elt) Data() ([]byte, error)
- func (p *G1Elt) Embed(_ []byte, _ cipher.Stream) kyber.Point
- func (p *G1Elt) EmbedLen() int
- func (p *G1Elt) Equal(p2 kyber.Point) bool
- func (p *G1Elt) Hash(msg []byte) kyber.Point
- func (p *G1Elt) Hash2(msg, dst []byte) kyber.Point
- func (p *G1Elt) IsInCorrectGroup() bool
- func (p *G1Elt) MarshalBinary() (data []byte, err error)
- func (p *G1Elt) MarshalSize() int
- func (p *G1Elt) MarshalTo(w io.Writer) (int, error)
- func (p *G1Elt) Mul(s kyber.Scalar, q kyber.Point) kyber.Point
- func (p *G1Elt) Neg(a kyber.Point) kyber.Point
- func (p *G1Elt) Null() kyber.Point
- func (p *G1Elt) Pick(rand cipher.Stream) kyber.Point
- func (p *G1Elt) Set(p2 kyber.Point) kyber.Point
- func (p *G1Elt) String() string
- func (p *G1Elt) Sub(a, b kyber.Point) kyber.Point
- func (p *G1Elt) UnmarshalBinary(data []byte) error
- func (p *G1Elt) UnmarshalFrom(r io.Reader) (int, error)
- type G2Elt
- func (p *G2Elt) Add(a, b kyber.Point) kyber.Point
- func (p *G2Elt) Base() kyber.Point
- func (p *G2Elt) Clone() kyber.Point
- func (p *G2Elt) Data() ([]byte, error)
- func (p *G2Elt) Embed(_ []byte, _ cipher.Stream) kyber.Point
- func (p *G2Elt) EmbedLen() int
- func (p *G2Elt) Equal(p2 kyber.Point) bool
- func (p *G2Elt) Hash(msg []byte) kyber.Point
- func (p *G2Elt) Hash2(msg, dst []byte) kyber.Point
- func (p *G2Elt) IsInCorrectGroup() bool
- func (p *G2Elt) MarshalBinary() (data []byte, err error)
- func (p *G2Elt) MarshalSize() int
- func (p *G2Elt) MarshalTo(w io.Writer) (int, error)
- func (p *G2Elt) Mul(s kyber.Scalar, q kyber.Point) kyber.Point
- func (p *G2Elt) Neg(a kyber.Point) kyber.Point
- func (p *G2Elt) Null() kyber.Point
- func (p *G2Elt) Pick(rand cipher.Stream) kyber.Point
- func (p *G2Elt) Set(p2 kyber.Point) kyber.Point
- func (p *G2Elt) String() string
- func (p *G2Elt) Sub(a, b kyber.Point) kyber.Point
- func (p *G2Elt) UnmarshalBinary(data []byte) error
- func (p *G2Elt) UnmarshalFrom(r io.Reader) (int, error)
- type GTElt
- func (p *GTElt) Add(a, b kyber.Point) kyber.Point
- func (p *GTElt) Base() kyber.Point
- func (p *GTElt) Clone() kyber.Point
- func (p *GTElt) Data() ([]byte, error)
- func (p *GTElt) Embed(_ []byte, _ cipher.Stream) kyber.Point
- func (p *GTElt) EmbedLen() int
- func (p *GTElt) Equal(p2 kyber.Point) bool
- func (p *GTElt) MarshalBinary() (data []byte, err error)
- func (p *GTElt) MarshalSize() int
- func (p *GTElt) MarshalTo(w io.Writer) (int, error)
- func (p *GTElt) Mul(s kyber.Scalar, q kyber.Point) kyber.Point
- func (p *GTElt) Neg(a kyber.Point) kyber.Point
- func (p *GTElt) Null() kyber.Point
- func (p *GTElt) Pick(_ cipher.Stream) kyber.Point
- func (p *GTElt) Set(p2 kyber.Point) kyber.Point
- func (p *GTElt) String() string
- func (p *GTElt) Sub(a, b kyber.Point) kyber.Point
- func (p *GTElt) UnmarshalBinary(data []byte) error
- func (p *GTElt) UnmarshalFrom(r io.Reader) (int, error)
- type Scalar
- func (s *Scalar) Add(a, b kyber.Scalar) kyber.Scalar
- func (s *Scalar) ByteOrder() kyber.ByteOrder
- func (s *Scalar) Clone() kyber.Scalar
- func (s *Scalar) Div(a, b kyber.Scalar) kyber.Scalar
- func (s *Scalar) Equal(s2 kyber.Scalar) bool
- func (s *Scalar) GroupOrder() *big.Int
- func (s *Scalar) Inv(a kyber.Scalar) kyber.Scalar
- func (s *Scalar) MarshalBinary() (data []byte, err error)
- func (s *Scalar) MarshalSize() int
- func (s *Scalar) MarshalTo(w io.Writer) (int, error)
- func (s *Scalar) Mul(a, b kyber.Scalar) kyber.Scalar
- func (s *Scalar) Neg(a kyber.Scalar) kyber.Scalar
- func (s *Scalar) One() kyber.Scalar
- func (s *Scalar) Pick(stream cipher.Stream) kyber.Scalar
- func (s *Scalar) Set(a kyber.Scalar) kyber.Scalar
- func (s *Scalar) SetBytes(data []byte) kyber.Scalar
- func (s *Scalar) SetInt64(v int64) kyber.Scalar
- func (s *Scalar) String() string
- func (s *Scalar) Sub(a, b kyber.Scalar) kyber.Scalar
- func (s *Scalar) UnmarshalBinary(data []byte) error
- func (s *Scalar) UnmarshalFrom(r io.Reader) (int, error)
- func (s *Scalar) Zero() kyber.Scalar
- type Suite
- func (s Suite) G1() kyber.Group
- func (s Suite) G2() kyber.Group
- func (s Suite) GT() kyber.Group
- func (s Suite) Hash() hash.Hash
- func (s Suite) Pair(p1, p2 kyber.Point) kyber.Point
- func (s Suite) RandomStream() cipher.Stream
- func (s Suite) Read(_ io.Reader, _ ...interface{}) error
- func (s Suite) String() string
- func (s Suite) ValidatePairing(p1, p2, p3, p4 kyber.Point) bool
- func (s Suite) Write(_ io.Writer, _ ...interface{}) error
- func (s Suite) XOF(seed []byte) kyber.XOF
- type SuiteBLS12381
Constants ¶
This section is empty.
Variables ¶
var ( G1 kyber.Group = &groupBls{name: "bls12-381.G1", newPoint: func() kyber.Point { return new(G1Elt).Null() }} G2 kyber.Group = &groupBls{name: "bls12-381.G2", newPoint: func() kyber.Point { return new(G2Elt).Null() }} GT kyber.Group = &groupBls{name: "bls12-381.GT", newPoint: func() kyber.Point { return new(GTElt).Null() }} )
Functions ¶
This section is empty.
Types ¶
type G1Elt ¶
type G1Elt struct {
// contains filtered or unexported fields
}
G1Elt is a wrapper around a G1 point on the BLS12-381 Gnark curve.
func (*G1Elt) IsInCorrectGroup ¶
func (*G1Elt) MarshalBinary ¶
MarshalBinary returns a compressed point, without any domain separation tag information
func (*G1Elt) MarshalSize ¶
func (*G1Elt) MarshalTo ¶
MarshalTo writes a compressed point to the Writer, without any domain separation tag information
func (*G1Elt) UnmarshalBinary ¶
UnmarshalBinary populates the point from a compressed point representation.
type G2Elt ¶
type G2Elt struct {
// contains filtered or unexported fields
}
G2Elt is a wrapper around the Gnark G2 point type.
func (*G2Elt) IsInCorrectGroup ¶
func (*G2Elt) MarshalBinary ¶
MarshalBinary returns a compressed point, without any domain separation tag information
func (*G2Elt) MarshalSize ¶
func (*G2Elt) MarshalTo ¶
MarshalTo writes a compressed point to the Writer, without any domain separation tag information
func (*G2Elt) UnmarshalBinary ¶
UnmarshalBinary populates the point from a compressed point representation.
type GTElt ¶
type GTElt struct {
// contains filtered or unexported fields
}
GTElt is a wrapper around the Circl Gt point type.
func (*GTElt) MarshalBinary ¶
MarshalBinary returns a compressed point, without any domain separation tag information
func (*GTElt) MarshalSize ¶
func (*GTElt) MarshalTo ¶
MarshalTo writes a compressed point to the Writer, without any domain separation tag information
func (*GTElt) UnmarshalBinary ¶
UnmarshalBinary populates the point from a compressed point representation.
type Scalar ¶
type Scalar struct {
// contains filtered or unexported fields
}
func (*Scalar) GroupOrder ¶
func (*Scalar) MarshalBinary ¶
func (*Scalar) MarshalSize ¶
func (*Scalar) UnmarshalBinary ¶
type SuiteBLS12381 ¶
type SuiteBLS12381 struct { Suite kyber.Group }
SuiteBLS12381 is an adapter that implements the suites.Suite interface so that bls12381 can be used as a common suite to generate key pairs for instance but still preserves the properties of the pairing (e.g. the Pair function).
It's important to note that the Point function will generate a point compatible with public keys only (group G2) where the signature must be used as a point from the group G1.
func NewSuiteBLS12381 ¶
func NewSuiteBLS12381() *SuiteBLS12381
NewSuiteBLS12381 makes a new BN256 suite
func (*SuiteBLS12381) Point ¶
func (s *SuiteBLS12381) Point() kyber.Point
Point generates a point from the G2 group that can only be used for public keys
func (*SuiteBLS12381) PointLen ¶
func (s *SuiteBLS12381) PointLen() int
PointLen returns the length of a G2 point
func (*SuiteBLS12381) Scalar ¶
func (s *SuiteBLS12381) Scalar() kyber.Scalar
Scalar generates a scalar
func (*SuiteBLS12381) ScalarLen ¶
func (s *SuiteBLS12381) ScalarLen() int
ScalarLen returns the length of a scalar
func (*SuiteBLS12381) String ¶
func (s *SuiteBLS12381) String() string
String returns the name of the suite