Documentation ¶
Index ¶
- func AggregateG1Points(points []*bn256.G1) *bn256.G1
- func AggregateG2Points(points []*bn256.G2) *bn256.G2
- func RecoverPublicKey(shares []*PublicKeyShare, threshold int) (*bn256.G2, error)
- func RecoverSignature(shares []*SignatureShare, threshold int) (*bn256.G1, error)
- func Sign(secretKey *big.Int, message []byte) *bn256.G1
- func SignG1(secretKey *big.Int, message *bn256.G1) *bn256.G1
- func Verify(publicKey *bn256.G2, message []byte, signature *bn256.G1) bool
- func VerifyG1(publicKey *bn256.G2, message *bn256.G1, signature *bn256.G1) bool
- type PublicKeyShare
- type SecretKeyShare
- type SignatureShare
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateG1Points ¶
AggregateG1Points aggregates array of G1 points into a single G1 point.
func AggregateG2Points ¶
AggregateG2Points aggregates array of G2 points into a single G2 point.
func RecoverPublicKey ¶
func RecoverPublicKey(shares []*PublicKeyShare, threshold int) (*bn256.G2, error)
RecoverPublicKey reconstructs public key from a threshold number of public key shares using Lagrange interpolation.
func RecoverSignature ¶
func RecoverSignature(shares []*SignatureShare, threshold int) (*bn256.G1, error)
RecoverSignature reconstructs the full BLS signature from a threshold number of signature shares using Lagrange interpolation.
func Sign ¶
Sign creates a point on a curve G1 by hashing and signing provided message using the provided secret key.
func SignG1 ¶
SignG1 creates a point on a curve G1 by signing the provided G1 point message using the provided secret key.
Types ¶
type PublicKeyShare ¶
type PublicKeyShare struct {}
PublicKeyShare represents public key share and its index.
type SecretKeyShare ¶
type SecretKeyShare struct {}
SecretKeyShare represents secret key share and its index.
func GetSecretKeyShare ¶
func GetSecretKeyShare(masterSecretKey []*big.Int, i int) *SecretKeyShare
GetSecretKeyShare computes secret share by evaluating a polynomial with coefficients taken from masterSecretKey. This is based on Shamir's Secret Sharing scheme and 'i' represents participant index.
func (*SecretKeyShare) PublicKeyShare ¶
func (s *SecretKeyShare) PublicKeyShare() *PublicKeyShare
PublicKeyShare returns public key share from the current secret key share.
type SignatureShare ¶
type SignatureShare struct {}
SignatureShare represents signature share and its index.