mirror of
https://github.com/logos-storage/gnark-plonky2-verifier.git
synced 2026-01-09 00:23:10 +00:00
* gl * stage 1 optimizations * working optimized poseidon * Fix posedion tests * in progress gate type refactor * working gates * working e2e * hm' * hm2 * debug saga continues * more debugging cry * more debug * it finally works * optimizations * more optimizations * new changes * more optimizations * more cleanup * some refactoring * new files * flattening of packages * working commit * more refactor * more flattening * more flattening * more more refactor * more optimizations * more optimizations * more optimizations * plonk benchmark * plonk * fix r1cs * resolve kevin's comments * Update goldilocks/base.go Co-authored-by: Kevin Jue <kjue235@gmail.com> * Update goldilocks/base.go Co-authored-by: Kevin Jue <kjue235@gmail.com> * Update goldilocks/base.go Co-authored-by: Kevin Jue <kjue235@gmail.com> * Update goldilocks/quadratic_extension.go Co-authored-by: Kevin Jue <kjue235@gmail.com> * fix: resolve kevin's confusion --------- Co-authored-by: Kevin Jue <kjue235@gmail.com>
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package gates
|
|
|
|
import (
|
|
gl "github.com/succinctlabs/gnark-plonky2-verifier/goldilocks"
|
|
"github.com/succinctlabs/gnark-plonky2-verifier/poseidon"
|
|
)
|
|
|
|
type EvaluationVars struct {
|
|
localConstants []gl.QuadraticExtensionVariable
|
|
localWires []gl.QuadraticExtensionVariable
|
|
publicInputsHash poseidon.GoldilocksHashOut
|
|
}
|
|
|
|
func NewEvaluationVars(
|
|
localConstants []gl.QuadraticExtensionVariable,
|
|
localWires []gl.QuadraticExtensionVariable,
|
|
publicInputsHash poseidon.GoldilocksHashOut,
|
|
) *EvaluationVars {
|
|
return &EvaluationVars{
|
|
localConstants: localConstants,
|
|
localWires: localWires,
|
|
publicInputsHash: publicInputsHash,
|
|
}
|
|
}
|
|
|
|
func (e *EvaluationVars) RemovePrefix(numSelectors uint64) {
|
|
e.localConstants = e.localConstants[numSelectors:]
|
|
}
|
|
|
|
func (e *EvaluationVars) GetLocalExtAlgebra(wireRange Range) gl.QuadraticExtensionAlgebraVariable {
|
|
// For now, only support degree 2
|
|
if wireRange.end-wireRange.start != gl.D {
|
|
panic("Range must be of size D")
|
|
}
|
|
|
|
var ret gl.QuadraticExtensionAlgebraVariable
|
|
for i := wireRange.start; i < wireRange.end; i++ {
|
|
ret[i-wireRange.start] = e.localWires[i]
|
|
}
|
|
|
|
return ret
|
|
}
|