Documentation
¶
Index ¶
- Constants
- Variables
- func PublicKeyToCompressedBytes(pk *PublicKey) []byte
- func PublicKeyToUncompressedBytes(key *PublicKey) []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 Ciphersuite
- type PublicKey
- type Signature
- type Signer
Constants ¶
const PublicKeyLen = blst.BLST_P1_COMPRESS_BYTES
const SignatureLen = blst.BLST_P2_COMPRESS_BYTES
Variables ¶
var ( ErrNoPublicKeys = errors.New("no public keys") ErrFailedPublicKeyDecompress = errors.New("couldn't decompress public key") )
Functions ¶
func PublicKeyToCompressedBytes ¶ added in v1.11.3
PublicKeyToCompressedBytes returns the compressed big-endian format of the public key.
func PublicKeyToUncompressedBytes ¶ added in v1.11.3
PublicKeyToUncompressedBytes returns the uncompressed big-endian format of the public 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 Ciphersuite ¶
type Ciphersuite int
const ( CiphersuiteSignature Ciphersuite = iota CiphersuiteProofOfPossession )
func (Ciphersuite) Bytes ¶
func (c Ciphersuite) Bytes() []byte
func (Ciphersuite) String ¶
func (c Ciphersuite) String() string
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 PublicKeyFromCompressedBytes ¶ added in v1.11.3
PublicKeyFromCompressedBytes parses the compressed big-endian format of the public key into a public key.
func PublicKeyFromValidUncompressedBytes ¶ added in v1.11.3
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 Signature ¶
func AggregateSignatures ¶
AggregateSignatures aggregates a non-zero number of signatures into a single aggregated signature. Invariant: all [sigs] have been validated.
func SignatureFromBytes ¶
SignatureFromBytes parses the compressed big-endian format of the signature into a signature.