pub struct WireMod2 { /* private fields */ }Expand description
Representation of a mod-2 wire.
Trait Implementations§
Source§impl ConditionallySelectable for WireMod2
impl ConditionallySelectable for WireMod2
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
Conditionally swap
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl<'de> Deserialize<'de> for WireMod2
impl<'de> Deserialize<'de> for WireMod2
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl WireLabel for WireMod2
impl WireLabel for WireMod2
Source§fn rand_delta<R: CryptoRng + Rng>(rng: &mut R, q: u16) -> Self
fn rand_delta<R: CryptoRng + Rng>(rng: &mut R, q: u16) -> Self
Get a random wire label mod
q, with the first digit set to 1Source§fn plus_eq<'a>(&'a mut self, other: &Self) -> &'a mut Self
fn plus_eq<'a>(&'a mut self, other: &Self) -> &'a mut Self
Add another wire digit-wise into this one. Assumes that both wires have
the same modulus.
Source§fn from_block(inp: Block, q: u16) -> Self
fn from_block(inp: Block, q: u16) -> Self
Pack the wire into a
Block.Source§fn hash_to_mod(hash: Block, q: u16) -> Self
fn hash_to_mod(hash: Block, q: u16) -> Self
Subroutine of hashback that converts the hash block into a valid wire of the given
modulus. Also useful when batching hashes ahead of time for later conversion.
Source§fn hashback(&self, tweak: Block, q: u16) -> Self
fn hashback(&self, tweak: Block, q: u16) -> Self
Compute the hash of this wire, converting the result back to a wire. Read more
Source§fn negate_mov(self) -> Self
fn negate_mov(self) -> Self
Negate all the digits
mod q, consuming it for chained computations.Source§fn cmul_mov(self, c: u16) -> Self
fn cmul_mov(self, c: u16) -> Self
Multiply each digit by a constant
c mod q, consuming it for chained computations.Source§fn cmul(&self, c: u16) -> Self
fn cmul(&self, c: u16) -> Self
Multiply each digit by a constant
c mod q, returning a new wire.Source§fn plus_mov(self, other: &Self) -> Self
fn plus_mov(self, other: &Self) -> Self
Add another wire into this one, consuming it for chained computations.
impl Copy for WireMod2
impl StructuralPartialEq for WireMod2
Auto Trait Implementations§
impl Freeze for WireMod2
impl RefUnwindSafe for WireMod2
impl Send for WireMod2
impl Sync for WireMod2
impl Unpin for WireMod2
impl UnwindSafe for WireMod2
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§impl<T> IsSameType<T> for T
impl<T> IsSameType<T> for T
§type EqualityProposition = TrueEqualityProposition
type EqualityProposition = TrueEqualityProposition
The [
EqualityProposition] that Self == T