Enum triton_vm::table::hash_table::HashTableMode
source · pub enum HashTableMode {
ProgramHashing,
Sponge,
Hash,
Pad,
}Expand description
The current “mode” of the Hash Table. The Hash Table can be in one of four distinct modes:
- Hashing the
Program. This is part of program attestation. - Processing all Sponge instructions, i.e.,
sponge_init,sponge_absorb, andsponge_squeeze. - Processing the
hashinstruction. - Padding mode.
Changing the mode is only possible when the current RoundNumber is NUM_ROUNDS.
The mode evolves as
ProgramHashing → Sponge → Hash → Pad.
Once mode Pad is reached, it is not possible to change the mode anymore.
Skipping any or all of the modes Sponge, Hash, or Pad
is possible in principle:
- if no Sponge instructions are executed, mode
Spongewill be skipped, - if no
hashinstruction is executed, modeHashwill be skipped, and - if the Hash Table does not require any padding, mode
Padwill be skipped.
It is not possible to skip mode ProgramHashing:
the Program is always hashed.
The empty program is not valid since any valid Program must execute
instruction halt.
Variants§
ProgramHashing
The mode in which the Program is hashed. This is part of program attestation.
Sponge
The mode in which Sponge instructions, i.e., sponge_init, sponge_absorb,
and sponge_squeeze, are processed.
Hash
The mode in which the hash instruction is processed.
Pad
Indicator for padding rows.
Trait Implementations§
source§impl Clone for HashTableMode
impl Clone for HashTableMode
source§fn clone(&self) -> HashTableMode
fn clone(&self) -> HashTableMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for HashTableMode
impl Debug for HashTableMode
source§impl Display for HashTableMode
impl Display for HashTableMode
source§impl From<HashTableMode> for BFieldElement
impl From<HashTableMode> for BFieldElement
source§fn from(mode: HashTableMode) -> Self
fn from(mode: HashTableMode) -> Self
source§impl From<HashTableMode> for u32
impl From<HashTableMode> for u32
source§fn from(mode: HashTableMode) -> Self
fn from(mode: HashTableMode) -> Self
source§impl From<HashTableMode> for u64
impl From<HashTableMode> for u64
source§fn from(mode: HashTableMode) -> Self
fn from(mode: HashTableMode) -> Self
source§impl Hash for HashTableMode
impl Hash for HashTableMode
source§impl IntoEnumIterator for HashTableMode
impl IntoEnumIterator for HashTableMode
type Iterator = HashTableModeIter
fn iter() -> HashTableModeIter ⓘ
source§impl PartialEq for HashTableMode
impl PartialEq for HashTableMode
source§fn eq(&self, other: &HashTableMode) -> bool
fn eq(&self, other: &HashTableMode) -> bool
self and other values to be equal, and is used
by ==.impl Copy for HashTableMode
impl Eq for HashTableMode
impl StructuralPartialEq for HashTableMode
Auto Trait Implementations§
impl Freeze for HashTableMode
impl RefUnwindSafe for HashTableMode
impl Send for HashTableMode
impl Sync for HashTableMode
impl Unpin for HashTableMode
impl UnwindSafe for HashTableMode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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