Documentation ¶
Index ¶
- Constants
- Variables
- func PublicKeyToBytes(pk *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")
)
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 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 PublicKeyFromBytes ¶
PublicKeyFromBytes parses the compressed big-endian format of the public key into a public key.
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.