Crate essential_constraint_vm::asm

source ·
Expand description

Assembly for checking constraints.

§Op Table

OpcodeOpShort Description
0x01Stack PushPush one word onto the stack.
0x02Stack PopPop one word from the stack.
0x03Stack DupDuplicate the top word on the stack.
0x04Stack DupFromDuplicate the word at the given stack depth index.
0x05Stack SwapSwap top two words on stack.
0x06Stack SwapIndexSwap the top word on the stack with the word at the given stack depth index.
0x07Stack SelectConditionally keep one of the top two elements on the stack.
0x08Stack SelectRangeConditionally keep one of the top two ranges on the stack.
0x09Stack RepeatRepeat a section of code the number of times.
0x0AStack RepeatEndIncrement or decrements the top counter on the repeat stack.
0x10Pred EqCheck equality of two words.
0x11Pred EqRangeCheck equality of two ranges on the stack.
0x12Pred GtCheck if left-hand side is greater than right-hand side.
0x13Pred LtCheck if left-hand side is less than right-hand side.
0x14Pred GteCheck if left-hand side is greater than or equal to right-hand side.
0x15Pred LteCheck if left-hand side is less than or equal to right-hand side.
0x16Pred AndLogical AND of two words.
0x17Pred OrLogical OR of two words.
0x18Pred NotLogical NOT of a word.
0x20Alu AddAdd two words.
0x21Alu SubSubtract two words.
0x22Alu MulMultiply two words.
0x23Alu DivInteger division.
0x24Alu ModModulus of lhs by rhs.
0x30Access DecisionVarAccess the first word in a decision variable slot by slot.
0x31Access DecisionVarAtAccess a word in a decision variable slot by slot and index.
0x32Access DecisionVarRangeAccess a range of decision variables slot words starting from a specified slot and index.
0x33Access DecisionVarLenGet the length of a specified slot.
0x34Access StateAccess a state variable by slot.
0x35Access StateRangeAccess a range of state variables starting from a specified slot.
0x36Access StateLenGet the length of a state variable at a specified slot.
0x37Access StateLenRangeGet the lengths of a range of state variables starting from a specified slot.
0x38Access MutKeysLenGet the number of mutable keys being proposed for mutation.
0x39Access MutKeysContainsCheck if the mutable keys being proposed contain the given key.
0x3AAccess ThisAddressGet the content hash of this predicate.
0x3BAccess ThisContractAddressGet the content hash of the contract this predicate belongs to.
0x3CAccess ThisPathwayGet the pathway of this predicate.
0x3DAccess RepeatCounterAccess the top repeat counters current value.
0x3EAccess TransientGet the solution data indexed by pathway and key.
0x3FAccess TransientLenGet the length of solution data indexed by pathway and key.
0x40Access PredicateAtGet the predicate at solution data pathway.
0x41Access ThisTransientLenGet the length of the transient data at this predicate.
0x42Access ThisTransientContainsCheck if the transient data at this predicate contains the given key.
0x50Crypto Sha256Produce a SHA 256 hash from the specified data.
0x51Crypto VerifyEd25519Validate an Ed25519 signature against a public key.
0x52Crypto RecoverSecp256k1Recover the public key from a secp256k1 signature.
0x60TotalControlFlow HaltEnd the execution of the program.
0x61TotalControlFlow HaltIfHalt the program if the value is true.
0x63TotalControlFlow JumpForwardIfJump forward the given number of instructions if the value is true.
0x70Temporary AllocAllocate new memory to the end of the temporary memory.
0x71Temporary LoadLoad the value at the index of temporary memory onto the stack.
0x72Temporary StoreStore the value at the index of temporary memory.

Modules§

  • Provides the operation type bytes iterators.
  • Typed representation of the opcode, without any associated data.

Structs§

  • An attempt to parse a byte as an opcode failed.
  • An error occurring within Opcode::parse_op in the case that the provided bytes iterator contains insufficient bytes for the expected associated operation data.

Enums§

  • Operations for accessing input data.
  • Operations for computing arithmetic and logic.
  • All operations available to the constraint checker.
  • Operations providing cryptographic functionality.
  • Errors that can occur while parsing ops from bytes.
  • All operations available to the constraint checker.
  • All operations available to the constraint checker.
  • Operations for computing predicates.
  • Operations related to stack manipulation.
  • Operations for temporary memory.
  • Control flow operations that keep the program total.

Traits§

  • Operation types that may be converted to their serialized form in bytes.
  • Allows for converting an Op into its associated Opcode.
  • Operation types that may be parsed from a bytecode representation.

Functions§

  • Parse operations from the given iterator yielding bytes.
  • Convert the given iterator yielding operations into and iterator yielding the serialized form in bytes.

Type Aliases§

  • Single unit of data.