Documentation ¶
Index ¶
- func CalculateAntiRogueCoefficients(pubs []PublicKey) []big.Int
- func EmptyMultisigMask() big.Int
- func GenerateRandomKey() (PrivateKey, PublicKey)
- type PrivateKey
- func (secretKey PrivateKey) GenerateMembershipKeyPart(index byte, aggPub PublicKey, anticoef big.Int) Signature
- func (secretKey PrivateKey) Marshal() []byte
- func (secretKey PrivateKey) MarshalJSON() ([]byte, error)
- func (secretKey PrivateKey) Multisign(message []byte, aggPublicKey PublicKey, membershipKey Signature) Signature
- func (priv PrivateKey) PublicKey() PublicKey
- func (secretKey PrivateKey) Sign(message []byte) Signature
- func (secretKey *PrivateKey) UnmarshalJSON(data []byte) error
- type PublicKey
- type Signature
- func (signature Signature) Aggregate(onemore Signature) Signature
- func (signature Signature) Marshal() []byte
- func (signature Signature) MarshalJSON() ([]byte, error)
- func (signature *Signature) UnmarshalJSON(data []byte) error
- func (signature Signature) Verify(publicKey PublicKey, message []byte) bool
- func (signature Signature) VerifyMembershipKeyPart(aggPublicKey PublicKey, partPublicKey PublicKey, anticoef big.Int, index byte) bool
- func (signature Signature) VerifyMultisig(aggPublicKey PublicKey, publicKey PublicKey, message []byte, bitmask *big.Int) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateAntiRogueCoefficients ¶
CalculateAntiRogueCoefficients returns an array of bigints used for subsequent key aggregations:
Ai = hash(Pi, {P1, P2, ...})
func GenerateRandomKey ¶
func GenerateRandomKey() (PrivateKey, PublicKey)
GenerateRandomKey creates a random private and its corresponding public keys
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func UnmarshalPrivateKey ¶
func UnmarshalPrivateKey(data []byte) (PrivateKey, error)
UnmarshalBlsPrivateKey reads the private key from the given byte array
func (PrivateKey) GenerateMembershipKeyPart ¶
func (secretKey PrivateKey) GenerateMembershipKeyPart(index byte, aggPub PublicKey, anticoef big.Int) Signature
GenerateMembershipKeyPart generates the participant signature to be aggregated into membership key
func (PrivateKey) Marshal ¶
func (secretKey PrivateKey) Marshal() []byte
func (PrivateKey) MarshalJSON ¶
func (secretKey PrivateKey) MarshalJSON() ([]byte, error)
func (PrivateKey) Multisign ¶
func (secretKey PrivateKey) Multisign(message []byte, aggPublicKey PublicKey, membershipKey Signature) Signature
Multisign generates BLS multi-signature of the given message, aggregated public key of all participants and the membership key of the signer
func (PrivateKey) PublicKey ¶
func (priv PrivateKey) PublicKey() PublicKey
PublicKey calculates public key corresponding to the given private key
func (PrivateKey) Sign ¶
func (secretKey PrivateKey) Sign(message []byte) Signature
Sign generates a simple BLS signature of the given message
func (*PrivateKey) UnmarshalJSON ¶
func (secretKey *PrivateKey) UnmarshalJSON(data []byte) error
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func AggregatePublicKeys ¶
AggregatePublicKeys calculates P1*A1 + P2*A2 + ...
func UnmarshalPublicKey ¶
func ZeroPublicKey ¶
func ZeroPublicKey() PublicKey
ZeroPublicKey returns zero public key (point at infinity)
func (PublicKey) MarshalJSON ¶
func (*PublicKey) UnmarshalJSON ¶
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
func AggregateSignatures ¶
AggregateSignatures sums the given array of signatures
func HashToPointIndex ¶
func UnmarshalSignature ¶
func ZeroSignature ¶
func ZeroSignature() Signature
ZeroSignature returns zero signature (point at infinity)
func (Signature) MarshalJSON ¶
func (*Signature) UnmarshalJSON ¶
func (Signature) Verify ¶
Verify checks the BLS signature of the message against the public key of its signer
func (Signature) VerifyMembershipKeyPart ¶
func (signature Signature) VerifyMembershipKeyPart(aggPublicKey PublicKey, partPublicKey PublicKey, anticoef big.Int, index byte) bool
VerifyMembershipKeyPart verifies membership key part i ((a⋅pk)×H(P, i)) against aggregated public key (P) and public key of the party (pk×G)
func (Signature) VerifyMultisig ¶
func (signature Signature) VerifyMultisig(aggPublicKey PublicKey, publicKey PublicKey, message []byte, bitmask *big.Int) bool
VerifyMultisig checks the BLS multisignature of the message against: * the aggregated public key of all its signers (whether signed or not), * the aggregated public key of participated signers (who really signed), * and the bitmask of signers