common

package
v5.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package common provides the BLS interfaces that are implemented by the various BLS wrappers.

This package should not be used by downstream consumers. These interfaces are re-exporter by github.com/prysmaticlabs/prysm/crypto/bls. This package exists to prevent an import circular dependency.

Index

Constants

This section is empty.

Variables

View Source
var ErrInfinitePubKey = errors.New("received an infinite public key")

ErrInfinitePubKey describes an error due to an infinite public key.

View Source
var ErrSecretUnmarshal = errors.New("could not unmarshal bytes into secret key")

ErrSecretUnmarshal describes an error which happens during unmarshalling a secret key.

View Source
var ErrZeroKey = errors.New("received secret key is zero")

ErrZeroKey describes an error due to a zero secret key.

View Source
var InfinitePublicKey = [fieldparams.BLSPubkeyLength]byte{0xC0}

InfinitePublicKey represents an infinite public key (G1 Point at Infinity).

View Source
var InfiniteSignature = [96]byte{0xC0}

InfiniteSignature represents an infinite signature (G2 Point at Infinity).

View Source
var ZeroSecretKey = [32]byte{}

ZeroSecretKey represents a zero secret key.

Functions

This section is empty.

Types

type PublicKey

type PublicKey interface {
	Marshal() []byte
	Copy() PublicKey
	Aggregate(p2 PublicKey) PublicKey
	IsInfinite() bool
	Equals(p2 PublicKey) bool
}

PublicKey represents a BLS public key.

type SecretKey

type SecretKey interface {
	PublicKey() PublicKey
	Sign(msg []byte) Signature
	Marshal() []byte
}

SecretKey represents a BLS secret or private key.

type Signature

type Signature interface {
	Verify(pubKey PublicKey, msg []byte) bool
	// Deprecated: Use FastAggregateVerify or use this method in spectests only.
	AggregateVerify(pubKeys []PublicKey, msgs [][32]byte) bool
	FastAggregateVerify(pubKeys []PublicKey, msg [32]byte) bool
	Eth2FastAggregateVerify(pubKeys []PublicKey, msg [32]byte) bool
	Marshal() []byte
	Copy() Signature
}

Signature represents a BLS signature.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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