pub struct RingGadget<F> {
pub ring: Vec<(u32, Flat<F>)>,
pub mu: Vec<Flat<F>>,
pub first_wire: u32,
pub first_row: usize,
}Expand description
Δ = Σ_c a_c φ(h_c) over the pad entries (pad, a_c)
as the chain X_127 = T'_127, X_j = T'_j + X_{j+1}²,
T'_j = Σ_c σ^{-j}(μ_j a_c) h_c, on squaring wires
first_wire + j - 1 for j = 1..128; Δ = X_0.
Fields§
§ring: Vec<(u32, Flat<F>)>§mu: Vec<Flat<F>>§first_wire: u32§first_row: usizeStatement row of Lhs_1; the chain
occupies 2 · (BITS - 1) rows from there.
Implementations§
Source§impl<F: HardwareField> RingGadget<F>
impl<F: HardwareField> RingGadget<F>
pub fn new(ring: Vec<(u32, Flat<F>)>, mu: Vec<Flat<F>>, first_wire: u32) -> Self
Sourcepub fn for_each_tie_row(&self, f: impl FnMut(usize, &[Flat<F>]))
pub fn for_each_tie_row(&self, f: impl FnMut(usize, &[Flat<F>]))
f(j, tie_j) for j = 127 down to 1,
tie_j[c] = σ^{-j}(μ_j a_c); the coefficients
of row Lhs_j on the pad entries.
Sourcepub fn wire_rows(&self) -> Vec<AffineRow<F>>
pub fn wire_rows(&self) -> Vec<AffineRow<F>>
Wire terms of the chain rows, in [row_of] order:
Lhs_j + Product_{j+1} and Rhs_j + Lhs_j.
Sourcepub fn delta_form(&self) -> Vec<(Unknown, Flat<F>)>
pub fn delta_form(&self) -> Vec<(Unknown, Flat<F>)>
Δ over the pad entries and the wire Product_1.
Auto Trait Implementations§
impl<F> Freeze for RingGadget<F>
impl<F> RefUnwindSafe for RingGadget<F>
impl<F> Send for RingGadget<F>
impl<F> Sync for RingGadget<F>
impl<F> Unpin for RingGadget<F>
impl<F> UnsafeUnpin for RingGadget<F>
impl<F> UnwindSafe for RingGadget<F>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more