Documentation ¶
Index ¶
- Constants
- func Fp12FinalVerify(pt1 *Fp12, pt2 *Fp12) bool
- func PairingAggregatePkInG1(ctx Pairing, PK *P1Affine, pkValidate bool, sig *P2Affine, sigGroupcheck bool, ...) int
- func PairingAggregatePkInG2(ctx Pairing, PK *P2Affine, pkValidate bool, sig *P1Affine, sigGroupcheck bool, ...) int
- func PairingCommit(ctx Pairing)
- func PairingFinalVerify(ctx Pairing, optional ...*Fp12) bool
- func PairingMerge(ctx Pairing, ctx1 Pairing) int
- func PairingMulNAggregatePkInG1(ctx Pairing, PK *P1Affine, pkValidate bool, sig *P2Affine, sigGroupcheck bool, ...) int
- func PairingMulNAggregatePkInG2(ctx Pairing, PK *P2Affine, pkValidate bool, sig *P1Affine, sigGroupcheck bool, ...) int
- func PairingRawAggregate(ctx Pairing, q *P2Affine, p *P1Affine)
- func PrintBytes(val []byte, name string)
- func SetMaxProcs(max int)
- func Uniq(msgs []Message) bool
- type Fp
- type Fp12
- type Fp2
- type Fp6
- type Message
- type P1
- func (p1 *P1) Add(pointIf interface{}) *P1
- func (p1 *P1) AddAssign(pointIf interface{}) *P1
- func (p1 *P1) Compress() []byte
- func (e1 *P1) Equals(e2 *P1) bool
- func (p *P1) FromAffine(pa *P1Affine)
- func (p1 *P1) Mult(scalarIf interface{}, optional ...int) *P1
- func (p1 *P1) MultAssign(scalarIf interface{}, optional ...int) *P1
- func (acc *P1) MultNAccumulate(pointIf interface{}, scalarIf interface{}, optional ...int) *P1
- func (p *P1) Print(name string)
- func (p1 *P1) Serialize() []byte
- func (p *P1) ToAffine() *P1Affine
- type P1Affine
- func (sig *P1Affine) AggregateVerify(sigGroupcheck bool, pks []*P2Affine, pksVerify bool, msgs []Message, ...) bool
- func (dummy *P1Affine) AggregateVerifyCompressed(sig []byte, sigGroupcheck bool, pks [][]byte, pksVerify bool, msgs []Message, ...) bool
- func (dummy *P1Affine) BatchUncompress(in [][]byte) []*P1Affine
- func (p1 *P1Affine) Compress() []byte
- func (p1 *P1Affine) Deserialize(in []byte) *P1Affine
- func (e1 *P1Affine) Equals(e2 *P1Affine) bool
- func (sig *P1Affine) FastAggregateVerify(sigGroupcheck bool, pks []*P2Affine, msg Message, dst []byte, ...) bool
- func (pk *P1Affine) From(s *Scalar) *P1Affine
- func (p1 *P1Affine) InG1() bool
- func (pk *P1Affine) KeyValidate() bool
- func (dummy *P1Affine) MultipleAggregateVerify(sigs []*P1Affine, sigsGroupcheck bool, pks []*P2Affine, pksVerify bool, ...) bool
- func (p *P1Affine) Print(name string)
- func (p1 *P1Affine) Serialize() []byte
- func (sig *P1Affine) SigValidate(sigInfcheck bool) bool
- func (sig *P1Affine) Sign(sk *SecretKey, msg []byte, dst []byte, optional ...interface{}) *P1Affine
- func (p1 *P1Affine) Uncompress(in []byte) *P1Affine
- func (sig *P1Affine) Verify(sigGroupcheck bool, pk *P2Affine, pkValidate bool, msg Message, dst []byte, ...) bool
- func (dummy *P1Affine) VerifyCompressed(sig []byte, sigGroupcheck bool, pk []byte, pkValidate bool, msg Message, ...) bool
- type P1Affines
- type P1Aggregate
- func (agg *P1Aggregate) Add(elmt *P1Affine, groupcheck bool) bool
- func (agg *P1Aggregate) AddAggregate(other *P1Aggregate)
- func (agg *P1Aggregate) Aggregate(elmts []*P1Affine, groupcheck bool) bool
- func (agg *P1Aggregate) AggregateCompressed(elmts [][]byte, groupcheck bool) bool
- func (agg *P1Aggregate) ToAffine() *P1Affine
- type P1s
- type P2
- func (p2 *P2) Add(pointIf interface{}) *P2
- func (p2 *P2) AddAssign(pointIf interface{}) *P2
- func (p2 *P2) Compress() []byte
- func (e1 *P2) Equals(e2 *P2) bool
- func (p *P2) FromAffine(pa *P2Affine)
- func (p2 *P2) Mult(scalarIf interface{}, optional ...int) *P2
- func (p2 *P2) MultAssign(scalarIf interface{}, optional ...int) *P2
- func (acc *P2) MultNAccumulate(pointIf interface{}, scalarIf interface{}, optional ...int) *P2
- func (p *P2) Print(name string)
- func (p2 *P2) Serialize() []byte
- func (p *P2) ToAffine() *P2Affine
- type P2Affine
- func (sig *P2Affine) AggregateVerify(sigGroupcheck bool, pks []*P1Affine, pksVerify bool, msgs []Message, ...) bool
- func (dummy *P2Affine) AggregateVerifyCompressed(sig []byte, sigGroupcheck bool, pks [][]byte, pksVerify bool, msgs []Message, ...) bool
- func (dummy *P2Affine) BatchUncompress(in [][]byte) []*P2Affine
- func (p2 *P2Affine) Compress() []byte
- func (p2 *P2Affine) Deserialize(in []byte) *P2Affine
- func (e1 *P2Affine) Equals(e2 *P2Affine) bool
- func (sig *P2Affine) FastAggregateVerify(sigGroupcheck bool, pks []*P1Affine, msg Message, dst []byte, ...) bool
- func (pk *P2Affine) From(s *Scalar) *P2Affine
- func (p2 *P2Affine) InG2() bool
- func (pk *P2Affine) KeyValidate() bool
- func (dummy *P2Affine) MultipleAggregateVerify(sigs []*P2Affine, sigsGroupcheck bool, pks []*P1Affine, pksVerify bool, ...) bool
- func (p *P2Affine) Print(name string)
- func (p2 *P2Affine) Serialize() []byte
- func (sig *P2Affine) SigValidate(sigInfcheck bool) bool
- func (sig *P2Affine) Sign(sk *SecretKey, msg []byte, dst []byte, optional ...interface{}) *P2Affine
- func (p2 *P2Affine) Uncompress(in []byte) *P2Affine
- func (sig *P2Affine) Verify(sigGroupcheck bool, pk *P1Affine, pkValidate bool, msg Message, dst []byte, ...) bool
- func (dummy *P2Affine) VerifyCompressed(sig []byte, sigGroupcheck bool, pk []byte, pkValidate bool, msg Message, ...) bool
- type P2Affines
- type P2Aggregate
- func (agg *P2Aggregate) Add(elmt *P2Affine, groupcheck bool) bool
- func (agg *P2Aggregate) AddAggregate(other *P2Aggregate)
- func (agg *P2Aggregate) Aggregate(elmts []*P2Affine, groupcheck bool) bool
- func (agg *P2Aggregate) AggregateCompressed(elmts [][]byte, groupcheck bool) bool
- func (agg *P2Aggregate) ToAffine() *P2Affine
- type P2s
- type Pairing
- type Scalar
- func (a *Scalar) Add(b *Scalar) (*Scalar, bool)
- func (a *Scalar) AddAssign(b *Scalar) (*Scalar, bool)
- func (s *Scalar) Deserialize(in []byte) *Scalar
- func (s1 *Scalar) Equals(s2 *Scalar) bool
- func (fr *Scalar) FromBEndian(arr []byte) *Scalar
- func (fr *Scalar) FromLEndian(arr []byte) *Scalar
- func (s *Scalar) HashTo(msg []byte, dst []byte) bool
- func (a *Scalar) Inverse() *Scalar
- func (a *Scalar) Mul(b *Scalar) (*Scalar, bool)
- func (a *Scalar) MulAssign(b *Scalar) (*Scalar, bool)
- func (s *Scalar) Print(name string)
- func (s *Scalar) Serialize() []byte
- func (a *Scalar) Sub(b *Scalar) (*Scalar, bool)
- func (a *Scalar) SubAssign(b *Scalar) (*Scalar, bool)
- func (fr *Scalar) ToBEndian() []byte
- func (fr *Scalar) ToLEndian() []byte
- func (s *Scalar) Valid() bool
- type SecretKey
- func DeriveMasterEip2333(ikm []byte) *SecretKey
- func KeyGen(ikm []byte, optional ...[]byte) *SecretKey
- func KeyGenV3(ikm []byte, optional ...[]byte) *SecretKey
- func KeyGenV45(ikm []byte, salt []byte, optional ...[]byte) *SecretKey
- func KeyGenV5(ikm []byte, salt []byte, optional ...[]byte) *SecretKey
Constants ¶
const BLST_FP_BYTES = 384 / 8
const BLST_P1_COMPRESS_BYTES = BLST_FP_BYTES
const BLST_P1_SERIALIZE_BYTES = BLST_FP_BYTES * 2
const BLST_P2_COMPRESS_BYTES = BLST_FP_BYTES * 2
const BLST_P2_SERIALIZE_BYTES = BLST_FP_BYTES * 4
const BLST_SCALAR_BYTES = 256 / 8
Variables ¶
This section is empty.
Functions ¶
func Fp12FinalVerify ¶
func PairingAggregatePkInG1 ¶
func PairingAggregatePkInG2 ¶
func PairingCommit ¶
func PairingCommit(ctx Pairing)
func PairingFinalVerify ¶
func PairingMerge ¶
func PairingRawAggregate ¶
func PrintBytes ¶
func SetMaxProcs ¶
func SetMaxProcs(max int)
Types ¶
type P1 ¶
func P1AffinesAdd ¶
func P1AffinesMult ¶
func P1Generator ¶
func P1Generator() *P1
func (*P1) FromAffine ¶
func (*P1) MultAssign ¶
func (*P1) MultNAccumulate ¶
'acc += point * scalar', passing 'nil' for 'point' means "use the
group generator point"
type P1Affine ¶
type P1Affine = C.blst_p1_affine
func (*P1Affine) AggregateVerify ¶
func (sig *P1Affine) AggregateVerify(sigGroupcheck bool, pks []*P2Affine, pksVerify bool, msgs []Message, dst []byte, optional ...interface{}) bool
Aggregate verify with uncompressed signature and public keys Note that checking message uniqueness, if required, is left to the user. Not all signature schemes require it and this keeps the binding minimal and fast. Refer to the Uniq function for one method method of performing this check.
func (*P1Affine) AggregateVerifyCompressed ¶
func (dummy *P1Affine) AggregateVerifyCompressed(sig []byte, sigGroupcheck bool, pks [][]byte, pksVerify bool, msgs []Message, dst []byte, optional ...bool) bool
Aggregate verify with compressed signature and public keys Uses a dummy signature to get the correct type
func (*P1Affine) BatchUncompress ¶
func (*P1Affine) Deserialize ¶
func (*P1Affine) FastAggregateVerify ¶
func (sig *P1Affine) FastAggregateVerify(sigGroupcheck bool, pks []*P2Affine, msg Message, dst []byte, optional ...interface{}) bool
pks are assumed to be verified for proof of possession, which implies that they are already group-checked
func (*P1Affine) KeyValidate ¶
func (*P1Affine) MultipleAggregateVerify ¶
func (*P1Affine) SigValidate ¶
sigInfcheck, check for infinity, is a way to avoid going into resource-consuming verification. Passing 'false' is always cryptographically safe, but application might want to guard against obviously bogus individual[!] signatures.
func (*P1Affine) Uncompress ¶
type P1Aggregate ¶
type P1Aggregate struct {
// contains filtered or unexported fields
}
func (*P1Aggregate) AddAggregate ¶
func (agg *P1Aggregate) AddAggregate(other *P1Aggregate)
func (*P1Aggregate) Aggregate ¶
func (agg *P1Aggregate) Aggregate(elmts []*P1Affine, groupcheck bool) bool
Aggregate uncompressed elements
func (*P1Aggregate) AggregateCompressed ¶
func (agg *P1Aggregate) AggregateCompressed(elmts [][]byte, groupcheck bool) bool
Aggregate compressed elements
func (*P1Aggregate) ToAffine ¶
func (agg *P1Aggregate) ToAffine() *P1Affine
type P2 ¶
func P2AffinesAdd ¶
func P2AffinesMult ¶
func P2Generator ¶
func P2Generator() *P2
func (*P2) FromAffine ¶
func (*P2) MultAssign ¶
func (*P2) MultNAccumulate ¶
'acc += point * scalar', passing 'nil' for 'point' means "use the
group generator point"
type P2Affine ¶
type P2Affine = C.blst_p2_affine
func (*P2Affine) AggregateVerify ¶
func (sig *P2Affine) AggregateVerify(sigGroupcheck bool, pks []*P1Affine, pksVerify bool, msgs []Message, dst []byte, optional ...interface{}) bool
Aggregate verify with uncompressed signature and public keys Note that checking message uniqueness, if required, is left to the user. Not all signature schemes require it and this keeps the binding minimal and fast. Refer to the Uniq function for one method method of performing this check.
func (*P2Affine) AggregateVerifyCompressed ¶
func (dummy *P2Affine) AggregateVerifyCompressed(sig []byte, sigGroupcheck bool, pks [][]byte, pksVerify bool, msgs []Message, dst []byte, optional ...bool) bool
Aggregate verify with compressed signature and public keys Uses a dummy signature to get the correct type
func (*P2Affine) BatchUncompress ¶
func (*P2Affine) Deserialize ¶
func (*P2Affine) FastAggregateVerify ¶
func (sig *P2Affine) FastAggregateVerify(sigGroupcheck bool, pks []*P1Affine, msg Message, dst []byte, optional ...interface{}) bool
pks are assumed to be verified for proof of possession, which implies that they are already group-checked
func (*P2Affine) KeyValidate ¶
func (*P2Affine) MultipleAggregateVerify ¶
func (*P2Affine) SigValidate ¶
sigInfcheck, check for infinity, is a way to avoid going into resource-consuming verification. Passing 'false' is always cryptographically safe, but application might want to guard against obviously bogus individual[!] signatures.
func (*P2Affine) Uncompress ¶
type P2Aggregate ¶
type P2Aggregate struct {
// contains filtered or unexported fields
}
func (*P2Aggregate) AddAggregate ¶
func (agg *P2Aggregate) AddAggregate(other *P2Aggregate)
func (*P2Aggregate) Aggregate ¶
func (agg *P2Aggregate) Aggregate(elmts []*P2Affine, groupcheck bool) bool
Aggregate uncompressed elements
func (*P2Aggregate) AggregateCompressed ¶
func (agg *P2Aggregate) AggregateCompressed(elmts [][]byte, groupcheck bool) bool
Aggregate compressed elements
func (*P2Aggregate) ToAffine ¶
func (agg *P2Aggregate) ToAffine() *P2Affine
type Pairing ¶
type Pairing = []C.blst_pairing
type Scalar ¶
type Scalar = C.blst_scalar
func HashToScalar ¶
func (*Scalar) Deserialize ¶
func (*Scalar) FromBEndian ¶
func (*Scalar) FromLEndian ¶
type SecretKey ¶
type SecretKey = Scalar