#[repr(C)]pub(crate) struct RegisterFile([u64; 8]);Expand description
Values for all registers in the HashX machine
Guaranteed to have a repr(C) layout that includes each register in order
with no padding and no extra fields. The compiled runtime will produce
functions that read or write a RegisterFile directly.
Tuple Fields§
§0: [u64; 8]Implementations§
Source§impl RegisterFile
impl RegisterFile
Sourcepub(crate) fn load(&self, id: RegisterId) -> u64
pub(crate) fn load(&self, id: RegisterId) -> u64
Load a word from the register file.
Sourcepub(crate) fn store(&mut self, id: RegisterId, value: u64)
pub(crate) fn store(&mut self, id: RegisterId, value: u64)
Store a word into the register file.
Sourcepub(crate) fn new(key: SipState, input: u64) -> Self
pub(crate) fn new(key: SipState, input: u64) -> Self
Initialize a new HashX register file, given a key (derived from the seed) and the user-specified hash input word.
Sourcepub(crate) fn digest(&self, key: SipState) -> [u64; 4]
pub(crate) fn digest(&self, key: SipState) -> [u64; 4]
Finalize the state of the register file and generate up to 4 words of output in HashX’s final result format.
This splits the register file into two halves, mixes in the siphash keys again to “remove bias toward 0 caused by multiplications”, and runs one siphash round on each half before recombining them.
Trait Implementations§
Source§impl Clone for RegisterFile
impl Clone for RegisterFile
Source§fn clone(&self) -> RegisterFile
fn clone(&self) -> RegisterFile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RegisterFile
impl Debug for RegisterFile
Source§impl PartialEq for RegisterFile
impl PartialEq for RegisterFile
Source§fn eq(&self, other: &RegisterFile) -> bool
fn eq(&self, other: &RegisterFile) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for RegisterFile
impl StructuralPartialEq for RegisterFile
Auto Trait Implementations§
impl Freeze for RegisterFile
impl RefUnwindSafe for RegisterFile
impl Send for RegisterFile
impl Sync for RegisterFile
impl Unpin for RegisterFile
impl UnsafeUnpin for RegisterFile
impl UnwindSafe for RegisterFile
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
Mutably borrows from an owned value. Read more