mirror of
https://github.com/arnaucube/gnark-plonky2-verifier.git
synced 2026-01-12 00:51:33 +01:00
Moved to variables
This commit is contained in:
@@ -58,7 +58,7 @@ func (g *ArithmeticExtensionGate) wiresIthOutput(i uint64) Range {
|
||||
|
||||
func (g *ArithmeticExtensionGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
const0 := vars.localConstants[0]
|
||||
|
||||
@@ -59,7 +59,7 @@ func (g *ArithmeticGate) WireIthOutput(i uint64) uint64 {
|
||||
|
||||
func (g *ArithmeticGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
const0 := vars.localConstants[0]
|
||||
|
||||
@@ -65,7 +65,7 @@ func (g *BaseSumGate) limbs() []uint64 {
|
||||
|
||||
func (g *BaseSumGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
sum := vars.localWires[BASESUM_GATE_WIRE_SUM]
|
||||
|
||||
@@ -56,7 +56,7 @@ func (g *ConstantGate) WireOutput(i uint64) uint64 {
|
||||
|
||||
func (g *ConstantGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
constraints := []gl.QuadraticExtensionVariable{}
|
||||
|
||||
@@ -147,7 +147,7 @@ func (g *CosetInterpolationGate) wiresShiftedEvaluationPoint() Range {
|
||||
|
||||
func (g *CosetInterpolationGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
constraints := []gl.QuadraticExtensionVariable{}
|
||||
|
||||
@@ -36,7 +36,7 @@ func (g *EvaluateGatesChip) computeFilter(
|
||||
s gl.QuadraticExtensionVariable,
|
||||
manySelector bool,
|
||||
) gl.QuadraticExtensionVariable {
|
||||
glApi := gl.NewGoldilocksApi(g.api)
|
||||
glApi := gl.New(g.api)
|
||||
product := gl.OneExtension()
|
||||
for i := groupRange.start; i < groupRange.end; i++ {
|
||||
if i == uint64(row) {
|
||||
@@ -62,7 +62,7 @@ func (g *EvaluateGatesChip) evalFiltered(
|
||||
groupRange Range,
|
||||
numSelectors uint64,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
glApi := gl.NewGoldilocksApi(g.api)
|
||||
glApi := gl.New(g.api)
|
||||
filter := g.computeFilter(row, groupRange, vars.localConstants[selectorIndex], numSelectors > 1)
|
||||
|
||||
vars.RemovePrefix(numSelectors)
|
||||
@@ -75,7 +75,7 @@ func (g *EvaluateGatesChip) evalFiltered(
|
||||
}
|
||||
|
||||
func (g *EvaluateGatesChip) EvaluateGateConstraints(vars EvaluationVars) []gl.QuadraticExtensionVariable {
|
||||
glApi := gl.NewGoldilocksApi(g.api)
|
||||
glApi := gl.New(g.api)
|
||||
constraints := make([]gl.QuadraticExtensionVariable, g.numGateConstraints)
|
||||
for i := range constraints {
|
||||
constraints[i] = gl.ZeroExtension()
|
||||
|
||||
@@ -65,7 +65,7 @@ func (g *ExponentiationGate) wireIntermediateValue(i uint64) uint64 {
|
||||
|
||||
func (g *ExponentiationGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
base := vars.localWires[g.wireBase()]
|
||||
|
||||
@@ -12,7 +12,7 @@ type Gate interface {
|
||||
Id() string
|
||||
EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable
|
||||
}
|
||||
|
||||
@@ -693,7 +693,7 @@ func (circuit *TestGateCircuit) Define(api frontend.API) error {
|
||||
commonCircuitData := verifier.DeserializeCommonCircuitData("../../data/decode_block/common_circuit_data.json")
|
||||
numSelectors := commonCircuitData.SelectorsInfo.NumSelectors()
|
||||
|
||||
glApi := gl.NewGoldilocksApi(api)
|
||||
glApi := gl.New(api)
|
||||
|
||||
vars := gates.NewEvaluationVars(localConstants[numSelectors:], localWires, publicInputsHash)
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ func (g *MultiplicationExtensionGate) wiresIthOutput(i uint64) Range {
|
||||
|
||||
func (g *MultiplicationExtensionGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
const0 := vars.localConstants[0]
|
||||
|
||||
@@ -27,7 +27,7 @@ func (g *NoopGate) Id() string {
|
||||
|
||||
func (g *NoopGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
return []gl.QuadraticExtensionVariable{}
|
||||
|
||||
@@ -91,7 +91,7 @@ func (g *PoseidonGate) WiresEnd() uint64 {
|
||||
|
||||
func (g *PoseidonGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
constraints := []gl.QuadraticExtensionVariable{}
|
||||
|
||||
@@ -45,7 +45,7 @@ func (g *PoseidonMdsGate) mdsRowShfAlgebra(
|
||||
v [poseidon.SPONGE_WIDTH]gl.QuadraticExtensionAlgebraVariable,
|
||||
api frontend.API,
|
||||
) gl.QuadraticExtensionAlgebraVariable {
|
||||
glApi := gl.NewGoldilocksApi(api)
|
||||
glApi := gl.New(api)
|
||||
if r >= poseidon.SPONGE_WIDTH {
|
||||
panic("MDS row index out of range")
|
||||
}
|
||||
@@ -75,7 +75,7 @@ func (g *PoseidonMdsGate) mdsLayerAlgebra(
|
||||
|
||||
func (g *PoseidonMdsGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
constraints := []gl.QuadraticExtensionVariable{}
|
||||
|
||||
@@ -31,7 +31,7 @@ func (g *PublicInputGate) WiresPublicInputsHash() []uint64 {
|
||||
|
||||
func (g *PublicInputGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
constraints := []gl.QuadraticExtensionVariable{}
|
||||
|
||||
@@ -116,7 +116,7 @@ func (g *RandomAccessGate) WireBit(i uint64, copy uint64) uint64 {
|
||||
|
||||
func (g *RandomAccessGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
two := gl.NewVariable(2).ToQuadraticExtension()
|
||||
|
||||
@@ -76,7 +76,7 @@ func (g *ReducingExtensionGate) wiresAccs(i uint64) Range {
|
||||
|
||||
func (g *ReducingExtensionGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
alpha := vars.GetLocalExtAlgebra(g.wiresAlpha())
|
||||
|
||||
@@ -76,7 +76,7 @@ func (g *ReducingGate) wiresAccs(i uint64) Range {
|
||||
|
||||
func (g *ReducingGate) EvalUnfiltered(
|
||||
api frontend.API,
|
||||
glApi gl.GoldilocksApi,
|
||||
glApi gl.Chip,
|
||||
vars EvaluationVars,
|
||||
) []gl.QuadraticExtensionVariable {
|
||||
alpha := vars.GetLocalExtAlgebra(g.wiresAlpha())
|
||||
|
||||
Reference in New Issue
Block a user