Documentation ¶
Index ¶
- Constants
- func CoreVerifyPkInG1(pk *P1Affine, sig *P2Affine, hash_or_encode bool, msg Message, dst []byte, ...) int
- func CoreVerifyPkInG2(pk *P2Affine, sig *P1Affine, hash_or_encode bool, msg Message, dst []byte, ...) int
- func Fp12FinalVerify(pt1 *Fp12, pt2 *Fp12) bool
- func P1AffinesValidate(pointsIf interface{}) bool
- func P2AffinesValidate(pointsIf interface{}) 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 (p1 *P1) Sub(pointIf interface{}) *P1
- func (p1 *P1) SubAssign(pointIf interface{}) *P1
- func (p *P1) ToAffine() *P1Affine
- type P1Affine
- func (sig *P1Affine) AggregateVerify(sigGroupcheck bool, pks []*P2Affine, pksVerify bool, msgs []Message, ...) bool
- func (_ *P1Affine) AggregateVerifyCompressed(sig []byte, sigGroupcheck bool, pks [][]byte, pksVerify bool, msgs []Message, ...) bool
- func (_ *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 (_ *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) AggregateWithRandomness(pointsIf interface{}, scalarsIf interface{}, nbits int, 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 (p2 *P2) Sub(pointIf interface{}) *P2
- func (p2 *P2) SubAssign(pointIf interface{}) *P2
- func (p *P2) ToAffine() *P2Affine
- type P2Affine
- func (sig *P2Affine) AggregateVerify(sigGroupcheck bool, pks []*P1Affine, pksVerify bool, msgs []Message, ...) bool
- func (_ *P2Affine) AggregateVerifyCompressed(sig []byte, sigGroupcheck bool, pks [][]byte, pksVerify bool, msgs []Message, ...) bool
- func (_ *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 (_ *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) AggregateWithRandomness(pointsIf interface{}, scalarsIf interface{}, nbits int, 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 CoreVerifyPkInG1 ¶ added in v0.3.11
func CoreVerifyPkInG2 ¶ added in v0.3.11
func Fp12FinalVerify ¶ added in v0.3.5
func P1AffinesValidate ¶ added in v0.3.13
func P1AffinesValidate(pointsIf interface{}) bool
func P2AffinesValidate ¶ added in v0.3.13
func P2AffinesValidate(pointsIf interface{}) bool
func PairingAggregatePkInG1 ¶
func PairingAggregatePkInG2 ¶
func PairingCommit ¶
func PairingCommit(ctx Pairing)
func PairingFinalVerify ¶
func PairingMerge ¶
func PairingMulNAggregatePkInG1 ¶ added in v0.2.0
func PairingMulNAggregatePkInG2 ¶ added in v0.2.0
func PairingRawAggregate ¶ added in v0.3.5
func PrintBytes ¶
func SetMaxProcs ¶ added in v0.1.1
func SetMaxProcs(max int)
Types ¶
type Fp12 ¶
func Fp12MillerLoop ¶ added in v0.3.5
func Fp12MillerLoopN ¶ added in v0.3.11
func PairingAsFp12 ¶ added in v0.3.5
type P1 ¶
func P1AffinesAdd ¶ added in v0.3.6
func P1AffinesMult ¶ added in v0.3.6
func P1Generator ¶ added in v0.3.6
func P1Generator() *P1
func (*P1) FromAffine ¶ added in v0.3.5
func (*P1) MultAssign ¶ added in v0.3.8
func (*P1) MultNAccumulate ¶ added in v0.3.8
'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 (_ *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 ¶ added in v0.2.0
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 ¶ added in v0.3.0
func (*P1Affine) MultipleAggregateVerify ¶ added in v0.2.0
func (*P1Affine) SigValidate ¶ added in v0.3.0
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 P1Affines ¶ added in v0.3.5
type P1Affines []P1Affine
func P1sToAffine ¶ added in v0.3.5
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) AggregateWithRandomness ¶ added in v0.3.13
func (agg *P1Aggregate) AggregateWithRandomness(pointsIf interface{}, scalarsIf interface{}, nbits int, groupcheck bool) bool
func (*P1Aggregate) ToAffine ¶
func (agg *P1Aggregate) ToAffine() *P1Affine
type P2 ¶
func P2AffinesAdd ¶ added in v0.3.6
func P2AffinesMult ¶ added in v0.3.6
func P2Generator ¶ added in v0.3.6
func P2Generator() *P2
func (*P2) FromAffine ¶ added in v0.3.5
func (*P2) MultAssign ¶ added in v0.3.8
func (*P2) MultNAccumulate ¶ added in v0.3.8
'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 (_ *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 ¶ added in v0.2.0
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 ¶ added in v0.3.0
func (*P2Affine) MultipleAggregateVerify ¶ added in v0.2.0
func (*P2Affine) SigValidate ¶ added in v0.3.0
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 P2Affines ¶ added in v0.3.5
type P2Affines []P2Affine
func P2sToAffine ¶ added in v0.3.5
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) AggregateWithRandomness ¶ added in v0.3.13
func (agg *P2Aggregate) AggregateWithRandomness(pointsIf interface{}, scalarsIf interface{}, nbits int, groupcheck bool) bool
func (*P2Aggregate) ToAffine ¶
func (agg *P2Aggregate) ToAffine() *P2Affine
type Scalar ¶
type Scalar = C.blst_scalar