[−][src]Struct r1cs::Sponge
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 memorybitrate
- the size of the input section, in field elementscapacity
- 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]
&self,
builder: &mut GadgetBuilder<F>,
inputs: &[Expression<F>],
output_len: usize
) -> Vec<Expression<F>>
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,
MP: Unpin,
impl<F, MP> UnwindSafe for Sponge<F, MP> where
F: RefUnwindSafe,
MP: UnwindSafe,
F: RefUnwindSafe,
MP: UnwindSafe,
impl<F, MP> RefUnwindSafe for Sponge<F, MP> where
F: RefUnwindSafe,
MP: RefUnwindSafe,
F: RefUnwindSafe,
MP: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,