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 Ciphersuite
- type PublicKey
- type SecretKey
- type Signature
- type Signer
Constants ¶
const ( SecretKeyLen = 32 PublicKeyLen = 48 // Compressed G1 point SignatureLen = 96 // Compressed G2 point )
Variables ¶
var ( ErrNoPublicKeys = errors.New("no public keys") ErrFailedPublicKeyDecompress = errors.New("couldn't decompress public key") ErrFailedSignatureDecompress = errors.New("couldn't decompress signature") ErrInvalidSignature = errors.New("invalid signature") ErrNoSignatures = errors.New("no signatures") ErrFailedSignatureAggregation = errors.New("couldn't aggregate signatures") )
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. For circl/bls, this is the same as compressed.
func SecretKeyToBytes ¶ added in v0.1.3
SecretKeyToBytes returns the big-endian format of the secret key.
func SignatureToBytes ¶
SignatureToBytes returns the compressed big-endian format of the signature.
Types ¶
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 ¶
type PublicKey struct {
// contains filtered or unexported fields
}
Types wrapping the circl BLS types
func AggregatePublicKeys ¶
AggregatePublicKeys aggregates a non-zero number of public keys into a single aggregated public 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 ¶ added in v0.1.3
type SecretKey struct {
// contains filtered or unexported fields
}
Types wrapping the circl BLS types
func NewSecretKey ¶ added in v0.1.3
NewSecretKey generates a new secret key from the local source of cryptographically secure randomness.
func SecretKeyFromBytes ¶ added in v0.1.3
SecretKeyFromBytes parses the big-endian format of the secret key into a secret key.
func (*SecretKey) PublicKey ¶ added in v0.1.3
PublicKey returns the public key associated with the secret key.
func (*SecretKey) Sign ¶ added in v0.1.3
Sign [msg] to authorize that this private key signed [msg].
func (*SecretKey) SignProofOfPossession ¶ added in v0.1.3
SignProofOfPossession signs a [msg] to prove the ownership of this secret key.
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
Types wrapping the circl BLS types
func AggregateSignatures ¶
AggregateSignatures aggregates a non-zero number of signatures into a single aggregated signature.
func SignatureFromBytes ¶
SignatureFromBytes parses the compressed big-endian format of the signature into a signature.