Documentation ¶
Index ¶
- Constants
- Variables
- func PublicKeyToBytes(pk *PublicKey) []byte
- func SecretKeyToBytes(sk *SecretKey) []byte
- func SerializePublicKey(key *PublicKey) []byte
- func SerializeSecretKey(key *SecretKey) []byte
- func SignatureToBytes(sig *Signature) []byte
- func Verify(pk *PublicKey, sig *Signature, msg []byte) bool
- func VerifyProofOfPossession(pk *PublicKey, sig *Signature, msg []byte) bool
- type AggregatePublicKey
- type AggregateSignature
- type PublicKey
- type SecretKey
- type Signature
Constants ¶
const PublicKeyLen = blst.BLST_P1_COMPRESS_BYTES
const SecretKeyLen = blst.BLST_SCALAR_BYTES
const SignatureLen = blst.BLST_P2_COMPRESS_BYTES
Variables ¶
var ( ErrNoPublicKeys = errors.New("no public keys") ErrFailedPublicKeyDecompress = errors.New("couldn't decompress public key") )
var (
ErrFailedSignatureDecompress = errors.New("couldn't decompress signature")
)
Functions ¶
func PublicKeyToBytes ¶
PublicKeyToBytes returns the compressed big-endian format of the public key.
func SecretKeyToBytes ¶
SecretKeyToBytes returns the big-endian format of the secret key.
func SerializePublicKey ¶ added in v1.10.15
func SerializeSecretKey ¶ added in v1.10.15
func SignatureToBytes ¶
SignatureToBytes returns the compressed big-endian format of the signature.
func Verify ¶
Verify the [sig] of [msg] against the [pk]. The [sig] and [pk] may have been an aggregation of other signatures and keys. Invariant: [pk] and [sig] have both been validated.
func VerifyProofOfPossession ¶
Verify the possession of the secret pre-image of [sk] by verifying a [sig] of [msg] against the [pk]. The [sig] and [pk] may have been an aggregation of other signatures and keys. Invariant: [pk] and [sig] have both been validated.
Types ¶
type AggregatePublicKey ¶
type AggregatePublicKey = blst.P1Aggregate
type AggregateSignature ¶
type AggregateSignature = blst.P2Aggregate
type PublicKey ¶
func AggregatePublicKeys ¶
AggregatePublicKeys aggregates a non-zero number of public keys into a single aggregated public key. Invariant: all [pks] have been validated.
func DeserializePublicKey ¶ added in v1.10.15
func PublicFromSecretKey ¶
PublicFromSecretKey returns the public key that corresponds to this secret key.
func PublicKeyFromBytes ¶
PublicKeyFromBytes parses the compressed big-endian format of the public key into a public key.
type SecretKey ¶
func DeserializeSecretKey ¶ added in v1.10.15
func NewSecretKey ¶
NewSecretKey generates a new secret key from the local source of cryptographically secure randomness.
func SecretKeyFromBytes ¶
SecretKeyFromBytes parses the big-endian format of the secret key into a secret key.
type Signature ¶
func AggregateSignatures ¶
AggregateSignatures aggregates a non-zero number of signatures into a single aggregated signature. Invariant: all [sigs] have been validated.
func SignProofOfPossession ¶
Sign [msg] to prove the ownership of this [sk].
func SignatureFromBytes ¶
SignatureFromBytes parses the compressed big-endian format of the signature into a signature.