bls

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrivKeyName   = "ostracon/PrivKeyBLS12"
	PubKeyName    = "ostracon/PubKeyBLS12"
	PrivKeySize   = 32
	PubKeySize    = 48
	SignatureSize = 96
	KeyType       = "bls12-381"
)

Variables

This section is empty.

Functions

func AddSignature

func AddSignature(init []byte, signature []byte) (aggrSign []byte, err error)

AddSignature adds a BLS signature to the init. When the init is nil, then a new aggregate signature is built from specified signature.

func VerifyAggregatedSignature

func VerifyAggregatedSignature(aggregatedSignature []byte, pubKeys []PubKey, msgs [][]byte) error

Types

type PrivKey

type PrivKey [PrivKeySize]byte

PrivKey implements crypto.PrivKey.

func GenPrivKey

func GenPrivKey() PrivKey

GenPrivKey generates a new BLS12-381 private key.

func (PrivKey) Bytes

func (privKey PrivKey) Bytes() []byte

Bytes marshals the privkey using amino encoding.

func (PrivKey) Equals

func (privKey PrivKey) Equals(other crypto.PrivKey) bool

Equals - you probably don't need to use this. Runs in constant time based on length of the keys.

func (PrivKey) PubKey

func (privKey PrivKey) PubKey() crypto.PubKey

PubKey gets the corresponding public key from the private key.

func (PrivKey) Sign

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

Sign produces a signature on the provided message.

func (PrivKey) Type

func (privKey PrivKey) Type() string

Type returns information to identify the type of this key.

func (PrivKey) VRFProve

func (privKey PrivKey) VRFProve(seed []byte) (crypto.Proof, error)

VRFProve is not supported in BLS12.

type PubKey

type PubKey [PubKeySize]byte

PubKey implements crypto.PubKey for the BLS12-381 signature scheme.

func (PubKey) Address

func (pubKey PubKey) Address() crypto.Address

Address is the SHA256-20 of the raw pubkey bytes.

func (PubKey) Bytes

func (pubKey PubKey) Bytes() []byte

Bytes marshals the PubKey using amino encoding.

func (PubKey) Equals

func (pubKey PubKey) Equals(other crypto.PubKey) bool

func (PubKey) String

func (pubKey PubKey) String() string

func (PubKey) Type

func (pubKey PubKey) Type() string

Type returns information to identify the type of this key.

func (PubKey) VRFVerify

func (pubKey PubKey) VRFVerify(proof crypto.Proof, seed []byte) (crypto.Output, error)

VRFVerify is not supported in BLS12.

func (PubKey) VerifySignature

func (pubKey PubKey) VerifySignature(msg []byte, sig []byte) bool

Jump to

Keyboard shortcuts

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