Documentation ¶
Index ¶
- type PointG1
- func (po *PointG1) Add(p crypto.Point) (crypto.Point, error)
- func (po *PointG1) Clone() crypto.Point
- func (po *PointG1) Equal(p crypto.Point) (bool, error)
- func (po *PointG1) GetUnderlyingObj() interface{}
- func (po *PointG1) IsInterfaceNil() bool
- func (po *PointG1) MarshalBinary() ([]byte, error)
- func (po *PointG1) Mul(s crypto.Scalar) (crypto.Point, error)
- func (po *PointG1) Neg() crypto.Point
- func (po *PointG1) Null() crypto.Point
- func (po *PointG1) Pick() (crypto.Point, error)
- func (po *PointG1) Set(p crypto.Point) error
- func (po *PointG1) Sub(p crypto.Point) (crypto.Point, error)
- func (po *PointG1) UnmarshalBinary(point []byte) error
- type PointG2
- func (po *PointG2) Add(p crypto.Point) (crypto.Point, error)
- func (po *PointG2) Clone() crypto.Point
- func (po *PointG2) Equal(p crypto.Point) (bool, error)
- func (po *PointG2) GetUnderlyingObj() interface{}
- func (po *PointG2) IsInterfaceNil() bool
- func (po *PointG2) MarshalBinary() ([]byte, error)
- func (po *PointG2) Mul(s crypto.Scalar) (crypto.Point, error)
- func (po *PointG2) Neg() crypto.Point
- func (po *PointG2) Null() crypto.Point
- func (po *PointG2) Pick() (crypto.Point, error)
- func (po *PointG2) Set(p crypto.Point) error
- func (po *PointG2) Sub(p crypto.Point) (crypto.Point, error)
- func (po *PointG2) UnmarshalBinary(point []byte) error
- type PointGT
- func (po *PointGT) Add(p crypto.Point) (crypto.Point, error)
- func (po *PointGT) Clone() crypto.Point
- func (po *PointGT) Equal(p crypto.Point) (bool, error)
- func (po *PointGT) GetUnderlyingObj() interface{}
- func (po *PointGT) IsInterfaceNil() bool
- func (po *PointGT) MarshalBinary() ([]byte, error)
- func (po *PointGT) Mul(s crypto.Scalar) (crypto.Point, error)
- func (po *PointGT) Neg() crypto.Point
- func (po *PointGT) Null() crypto.Point
- func (po *PointGT) Pick() (crypto.Point, error)
- func (po *PointGT) Set(p crypto.Point) error
- func (po *PointGT) Sub(p crypto.Point) (crypto.Point, error)
- func (po *PointGT) UnmarshalBinary(point []byte) error
- type Scalar
- func (sc *Scalar) Add(s crypto.Scalar) (crypto.Scalar, error)
- func (sc *Scalar) Clone() crypto.Scalar
- func (sc *Scalar) Div(s crypto.Scalar) (crypto.Scalar, error)
- func (sc *Scalar) Equal(s crypto.Scalar) (bool, error)
- func (sc *Scalar) GetUnderlyingObj() interface{}
- func (sc *Scalar) Inv(s crypto.Scalar) (crypto.Scalar, error)
- func (sc *Scalar) IsInterfaceNil() bool
- func (sc *Scalar) MarshalBinary() ([]byte, error)
- func (sc *Scalar) Mul(s crypto.Scalar) (crypto.Scalar, error)
- func (sc *Scalar) Neg() crypto.Scalar
- func (sc *Scalar) One() crypto.Scalar
- func (sc *Scalar) Pick() (crypto.Scalar, error)
- func (sc *Scalar) Set(s crypto.Scalar) error
- func (sc *Scalar) SetBytes(s []byte) (crypto.Scalar, error)
- func (sc *Scalar) SetInt64(v int64)
- func (sc *Scalar) Sub(s crypto.Scalar) (crypto.Scalar, error)
- func (sc *Scalar) UnmarshalBinary(s []byte) error
- func (sc *Scalar) Zero() crypto.Scalar
- type SuiteBLS12
- func (s *SuiteBLS12) CheckPointValid(pointBytes []byte) error
- func (s *SuiteBLS12) CreateKeyPair() (crypto.Scalar, crypto.Point)
- func (s *SuiteBLS12) CreatePoint() crypto.Point
- func (s *SuiteBLS12) CreatePointForScalar(scalar crypto.Scalar) (crypto.Point, error)
- func (s *SuiteBLS12) CreateScalar() crypto.Scalar
- func (s *SuiteBLS12) GetUnderlyingSuite() interface{}
- func (s *SuiteBLS12) IsInterfaceNil() bool
- func (s *SuiteBLS12) PointLen() int
- func (s *SuiteBLS12) RandomStream() cipher.Stream
- func (s *SuiteBLS12) ScalarLen() int
- func (s *SuiteBLS12) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PointG1 ¶
PointG1 -
func NewPointG1 ¶
func NewPointG1() *PointG1
NewPointG1 creates a new point on G1 initialized with base point
func (*PointG1) Add ¶
Add returns the result of adding receiver with Point p given as parameter, so that their scalars add homomorphically
func (*PointG1) Equal ¶
Equal tests if receiver is equal with the Point p given as parameter. Both Points need to be derived from the same Group
func (*PointG1) GetUnderlyingObj ¶
func (po *PointG1) GetUnderlyingObj() interface{}
GetUnderlyingObj returns the object the implementation wraps
func (*PointG1) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*PointG1) MarshalBinary ¶
MarshalBinary converts the point into its byte array representation
func (*PointG1) Sub ¶
Sub returns the result of subtracting from receiver the Point p given as parameter, so that their scalars subtract homomorphically
func (*PointG1) UnmarshalBinary ¶
UnmarshalBinary reconstructs a point from its byte array representation
type PointG2 ¶
PointG2 -
func NewPointG2 ¶
func NewPointG2() *PointG2
NewPointG2 creates a new point on G2 initialized with base point
func (*PointG2) Add ¶
Add returns the result of adding receiver with Point p given as parameter, so that their scalars add homomorphically
func (*PointG2) Equal ¶
Equal tests if receiver is equal with the Point p given as parameter. Both Points need to be derived from the same Group
func (*PointG2) GetUnderlyingObj ¶
func (po *PointG2) GetUnderlyingObj() interface{}
GetUnderlyingObj returns the object the implementation wraps
func (*PointG2) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*PointG2) MarshalBinary ¶
MarshalBinary converts the point into its byte array representation
func (*PointG2) Sub ¶
Sub returns the result of subtracting from receiver the Point p given as parameter, so that their scalars subtract homomorphically
func (*PointG2) UnmarshalBinary ¶
UnmarshalBinary reconstructs a point from its byte array representation
type PointGT ¶
PointGT -
func NewPointGT ¶
func NewPointGT() *PointGT
NewPointGT creates a new point on GT initialized with identity
func (*PointGT) Add ¶
Add returns the result of adding receiver with Point p given as parameter, so that their scalars add homomorphically
func (*PointGT) Equal ¶
Equal tests if receiver is equal with the Point p given as parameter. Both Points need to be derived from the same Group
func (*PointGT) GetUnderlyingObj ¶
func (po *PointGT) GetUnderlyingObj() interface{}
GetUnderlyingObj returns the object the implementation wraps
func (*PointGT) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*PointGT) MarshalBinary ¶
MarshalBinary converts the point into its byte array representation
func (*PointGT) Sub ¶
Sub returns the result of subtracting from receiver the Point p given as parameter, so that their scalars subtract homomorphically
func (*PointGT) UnmarshalBinary ¶
UnmarshalBinary reconstructs a point from its byte array representation
type Scalar ¶
Scalar -
func (*Scalar) Div ¶
Div returns the modular division between receiver and scalarInt s given as parameter
func (*Scalar) Equal ¶
Equal tests if receiver is equal with the scalarInt s given as parameter. Both scalars need to be derived from the same Group
func (*Scalar) GetUnderlyingObj ¶
func (sc *Scalar) GetUnderlyingObj() interface{}
GetUnderlyingObj returns the object the implementation wraps
func (*Scalar) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*Scalar) MarshalBinary ¶
MarshalBinary encodes the receiver into a binary form and returns the result.
func (*Scalar) Mul ¶
Mul returns the modular product of receiver with scalarInt s given as parameter
func (*Scalar) SetBytes ¶
SetBytes sets the scalarInt from a byte-slice, reducing if necessary to the appropriate modulus.
func (*Scalar) Sub ¶
Sub returns the modular difference between receiver and scalarInt s given as parameter
func (*Scalar) UnmarshalBinary ¶
UnmarshalBinary decodes a scalarInt from its byte array representation and sets the receiver to this value
type SuiteBLS12 ¶
type SuiteBLS12 struct { G1 *groupG1 G2 *groupG2 GT *groupGT // contains filtered or unexported fields }
SuiteBLS12 provides an implementation of the Suite interface for BLS12-381
func NewSuiteBLS12 ¶
func NewSuiteBLS12() *SuiteBLS12
NewSuiteBLS12 returns a wrapper over a BLS12 curve.
func (*SuiteBLS12) CheckPointValid ¶ added in v1.0.120
func (s *SuiteBLS12) CheckPointValid(pointBytes []byte) error
CheckPointValid returns error if the point is not valid (zero is also not valid), otherwise nil
func (*SuiteBLS12) CreateKeyPair ¶
func (s *SuiteBLS12) CreateKeyPair() (crypto.Scalar, crypto.Point)
CreateKeyPair returns a pair of private public BLS keys. The private key is a scalarInt, while the public key is a Point on G2 curve
func (*SuiteBLS12) CreatePoint ¶
func (s *SuiteBLS12) CreatePoint() crypto.Point
CreatePoint creates a new point
func (*SuiteBLS12) CreatePointForScalar ¶
CreatePointForScalar creates a new point corresponding to the given scalar
func (*SuiteBLS12) CreateScalar ¶
func (s *SuiteBLS12) CreateScalar() crypto.Scalar
CreateScalar creates a new Scalar
func (*SuiteBLS12) GetUnderlyingSuite ¶
func (s *SuiteBLS12) GetUnderlyingSuite() interface{}
GetUnderlyingSuite returns the underlying suite
func (*SuiteBLS12) IsInterfaceNil ¶
func (s *SuiteBLS12) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SuiteBLS12) PointLen ¶
func (s *SuiteBLS12) PointLen() int
PointLen returns the max length of point in nb of bytes
func (*SuiteBLS12) RandomStream ¶
func (s *SuiteBLS12) RandomStream() cipher.Stream
RandomStream returns a cipher.Stream that returns a key stream from crypto/rand.
func (*SuiteBLS12) ScalarLen ¶
func (s *SuiteBLS12) ScalarLen() int
ScalarLen returns the maximum length of scalars in bytes
func (*SuiteBLS12) String ¶
func (s *SuiteBLS12) String() string
String returns the string for the group