jf_rescue::sponge

Struct RescueSponge

Source
pub struct RescueSponge<F: RescueParameter, const RATE: usize> { /* private fields */ }
Expand description

A rescue hash function consists of a permutation function and an internal state.

Trait Implementations§

Source§

impl<F: Clone + RescueParameter, const RATE: usize> Clone for RescueSponge<F, RATE>

Source§

fn clone(&self) -> RescueSponge<F, RATE>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: RescueParameter + PrimeField, const RATE: usize> CryptographicSponge for RescueSponge<T, RATE>

Source§

type Config = Permutation<T>

Config used by the sponge.

Source§

fn new(permutation: &Self::Config) -> Self

Initialize a new instance of the sponge.

Source§

fn absorb(&mut self, input: &impl Absorb)

Absorb an input into the sponge. This function will absorb the entire input, in chunks of RATE, even if the input length is not a multiple of RATE.

Source§

fn squeeze_bytes(&mut self, _num_bytes: usize) -> Vec<u8>

WARNING! This trait method is unimplemented and should not be used. Only use the CryptographicSponge for squeezing native field elements.

Source§

fn squeeze_bits(&mut self, _num_bits: usize) -> Vec<bool>

WARNING! This trait method is unimplemented and should not be used. Only use the CryptographicSponge for squeezing native field elements.

Source§

fn squeeze_field_elements_with_sizes<F: PrimeField>( &mut self, _sizes: &[FieldElementSize], ) -> Vec<F>

WARNING! This trait method is unimplemented and should not be used. Use squeeze_native_field_elements instead.

Source§

fn squeeze_field_elements<F: PrimeField>( &mut self, _num_elements: usize, ) -> Vec<F>

WARNING! This trait method is unimplemented and should not be used. Use squeeze_native_field_elements instead.

Source§

fn fork(&self, domain: &[u8]) -> Self

Creates a new sponge with applied domain separation.

Source§

impl<F: Debug + RescueParameter, const RATE: usize> Debug for RescueSponge<F, RATE>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: Default + RescueParameter, const RATE: usize> Default for RescueSponge<F, RATE>

Source§

fn default() -> RescueSponge<F, RATE>

Returns the “default value” for a type. Read more
Source§

impl<T: RescueParameter, const RATE: usize> FieldBasedCryptographicSponge<T> for RescueSponge<T, RATE>

The interface for field-based cryptographic sponge. T is the native field used by the cryptographic sponge implementation.

Source§

fn squeeze_native_field_elements(&mut self, num_elements: usize) -> Vec<T>

Squeeze num_elements field elements from the sponge.

Source§

fn squeeze_native_field_elements_with_sizes( &mut self, _sizes: &[FieldElementSize], ) -> Vec<T>

WARNING! This trait method is unimplemented and should not be used. Use squeeze_native_field_elements instead.

Source§

impl<F: RescueParameter, const RATE: usize> SpongeExt for RescueSponge<F, RATE>

Source§

type State = RescueVector<F>

The full state of the cryptographic sponge.
Source§

fn from_state(state: Self::State, permutation: &Self::Config) -> Self

Returns a sponge that uses state.
Source§

fn into_state(self) -> Self::State

Consumes self and returns the state.

Auto Trait Implementations§

§

impl<F, const RATE: usize> Freeze for RescueSponge<F, RATE>
where F: Freeze,

§

impl<F, const RATE: usize> RefUnwindSafe for RescueSponge<F, RATE>
where F: RefUnwindSafe,

§

impl<F, const RATE: usize> Send for RescueSponge<F, RATE>

§

impl<F, const RATE: usize> Sync for RescueSponge<F, RATE>

§

impl<F, const RATE: usize> Unpin for RescueSponge<F, RATE>
where F: Unpin,

§

impl<F, const RATE: usize> UnwindSafe for RescueSponge<F, RATE>
where F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V