Documentation ¶
Index ¶
- Constants
- func ThresholdVerify(pk *G1Element, hash Hash, sig *G2Element) bool
- type Aggregator
- type AugSchemeMPL
- func (s *AugSchemeMPL) AggregatePubKeys(pks ...*G1Element) *G1Element
- func (s *AugSchemeMPL) AggregateSigs(sigs ...*G2Element) *G2Element
- func (s *AugSchemeMPL) AggregateVerify(pks []*G1Element, msgs [][]byte, sig *G2Element) bool
- func (s *AugSchemeMPL) DeriveChildPkUnhardened(el *G1Element, index int) *G1Element
- func (s *AugSchemeMPL) DeriveChildSk(sk *PrivateKey, index int) *PrivateKey
- func (s *AugSchemeMPL) DeriveChildSkUnhardened(sk *PrivateKey, index int) *PrivateKey
- func (s *AugSchemeMPL) KeyGen(seed []byte) (*PrivateKey, error)
- func (s *AugSchemeMPL) Sign(sk *PrivateKey, msg []byte) *G2Element
- func (s *AugSchemeMPL) SignPrepend(sk *PrivateKey, msg []byte, prepPk *G1Element) *G2Element
- func (s *AugSchemeMPL) SkToG1(sk *PrivateKey) *G1Element
- func (s *AugSchemeMPL) Verify(pk *G1Element, msg []byte, sig *G2Element) bool
- type BasicSchemeMPL
- func (s *BasicSchemeMPL) AggregatePubKeys(pks ...*G1Element) *G1Element
- func (s *BasicSchemeMPL) AggregateSigs(sigs ...*G2Element) *G2Element
- func (s *BasicSchemeMPL) AggregateVerify(pks []*G1Element, msgs [][]byte, sig *G2Element) bool
- func (s *BasicSchemeMPL) DeriveChildPkUnhardened(el *G1Element, index int) *G1Element
- func (s *BasicSchemeMPL) DeriveChildSk(sk *PrivateKey, index int) *PrivateKey
- func (s *BasicSchemeMPL) DeriveChildSkUnhardened(sk *PrivateKey, index int) *PrivateKey
- func (s *BasicSchemeMPL) KeyGen(seed []byte) (*PrivateKey, error)
- func (s *BasicSchemeMPL) Sign(sk *PrivateKey, msg []byte) *G2Element
- func (s *BasicSchemeMPL) SkToG1(sk *PrivateKey) *G1Element
- func (s *BasicSchemeMPL) Verify(pk *G1Element, msg []byte, sig *G2Element) bool
- type Deriver
- type G1Element
- type G2Element
- type Generator
- type Hash
- type PopSchemeMPL
- func (s *PopSchemeMPL) AggregatePubKeys(pks ...*G1Element) *G1Element
- func (s *PopSchemeMPL) AggregateSigs(sigs ...*G2Element) *G2Element
- func (s *PopSchemeMPL) AggregateVerify(pks []*G1Element, msgs [][]byte, sig *G2Element) bool
- func (s *PopSchemeMPL) DeriveChildPkUnhardened(el *G1Element, index int) *G1Element
- func (s *PopSchemeMPL) DeriveChildSk(sk *PrivateKey, index int) *PrivateKey
- func (s *PopSchemeMPL) DeriveChildSkUnhardened(sk *PrivateKey, index int) *PrivateKey
- func (s *PopSchemeMPL) FastAggregateVerify(pks []*G1Element, msg []byte, sig *G2Element) bool
- func (s *PopSchemeMPL) KeyGen(seed []byte) (*PrivateKey, error)
- func (s *PopSchemeMPL) PopProve(sk *PrivateKey) *G2Element
- func (s *PopSchemeMPL) PopVerify(pk *G1Element, sig *G2Element) bool
- func (s *PopSchemeMPL) Sign(sk *PrivateKey, msg []byte) *G2Element
- func (s *PopSchemeMPL) SkToG1(sk *PrivateKey) *G1Element
- func (s *PopSchemeMPL) Verify(pk *G1Element, msg []byte, sig *G2Element) bool
- type PrivateKey
- type Scheme
- type Signer
- type Verifier
Constants ¶
const HashSize = sha256.Size
HashSize is the allowed size of a hash
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Aggregator ¶
type Aggregator interface { AggregatePubKeys(pks ...*G1Element) *G1Element AggregateSigs(sigs ...*G2Element) *G2Element }
Aggregator is the interface that's described methods for aggregation public (G1) and private (g2) keys
type AugSchemeMPL ¶
type AugSchemeMPL struct {
// contains filtered or unexported fields
}
AugSchemeMPL represents bls::AugSchemeMPL augmented should be enough for most use cases
func NewAugSchemeMPL ¶
func NewAugSchemeMPL() *AugSchemeMPL
NewAugSchemeMPL returns a new AugSchemeMPL this method allocates the bls::AugSchemeMPL object and keeps its pointer
func (*AugSchemeMPL) AggregatePubKeys ¶
AggregatePubKeys returns a new G1Element (public key) as an aggregated public keys this method is a binding of bls::CoreMPL::AggregatePubKeys
func (*AugSchemeMPL) AggregateSigs ¶
AggregateSigs returns a new G1Element (aggregated public keys) as a result of the aggregation of the passed public keys this method is a binding of bls::CoreMPL::AggregateSigs
func (*AugSchemeMPL) AggregateVerify ¶
func (s *AugSchemeMPL) AggregateVerify(pks []*G1Element, msgs [][]byte, sig *G2Element) bool
AggregateVerify verifies the aggregated signature for a list of messages with public keys this method is a binding of bls::AugSchemeMPL::AggregateVerify
func (*AugSchemeMPL) DeriveChildPkUnhardened ¶
DeriveChildPkUnhardened returns a child G1Element of the passed master G1Element this method is a binding of bls::CoreMPL::DeriveChildPkUnhardened
func (*AugSchemeMPL) DeriveChildSk ¶
func (s *AugSchemeMPL) DeriveChildSk(sk *PrivateKey, index int) *PrivateKey
DeriveChildSk returns a child PrivateKey using the passed as a master key this method is a binding of bls::CoreMPL::DeriveChildSk
func (*AugSchemeMPL) DeriveChildSkUnhardened ¶
func (s *AugSchemeMPL) DeriveChildSkUnhardened(sk *PrivateKey, index int) *PrivateKey
DeriveChildSkUnhardened returns a child PrivateKey of the passed master PrivateKey this method is a binding of bls::CoreMPL::DeriveChildSkUnhardened
func (*AugSchemeMPL) KeyGen ¶
func (s *AugSchemeMPL) KeyGen(seed []byte) (*PrivateKey, error)
KeyGen returns a new generated PrivateKey using passed a genSeed data this method is a binding of bls::CoreMPL::KeyGen
func (*AugSchemeMPL) Sign ¶
func (s *AugSchemeMPL) Sign(sk *PrivateKey, msg []byte) *G2Element
Sign signs a message with a PrivateKey this method is a binding of bls::AugSchemeMPL::Sign
func (*AugSchemeMPL) SignPrepend ¶
func (s *AugSchemeMPL) SignPrepend(sk *PrivateKey, msg []byte, prepPk *G1Element) *G2Element
SignPrepend is used for prepending different message this method is a binding of bls::AugSchemeMPL::Sign
func (*AugSchemeMPL) SkToG1 ¶
func (s *AugSchemeMPL) SkToG1(sk *PrivateKey) *G1Element
SkToG1 converts PrivateKey into G1Element (public key) this method is a binding of bls::CoreMPL::SkToG1
type BasicSchemeMPL ¶
type BasicSchemeMPL struct {
// contains filtered or unexported fields
}
BasicSchemeMPL represents bls::BasicSchemeMPL (basic scheme using minimum public key sizes)
func NewBasicSchemeMPL ¶
func NewBasicSchemeMPL() *BasicSchemeMPL
NewBasicSchemeMPL returns a new BasicSchemeMPL this method allocates the bls::BasicSchemeMPL object and keeps its pointer
func (*BasicSchemeMPL) AggregatePubKeys ¶
AggregatePubKeys returns a new G1Element (public key) as an aggregated public keys this method is a binding of bls::CoreMPL::AggregatePubKeys
func (*BasicSchemeMPL) AggregateSigs ¶
AggregateSigs returns a new G1Element (aggregated public keys) as a result of the aggregation of the passed public keys this method is a binding of bls::CoreMPL::AggregateSigs
func (*BasicSchemeMPL) AggregateVerify ¶
func (s *BasicSchemeMPL) AggregateVerify(pks []*G1Element, msgs [][]byte, sig *G2Element) bool
AggregateVerify verifies the aggregated signature for a list of messages with public keys this method is a binding of bls::BasicSchemeMPL::AggregateVerify
func (*BasicSchemeMPL) DeriveChildPkUnhardened ¶
DeriveChildPkUnhardened returns a child G1Element of the passed master G1Element this method is a binding of bls::CoreMPL::DeriveChildPkUnhardened
func (*BasicSchemeMPL) DeriveChildSk ¶
func (s *BasicSchemeMPL) DeriveChildSk(sk *PrivateKey, index int) *PrivateKey
DeriveChildSk returns a child PrivateKey using the passed as a master key this method is a binding of bls::CoreMPL::DeriveChildSk
func (*BasicSchemeMPL) DeriveChildSkUnhardened ¶
func (s *BasicSchemeMPL) DeriveChildSkUnhardened(sk *PrivateKey, index int) *PrivateKey
DeriveChildSkUnhardened returns a child PrivateKey of the passed master PrivateKey this method is a binding of bls::CoreMPL::DeriveChildSkUnhardened
func (*BasicSchemeMPL) KeyGen ¶
func (s *BasicSchemeMPL) KeyGen(seed []byte) (*PrivateKey, error)
KeyGen returns a new generated PrivateKey using passed a genSeed data this method is a binding of bls::CoreMPL::KeyGen
func (*BasicSchemeMPL) Sign ¶
func (s *BasicSchemeMPL) Sign(sk *PrivateKey, msg []byte) *G2Element
Sign signs a message using a PrivateKey and returns the G2Element as a signature this method is a binding of bls::CoreMPL::Sign
func (*BasicSchemeMPL) SkToG1 ¶
func (s *BasicSchemeMPL) SkToG1(sk *PrivateKey) *G1Element
SkToG1 converts PrivateKey into G1Element (public key) this method is a binding of bls::CoreMPL::SkToG1
type Deriver ¶
type Deriver interface { DeriveChildSk(sk *PrivateKey, index int) *PrivateKey DeriveChildSkUnhardened(sk *PrivateKey, index int) *PrivateKey DeriveChildPkUnhardened(el *G1Element, index int) *G1Element }
Deriver is an interface for describing some methods for the derivation of children
type G1Element ¶
type G1Element struct {
// contains filtered or unexported fields
}
G1Element represents a bls::G1Element (48 bytes) in fact G1Element is corresponding to a public-key
func G1ElementFromBytes ¶
G1ElementFromBytes returns a new G1Element (public-key) from bytes this method allocates the new bls::G2Element object and keeps its pointer
func ThresholdPublicKeyRecover ¶
ThresholdPublicKeyRecover recovers G1Element (public key) from the set of shared G1Element(s) with a list of the hashes this function is a binding of bls::Threshold::PublicKeyRecover
func ThresholdPublicKeyShare ¶
ThresholdPublicKeyShare retrieves a shared G1Element (public key) from a set of G1Element(s) and a hash this function is a binding of bls::Threshold::PublicKeyShare
func (*G1Element) Add ¶
Add performs addition operation on the passed G1Element (public key) and returns a new G1Element (public key) this method is a binding of the bls::G1Element::GetFingerprint
func (*G1Element) EqualTo ¶
EqualTo returns true if the elements are equal otherwise returns false this method is the binding of the equality operation
func (*G1Element) Fingerprint ¶
Fingerprint returns a fingerprint of G1Element (public key) this method is a binding of the bls::G1Element::GetFingerprint
func (*G1Element) IsValid ¶
IsValid returns true if a state of G1Element (public key) is valid this method is the binding of the bls::G1Element::IsValid
func (*G1Element) Mul ¶
func (g *G1Element) Mul(sk *PrivateKey) *G1Element
Mul performs multiplication operation with PrivateKey and returns a new G1Element (public-key) this method is the binding of the multiplication operation
type G2Element ¶
type G2Element struct {
// contains filtered or unexported fields
}
G2Element represents a bls::G2Element (96 bytes) in fact G2Element is corresponding to a signature
func G2ElementFromBytes ¶
G2ElementFromBytes returns a new G2Element (signature) from passed byte slice this method allocates the new bls::G2Element object and keeps its pointer
func ThresholdSign ¶
func ThresholdSign(sk *PrivateKey, hash Hash) *G2Element
ThresholdSign signs of the hash with PrivateKey this function is a binding of bls::Threshold::Sign
func ThresholdSignatureRecover ¶
ThresholdSignatureRecover recovers G2Element (signature) from the set of shared G2Element(s) with a list of the hashes this function is a binding of bls::Threshold::SignatureRecover
func ThresholdSignatureShare ¶
ThresholdSignatureShare retrieves a shared G2Element (signature) from a set of G2Element(s) and a hash this function is a binding of bls::Threshold::SignatureShare
func (*G2Element) Add ¶
Add performs an addition operation on the passed G2Element (signature) and returns a new G2Element (signature) this method is the binding of the addition operation
func (*G2Element) EqualTo ¶
EqualTo returns true if the elements are equal, otherwise returns false this method is the binding of the equality operation
func (*G2Element) Mul ¶
func (g *G2Element) Mul(sk *PrivateKey) *G2Element
Mul performs multiplication operation with PrivateKey and returns a new G2Element (signature) this method is the binding of the multiplication operation
type Generator ¶
type Generator interface {
KeyGen(seed []byte) (*PrivateKey, error)
}
Generator is the interface that wraps the method needed to generate a private key
type Hash ¶
Hash represents 32 byte of hash data
func BuildSignHash ¶
BuildSignHash creates the required signHash for LLMQ threshold signing process
func HashFromString ¶
HashFromString convert a hex string into a Hash
type PopSchemeMPL ¶
type PopSchemeMPL struct {
// contains filtered or unexported fields
}
PopSchemeMPL represents bls::PopSchemeMPL (proof of possession scheme) proof of possession can be used where verification must be fast
func NewPopSchemeMPL ¶
func NewPopSchemeMPL() *PopSchemeMPL
NewPopSchemeMPL returns a new bls::PopSchemeMPL this method allocates the new bls::PopSchemeMPL object and keeps its pointer
func (*PopSchemeMPL) AggregatePubKeys ¶
AggregatePubKeys returns a new G1Element (public key) as an aggregated public keys this method is a binding of bls::CoreMPL::AggregatePubKeys
func (*PopSchemeMPL) AggregateSigs ¶
AggregateSigs returns a new G1Element (aggregated public keys) as a result of the aggregation of the passed public keys this method is a binding of bls::CoreMPL::AggregateSigs
func (*PopSchemeMPL) AggregateVerify ¶
AggregateVerify verifies the aggregated signature for a list of messages with public keys returns true if the signature is a valid otherwise returns false this method is a binding of bls::CoreMPL::AggregateVerify
func (*PopSchemeMPL) DeriveChildPkUnhardened ¶
DeriveChildPkUnhardened returns a child G1Element of the passed master G1Element this method is a binding of bls::CoreMPL::DeriveChildPkUnhardened
func (*PopSchemeMPL) DeriveChildSk ¶
func (s *PopSchemeMPL) DeriveChildSk(sk *PrivateKey, index int) *PrivateKey
DeriveChildSk returns a child PrivateKey using the passed as a master key this method is a binding of bls::CoreMPL::DeriveChildSk
func (*PopSchemeMPL) DeriveChildSkUnhardened ¶
func (s *PopSchemeMPL) DeriveChildSkUnhardened(sk *PrivateKey, index int) *PrivateKey
DeriveChildSkUnhardened returns a child PrivateKey of the passed master PrivateKey this method is a binding of bls::CoreMPL::DeriveChildSkUnhardened
func (*PopSchemeMPL) FastAggregateVerify ¶
func (s *PopSchemeMPL) FastAggregateVerify(pks []*G1Element, msg []byte, sig *G2Element) bool
FastAggregateVerify uses for a fast verification this method is a binding of bls::PopSchemeMPL::FastAggregateVerify
func (*PopSchemeMPL) KeyGen ¶
func (s *PopSchemeMPL) KeyGen(seed []byte) (*PrivateKey, error)
KeyGen returns a new generated PrivateKey using passed a genSeed data this method is a binding of bls::CoreMPL::KeyGen
func (*PopSchemeMPL) PopProve ¶
func (s *PopSchemeMPL) PopProve(sk *PrivateKey) *G2Element
PopProve proves using the PrivateKey this method is a binding of bls::PopSchemeMPL::PopProve
func (*PopSchemeMPL) PopVerify ¶
func (s *PopSchemeMPL) PopVerify(pk *G1Element, sig *G2Element) bool
PopVerify verifies of a signature using proof of possession this method is a binding of bls::PopSchemeMPL::PopVerify
func (*PopSchemeMPL) Sign ¶
func (s *PopSchemeMPL) Sign(sk *PrivateKey, msg []byte) *G2Element
Sign signs a message using a PrivateKey and returns the G2Element as a signature this method is a binding of bls::CoreMPL::Sign
func (*PopSchemeMPL) SkToG1 ¶
func (s *PopSchemeMPL) SkToG1(sk *PrivateKey) *G1Element
SkToG1 converts PrivateKey into G1Element (public key) this method is a binding of bls::CoreMPL::SkToG1
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
PrivateKey represents a bls::PrivateKey (32 byte integer)
func PrivateKeyAggregate ¶
func PrivateKeyAggregate(sks ...*PrivateKey) *PrivateKey
PrivateKeyAggregate securely aggregates multiple private keys into one this method is a binding of the bls::PrivateKey::Aggregate
func PrivateKeyFromBytes ¶
func PrivateKeyFromBytes(data []byte, modOrder bool) (*PrivateKey, error)
PrivateKeyFromBytes returns a new PrivateKey from bytes this method allocates the new bls::PrivateKey object and keeps its pointer
func ThresholdPrivateKeyRecover ¶
func ThresholdPrivateKeyRecover(sks []*PrivateKey, hashes []Hash) (*PrivateKey, error)
ThresholdPrivateKeyRecover recovers PrivateKey from the set of shared PrivateKey(s) with a list of the hashes this function is a binding of bls::Threshold::PrivateKeyRecover
func ThresholdPrivateKeyShare ¶
func ThresholdPrivateKeyShare(sks []*PrivateKey, hash Hash) (*PrivateKey, error)
ThresholdPrivateKeyShare retrieves a shared PrivateKey from a set of PrivateKey(s) and a hash this function is a binding of bls::Threshold::PrivateKeyShare
func (*PrivateKey) EqualTo ¶
func (sk *PrivateKey) EqualTo(other *PrivateKey) bool
EqualTo tests if one PrivateKey is equal to another this method is the binding of the equality operation
func (*PrivateKey) G1Element ¶
func (sk *PrivateKey) G1Element() (*G1Element, error)
G1Element returns a G1Element (public key) using a state of the current private key this method is a binding of the bls::PrivateKey::G1Element
func (*PrivateKey) G2Element ¶
func (sk *PrivateKey) G2Element() (*G2Element, error)
G2Element returns a G2Element (signature) using a state of the current private key this method is a binding of the bls::PrivateKey::G2Element
func (*PrivateKey) G2Power ¶
func (sk *PrivateKey) G2Power(el *G2Element) *G2Element
G2Power returns a power of G2Element (signature) this method is a binding of the bls::PrivateKey::G2Power
func (*PrivateKey) HexString ¶
func (sk *PrivateKey) HexString() string
HexString returns a hex string representation of serialized data
func (*PrivateKey) Serialize ¶
func (sk *PrivateKey) Serialize() []byte
Serialize returns the byte representation of the private key this method is a binding of the bls::PrivateKey::Serialize
type Scheme ¶
type Scheme interface { Signer Generator Verifier Aggregator Deriver }
Scheme is a schema interface
type Signer ¶
type Signer interface {
Sign(sk *PrivateKey, msg []byte) *G2Element
}
Signer is a signer interface
type Verifier ¶
type Verifier interface { Verify(pk *G1Element, msg []byte, sig *G2Element) bool AggregateVerify(pks []*G1Element, msgs [][]byte, sig *G2Element) bool }
Verifier is the interface that wraps the methods needed to verifications the interface contains the method for direct verification and aggregation with verification