bls

package
v1.3.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneFP

func CloneFP(fp *BN254.FP) *BN254.FP

func DeserializeHexStr

func DeserializeHexStr(s string) (*BN254.ECP, error)

func DeserializeHexStr2

func DeserializeHexStr2(s string) (*BN254.ECP2, error)

func Init

func Init() error

func Modadd

func Modadd(b0, b1 *BN254.BIG) *BN254.BIG

func Modmul

func Modmul(b0, b1 *BN254.BIG) *BN254.BIG

func ToBytes

func ToBytes(E *BN254.ECP) []byte

func ToBytes2

func ToBytes2(E *BN254.ECP2) []byte

Types

type ID

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

Copied directly from herumi's source code. ID: <https://github.com/herumi/bls-go-binary/blob/ef6a150a928bddb19cee55aec5c80585528d9a96/bls/bls.go#47> blsId: <https://github.com/herumi/bls/blob/1b48de51f4f76deb204d108f6126c1507623f739/include/bls/bls.h#L52> FP as Fr: <https://github.com/miracl/core/blob/master/go/FP.go#L26>

func (*ID) GetHexString

func (id *ID) GetHexString() string

func (*ID) Modmul

func (id *ID) Modmul(rhs *ID)

func (*ID) Serialize

func (id *ID) Serialize() []byte

func (*ID) SetHexString

func (id *ID) SetHexString(s string) error

func (*ID) Sub

func (id *ID) Sub(rhs *ID)

type PublicKey

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

Copied directly from herumi's source code. PublicKey: <https://github.com/herumi/bls-go-binary/blob/ef6a150a928bddb19cee55aec5c80585528d9a96/bls/bls.go#L334> blsPublicKey: <https://github.com/herumi/bls/blob/1b48de51f4f76deb204d108f6126c1507623f739/include/bls/bls.h#L60> mclBnG1: <https://github.com/herumi/mcl/blob/0114a3029f74829e79dc51de6dfb28f5da580632/include/mcl/bn.h#L96>

func GetMasterPublicKey

func GetMasterPublicKey(msk []SecretKey) []PublicKey

func NewPublicKey

func NewPublicKey() *PublicKey

func (*PublicKey) Add

func (pk *PublicKey) Add(rhs *PublicKey)

func (*PublicKey) IsEqual

func (pk *PublicKey) IsEqual(rhs *PublicKey) bool

func (*PublicKey) Serialize

func (pk *PublicKey) Serialize() []byte

func (*PublicKey) SerializeToHexStr

func (pk *PublicKey) SerializeToHexStr() string

func (*PublicKey) Set

func (pk *PublicKey) Set(pks []PublicKey, id *ID) error

func (*PublicKey) SetHexString

func (pk *PublicKey) SetHexString(s string) error

func (*PublicKey) ToString

func (pk *PublicKey) ToString() string

type SecretKey

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

Copied directly from herumi's source code. SecretKey: <https://github.com/herumi/bls-go-binary/blob/ef6a150a928bddb19cee55aec5c80585528d9a96/bls/bls.go#L154> blsSecretKey: <https://github.com/herumi/bls/blob/1b48de51f4f76deb204d108f6126c1507623f739/include/bls/bls.h#L56> FP as Fr: <https://github.com/miracl/core/blob/master/go/FP.go#L26>

func NewSecretKey

func NewSecretKey() *SecretKey

func SecretKey_fromBIG

func SecretKey_fromBIG(big *BN254.BIG) *SecretKey

func SecretKey_fromBytes

func SecretKey_fromBytes(b []byte) *SecretKey

func (*SecretKey) Add

func (sk *SecretKey) Add(rhs *SecretKey)

func (*SecretKey) Clone

func (sk *SecretKey) Clone() *SecretKey

func (*SecretKey) DeserializeHexStr

func (sk *SecretKey) DeserializeHexStr(s string) error

func (*SecretKey) GetBIG

func (sk *SecretKey) GetBIG() *BN254.BIG

func (*SecretKey) GetMasterSecretKey

func (sk *SecretKey) GetMasterSecretKey(k int) (msk []SecretKey)

func (*SecretKey) GetPublicKey

func (sk *SecretKey) GetPublicKey() *PublicKey

Turns out this is just MPIN_GET_SERVER_SECRET

func (*SecretKey) IsEqual

func (sk *SecretKey) IsEqual(rhs *SecretKey) bool

func (*SecretKey) SerializeToHexStr

func (sk *SecretKey) SerializeToHexStr() string

func (*SecretKey) SetByCSPRNG

func (sk *SecretKey) SetByCSPRNG() error

func (*SecretKey) Sign

func (sk *SecretKey) Sign(m []byte) *Sign

type Sign

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

Copied directly from herumi's source code. Sign: <https://github.com/herumi/bls-go-binary/blob/ef6a150a928bddb19cee55aec5c80585528d9a96/bls/bls.go#L449> blsSignature: <https://github.com/herumi/bls/blob/1b48de51f4f76deb204d108f6126c1507623f739/include/bls/bls.h#L68> mclBnG1: <https://github.com/herumi/mcl/blob/0114a3029f74829e79dc51de6dfb28f5da580632/include/mcl/bn.h#L96>

func (*Sign) Add

func (sig *Sign) Add(rhs *Sign)

func (*Sign) Recover

func (sig *Sign) Recover(shares []Sign, from []ID) error

Needs to port over this source: https://github.com/herumi/mcl/blob/0114a3029f74829e79dc51de6dfb28f5da580632/include/mcl/lagrange.hpp#L11

func (*Sign) SetHexString

func (sig *Sign) SetHexString(s string) error

Jump to

Keyboard shortcuts

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