From 85283a0662473eeabb313917086fab2f4ff70309 Mon Sep 17 00:00:00 2001 From: Nicholas Ward Date: Thu, 6 Apr 2023 14:40:39 -0700 Subject: [PATCH] fix --- plonky2_verifier/poseidon_gate.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plonky2_verifier/poseidon_gate.go b/plonky2_verifier/poseidon_gate.go index 8f6c44d..34a1dc4 100644 --- a/plonky2_verifier/poseidon_gate.go +++ b/plonky2_verifier/poseidon_gate.go @@ -112,11 +112,11 @@ func (g *PoseidonGate) EvalUnfiltered(p *PlonkChip, vars EvaluationVars) []Quadr state[i] = vars.localWires[g.WireInput(i)] } - round_ctr := 0 + roundCounter := 0 // First set of full rounds. for r := uint64(0); r < poseidon.HALF_N_FULL_ROUNDS; r++ { - state = poseidonChip.ConstantLayerExtension(state, &round_ctr) + state = poseidonChip.ConstantLayerExtension(state, &roundCounter) if r != 0 { for i := uint64(0); i < poseidon.SPONGE_WIDTH; i++ { sBoxIn := vars.localWires[g.WireFullSBox0(r, i)] @@ -126,7 +126,7 @@ func (g *PoseidonGate) EvalUnfiltered(p *PlonkChip, vars EvaluationVars) []Quadr } state = poseidonChip.SBoxLayerExtension(state) state = poseidonChip.MdsLayerExtension(state) - round_ctr++ + roundCounter++ } // Partial rounds. @@ -143,11 +143,11 @@ func (g *PoseidonGate) EvalUnfiltered(p *PlonkChip, vars EvaluationVars) []Quadr constraints = append(constraints, p.qeAPI.SubExtension(state[0], sBoxIn)) state[0] = poseidonChip.SBoxMonomialExtension(sBoxIn) state = poseidonChip.MdsPartialLayerFastExtension(state, poseidon.N_PARTIAL_ROUNDS-1) - round_ctr += poseidon.N_PARTIAL_ROUNDS + roundCounter += poseidon.N_PARTIAL_ROUNDS // Second set of full rounds. for r := uint64(0); r < poseidon.HALF_N_FULL_ROUNDS; r++ { - poseidonChip.ConstantLayerExtension(state, &round_ctr) + poseidonChip.ConstantLayerExtension(state, &roundCounter) for i := uint64(0); i < poseidon.SPONGE_WIDTH; i++ { sBoxIn := vars.localWires[g.WireFullSBox1(r, i)] constraints = append(constraints, p.qeAPI.SubExtension(state[i], sBoxIn)) @@ -155,7 +155,7 @@ func (g *PoseidonGate) EvalUnfiltered(p *PlonkChip, vars EvaluationVars) []Quadr } state = poseidonChip.MdsLayerExtension(state) state = poseidonChip.SBoxLayerExtension(state) - round_ctr++ + roundCounter++ } for i := uint64(0); i < poseidon.SPONGE_WIDTH; i++ {