bls12381

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 2 Imported by: 11

Documentation

Index

Constants

View Source
const (
	// PrivKeySize defines the length of the PrivKey byte array.
	PrivKeySize = 32
	// PubKeySize defines the length of the PubKey byte array.
	PubKeySize = 96
	// SignatureLength defines the byte length of a BLS signature.
	SignatureLength = 96
	// KeyType is the string constant for the BLS12-381 algorithm.
	KeyType = "bls12_381"
	// BLS12-381 private key name.
	PrivKeyName = "cometbft/PrivKeyBls12_381"
	// BLS12-381 public key name.
	PubKeyName = "cometbft/PubKeyBls12_381"
)
View Source
const (
	// Enabled indicates if this curve is enabled.
	Enabled = false
)

Variables

View Source
var ErrDisabled = errors.New("bls12_381 is disabled")

ErrDisabled is returned if the caller didn't use the `bls12381` build tag or has an incompatible OS.

Functions

This section is empty.

Types

type PrivKey

type PrivKey []byte

PrivKey represents a BLS private key noop when blst is not set as a build flag and cgo is disabled.

func GenPrivKey

func GenPrivKey() (PrivKey, error)

GenPrivKey returns ErrDisabled.

func NewPrivateKeyFromBytes

func NewPrivateKeyFromBytes([]byte) (PrivKey, error)

NewPrivateKeyFromBytes returns ErrDisabled.

func (PrivKey) Bytes

func (privKey PrivKey) Bytes() []byte

Bytes returns the byte representation of the Key.

func (PrivKey) PubKey

func (PrivKey) PubKey() crypto.PubKey

PubKey always panics.

func (PrivKey) Sign

func (PrivKey) Sign([]byte) ([]byte, error)

Sign always panics.

func (PrivKey) Type

func (PrivKey) Type() string

Type returns the key's type.

func (PrivKey) Zeroize

func (PrivKey) Zeroize()

Zeroize always panics.

type PubKey

type PubKey []byte

PubKey represents a BLS private key noop when blst is not set as a build flag and cgo is disabled.

func NewPublicKeyFromBytes

func NewPublicKeyFromBytes([]byte) (*PubKey, error)

NewPublicKeyFromBytes returns ErrDisabled.

func (PubKey) Address

func (PubKey) Address() crypto.Address

Address always panics.

func (PubKey) Bytes

func (PubKey) Bytes() []byte

Bytes always panics.

func (PubKey) Type

func (PubKey) Type() string

Type returns the key's type.

func (PubKey) VerifySignature

func (PubKey) VerifySignature([]byte, []byte) bool

VerifySignature always panics.

Jump to

Keyboard shortcuts

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