mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-08 08:43:06 +00:00
No functional changes here. The biggest change was moving certain files into new directories like `plonk` and `iop` (for things like `Challenger` that could be used in STARKs or other IOPs). I also split a few files, renames, etc, but again nothing functional, so I don't think a careful review is necessary (just a sanity check).
23 lines
596 B
Rust
23 lines
596 B
Rust
use std::ops::Range;
|
|
|
|
use crate::plonk::circuit_data::CircuitConfig;
|
|
|
|
/// Represents a wire in the circuit.
|
|
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
|
|
pub struct Wire {
|
|
/// The index of the associated gate.
|
|
pub gate: usize,
|
|
/// The index of the gate input wherein this wire is inserted.
|
|
pub input: usize,
|
|
}
|
|
|
|
impl Wire {
|
|
pub fn is_routable(&self, config: &CircuitConfig) -> bool {
|
|
self.input < config.num_routed_wires
|
|
}
|
|
|
|
pub fn from_range(gate: usize, range: Range<usize>) -> Vec<Self> {
|
|
range.map(|i| Wire { gate, input: i }).collect()
|
|
}
|
|
}
|