Skip to main content

Vm

Struct Vm 

Source
pub struct Vm {
    pub mem_reg: MemoryRegister,
    pub reg: Register,
    pub scratchpad: Vec<u64>,
    pub pc: i32,
    pub config: VmConfig,
    pub mem: Arc<VmMemory>,
    pub dataset_offset: u64,
    /* private fields */
}

Fields§

§mem_reg: MemoryRegister§reg: Register§scratchpad: Vec<u64>§pc: i32§config: VmConfig§mem: Arc<VmMemory>§dataset_offset: u64

Implementations§

Source§

impl Vm

Source

pub fn init_vm(&mut self, prog: &Program)

Source

pub fn init_scratchpad(&mut self, seed: &[m128i; 4]) -> [m128i; 4]

Source

pub fn calculate_hash(&mut self, input: &[u8]) -> Hash

Source

pub fn run(&mut self, seed: &[m128i; 4])

Runs one round

Source

pub fn reset_rounding_mode(&mut self)

Source

pub fn set_rounding_mode(&mut self, mode: u32)

Source

pub fn get_rounding_mode(&self) -> u32

Source

pub fn exec_fswap_r(&mut self, instr: &Instr)

Source

pub fn exec_fadd_r(&mut self, instr: &Instr)

Source

pub fn exec_fadd_m(&mut self, instr: &Instr)

Source

pub fn exec_fsub_r(&mut self, instr: &Instr)

Source

pub fn exec_fsub_m(&mut self, instr: &Instr)

Source

pub fn exec_fscal_r(&mut self, instr: &Instr)

Source

pub fn exec_fmul_r(&mut self, instr: &Instr)

Source

pub fn exec_fsqrt_r(&mut self, instr: &Instr)

Source

pub fn exec_fdiv_m(&mut self, instr: &Instr)

Source

pub fn exec_iadd_m(&mut self, instr: &Instr)

Source

pub fn exec_isub_m(&mut self, instr: &Instr)

Source

pub fn exec_imul_m(&mut self, instr: &Instr)

Source

pub fn exec_iadd_rs(&mut self, instr: &Instr)

Source

pub fn exec_isub_r(&mut self, instr: &Instr)

Source

pub fn exec_imul_r(&mut self, instr: &Instr)

Source

pub fn exec_imul_rcp(&mut self, instr: &Instr)

Source

pub fn exec_imulh_r(&mut self, instr: &Instr)

Source

pub fn exec_imulh_m(&mut self, instr: &Instr)

Source

pub fn exec_ismulh_r(&mut self, instr: &Instr)

Source

pub fn exec_ismulh_m(&mut self, instr: &Instr)

Source

pub fn exec_ineg_r(&mut self, instr: &Instr)

Source

pub fn exec_ixor_r(&mut self, instr: &Instr)

Source

pub fn exec_ixor_m(&mut self, instr: &Instr)

Source

pub fn exec_iror_r(&mut self, instr: &Instr)

Source

pub fn exec_irol_r(&mut self, instr: &Instr)

Source

pub fn exec_iswap_r(&mut self, instr: &Instr)

Source

pub fn exec_istore(&mut self, instr: &Instr)

Source

pub fn exec_cfround(&mut self, instr: &Instr)

Source

pub fn exec_cbranch(&mut self, instr: &Instr)

Auto Trait Implementations§

§

impl Freeze for Vm

§

impl RefUnwindSafe for Vm

§

impl Send for Vm

§

impl Sync for Vm

§

impl Unpin for Vm

§

impl UnsafeUnpin for Vm

§

impl UnwindSafe for Vm

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> 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, 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.