Documentation ¶
Index ¶
- func PopVerify(pk PublicKey, sig Signature) bool
- func SaveKey(path string, sk SecretKey) error
- func VerifyMultipleSignatures(sigs [][]byte, msgs [][32]byte, pubKeys []PublicKey) (bool, error)
- func VerifySignature(sig []byte, msg [32]byte, pk PublicKey) (bool, error)
- type PublicKey
- type SecretKey
- type Signature
- func AggregateCompressedSignatures(bs [][]byte) (Signature, error)
- func AggregateSignatures(sigs []Signature) (Signature, error)
- func MultipleSignaturesFromBytes(bs [][]byte) ([]Signature, error)
- func PopProve(sk SecretKey) Signature
- func Sign(sk SecretKey, msg []byte) Signature
- func SignatureFromBytes(b []byte) (Signature, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyMultipleSignatures ¶
VerifyMultipleSignatures verifies multiple signatures for distinct messages securely.
Types ¶
type PublicKey ¶
func AggregateMultiplePubkeys ¶
AggregateMultiplePubkeys aggregates multiple BLS public keys. Assumes that all given public keys are previously validated. Returns error if an empty slice is given.
func AggregatePublicKeys ¶
AggregatePublicKeys unmarshals and validates multiple BLS public key from bytes and then aggregates them. Returns error if an empty slice is given.
func MultiplePublicKeysFromBytes ¶
MultiplePublicKeysFromBytes unmarshals and validates multiple BLS public keys from bytes. Returns an empty slice if an empty slice is given.
func PublicKeyFromBytes ¶
PublicKeyFromBytes unmarshals and validates a BLS public key from bytes.
type SecretKey ¶
func DeriveFromECDSA ¶
func DeriveFromECDSA(priv *ecdsa.PrivateKey) (SecretKey, error)
DeriveFromECDSA generates a BLS secret key from the given EC private key. It is deterministic process. Same EC private key yields the same secret key.
func GenerateKey ¶
GenerateKey generates a BLS secret key from the initial key material (IKM). It is deterministic process. Same IKM yields the same secret key.
func SecretKeyFromBytes ¶
SecretKeyFromBytes unmarshals and validates a BLS secret key from bytes.
type Signature ¶
func AggregateCompressedSignatures ¶
AggregateCompressedSignatures unmarshals and validates multiple BLS signatures from bytes and then aggregates them. Returns error if an empty slice is given.
func AggregateSignatures ¶
AggregateSignatures aggregates multiple BLS signatures. Assumes that all given signatures are previously validated. Returns error if an empty slice is given.
func MultipleSignaturesFromBytes ¶
MultipleSignaturesFromBytes unmarshals multiple BLS signatures from bytes. Returns an empty slice if an empty slice is given.
func PopProve ¶
PopProve calculates the proof-of-possession for the secret key, which is the signature with its public key as message.
func SignatureFromBytes ¶
SignatureFromBytes unmarshals and validates a BLS signature from bytes.