mirror of
https://github.com/arnaucube/gnark-plonky2-verifier.git
synced 2026-01-12 09:01:32 +01:00
initial work on PoseidonGate
This commit is contained in:
@@ -1,28 +0,0 @@
|
|||||||
package plonky2_verifier
|
|
||||||
|
|
||||||
import (
|
|
||||||
. "gnark-plonky2-verifier/field"
|
|
||||||
)
|
|
||||||
|
|
||||||
type PublicInputGate struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *PublicInputGate) WiresPublicInputsHash() []uint64 {
|
|
||||||
return []uint64{0, 1, 2, 3}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *PublicInputGate) EvalUnfiltered(pc *PlonkChip, vars EvaluationVars) []QuadraticExtension {
|
|
||||||
constraints := []QuadraticExtension{}
|
|
||||||
|
|
||||||
wires := p.WiresPublicInputsHash()
|
|
||||||
hash_parts := vars.publicInputsHash
|
|
||||||
for i := 0; i < 4; i++ {
|
|
||||||
wire := wires[i]
|
|
||||||
hash_part := hash_parts[i]
|
|
||||||
|
|
||||||
diff := pc.qeAPI.SubExtension(vars.localWires[wire], pc.qeAPI.FieldToQE(hash_part))
|
|
||||||
constraints = append(constraints, diff)
|
|
||||||
}
|
|
||||||
|
|
||||||
return constraints
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user