Trait DeprecatedSnippet

Source
pub trait DeprecatedSnippet {
Show 18 methods // Required methods fn entrypoint_name(&self) -> String; fn input_field_names(&self) -> Vec<String>; fn input_types(&self) -> Vec<DataType>; fn output_field_names(&self) -> Vec<String>; fn output_types(&self) -> Vec<DataType>; fn stack_diff(&self) -> isize; fn function_code(&self, library: &mut Library) -> String; fn crash_conditions(&self) -> Vec<String>; fn gen_input_states(&self) -> Vec<InitVmState>; fn common_case_input_state(&self) -> InitVmState; fn worst_case_input_state(&self) -> InitVmState; fn rust_shadowing( &self, stack: &mut Vec<BFieldElement>, std_in: Vec<BFieldElement>, secret_in: Vec<BFieldElement>, memory: &mut HashMap<BFieldElement, BFieldElement>, ); // Provided methods fn function_code_as_instructions( &self, library: &mut Library, ) -> Vec<LabelledInstruction> { ... } fn link_for_isolated_run(&self) -> Vec<LabelledInstruction> { ... } fn link_and_run_tasm_for_test( &self, stack: &mut Vec<BFieldElement>, std_in: Vec<BFieldElement>, nondeterminism: NonDeterminism, ) -> Result<VMState> { ... } fn link_and_run_tasm_for_bench( &self, stack: &mut Vec<BFieldElement>, std_in: Vec<BFieldElement>, nondeterminism: NonDeterminism, ) -> Result<BenchmarkResult> { ... } fn link_and_run_tasm_from_state_for_test( &self, execution_state: &mut InitVmState, ) -> VMState { ... } fn link_and_run_tasm_from_state_for_bench( &self, execution_state: &mut InitVmState, ) -> Result<BenchmarkResult> { ... }
}

Required Methods§

Source

fn entrypoint_name(&self) -> String

The name of a Snippet

This is used as a unique identifier, e.g. when generating labels.

Source

fn input_field_names(&self) -> Vec<String>

The input stack

Source

fn input_types(&self) -> Vec<DataType>

Source

fn output_field_names(&self) -> Vec<String>

The output stack

Source

fn output_types(&self) -> Vec<DataType>

Source

fn stack_diff(&self) -> isize

The stack difference

Source

fn function_code(&self, library: &mut Library) -> String

The function

Source

fn crash_conditions(&self) -> Vec<String>

Ways in which this snippet can crash at runtime

Source

fn gen_input_states(&self) -> Vec<InitVmState>

Examples of valid initial states for running this snippet

Source

fn common_case_input_state(&self) -> InitVmState

Source

fn worst_case_input_state(&self) -> InitVmState

Source

fn rust_shadowing( &self, stack: &mut Vec<BFieldElement>, std_in: Vec<BFieldElement>, secret_in: Vec<BFieldElement>, memory: &mut HashMap<BFieldElement, BFieldElement>, )

Provided Methods§

Source

fn function_code_as_instructions( &self, library: &mut Library, ) -> Vec<LabelledInstruction>

Return Ok(vm_output_state) if execution succeeds, Err(error_message) if VM execution fails, panics if anything else goes wrong.

Implementors§

Source§

impl DeprecatedSnippet for IsOdd

Source§

impl DeprecatedSnippet for IsU32

Source§

impl DeprecatedSnippet for tasm_lib::arithmetic::u32::or::Or

Source§

impl DeprecatedSnippet for SafeAdd

Source§

impl DeprecatedSnippet for tasm_lib::arithmetic::u32::safe_mul::SafeMul

Source§

impl DeprecatedSnippet for SafeSub

Source§

impl DeprecatedSnippet for tasm_lib::arithmetic::u32::shift_left::ShiftLeft

Source§

impl DeprecatedSnippet for tasm_lib::arithmetic::u32::shift_right::ShiftRight

Source§

impl DeprecatedSnippet for MulTwoU64sToU128

Source§

impl DeprecatedSnippet for tasm_lib::arithmetic::u64::or::Or

Source§

impl DeprecatedSnippet for tasm_lib::arithmetic::u128::safe_mul::SafeMul

Source§

impl DeprecatedSnippet for tasm_lib::arithmetic::u128::shift_left::ShiftLeft

Source§

impl DeprecatedSnippet for tasm_lib::arithmetic::u128::shift_right::ShiftRight

Source§

impl DeprecatedSnippet for Sub

Source§

impl DeprecatedSnippet for Range

Source§

impl DeprecatedSnippet for SetLength

Source§

impl DeprecatedSnippet for MemCpy

Source§

impl DeprecatedSnippet for MmrCalculateNewPeaksFromLeafMutationMtIndices

Source§

impl DeprecatedSnippet for MmrVerifyFromMemory

Source§

impl<const N: u8> DeprecatedSnippet for ShiftRightStatic<N>