mirror of
https://github.com/arnaucube/gnark-plonky2-verifier.git
synced 2026-01-12 00:51:33 +01:00
add observer for FriConfig & FriParams in verifier circuit, to match the updated version of plonky2 at PR#1678 (https://github.com/0xPolygonZero/plonky2/pull/1678)
This commit is contained in:
@@ -86,6 +86,29 @@ func (c *Chip) ObserveOpenings(openings fri.Openings) {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Chip) ObserveFriConfig(
|
||||
config types.FriConfig,
|
||||
) {
|
||||
c.ObserveElement(gl.NewVariable(config.RateBits))
|
||||
c.ObserveElement(gl.NewVariable(config.CapHeight))
|
||||
c.ObserveElement(gl.NewVariable(config.ProofOfWorkBits))
|
||||
for i := 0; i < len(config.ReductionStrategy); i++ {
|
||||
c.ObserveElement(gl.NewVariable(config.ReductionStrategy[i]))
|
||||
}
|
||||
c.ObserveElement(gl.NewVariable(config.NumQueryRounds))
|
||||
}
|
||||
|
||||
func (c *Chip) ObserveFriParams(
|
||||
params types.FriParams,
|
||||
) {
|
||||
c.ObserveFriConfig(params.Config)
|
||||
c.ObserveElement(gl.NewVariable(0)) // Hiding, should be always false as hiding is not supported in gnark-plonky2-verifier
|
||||
c.ObserveElement(gl.NewVariable(params.DegreeBits))
|
||||
for i := 0; i < len(params.ReductionArityBits); i++ {
|
||||
c.ObserveElement(gl.NewVariable(params.ReductionArityBits[i]))
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Chip) GetChallenge() gl.Variable {
|
||||
if len(c.inputBuffer) != 0 || len(c.outputBuffer) == 0 {
|
||||
c.duplexing()
|
||||
|
||||
Reference in New Issue
Block a user