[−][src]Struct r1cs::MerkleDamgard
A hash function based on the Merkle–Damgård construction.
Methods
impl<F: Field, CF: CompressionFunction<F>> MerkleDamgard<F, CF>
[src]
pub fn new(initial_value: Element<F>, compress: CF) -> Self
[src]
Creates a Merkle–Damgård hash function from the given initial value and one-way compression function.
pub fn new_defaults(compress: CF) -> Self
[src]
Creates a Merkle–Damgård hash function from the given one-way compression function. Uses a simple LCG (seeded with 0) as a source of randomness for the initial value.
Trait Implementations
impl<F: Field, C: CompressionFunction<F>> HashFunction<F> for MerkleDamgard<F, C>
[src]
fn hash(
&self,
builder: &mut GadgetBuilder<F>,
blocks: &[Expression<F>]
) -> Expression<F>
[src]
&self,
builder: &mut GadgetBuilder<F>,
blocks: &[Expression<F>]
) -> Expression<F>
fn hash_evaluate(&self, blocks: &[Element<F>]) -> Element<F>
[src]
Auto Trait Implementations
impl<F, CF> !Send for MerkleDamgard<F, CF>
impl<F, CF> !Sync for MerkleDamgard<F, CF>
impl<F, CF> Unpin for MerkleDamgard<F, CF> where
CF: Unpin,
CF: Unpin,
impl<F, CF> UnwindSafe for MerkleDamgard<F, CF> where
CF: UnwindSafe,
F: RefUnwindSafe,
CF: UnwindSafe,
F: RefUnwindSafe,
impl<F, CF> RefUnwindSafe for MerkleDamgard<F, CF> where
CF: RefUnwindSafe,
F: RefUnwindSafe,
CF: RefUnwindSafe,
F: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,