File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/backends/plonky2/primitives/ec/gates Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,20 @@ use crate::backends::plonky2::primitives::ec::{
99/// homogeneous coordinates *minus* an offset in the `z` and `t`
1010/// coordinates, viz. the extension field generator times `Point::B1`,
1111/// cf. CircuitBuilderElliptic::add_point.
12+ ///
13+ /// In plonky2 one Gate can do multiple operations and the gate will register one
14+ /// generator per operation. When a gate operation is used, the `CircuitBuilder` tracks the
15+ /// allocation of operations to gaates via the `current_slots` field. Once the circuit is fully
16+ /// defined, during the build the circuit the generators
17+ /// associated to unused operations (free slots) are removed:
18+ /// https://github.com/0xPolygonZero/plonky2/blob/82791c4809d6275682c34b926390ecdbdc2a5297/plonky2/src/plonk/circuit_builder.rs#L1210
19+ /// Since the generator for the unused operations are removed, no witness value will be calculated
20+ /// for them, and the free slots gate witness wires will be filled with the default value which is zero:
21+ /// https://github.com/0xPolygonZero/plonky2/blob/82791c4809d6275682c34b926390ecdbdc2a5297/plonky2/src/iop/witness.rs#L377
22+ /// This means that a gate with multiple operations need to pass the constraints for a single
23+ /// operation when all its witness wire values are zero (so that when the gate is partially used,
24+ /// the unused slots still pass the constraints). This is the reason why this gate doesn't add the
25+ /// final offset: if it did, the constraints wouldn't pass on the zero witness values.
1226#[ derive( Debug , Clone ) ]
1327pub struct ECAddHomogOffset ;
1428
You can’t perform that action at this time.
0 commit comments