Versions in this module Expand all Collapse all v1 v1.1.2 Jul 4, 2022 v1.1.1 Apr 21, 2022 v1.1.0 Mar 30, 2022 Changes in this version type AggBpStatement + func GenerateAggBpStatement_range(m, n int64, range_hash []byte) *AggBpStatement v1.0.1 Mar 24, 2022 v1.0.0 Mar 14, 2022 Changes in this version + var Bn256 param + var G = MapIntoGroup("g") + var MAX = new(big.Int).SetInt64(4294967296) + var ORDER = BN256().N + func AggBpProve_s(instance *AggBpStatement, wit []*big.Int) (string, error) + func AggBpVerify(proof *AggBulletProof, instance *AggBpStatement) (bool, error) + func AggBpVerify_s(proof string, instance *AggBpStatement) (bool, error) + func AggProofMarshal(proof *AggBulletProof) (string, error) + func BN256() param + func Bij(i, j uint64) (int64, error) + func CXtilde(v, bTf *big.Int, P0 [][]*big.Int, P1 [][]*big.Int, N, m int64, ...) ([]*bn256.G1, error) + func CalculatetEval(T1, T2 *bn256.G1, x *big.Int) *bn256.G1 + func ComputeAR(x []*big.Int) []*big.Int + func ComputeAggDelta(y, z *big.Int, n, m int64) *big.Int + func ComputeAggLx(aL, sL []*big.Int, x, z *big.Int, nMulm int64) (lx []*big.Int, err error) + func ComputeAggRx(aR, sR []*big.Int, x, y, z *big.Int, n, m int64) (rx []*big.Int, err error) + func ComputeAt(aggBp *AggBpStatement, c, omega, tHat, stau, delta, sb, x *big.Int, m int64, ...) *bn256.G1 + func ComputeDelta(y, z *big.Int, n int64) *big.Int + func ComputeLx(aL, sL []*big.Int, z, x *big.Int) ([]*big.Int, error) + func ComputeRx(aR, sR []*big.Int, z, y, x *big.Int) ([]*big.Int, error) + func Computet0(aL, aR, sR []*big.Int, y, z *big.Int, n, m int64) (*big.Int, error) + func Computet1(aL, aR, sL, sR []*big.Int, y, z *big.Int, n, m int64) (*big.Int, error) + func Computet2(sL, aR, sR []*big.Int, y, z *big.Int, n, m int64) (*big.Int, error) + func Dec(c *Ciphertext, sk *big.Int) *bn256.G1 + func Decompose(v *big.Int, u int64, l int64) []*big.Int + func GenerateAggA(instance *AggBpStatement, witness *AggBpWitness) (aL, aR []*big.Int, alpha *big.Int, A *bn256.G1, err error) + func GenerateAggS(instance *AggBpStatement) (sL, sR []*big.Int, rho *big.Int, S *bn256.G1, err error) + func GenerateAggT1T2(instance *AggBpStatement, aL, aR, sL, sR []*big.Int, y, z *big.Int) (T1, T2 *bn256.G1, tau1, tau2 *big.Int, err error) + func GenerateAggTaux(tau1, tau2, x, z *big.Int, m int64, vectorGamma []*big.Int) (tauX *big.Int) + func GenerateAggtHat(aL, aR, sL, sR []*big.Int, x, y, z *big.Int, n, m int64) (lx, rx []*big.Int, tHat *big.Int, err error) + func GenerateAggyz(A, S *bn256.G1) (y, z *big.Int) + func GenerateBurnyz(A, S, cLn, cRn, pub *bn256.G1, epoch *big.Int, sender []byte) (y, z *big.Int) + func GenerateChallenge(msg []byte, order *big.Int) *big.Int + func GenerateHprime(h []*bn256.G1, y *big.Int) []*bn256.G1 + func GenerateKexi(v *big.Int, N int64) []*big.Int + func GenerateKey(p param, rand io.Reader) (*big.Int, error) + func GenerateTFv(tfStatement *TransferStatement, BpA, BpS, A, B *bn256.G1) (*big.Int, error) + func GenerateTfC(x *big.Int, Ay, AD, Ab, AX, At, Au *bn256.G1) *big.Int + func GenerateTfOmega(v *big.Int, ...) *big.Int + func GenerateWithdrawCh(x *big.Int, Rpub, Rb, RtHat, Ru *bn256.G1) *big.Int + func Generatex(T1, T2 *bn256.G1, z *big.Int) *big.Int + func Generateyz(A, S *bn256.G1) (y, z *big.Int) + func GetGenerator(param AggBpStatement) (*bn256.G1, *bn256.G1, []*bn256.G1, []*bn256.G1) + func InnerProductVerifier(instance *InnerProductStatement, proof *InnerProductProof, c *big.Int, ...) (bool, error) + func IpVerify(n int64, gVector, hVector []*bn256.G1, p, u *bn256.G1, ...) (bool, error) + func IsPowOfTwo(n int64) bool + func LPolyCoeff(aL []*big.Int, z *big.Int, nm int64) (lZero []*big.Int, err error) + func MapIntoGroup(s string) *bn256.G1 + func MultiVectorT(vector [][]*big.Int) [][]*big.Int + func PointToInt(p *bn256.G1) *big.Int + func PolyCoefficientsT1(sL, sR, aL, aR []*big.Int, y, z *big.Int) (*big.Int, error) + func PolyCoefficientsT2(sL, sR []*big.Int, y *big.Int) *big.Int + func PolyEvaluate(coefficients []*big.Int, x *big.Int) *big.Int + func PolyEvaluateField(coefficients []*big.Int, x *big.Int) *big.Int + func PolyProduct(a, b []*big.Int, field *big.Int) []*big.Int + func PowerOf(a *big.Int, n int64) []*big.Int + func ReadBalance(m *bn256.G1, a, b *big.Int) (*big.Int, error) + func RpolyCoeff(aR, sR []*big.Int, y, z *big.Int, n, m int64) (rZero []*big.Int, rOne []*big.Int, err error) + func SchnorrVerify(pub *bn256.G1, msg []byte, sigma *Signature) bool + func SigmaProve(g, h, cRn *bn256.G1, epoch, x, z, taux *big.Int, wit *WithdrawWitness) (c, ssk, sb, stau *big.Int, err error) + func SignMarshal(sigma *Signature) ([]byte, error) + func SignMarshal1(sigma *Signature) ([]byte, []byte, error) + func TFf(F1Coeff [][2]*big.Int, omega *big.Int) (f []*big.Int) + func TfPolyCoeffF0(a []*big.Int, lBits []*big.Int, m int64) ([][2]*big.Int, error) + func TfPolyCoeffF1(a []*big.Int, lBits []*big.Int, m int64) ([][2]*big.Int, error) + func TfPolyP(Flk0Coeff, Flk1Coeff [][2]*big.Int, N, m int64) [][]*big.Int + func TfProofMarshal(TfProof *TransferProof) string + func TfSampleRandomVector(m int64) (phi, chi, psi, omega []*big.Int) + func TfStatmentMarshal(tfStatment *TransferStatement) ([]byte, error) + func TfVerifier(AnonPk, CLnNew, CRnNew, CVector []*bn256.G1, D, NonceU *bn256.G1, ...) (bool, error) + func TfyXline(PolyP0Coeff [][]*big.Int, PolyP1Coeff [][]*big.Int, N, m int64, ...) (*bn256.G1, error) + func TransferVerify(tfStatement *TransferStatement, tfProof *TransferProof) (bool, error) + func UpdateAggP(A, S, h *bn256.G1, gVector, hprime []*bn256.G1, x, y, z, mu *big.Int, ...) (*bn256.G1, error) + func UpdateP(A, S *bn256.G1, g, hprime []*bn256.G1, h *bn256.G1, x, z, y, mu *big.Int) *bn256.G1 + func VectorAdd(a, b []*big.Int) ([]*big.Int, error) + func VectorCommitMuliExp(P0 [][]*big.Int, Cipher []*bn256.G1, m int64, Publ0 *bn256.G1, phi []*big.Int) ([]*bn256.G1, error) + func VectorDecompose(v []*big.Int, u, n, m int64) []*big.Int + func VectorEcAdd(a, b []*bn256.G1) ([]*bn256.G1, error) + func VectorHadamard(a, b []*big.Int) ([]*big.Int, error) + func VectorInnerProduct(a, b []*big.Int) (*big.Int, error) + func VectorInv(sVector []*big.Int) (sInv []*big.Int) + func VectorLine(point *bn256.G1, pub *bn256.G1, r []*big.Int, w *big.Int, m int64) (*bn256.G1, error) + func VectorMuliExpShift(vectorPoint []*bn256.G1, kexi, polyP0, polyP1 []*big.Int, N int64) (*bn256.G1, error) + func VectorNeg(a []*big.Int) []*big.Int + func VectorPolyEvaluate(PolyCoeff [][]*big.Int, x *big.Int) []*big.Int + func VectorScalarExp(gVector []*bn256.G1, x *big.Int) []*bn256.G1 + func VectorScalarMul(a []*big.Int, b *big.Int) []*big.Int + func VectorScalarMulG(G *bn256.G1, randNum []*big.Int) []*bn256.G1 + func VectorScalarMulSum(aVector []*big.Int, gVector []*bn256.G1) (*bn256.G1, error) + func VectorShift(vector []*big.Int, shift int64) []*big.Int + func VectorSub(a, b []*big.Int) ([]*big.Int, error) + func VerifierCommit(f []*big.Int, A, B *bn256.G1, m int64, zA, challOmega *big.Int, ...) (bool, error) + func VerifierF0Coeff(f []*big.Int, challOmega *big.Int) []*big.Int + func VerifierPolyCoeff(flk0, flk1 []*big.Int, N, m int64) []*big.Int + func VerifierVectorLine(vectorPoint, vectorTilde []*bn256.G1, coeff []*big.Int, omega *big.Int) (*bn256.G1, error) + func VerifierVectorTilde(vectorTilde []*bn256.G1, omega *big.Int) (*bn256.G1, error) + func VerifyAggIpp(proof *AggBulletProof, instance *AggBpStatement) (bool, error) + func VerifyThat(proof *BulletProof, params BulletProofParams) bool + func WdPointMarshal(point []*bn256.G1) []byte + func WdPointUnMarshal(res []byte) ([]*bn256.G1, error) + func WithdrawVerify(statement *WithdrawStatement, proof *WithdrawProof) (bool, error) + type ABProofMarshal struct + A []byte + InnerProductProof []byte + Mu *big.Int + S []byte + T1 []byte + T2 []byte + THat *big.Int + Taux *big.Int + V []byte + type AggBpStatement struct + func AggBp() AggBpStatement + func GenerateAggBpStatement(m, n int64) *AggBpStatement + func NewAggBpStatement(m int64, aggbppram AggBpStatement) *AggBpStatement + type AggBpWitness struct + func NewAggBpWitness(Wit []*big.Int) *AggBpWitness + type AggBulletProof struct + A *bn256.G1 + S *bn256.G1 + T1 *bn256.G1 + T2 *bn256.G1 + V []*bn256.G1 + func AggBpProve(instance *AggBpStatement, witness *AggBpWitness) (*AggBulletProof, error) + func AggProofUnMarshal(str string) (*AggBulletProof, error) + func (aggreBp *AggBulletProof) VectorvCommit(param BulletProofParams, v []*big.Int, m int64) (vectorV []*bn256.G1, vectorGamma []*big.Int, err error) + func (proof *AggBulletProof) VerifyAggtHat(instance *AggBpStatement) (bool, error) + type BulletProof struct + A *bn256.G1 + S *bn256.G1 + T1 *bn256.G1 + T2 *bn256.G1 + V *bn256.G1 + func Prove(witness *big.Int, params BulletProofParams) (*BulletProof, error) + func (proof *BulletProof) Verify(param BulletProofParams) (bool, error) + type BulletProofParams struct + func Bp() BulletProofParams + func GenerateBpParam(n int64) *BulletProofParams + type Ciphertext struct + C *bn256.G1 + D *bn256.G1 + func Enc(rand io.Reader, pk *bn256.G1, b *big.Int) (*Ciphertext, error) + func Newciphertext(C, D *bn256.G1) *Ciphertext + func (c *Ciphertext) Marshal() ([]byte, error) + func (c *Ciphertext) UnMarshal(res []byte) error + type IPproofMarshal struct + A *big.Int + B *big.Int + LS []byte + RS []byte + type InnerProductProof struct + LS []*bn256.G1 + RS []*bn256.G1 + func GenerateAggIpp(instance *AggBpStatement, A, S *bn256.G1, x, y, z, mu, tHat *big.Int, ...) (*InnerProductProof, error) + func InnerProductProver(instance *InnerProductStatement, witness *InnerProductWitness, tHat *big.Int, ...) (proof *InnerProductProof, err error) + func IpProve(n int64, GVector, HVector []*bn256.G1, p, u *bn256.G1, l, r []*big.Int, ...) (proof *InnerProductProof, err error) + type InnerProductStatement struct + func Protocol1(instance *InnerProductStatement, c *big.Int, previousChallenge *big.Int) (*InnerProductStatement, *big.Int) + type InnerProductWitness struct + type KeyPair struct + func NewKeyPair(rand io.Reader) (*KeyPair, error) + func (key *KeyPair) GetPrivateKey() *big.Int + func (key *KeyPair) GetPublicKey() (*bn256.G1, error) + func (key *KeyPair) NewPrivateKey(a *big.Int) + func (key *KeyPair) NewPublicKey(s string) error + type PedersenCommitment struct + func NewPedersenCommitment(p BulletProofParams, x *big.Int) *PedersenCommitment + func (commit *PedersenCommitment) Commit() *bn256.G1 + type Signature struct + R *big.Int + S *big.Int + func SchnorrSign(rand io.Reader, key *KeyPair, msg []byte) (*Signature, error) + func SchnorrTest(rand io.Reader, sk *big.Int, pk *bn256.G1, msg []byte) (*Signature, error) + func SignUnMarshal(res []byte) (*Signature, error) + type TfPMarshal struct + A []byte + B []byte + BpA []byte + BpMu *big.Int + BpS []byte + BpT1 []byte + BpT2 []byte + BpThat *big.Int + C0Tilde []byte + CLnTilde []byte + CRnTilde []byte + CXtilde []byte + Dtilde []byte + Ia *big.Int + Ib *big.Int + LS []byte + RS []byte + TfSb *big.Int + TfSr *big.Int + TfSsk *big.Int + TfStau *big.Int + Tfc *big.Int + Tff []*big.Int + TfgTilde []byte + Tfy0Tilde []byte + TfyXtilde []byte + TfzA *big.Int + type TfSMarshal struct + AnonPk []byte + CLnNew []byte + CRnNew []byte + CVector []byte + D []byte + Epoch []byte + NonceU []byte + type TransferProof struct + A *bn256.G1 + B *bn256.G1 + BpA *bn256.G1 + BpMu *big.Int + BpS *bn256.G1 + BpT1 *bn256.G1 + BpT2 *bn256.G1 + BpThat *big.Int + C0Tilde []*bn256.G1 + CLnTilde []*bn256.G1 + CRnTilde []*bn256.G1 + CXtilde []*bn256.G1 + Dtilde []*bn256.G1 + IpProof *InnerProductProof + TfSb *big.Int + TfSr *big.Int + TfSsk *big.Int + TfStau *big.Int + Tfc *big.Int + Tff []*big.Int + TfgTilde []*bn256.G1 + Tfy0Tilde []*bn256.G1 + TfyXtilde []*bn256.G1 + TfzA *big.Int + func TfProofUnMarshal(str string) (*TransferProof, error) + func TfProver(AnonPk, CLnNew, CRnNew, CVector []*bn256.G1, D, NonceU *bn256.G1, ...) (*TransferProof, error) + func TransferProve(tfStatement *TransferStatement, tfWit *TransferWitness) (*TransferProof, error) + type TransferStatement struct + AnonPk []*bn256.G1 + CLnNew []*bn256.G1 + CRnNew []*bn256.G1 + CVector []*bn256.G1 + D *bn256.G1 + Epoch *big.Int + NonceU *bn256.G1 + type TransferWitness struct + type VectorCommitment struct + func NewVectorCommitment(p BulletProofParams, a, b []*big.Int) *VectorCommitment + func (commit *VectorCommitment) Commit() (*bn256.G1, error) + type WdProofMarshal struct + A []byte + C *big.Int + Ia *big.Int + Ib *big.Int + LS []byte + Mu *big.Int + RS []byte + S []byte + Sb *big.Int + Ssk *big.Int + Stau *big.Int + T1 []byte + T2 []byte + That *big.Int + type WithdrawProof struct + A *bn256.G1 + S *bn256.G1 + T1 *bn256.G1 + T2 *bn256.G1 + func WdProofUnMarshal(str string) (*WithdrawProof, error) + func WithdrawProve(cLn, cRn, pub *bn256.G1, epoch *big.Int, sender []byte, ...) (*WithdrawProof, error) + func (wdProof *WithdrawProof) WdProofMarshal() string + type WithdrawStatement struct + func NewWithdrawStatement(cLn, cRn, pub, u *bn256.G1, epoch *big.Int, sender []byte) *WithdrawStatement + type WithdrawWitness struct + func NewWithdrawWit(Priv *big.Int, Vdiff *AggBpWitness) *WithdrawWitness