Struct Engine
pub struct Engine<Ck>where
Ck: Checksum,{ /* private fields */ }
Expand description
A checksum engine, which can be used to compute or verify a checksum.
Use this to verify a checksum, feed it the data to be checksummed using
the Self::input_*
methods.
Implementations§
§impl<Ck> Engine<Ck>where
Ck: Checksum,
impl<Ck> Engine<Ck>where
Ck: Checksum,
pub fn input_fe(&mut self, e: Fe32)
pub fn input_fe(&mut self, e: Fe32)
Adds a single gf32 element to the checksum engine.
This is where the actual checksum computation magic happens.
pub fn input_target_residue(&mut self)
pub fn input_target_residue(&mut self)
Inputs the target residue of the checksum.
Checksums are generated by appending the target residue to the input string, then computing the actual residue, and then replacing the target with the actual. This method lets us compute the actual residue without doing any string concatenations.
pub fn residue(&self) -> &<Ck as Checksum>::MidstateRepr
pub fn residue(&self) -> &<Ck as Checksum>::MidstateRepr
Returns for the current checksum residue.
Trait Implementations§
impl<Ck> Copy for Engine<Ck>
impl<Ck> Eq for Engine<Ck>
impl<Ck> StructuralPartialEq for Engine<Ck>where
Ck: Checksum,
Auto Trait Implementations§
impl<Ck> Freeze for Engine<Ck>
impl<Ck> RefUnwindSafe for Engine<Ck>
impl<Ck> Send for Engine<Ck>
impl<Ck> Sync for Engine<Ck>
impl<Ck> Unpin for Engine<Ck>
impl<Ck> UnwindSafe for Engine<Ck>
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more