Documentation ¶
Index ¶
- func CloneFP(fp *BN254.FP) *BN254.FP
- func DeserializeHexStr(s string) (*BN254.ECP, error)
- func DeserializeHexStr2(s string) (*BN254.ECP2, error)
- func Init() error
- func Modadd(b0, b1 *BN254.BIG) *BN254.BIG
- func Modmul(b0, b1 *BN254.BIG) *BN254.BIG
- func SetRandFunc(randReader io.Reader)
- func ToBytes(E *BN254.ECP) []byte
- func ToBytes2(E *BN254.ECP2) []byte
- type ID
- type PublicKey
- func (pk *PublicKey) Add(rhs *PublicKey)
- func (pk *PublicKey) DeserializeHexStr(s string) error
- func (pk *PublicKey) IsEqual(rhs *PublicKey) bool
- func (pk *PublicKey) Serialize() []byte
- func (pk *PublicKey) SerializeToHexStr() string
- func (pk *PublicKey) Set(pks []PublicKey, id *ID) error
- func (pk *PublicKey) SetHexString(s string) error
- func (pk *PublicKey) ToString() string
- type SecretKey
- func (sk *SecretKey) Add(rhs *SecretKey)
- func (sk *SecretKey) Clone() *SecretKey
- func (sk *SecretKey) DeserializeHexStr(s string) error
- func (sk *SecretKey) GetBIG() *BN254.BIG
- func (sk *SecretKey) GetMasterSecretKey(k int) (msk []SecretKey)
- func (sk *SecretKey) GetPublicKey() *PublicKey
- func (sk *SecretKey) IsEqual(rhs *SecretKey) bool
- func (sk *SecretKey) SerializeToHexStr() string
- func (sk *SecretKey) Set(msk []SecretKey, id *ID) error
- func (sk *SecretKey) SetByCSPRNG() error
- func (sk *SecretKey) Sign(m []byte) *Sign
- type Sign
- func (sig *Sign) Add(rhs *Sign)
- func (sig *Sign) DeserializeHexStr(s string) error
- func (sig *Sign) Recover(shares []Sign, from []ID) error
- func (sig *Sign) Serialize() []byte
- func (sig *Sign) SerializeToHexStr() string
- func (sig *Sign) SetHexString(s string) error
- func (sig *Sign) Verify(pub *PublicKey, m []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetRandFunc ¶
Basically entirely from <https://github.com/herumi/bls-go-binary/blob/ef6a150a928bddb19cee55aec5c80585528d9a96/bls/bls.go#L729>
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) SetHexString ¶
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 NewPublicKey ¶
func NewPublicKey() *PublicKey
func (*PublicKey) DeserializeHexStr ¶
Starting from herumi's library: <https://github.com/herumi/bls-go-binary/blob/ef6a150a928bddb19cee55aec5c80585528d9a96/bls/bls.go#L480>
func (*PublicKey) SerializeToHexStr ¶
func (*PublicKey) SetHexString ¶
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_fromBytes ¶
func (*SecretKey) DeserializeHexStr ¶
func (*SecretKey) GetMasterSecretKey ¶
func (*SecretKey) GetPublicKey ¶
Turns out this is just MPIN_GET_SERVER_SECRET
func (*SecretKey) SerializeToHexStr ¶
func (*SecretKey) Set ¶
Porting over: blsSecretKeyShare: <https://github.com/herumi/bls/blob/3005a32a97ebdcb426d59caaa9868a074fe7b35a/src/bls_c_impl.hpp#L543> evaluatePolynomial: <https://github.com/herumi/mcl/blob/0114a3029f74829e79dc51de6dfb28f5da580632/include/mcl/lagrange.hpp#L64>
func (*SecretKey) SetByCSPRNG ¶
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) DeserializeHexStr ¶
Starting from herumi's library: <https://github.com/herumi/bls-go-binary/blob/ef6a150a928bddb19cee55aec5c80585528d9a96/bls/bls.go#L480>
func (*Sign) Recover ¶
Needs to port over this source: https://github.com/herumi/mcl/blob/0114a3029f74829e79dc51de6dfb28f5da580632/include/mcl/lagrange.hpp#L11
func (*Sign) Serialize ¶
Starting from herumi's library: <https://github.com/herumi/bls-go-binary/blob/ef6a150a928bddb19cee55aec5c80585528d9a96/bls/bls.go#L454>
func (*Sign) SerializeToHexStr ¶
Starting from herumi's library: <https://github.com/herumi/bls-go-binary/blob/ef6a150a928bddb19cee55aec5c80585528d9a96/bls/bls.go#L475>