Documentation ¶
Index ¶
- Constants
- Variables
- func PublicKeyToCompressedBytes(pk *PublicKey) []byte
- func PublicKeyToUncompressedBytes(key *PublicKey) []byte
- func SecretKeyToBytes(sk *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 PublicKeyToCompressedBytes ¶
PublicKeyToCompressedBytes returns the compressed big-endian format of the public key.
func PublicKeyToUncompressedBytes ¶
PublicKeyToUncompressedBytes returns the uncompressed big-endian format of the public key.
func SecretKeyToBytes ¶
SecretKeyToBytes returns the big-endian format of the secret key.
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 PublicFromSecretKey ¶
PublicFromSecretKey returns the public key that corresponds to this secret key.
func PublicKeyFromCompressedBytes ¶
PublicKeyFromCompressedBytes parses the compressed big-endian format of the public key into a public key.
func PublicKeyFromValidUncompressedBytes ¶
PublicKeyFromValidUncompressedBytes parses the uncompressed big-endian format of the public key into a public key. It is assumed that the provided bytes are valid.
type SecretKey ¶
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.