Documentation ¶
Index ¶
- Constants
- func FinalExp(out *GT, x *GT)
- func FrAdd(out *Fr, x *Fr, y *Fr)
- func FrDiv(out *Fr, x *Fr, y *Fr)
- func FrEvaluatePolynomial(y *Fr, c []Fr, x *Fr) error
- func FrInv(out *Fr, x *Fr)
- func FrLagrangeInterpolation(out *Fr, xVec []Fr, yVec []Fr) error
- func FrMul(out *Fr, x *Fr, y *Fr)
- func FrNeg(out *Fr, x *Fr)
- func FrSub(out *Fr, x *Fr, y *Fr)
- func G1Add(out *G1, x *G1, y *G1)
- func G1Dbl(out *G1, x *G1)
- func G1EvaluatePolynomial(y *G1, c []G1, x *Fr) error
- func G1LagrangeInterpolation(out *G1, xVec []Fr, yVec []G1) error
- func G1Mul(out *G1, x *G1, y *Fr)
- func G1MulCT(out *G1, x *G1, y *Fr)
- func G1Neg(out *G1, x *G1)
- func G1Sub(out *G1, x *G1, y *G1)
- func G2Add(out *G2, x *G2, y *G2)
- func G2Dbl(out *G2, x *G2)
- func G2EvaluatePolynomial(y *G2, c []G2, x *Fr) error
- func G2LagrangeInterpolation(out *G2, xVec []Fr, yVec []G2) error
- func G2Mul(out *G2, x *G2, y *Fr)
- func G2Neg(out *G2, x *G2)
- func G2Sub(out *G2, x *G2, y *G2)
- func GTAdd(out *GT, x *GT, y *GT)
- func GTDiv(out *GT, x *GT, y *GT)
- func GTInv(out *GT, x *GT)
- func GTMul(out *GT, x *GT, y *GT)
- func GTNeg(out *GT, x *GT)
- func GTPow(out *GT, x *GT, y *Fr)
- func GTSub(out *GT, x *GT, y *GT)
- func GetCurveOrder() string
- func GetFieldOrder() string
- func GetFpUnitSize() int
- func GetFrUnitSize() int
- func GetMaxOpUnitSize() int
- func GetOpUnitSize() int
- func GetUint64NumToPrecompute() int
- func MillerLoop(out *GT, x *G1, y *G2)
- func Pairing(out *GT, x *G1, y *G2)
- func PrecomputeG2(Qbuf []uint64, Q *G2)
- func PrecomputedMillerLoop(out *GT, P *G1, Qbuf []uint64)
- func PrecomputedMillerLoop2(out *GT, P1 *G1, Q1buf []uint64, P2 *G1, Q2buf []uint64)
- func SHA256_Final(md *C.uchar, c unsafe.Pointer) C.int
- func SHA256_Init(c unsafe.Pointer) C.int
- func SHA256_Update(c, data unsafe.Pointer, len C.size_t) C.int
- func SHA512_Final(md *C.uchar, c unsafe.Pointer) C.int
- func SHA512_Init(c unsafe.Pointer) C.int
- func SHA512_Update(c, data unsafe.Pointer, len C.size_t) C.int
- type Curve
- type Fr
- func (x *Fr) Clear()
- func (x *Fr) Deserialize(buf []byte) error
- func (x *Fr) GetString(base int) string
- func (x *Fr) IsEqual(rhs *Fr) bool
- func (x *Fr) IsOne() bool
- func (x *Fr) IsZero() bool
- func (x *Fr) Serialize() []byte
- func (x *Fr) SetByCSPRNG()
- func (x *Fr) SetHashOf(buf []byte) bool
- func (x *Fr) SetInt64(v int64)
- func (x *Fr) SetLittleEndian(buf []byte) error
- func (x *Fr) SetString(s string, base int) error
- type G1
- type G2
- type GT
- func (x *GT) Clear()
- func (x *GT) Deserialize(buf []byte) error
- func (x *GT) GetString(base int) string
- func (x *GT) IsEqual(rhs *GT) bool
- func (x *GT) IsOne() bool
- func (x *GT) IsZero() bool
- func (x *GT) Serialize() []byte
- func (x *GT) SetInt64(v int64)
- func (x *GT) SetString(s string, base int) error
- type ID
- 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) GetHexString() string
- func (pub *PublicKey) IsEqual(rhs *PublicKey) bool
- func (pub *PublicKey) Recover(pubVec []PublicKey, idVec []ID) error
- func (pub *PublicKey) Serialize() []byte
- func (pub *PublicKey) SerializeToHexStr() string
- func (pub *PublicKey) Set(mpk []PublicKey, id *ID) error
- func (pub *PublicKey) SetHexString(s string) error
- type SecretKey
- func (sec *SecretKey) Add(rhs *SecretKey)
- func (sec *SecretKey) DeserializeHexStr(s string) error
- func (sec *SecretKey) GetDecString() string
- func (sec *SecretKey) GetHexString() string
- func (sec *SecretKey) GetLittleEndian() []byte
- func (sec *SecretKey) GetMasterSecretKey(k int) (msk []SecretKey)
- func (sec *SecretKey) GetPop() (sign *Sign)
- func (sec *SecretKey) GetPublicKey() (pub *PublicKey)
- func (sec *SecretKey) IsEqual(rhs *SecretKey) bool
- func (sec *SecretKey) Recover(secVec []SecretKey, idVec []ID) error
- func (sec *SecretKey) SerializeToHexStr() string
- func (sec *SecretKey) Set(msk []SecretKey, id *ID) error
- func (sec *SecretKey) SetByCSPRNG() *SecretKey
- func (sec *SecretKey) SetDecString(s string) error
- func (sec *SecretKey) SetHexString(s string) error
- func (sec *SecretKey) SetLittleEndian(buf []byte) error
- func (sec *SecretKey) Sign(m string) (sign *Sign)
- func (sec *SecretKey) SignBytes(buf []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) GetHexString() string
- func (sign *Sign) IsEqual(rhs *Sign) bool
- func (sign *Sign) Recover(signVec []Sign, idVec []ID) error
- func (sign *Sign) Serialize() []byte
- func (sign *Sign) SerializeToHexStr() string
- func (sign *Sign) SetHexString(s string) error
- func (sign *Sign) Verify(pub *PublicKey, m string) bool
- func (sign *Sign) VerifyBytes(pub *PublicKey, buf []byte) bool
- func (sign *Sign) VerifyPop(pub *PublicKey) bool
Constants ¶
const ( // BN160 BN160 = Curve(C.MCL_BN160) // BN254 -- 254 bit curve BN254 = Curve(C.MCL_BN254) // BN_SNARK1 BN_SNARK1 = Curve(C.MCL_BN_SNARK1) // BN381_1 -- 382 bit curve 1 BN381_1 = Curve(C.MCL_BN381_1) // BN381_2 -- 382 bit curve 2 BN381_2 = Curve(C.MCL_BN381_2) // BLS12_381 BLS12_381 = Curve(C.MCL_BLS12_381) )
noinspection GoSnakeCaseUsage,GoNameStartsWithPackageName
const IoSerializeHexStr = C.MCLBN_IO_SERIALIZE_HEX_STR
IoSerializeHexStr
Variables ¶
This section is empty.
Functions ¶
func FrEvaluatePolynomial ¶
FrEvaluatePolynomial -- y = c[0] + c[1] * x + c[2] * x^2 + ...
func FrLagrangeInterpolation ¶
FrLagrangeInterpolation --
func G1EvaluatePolynomial ¶
G1EvaluatePolynomial -- y = c[0] + c[1] * x + c[2] * x^2 + ...
func G1LagrangeInterpolation ¶
G1LagrangeInterpolation --
func G2EvaluatePolynomial ¶
G2EvaluatePolynomial -- y = c[0] + c[1] * x + c[2] * x^2 + ...
func G2LagrangeInterpolation ¶
G2LagrangeInterpolation --
func GetFieldOrder ¶
func GetFieldOrder() string
GetFieldOrder -- return the characteristic of the field where a curve is defined
func GetOpUnitSize ¶
func GetOpUnitSize() int
GetOpUnitSize -- the length of Fr is GetOpUnitSize() * 8 bytes
func PrecomputedMillerLoop ¶
PrecomputedMillerLoop --
func PrecomputedMillerLoop2 ¶
PrecomputedMillerLoop2 --
func SHA256_Final ¶
noinspection GoSnakeCaseUsage
func SHA256_Update ¶
noinspection GoSnakeCaseUsage
func SHA512_Final ¶
noinspection GoSnakeCaseUsage
Types ¶
type Curve ¶
type Curve int8
func CurrentCurve ¶
func CurrentCurve() Curve
func (Curve) PublicKeyLength ¶
func (Curve) SecretKeyLength ¶
func (Curve) SignLength ¶
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey --
func DHKeyExchange ¶
DHKeyExchange --
func GetMasterPublicKey ¶
GetMasterPublicKey --
func (*PublicKey) DeserializeHexStr ¶
DeserializeHexStr --
func (*PublicKey) SerializeToHexStr ¶
SerializeToHexStr --
type SecretKey ¶
type SecretKey struct {
// contains filtered or unexported fields
}
SecretKey --
func (*SecretKey) DeserializeHexStr ¶
DeserializeHexStr --
func (*SecretKey) GetLittleEndian ¶
GetLittleEndian --
func (*SecretKey) GetMasterSecretKey ¶
GetMasterSecretKey --
func (*SecretKey) GetPublicKey ¶
GetPublicKey --
func (*SecretKey) SerializeToHexStr ¶
SerializeToHexStr --
func (*SecretKey) SetLittleEndian ¶
SetLittleEndian --
type Sign ¶
type Sign struct {
// contains filtered or unexported fields
}
Sign --
func (*Sign) DeserializeHexStr ¶
DeserializeHexStr --
func (*Sign) VerifyBytes ¶
VerifyBytes --