pub struct Tip5 {}

Implementations§

source§

impl Tip5

source

pub const fn offset_fermat_cube_map(x: u16) -> u16

source

pub fn trace(sponge: &mut Tip5State) -> [[BFieldElement; 16]; 6]

Functionally equivalent to permutation. Returns the trace of applying the permutation; that is, the initial state of the sponge as well as its state after each round.

source

pub fn hash_10(input: &[BFieldElement; 10]) -> [BFieldElement; 5]

hash_10 Hash 10 elements, or two digests. There is no padding because the input length is fixed.

Trait Implementations§

source§

impl AlgebraicHasher for Tip5

source§

fn sample_scalars( state: &mut Self::SpongeState, num_elements: usize ) -> Vec<XFieldElement>

Produce num_elements random XFieldElement values.

  • The randomness depends on state.

Since RATE is not divisible by EXTENSION_DEGREE, produce as many XFieldElement per squeeze as possible, and spill the remaining element(s). This causes some internal fragmentation, but it greatly simplifies building [AlgebraicHasher::sample_xfield()] on Triton VM.

source§

fn hash_pair(left: &Digest, right: &Digest) -> Digest

Hash two Digests into one.
source§

fn hash<T: BFieldCodec>(value: &T) -> Digest

Hash a value: &T to a Digest. Read more
source§

fn hash_varlen(input: &[BFieldElement]) -> Digest

Hash a variable-length sequence of BFieldElement. Read more
source§

fn sample_indices( state: &mut Self::SpongeState, upper_bound: u32, num_indices: usize ) -> Vec<u32>

Produce num_indices random integer values in the range [0, upper_bound). Read more
source§

impl BFieldCodec for Tip5

source§

fn decode(sequence: &[BFieldElement]) -> Result<Box<Self>>

source§

fn encode(&self) -> Vec<BFieldElement>

source§

fn static_length() -> Option<usize>

Returns the length in number of BFieldElements if it is known at compile-time. Otherwise, None.
source§

impl Clone for Tip5

source§

fn clone(&self) -> Tip5

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 Debug for Tip5

source§

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

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

impl Default for Tip5

source§

fn default() -> Tip5

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

impl<'de> Deserialize<'de> for Tip5

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl GetSize for Tip5

source§

fn get_stack_size() -> usize

Determines how may bytes this object occupies inside the stack. Read more
source§

fn get_heap_size(&self) -> usize

Determines how many bytes this object occupies inside the heap. Read more
source§

fn get_size(&self) -> usize

Determines the total size of the object. Read more
source§

impl PartialEq<Tip5> for Tip5

source§

fn eq(&self, other: &Tip5) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Tip5

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl SpongeHasher for Tip5

source§

const RATE: usize = 10usize

§

type SpongeState = Tip5State

source§

fn init() -> Self::SpongeState

Initialize a sponge state
source§

fn absorb(sponge: &mut Self::SpongeState, input: &[BFieldElement; 10])

Absorb an array of RATE field elements into the sponge’s state, mutating it.
source§

fn squeeze(sponge: &mut Self::SpongeState) -> [BFieldElement; 10]

Squeeze an array of RATE field elements out from the sponge’s state, mutating it.
source§

fn absorb_repeatedly<'a, I>(sponge: &mut Self::SpongeState, input: I)where I: Iterator<Item = &'a BFieldElement>,

Chunk input into arrays of RATE elements and repeatedly SpongeHasher::absorb(). Read more
source§

impl Eq for Tip5

source§

impl StructuralEq for Tip5

source§

impl StructuralPartialEq for Tip5

Auto Trait Implementations§

§

impl RefUnwindSafe for Tip5

§

impl Send for Tip5

§

impl Sync for Tip5

§

impl Unpin for Tip5

§

impl UnwindSafe for Tip5

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

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<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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 Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,