mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 06:13:07 +00:00
Merge pull request #105 from mir-protocol/remove_wire_partition_indices
Remove `indices` in `WirePartitions`
This commit is contained in:
commit
d24ecb6dc3
@ -108,14 +108,12 @@ impl<F: Fn(Target) -> usize> TargetPartition<Target, F> {
|
||||
});
|
||||
});
|
||||
|
||||
WirePartitions { partition, indices }
|
||||
WirePartitions { partition }
|
||||
}
|
||||
}
|
||||
|
||||
pub struct WirePartitions {
|
||||
partition: Vec<Vec<Wire>>,
|
||||
// TODO: We don't need `indices` anymore, so we can delete it.
|
||||
indices: HashMap<Wire, usize>,
|
||||
}
|
||||
|
||||
impl WirePartitions {
|
||||
@ -126,7 +124,7 @@ impl WirePartitions {
|
||||
subgroup: &[F],
|
||||
) -> Vec<PolynomialValues<F>> {
|
||||
let degree = 1 << degree_log;
|
||||
let sigma = self.get_sigma_map(degree);
|
||||
let sigma = self.get_sigma_map(degree, k_is.len());
|
||||
|
||||
sigma
|
||||
.chunks(degree)
|
||||
@ -142,10 +140,7 @@ impl WirePartitions {
|
||||
|
||||
/// Generates sigma in the context of Plonk, which is a map from `[kn]` to `[kn]`, where `k` is
|
||||
/// the number of routed wires and `n` is the number of gates.
|
||||
fn get_sigma_map(&self, degree: usize) -> Vec<usize> {
|
||||
debug_assert_eq!(self.indices.len() % degree, 0);
|
||||
let num_routed_wires = self.indices.len() / degree;
|
||||
|
||||
fn get_sigma_map(&self, degree: usize, num_routed_wires: usize) -> Vec<usize> {
|
||||
// Find a wire's "neighbor" in the context of Plonk's "extended copy constraints" check. In
|
||||
// other words, find the next wire in the given wire's partition. If the given wire is last in
|
||||
// its partition, this will loop around. If the given wire has a partition all to itself, it
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user