[][src]Struct r1cs::Sponge

pub struct Sponge<F: Field, MP: MultiPermutation<F>> { /* fields omitted */ }

A sponge function.

In a SNARK setting, efficiency demands that the two sections of sponge state memory (R and C) be stored in separate field elements, so that inputs can be efficiently added to R without affecting C.

Methods

impl<F: Field, MP: MultiPermutation<F>> Sponge<F, MP>[src]

pub fn new(permutation: MP, bitrate: usize, capacity: usize) -> Self[src]

Create a new sponge function.

Parameters

  • permutation - the permutation with which to transform state memory
  • bitrate - the size of the input section, in field elements
  • capacity - the size of the capacity section, in field elements

pub fn evaluate(
    &self,
    builder: &mut GadgetBuilder<F>,
    inputs: &[Expression<F>],
    output_len: usize
) -> Vec<Expression<F>>
[src]

Auto Trait Implementations

impl<F, MP> !Send for Sponge<F, MP>

impl<F, MP> !Sync for Sponge<F, MP>

impl<F, MP> Unpin for Sponge<F, MP> where
    MP: Unpin

impl<F, MP> UnwindSafe for Sponge<F, MP> where
    F: RefUnwindSafe,
    MP: UnwindSafe

impl<F, MP> RefUnwindSafe for Sponge<F, MP> where
    F: RefUnwindSafe,
    MP: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]