pub struct Increment<T>(pub T);Expand description
A derangement d(x) = x + increment.
This is the standard padding function for sponge constructions. A derangement has no fixed points (d(x) != x for all x), which holds as long as the stored increment is non-zero.
ⓘ
Increment(BabyBear::ONE) // d(x) = x + 1 for field elements
Increment(1u64) // d(x) = x + 1 for raw integersTuple Fields§
§0: TTrait Implementations§
impl<T: Copy> Copy for Increment<T>
impl<T: Clone + Sync + Send + Add<Output = T>> Derangement<T> for Increment<T>
Auto Trait Implementations§
impl<T> Freeze for Increment<T>where
T: Freeze,
impl<T> RefUnwindSafe for Increment<T>where
T: RefUnwindSafe,
impl<T> Send for Increment<T>where
T: Send,
impl<T> Sync for Increment<T>where
T: Sync,
impl<T> Unpin for Increment<T>where
T: Unpin,
impl<T> UnsafeUnpin for Increment<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Increment<T>where
T: UnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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