Documentation ¶
Index ¶
- Variables
- func Commit(ts *TrustedSetup, p []*big.Int) *bn256.G1
- func EvaluationBatchProof(ts *TrustedSetup, p []*big.Int, zs, ys []*big.Int) (*bn256.G1, error)
- func EvaluationProof(ts *TrustedSetup, p []*big.Int, z, y *big.Int) (*bn256.G1, error)
- func LagrangeInterpolation(x, y []*big.Int) ([]*big.Int, error)
- func PolynomialToString(p []*big.Int) string
- func Verify(ts *TrustedSetup, c, proof *bn256.G1, z, y *big.Int) bool
- func VerifyBatchProof(ts *TrustedSetup, c, proof *bn256.G1, zs, ys []*big.Int) bool
- type TrustedSetup
Constants ¶
This section is empty.
Variables ¶
var Q, _ = new(big.Int).SetString(
"21888242871839275222246405745257275088696311157297823662689037894645226208583", 10)
Q is the order of the integer field (Zq) that fits inside the snark
var R, _ = new(big.Int).SetString(
"21888242871839275222246405745257275088548364400416034343698204186575808495617", 10)
R is the mod of the finite field
Functions ¶
func Commit ¶
func Commit(ts *TrustedSetup, p []*big.Int) *bn256.G1
Commit generates the commitment to the polynomial p(x)
func EvaluationBatchProof ¶
EvaluationBatchProof generates the evalutation proof for the given list of points
func EvaluationProof ¶
EvaluationProof generates the evaluation proof
func LagrangeInterpolation ¶
LagrangeInterpolation implements the Lagrange interpolation: https://en.wikipedia.org/wiki/Lagrange_polynomial
func PolynomialToString ¶
PolynomialToString converts a polynomial represented by a *big.Int array, into its string human readable representation
func VerifyBatchProof ¶
VerifyBatchProof computes the KZG batch proof commitment verification
Types ¶
type TrustedSetup ¶
TrustedSetup also named Reference String
func NewTrustedSetup ¶
func NewTrustedSetup(l int) (*TrustedSetup, error)
NewTrustedSetup returns a new trusted setup. This step should be done in a secure & distributed way