mirror of https://github.com/zcash/halo2.git
Merge pull request #261 from zcash/fix-mockprover-lookup
[MockProver] Handle query rotations in lookups
This commit is contained in:
commit
7f451a0c64
21
src/dev.rs
21
src/dev.rs
|
@ -337,16 +337,25 @@ impl<F: FieldExt> MockProver<F> {
|
||||||
expression.evaluate(
|
expression.evaluate(
|
||||||
&|scalar| scalar,
|
&|scalar| scalar,
|
||||||
&|index| {
|
&|index| {
|
||||||
let column_index = self.cs.fixed_queries[index].0.index();
|
let query = self.cs.fixed_queries[index];
|
||||||
self.fixed[column_index][row as usize]
|
let column_index = query.0.index();
|
||||||
|
let rotation = query.1.0;
|
||||||
|
self.fixed[column_index]
|
||||||
|
[(row as i32 + n + rotation) as usize % n as usize]
|
||||||
},
|
},
|
||||||
&|index| {
|
&|index| {
|
||||||
let column_index = self.cs.advice_queries[index].0.index();
|
let query = self.cs.advice_queries[index];
|
||||||
self.advice[column_index][row as usize]
|
let column_index = query.0.index();
|
||||||
|
let rotation = query.1.0;
|
||||||
|
self.advice[column_index]
|
||||||
|
[(row as i32 + n + rotation) as usize % n as usize]
|
||||||
},
|
},
|
||||||
&|index| {
|
&|index| {
|
||||||
let column_index = self.cs.instance_queries[index].0.index();
|
let query = self.cs.instance_queries[index];
|
||||||
self.instance[column_index][row as usize]
|
let column_index = query.0.index();
|
||||||
|
let rotation = query.1.0;
|
||||||
|
self.instance[column_index]
|
||||||
|
[(row as i32 + n + rotation) as usize % n as usize]
|
||||||
},
|
},
|
||||||
&|a, b| a + b,
|
&|a, b| a + b,
|
||||||
&|a, b| a * b,
|
&|a, b| a * b,
|
||||||
|
|
Loading…
Reference in New Issue