bls

package
v0.2.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package bls implements a go-wrapper around a library implementing the the BLS12-381 curve and signature scheme. This package exposes a public API for verifying and aggregating BLS signatures used by Ethereum 2.0.

Index

Constants

View Source
const CurveOrder = "52435875175126190479447740508185965837690552500527637822603658699938581184513"

CurveOrder for the BLS12-381 curve.

View Source
const DomainByteLength = 4

DomainByteLength length of domain byte array.

Variables

View Source
var ErrImplementationNotFound = errors.New("the implementation requested is not found")

ErrImplementationNotFound returns when selecting another bls implementation

View Source
var ErrInfinitePubKey = common.ErrInfinitePubKey

ErrInfinitePubKey describes an error due to an infinite public key.

View Source
var ErrZeroKey = common.ErrZeroKey

ErrZeroKey describes an error due to a zero secret key.

View Source
var InfinitePublicKey = common.InfinitePublicKey

InfinitePublicKey represents an infinite public key.

View Source
var Prefix = params.MainNet.AccountPrefixes
View Source
var ZeroSecretKey = common.ZeroSecretKey

ZeroSecretKey represents a zero secret key.

Functions

func AggregateSignatures

func AggregateSignatures(sigs []common.Signature) common.Signature

AggregateSignatures converts a list of signatures into a single, aggregated sig.

func Initialize

func Initialize(c *params.ChainParams, impl string)

func NewAggregateSignature

func NewAggregateSignature() common.Signature

NewAggregateSignature creates a blank aggregate signature.

func RandKey

func RandKey() (common.SecretKey, error)

RandKey creates a new private key using a random input.

Types

type KeyPair

type KeyPair struct {
	Public  string `json:"public"`
	Private string `json:"private"`
}

KeyPair is an interface struct to serve keypairs

type PublicKey

type PublicKey = common.PublicKey

PublicKey represents a BLS public key.

func AggregatePublicKeys

func AggregatePublicKeys(pubs [][]byte) (PublicKey, error)

AggregatePublicKeys aggregates the provided raw public keys into a single key.

func PublicKeyFromBytes

func PublicKeyFromBytes(pubKey []byte) (PublicKey, error)

PublicKeyFromBytes creates a BLS public key from a BigEndian byte slice.

type SecretKey

type SecretKey = common.SecretKey

SecretKey represents a BLS secret or private key.

func SecretKeyFromBigNum

func SecretKeyFromBigNum(s string) (SecretKey, error)

SecretKeyFromBigNum takes in a big number string and creates a BLS private key.

func SecretKeyFromBytes

func SecretKeyFromBytes(privKey []byte) (SecretKey, error)

SecretKeyFromBytes creates a BLS private key from a BigEndian byte slice.

type Signature

type Signature = common.Signature

Signature represents a BLS signature.

func SignatureFromBytes

func SignatureFromBytes(sig []byte) (Signature, error)

SignatureFromBytes creates a BLS signature from a LittleEndian byte slice.

Directories

Path Synopsis
Package common provides the BLS interfaces that are implemented by the various BLS wrappers.
Package common provides the BLS interfaces that are implemented by the various BLS wrappers.
Code generated by fastssz.
Code generated by fastssz.

Jump to

Keyboard shortcuts

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