Documentation ¶
Index ¶
- func CheckIPAProof(transcript *common.Transcript, ic *IPAConfig, commitment banderwagon.Element, ...) (bool, error)
- func GenerateRandomPoints(numPoints uint64) []banderwagon.Element
- func InnerProd(a []fr.Element, b []fr.Element) (fr.Element, error)
- func MultiScalar(points []banderwagon.Element, scalars []fr.Element) (banderwagon.Element, error)
- type IPAConfig
- type IPAProof
- type PrecomputedWeights
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIPAProof ¶
func CheckIPAProof(transcript *common.Transcript, ic *IPAConfig, commitment banderwagon.Element, proof IPAProof, evalPoint fr.Element, result fr.Element) (bool, error)
CheckIPAProof verifies an IPA proof for a committed polynomial in evaluation form. It verifies that `proof` is a valid proof for the polynomial at the evaluation point `evalPoint` with result `result`
func GenerateRandomPoints ¶
func GenerateRandomPoints(numPoints uint64) []banderwagon.Element
GenerateRandomPoints generates numPoints random points on the curve using hardcoded seed.
func MultiScalar ¶
func MultiScalar(points []banderwagon.Element, scalars []fr.Element) (banderwagon.Element, error)
MultiScalar computes the multi scalar multiplication of points and scalars.
Types ¶
type IPAConfig ¶
type IPAConfig struct { SRS []banderwagon.Element Q banderwagon.Element PrecompMSM banderwagon.MSMPrecomp PrecomputedWeights *PrecomputedWeights // contains filtered or unexported fields }
IPAConfig contains all the necessary information to create an IPA related proofs, such as the SRS, Q, and precomputed weights for the barycentric formula.
func NewIPASettings ¶
NewIPASettings generates the SRS, Q and precomputed weights for the barycentric formula. The SRS is generated as common.VectorLength random points where the relative discrete log is not known between each generator.
type IPAProof ¶
type IPAProof struct { L []banderwagon.Element R []banderwagon.Element A_scalar fr.Element }
IPAProof is an inner product argument proof.
func CreateIPAProof ¶
func CreateIPAProof(transcript *common.Transcript, ic *IPAConfig, commitment banderwagon.Element, a []fr.Element, evalPoint fr.Element) (IPAProof, error)
CreateIPAProof creates an IPA proof for a committed polynomial in evaluation form. `a` are the evaluation of the polynomial in the domain, and `evalPoint` represents the evaluation point. The evaluation of the polynomial at such point is computed automatically.
type PrecomputedWeights ¶
type PrecomputedWeights struct {
// contains filtered or unexported fields
}
PrecomputedWeights contains precomputed coefficients for efficient usage of the Barycentric formula.
func NewPrecomputedWeights ¶
func NewPrecomputedWeights() *PrecomputedWeights
NewPrecomputedWeights generates the precomputed weights for the barycentric formula.
func (*PrecomputedWeights) ComputeBarycentricCoefficients ¶
func (preComp *PrecomputedWeights) ComputeBarycentricCoefficients(point fr.Element) []fr.Element
ComputeBarycentricCoefficients, computes the coefficients `bary_coeffs` for a point `z` such that when we have a polynomial `p` in lagrange basis, the inner product of `p` and `bary_coeffs` is equal to p(z) Note that `z` should not be in the domain. This can also be seen as the lagrange coefficients L_i(point)
func (*PrecomputedWeights) DivideOnDomain ¶
DivideOnDomain computes f(x) - f(x_i) / x - x_i where x_i is an element in the domain