bls

package
v1.22.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const PublicKeyLen = luxbls.PublicKeyLen
View Source
const SignatureLen = luxbls.SignatureLen

Variables

View Source
var (
	ErrNoPublicKeys              = luxbls.ErrNoPublicKeys
	ErrFailedPublicKeyDecompress = luxbls.ErrFailedPublicKeyDecompress
)
View Source
var (
	ErrNoSignatures              = luxbls.ErrNoSignatures
	ErrFailedSignatureDecompress = luxbls.ErrFailedSignatureDecompress
)

Functions

func PublicKeyToCompressedBytes

func PublicKeyToCompressedBytes(pk *PublicKey) []byte

PublicKeyToCompressedBytes returns the compressed big-endian format of the public key.

func PublicKeyToUncompressedBytes

func PublicKeyToUncompressedBytes(key *PublicKey) []byte

PublicKeyToUncompressedBytes returns the uncompressed big-endian format of the public key.

func SecretKeyToBytes added in v1.11.10

func SecretKeyToBytes(sk *SecretKey) []byte

SecretKeyToBytes returns the big-endian format of the secret key.

func SignatureToBytes

func SignatureToBytes(sig *Signature) []byte

SignatureToBytes returns the compressed big-endian format of the signature.

func Verify

func Verify(pk *PublicKey, sig *Signature, msg []byte) bool

Verify verifies that the signature was signed from the given public key on the given message.

func VerifyProofOfPossession

func VerifyProofOfPossession(pk *PublicKey, sig *Signature, msg []byte) bool

VerifyProofOfPossession verifies that the signature was signed from the given public key on the given message using the proof of possession domain separation tag.

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 = luxbls.PublicKey

func AggregatePublicKeys

func AggregatePublicKeys(pks []*PublicKey) (*PublicKey, error)

AggregatePublicKeys aggregates a non-zero number of public keys into a single aggregated public key.

func PublicFromSecretKey added in v1.11.10

func PublicFromSecretKey(sk *SecretKey) *PublicKey

PublicFromSecretKey returns the public key associated with sk

func PublicKeyFromCompressedBytes

func PublicKeyFromCompressedBytes(pkBytes []byte) (*PublicKey, error)

PublicKeyFromCompressedBytes parses the compressed big-endian format of the public key into a public key.

func PublicKeyFromUncompressedBytes added in v1.16.56

func PublicKeyFromUncompressedBytes(pkBytes []byte) (*PublicKey, error)

PublicKeyFromUncompressedBytes parses the uncompressed big-endian format of the public key into a public key.

func PublicKeyFromValidUncompressedBytes

func PublicKeyFromValidUncompressedBytes(pkBytes []byte) *PublicKey

PublicKeyFromValidUncompressedBytes parses the uncompressed big-endian format of the public key into a public key without performing validation. This should only be used when the public key is known to be valid.

type SecretKey added in v1.11.10

type SecretKey = luxbls.SecretKey

func NewSecretKey added in v1.11.10

func NewSecretKey() (*SecretKey, error)

NewSecretKey generates a new secret key

func SecretKeyFromBytes added in v1.11.10

func SecretKeyFromBytes(skBytes []byte) (*SecretKey, error)

SecretKeyFromBytes parses a secret key from bytes

type Signature

type Signature = luxbls.Signature

func AggregateSignatures

func AggregateSignatures(sigs []*Signature) (*Signature, error)

AggregateSignatures aggregates a non-zero number of signatures into a single aggregated signature.

func SignProofOfPossession added in v1.11.10

func SignProofOfPossession(sk *SecretKey, msg []byte) *Signature

SignProofOfPossession signs msg to prove ownership of sk

func SignatureFromBytes

func SignatureFromBytes(sigBytes []byte) (*Signature, error)

SignatureFromBytes parses the compressed big-endian format of the signature into a signature.

type Signer

type Signer = luxbls.Signer

Directories

Path Synopsis
signer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL