tasm_lib::traits::basic_snippet

Trait BasicSnippet

Source
pub trait BasicSnippet {
    // Required methods
    fn inputs(&self) -> Vec<(DataType, String)>;
    fn outputs(&self) -> Vec<(DataType, String)>;
    fn entrypoint(&self) -> String;
    fn code(&self, library: &mut Library) -> Vec<LabelledInstruction>;

    // Provided methods
    fn annotated_code(&self, library: &mut Library) -> Vec<LabelledInstruction> { ... }
    fn link_for_isolated_run(&self) -> Vec<LabelledInstruction> { ... }
    fn init_stack_for_isolated_run(&self) -> Vec<BFieldElement> { ... }
    fn stack_diff(&self) -> isize { ... }
}

Required Methods§

Source

fn inputs(&self) -> Vec<(DataType, String)>

Source

fn outputs(&self) -> Vec<(DataType, String)>

Source

fn entrypoint(&self) -> String

Source

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

Provided Methods§

Source

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

Source

fn init_stack_for_isolated_run(&self) -> Vec<BFieldElement>

Intial stack on program start, when the snippet runs in isolation.

Source

fn stack_diff(&self) -> isize

Implementors§

Source§

impl BasicSnippet for PrimitiveRootOfUnity

Source§

impl BasicSnippet for NextPowerOfTwo

Source§

impl BasicSnippet for Overflowingadd

Source§

impl BasicSnippet for Safepow

Source§

impl BasicSnippet for Log2FloorU64

Source§

impl BasicSnippet for LtU64ConsumeArgs

Source§

impl BasicSnippet for OverflowingAdd

Source§

impl BasicSnippet for OverflowingSub

Source§

impl BasicSnippet for WrappingSub

Source§

impl BasicSnippet for SafeAddU128

Source§

impl BasicSnippet for Cube

Source§

impl BasicSnippet for XfeModPowU32Generic

Source§

impl BasicSnippet for Square

Source§

impl BasicSnippet for ToTheFourth

Source§

impl BasicSnippet for ToThePowerOfPowerOf2

Source§

impl BasicSnippet for HornerEvaluation

Source§

impl BasicSnippet for InnerProductOfThreeRowsWithWeights

Source§

impl BasicSnippet for InnerProductOfXfes

Source§

impl BasicSnippet for SumOfBfes

Source§

impl BasicSnippet for SumOfXfes

Source§

impl BasicSnippet for AbsorbMultiple

Source§

impl BasicSnippet for AbsorbMultipleStaticSize

Source§

impl BasicSnippet for HashStaticSize

Source§

impl BasicSnippet for HashVarlen

Source§

impl BasicSnippet for SampleIndices

Source§

impl BasicSnippet for SampleScalarOne

Source§

impl BasicSnippet for SampleScalars

Source§

impl BasicSnippet for SampleScalarsStaticLengthDynMalloc

Source§

impl BasicSnippet for SampleScalarsStaticLengthKMalloc

Source§

impl BasicSnippet for SampleScalarsStaticLengthStaticPointer

Source§

impl BasicSnippet for LtDigest

Source§

impl BasicSnippet for MerkleRoot

Source§

impl BasicSnippet for MerkleRootFromXfesGeneric

Source§

impl BasicSnippet for MerkleRootFromXfesStaticSize

Source§

impl BasicSnippet for MerkleRootFromXfesWrapper

Source§

impl BasicSnippet for MerkleStepU64Index

Source§

impl BasicSnippet for MerkleVerify

Source§

impl BasicSnippet for Absorb

Source§

impl BasicSnippet for Init

Source§

impl BasicSnippet for PadAndAbsorbAll

Source§

impl BasicSnippet for Squeeze

Source§

impl BasicSnippet for SqueezeRepeatedly

Source§

impl BasicSnippet for SqueezeRepeatedlyStaticNumber

Source§

impl BasicSnippet for ReadInput

Source§

impl BasicSnippet for WriteToStdout

Source§

impl BasicSnippet for Contains

Source§

impl BasicSnippet for All

Source§

impl BasicSnippet for Filter

Source§

impl BasicSnippet for Zip

Source§

impl BasicSnippet for HornerEvaluationDynamicLength

Source§

impl BasicSnippet for MultisetEqualityDigests

Source§

impl BasicSnippet for MultisetEqualityU64s

Source§

impl BasicSnippet for SplitOff

Source§

impl BasicSnippet for SwapUnchecked

Source§

impl BasicSnippet for DynMalloc

Source§

impl BasicSnippet for PushRamToStack

Source§

impl BasicSnippet for BagPeaks

Source§

impl BasicSnippet for MmrVerifyFromSecretInLeafIndexOnStack

Source§

impl BasicSnippet for MmrVerifyFromSecretInSecretLeafIndex

Source§

impl BasicSnippet for VerifyMmrSuccessor

Source§

impl BasicSnippet for GetSwbfIndices

Source§

impl BasicSnippet for NewEmptyInputAndOutput

Source§

impl BasicSnippet for NewGenericDynClaim

Source§

impl BasicSnippet for InstantiateFiatShamirWithClaim

Source§

impl BasicSnippet for NewRecursive

Source§

impl BasicSnippet for ComputeTerminalDynSizedDynamicSymbols

Source§

impl BasicSnippet for ComputeTerminalFromDigestInitialIsOne

Source§

impl BasicSnippet for BarycentricEvaluation

Source§

impl BasicSnippet for CollinearYXfe

Source§

impl BasicSnippet for GetCollinearityCheckX

Source§

impl BasicSnippet for DeriveFriFromStark

Source§

impl BasicSnippet for NumberOfRounds

Source§

impl BasicSnippet for FriSnippet

Source§

impl BasicSnippet for VerifyFriAuthenticationPaths

Source§

impl BasicSnippet for AirConstraintEvaluation

Source§

impl BasicSnippet for DivideOutZerofiers

Source§

impl BasicSnippet for VerifyTableRows

Source§

impl BasicSnippet for ZerofiersInverse

Source§

impl BasicSnippet for OutOfDomainPoints

Source§

impl BasicSnippet for OwnProgramDigest

Source§

impl BasicSnippet for ReadAndVerifyOwnProgramDigestFromStdIn

Source§

impl BasicSnippet for StarkVerify

Source§

impl BasicSnippet for DequeueNextAs

Source§

impl BasicSnippet for Drop

Source§

impl BasicSnippet for New

Source§

impl BasicSnippet for XfeNtt

Source§

impl<S: DeprecatedSnippet> BasicSnippet for S

Source§

impl<T: TasmObject + BFieldCodec + Clone + Debug> BasicSnippet for VerifyNdSiIntegrity<T>

Source§

impl<const N: usize> BasicSnippet for ComputeTerminalConstSizedDynamicSymbolsReversed<N>

Source§

impl<const N: usize> BasicSnippet for ComputeTerminalConstSizedStaticSymbols<N>

Source§

impl<const NUM_INPUT_LISTS: usize> BasicSnippet for ChainMap<NUM_INPUT_LISTS>