Documentation ¶
Index ¶
- Constants
- func GetMaxOpUnitSize() int
- func GetOpUnitSize() int
- func HashAndMapToG2(m []byte) error
- type PublicKey
- func (pub *PublicKey) Add(rhs *PublicKey)
- func (pub *PublicKey) Deserialize(buf []byte) error
- func (pub *PublicKey) DeserializeHexStr(s string) error
- func (pub *PublicKey) HexString() string
- func (pub *PublicKey) IsEqual(rhs *PublicKey) bool
- func (pub *PublicKey) Serialize() []byte
- func (pub *PublicKey) SerializeToHexStr() string
- func (pub *PublicKey) SetHexString(s string) error
- type SecretKey
- func (sec *SecretKey) Add(rhs *SecretKey)
- func (sec *SecretKey) DecString() string
- func (sec *SecretKey) DeserializeHexStr(s string) error
- func (sec *SecretKey) GetMasterSecretKey(k int) (msk []SecretKey)
- func (sec *SecretKey) GetPublicKey() (pub *PublicKey)
- func (sec *SecretKey) HexString() string
- func (sec *SecretKey) IsEqual(rhs *SecretKey) bool
- func (sec *SecretKey) LittleEndian() []byte
- func (sec *SecretKey) SerializeToHexStr() string
- func (sec *SecretKey) SetByCSPRNG()
- func (sec *SecretKey) SetDecString(s string) error
- func (sec *SecretKey) SetHexString(s string) error
- func (sec *SecretKey) SetLittleEndian(buf []byte) error
- func (sec *SecretKey) SetValue(val int64)
- func (sec *SecretKey) Sign(m []byte) (sign *Sign)
- type Sign
- func (sign *Sign) Add(rhs *Sign)
- func (sign *Sign) Deserialize(buf []byte) error
- func (sign *Sign) DeserializeHexStr(s string) error
- func (sign *Sign) HexString() string
- func (sign *Sign) IsEqual(rhs *Sign) bool
- func (sign *Sign) Serialize() []byte
- func (sign *Sign) SerializeToHexStr() string
- func (sign *Sign) SetHexString(s string) error
- func (sign *Sign) Verify(pub *PublicKey, m []byte) bool
Constants ¶
const BLS12_381 = C.MCL_BLS12_381
BLS12_381 Curve.
const CurveFp254BNb = C.mclBn_CurveFp254BNb
CurveFp254BNb -- 254 bit curve.
const CurveFp382_1 = C.mclBn_CurveFp382_1
CurveFp382_1 -- 382 bit curve 1.
const CurveFp382_2 = C.mclBn_CurveFp382_2
CurveFp382_2 -- 382 bit curve 2.
const IoSerializeHexStr = C.MCLBN_IO_SERIALIZE_HEX_STR
IoSerializeHexStr -- serialization parameter for the underlying cryptographic library created by @herumi.
Variables ¶
This section is empty.
Functions ¶
func GetOpUnitSize ¶
func GetOpUnitSize() int
GetOpUnitSize -- the length of Fr is GetOpUnitSize() * 8 bytes
func HashAndMapToG2 ¶
HashAndMapToG2 takes a byte slice of a message and attempts to hash it and map the output into the G2 Group.
Types ¶
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey definition in the BLS scheme.
func GetMasterPublicKey ¶
GetMasterPublicKey returns a list of public keys for a slice of private keys.
func (*PublicKey) Deserialize ¶
Deserialize converts a byte slice into a public key.
func (*PublicKey) DeserializeHexStr ¶
DeserializeHexStr sets a public key from a hex string.
func (*PublicKey) SerializeToHexStr ¶
SerializeToHexStr returns a hex string serialization of a public key.
func (*PublicKey) SetHexString ¶
SetHexString sets a public key from a hex string.
type SecretKey ¶
type SecretKey struct {
// contains filtered or unexported fields
}
SecretKey --
func (*SecretKey) DeserializeHexStr ¶
DeserializeHexStr deserializes a hex string into a private key.
func (*SecretKey) GetMasterSecretKey ¶
GetMasterSecretKey creates a series of k secret keys and using a pseudorandom number generator and returns them as a slice.
func (*SecretKey) GetPublicKey ¶
GetPublicKey returns the public key corresponding to a BLS private key.
func (*SecretKey) LittleEndian ¶
LittleEndian returns the serialized, little-endian formatted byte slice of the secret key.
func (*SecretKey) SerializeToHexStr ¶
SerializeToHexStr returns a hex string representation of a private key.
func (*SecretKey) SetByCSPRNG ¶
func (sec *SecretKey) SetByCSPRNG()
SetByCSPRNG sets a private key's internal representation using a cryptographically-secure, pseudorandom number generator.
func (*SecretKey) SetDecString ¶
SetDecString sets a private key based on a decimal string.
func (*SecretKey) SetHexString ¶
SetHexString sets a private key based on a hex string.
func (*SecretKey) SetLittleEndian ¶
SetLittleEndian sets a secret key based on a little-endian formatted byte slice.
type Sign ¶
type Sign struct {
// contains filtered or unexported fields
}
Sign represents a signature in the BLS signature aggregation scheme.
func (*Sign) Deserialize ¶
Deserialize a signature from a byte array.
func (*Sign) DeserializeHexStr ¶
DeserializeHexStr creates a signature from a hex string serialization.
func (*Sign) SerializeToHexStr ¶
SerializeToHexStr serializes a signature into a hex string.
func (*Sign) SetHexString ¶
SetHexString sets a signature from a hex string.