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
,sponge_absorb_mem
, andsponge_squeeze
. - Processing the
hash
instruction. - 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
Sponge
will be skipped, - if no
hash
instruction is executed, modeHash
will be skipped, and - if the Hash Table does not require any padding, mode
Pad
will 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
, sponge_absorb_mem
, 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
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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