bls

package
v0.0.0-...-a111a03 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const RandLength = 32

RandLength --

Variables

View Source
var R = Decimal2Big("16798108731015832284940804142231733909759579603404752749028378864165570215949")

R --

Functions

func BatchVerify

func BatchVerify(pubs []Pubkey, msg []byte, sigs []Signature) bool

BatchVerify --

func Bytes2Big

func Bytes2Big(b []byte) (x big.Int)

Bytes2Big --

func Decimal2Big

func Decimal2Big(s string) (x big.Int)

Decimal2Big --

func Hex2Big

func Hex2Big(s string) (x big.Int)

Hex2Big --

func PrintCtrs

func PrintCtrs()

PrintCtrs -- print counters counting various operations

func PubkeyCtrs

func PubkeyCtrs() string

PubkeyCtrs --

func SeckeyCtrs

func SeckeyCtrs() string

SeckeyCtrs -- one-line summary of counter values related to secret key operations

func SignatureCtrs

func SignatureCtrs() string

SignatureCtrs --

func VerifyAggregateSig

func VerifyAggregateSig(pubs []Pubkey, msg []byte, asig Signature) bool

VerifyAggregateSig --

func VerifyPop

func VerifyPop(pub Pubkey, pop Pop) bool

VerifyPop --

func VerifySig

func VerifySig(pub Pubkey, msg []byte, sig Signature) bool

VerifySig -- verify message and signature against public key

Types

type ID

type ID struct {
	// contains filtered or unexported fields
}

ID -- id for secret sharing, represented by big.Int

func IDFromAddress

func IDFromAddress(addr common.Address) ID

IDFromAddress --

func IDFromBig

func IDFromBig(b *big.Int) (id ID)

IDFromBig --

func IDFromInt64

func IDFromInt64(i int64) (id ID)

IDFromInt64 --

func (ID) CgoID

func (id ID) CgoID() (cgoid blscgo.ID)

CgoID --

func (*ID) SetBig

func (id *ID) SetBig(b *big.Int)

SetBig --

type Pop

type Pop Signature

Pop --

func GeneratePop

func GeneratePop(sec Seckey, pub Pubkey) Pop

GeneratePop --

type Pubkey

type Pubkey struct {
	// contains filtered or unexported fields
}

Pubkey -

func AggregatePubkeys

func AggregatePubkeys(pubs []Pubkey) (pub Pubkey)

AggregatePubkeys -- aggregate multiple into one by summing up

func PubkeyFromSeckey

func PubkeyFromSeckey(sec Seckey) (pub Pubkey)

PubkeyFromSeckey -- derive the pubkey from seckey

func SharePubkey

func SharePubkey(mpub []Pubkey, id ID) (pub Pubkey)

SharePubkey -- Derive shares from master through polynomial substitution

func (Pubkey) Address

func (pub Pubkey) Address() common.Address

Address --

func (Pubkey) Hash

func (pub Pubkey) Hash() common.Hash

Hash -- hash & id

func (Pubkey) PublicKey

func (pub Pubkey) PublicKey() (pk *blscgo.PublicKey)

PublicKey --

func (Pubkey) String

func (pub Pubkey) String() string

String --

type PubkeyMap

type PubkeyMap map[common.Address]Pubkey

PubkeyMap --

type Rand

type Rand [RandLength]byte

Rand --

func RandFromBytes

func RandFromBytes(b []byte) (r Rand)

RandFromBytes --

func (Rand) Bytes

func (r Rand) Bytes() []byte

Bytes --

func (Rand) Deri

func (r Rand) Deri(i int) Rand

Deri -- ... by int

func (Rand) DerivedRand

func (r Rand) DerivedRand(idx []byte) Rand

DerivedRand -- Derived Randomness hierarchically

func (Rand) Ders

func (r Rand) Ders(s ...string) Rand

Ders -- ... by string

func (Rand) Modulo

func (r Rand) Modulo(n int) int

Modulo -- Convert to a random integer from the interval [0,n-1].

func (Rand) RandomPerm

func (r Rand) RandomPerm(n int, k int) []int

RandomPerm -- Convert to a random permutation

func (Rand) String

func (r Rand) String() string

String --

type Seckey

type Seckey struct {
	// contains filtered or unexported fields
}

Seckey -- represented by a big.Int modulo R

func AggregateSeckeys

func AggregateSeckeys(secs []Seckey) (sec Seckey)

AggregateSeckeys -- Aggregate multiple seckeys into one by summing up

func RecoverSeckey

func RecoverSeckey(secs []Seckey, ids []ID) (sec Seckey)

RecoverSeckey -- Recover master from shares through Lagrange interpolation

func RecoverSeckeyByMap

func RecoverSeckeyByMap(m SeckeyMap, k int) (sec Seckey)

RecoverSeckeyByMap --

func SeckeyFromBigInt

func SeckeyFromBigInt(b *big.Int) (sec Seckey)

SeckeyFromBigInt --

func SeckeyFromBytes

func SeckeyFromBytes(b []byte) (sec Seckey)

SeckeyFromBytes --

func SeckeyFromInt

func SeckeyFromInt(i int64) (sec Seckey)

SeckeyFromInt --

func SeckeyFromRand

func SeckeyFromRand(seed Rand) Seckey

SeckeyFromRand --

func ShareSeckey

func ShareSeckey(msec []Seckey, id ID) (sec Seckey)

ShareSeckey -- Derive shares from master through polynomial substitution

func ShareSeckeyByAddr

func ShareSeckeyByAddr(msec []Seckey, addr common.Address) (sec Seckey)

ShareSeckeyByAddr -- wrapper around sharing by ID

func (Seckey) BigInt

func (sec Seckey) BigInt() *big.Int

BigInt --

func (Seckey) Bytes

func (sec Seckey) Bytes() []byte

Bytes --

func (Seckey) Hex

func (sec Seckey) Hex() string

Hex --

func (Seckey) SecretKey

func (sec Seckey) SecretKey() (sk *blscgo.SecretKey)

SecretKey -- convert the Seckey to blscgo.SecretKey

func (Seckey) String

func (sec Seckey) String() string

String --

type SeckeyMap

type SeckeyMap map[common.Address]Seckey

SeckeyMap -- a map from addresses to Seckey

type Signature

type Signature struct {
	// contains filtered or unexported fields
}

Signature --

func AggregateSigs

func AggregateSigs(sigs []Signature) (sig Signature)

AggregateSigs -- aggregate multiple into one by summing up

func RecoverSignature

func RecoverSignature(sigs []Signature, ids []ID) (sig Signature)

RecoverSignature -- Recover master from shares through Lagrange interpolation

func RecoverSignatureByMap

func RecoverSignatureByMap(m SignatureMap, k int) (sec Signature)

RecoverSignatureByMap --

func Sign

func Sign(sec Seckey, msg []byte) (sig Signature)

Sign -- sign a message with secret key

func (Signature) Rand

func (sig Signature) Rand() Rand

Rand --

func (Signature) Sig

func (sig Signature) Sig() (sign *blscgo.Sign)

Sig -- convert Signature to blscgo Sign

func (Signature) String

func (sig Signature) String() string

String --

type SignatureMap

type SignatureMap map[common.Address]Signature

SignatureMap --

Jump to

Keyboard shortcuts

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