Crate essential_constraint_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.
0x19Pred EqSetPop two sets off the stack and check if they are equal.
0x1APred BitAndBitwise AND of two words.
0x1BPred BitOrBitwise OR of two words.
0x20Alu AddAdd two words.
0x21Alu SubSubtract two words.
0x22Alu MulMultiply two words.
0x23Alu DivInteger division.
0x24Alu ModModulus of lhs by rhs.
0x25Alu ShlLogical shift left by number of bits.
0x26Alu ShrLogical shift right by number of bits.
0x27Alu ShrIArithmetic shift right by number of bits.
0x30Access ThisAddressGet the content hash of this predicate.
0x31Access ThisContractAddressGet the content hash of the contract this predicate belongs to.
0x32Access ThisPathwayGet the pathway of this predicate.
0x33Access PredicateAtGet the predicate at solution data pathway.
0x34Access MutKeysPush the keys of the proposed state mutations onto the stack.
0x35Access PubVarKeysPush the keys of the pub vars at pathway_id onto the stack.
0x36Access RepeatCounterAccess the top repeat counters current value.
0x37Access DecisionVarAccess a range of len words starting from value_ix within the decision variable located at slot_ix.
0x38Access DecisionVarLenGet the length of a the decision variable value located at slot_ix.
0x39Access StateAccess a range of words from the state value located in the slot at slot_ix.
0x3AAccess StateLenGet the length of a state value at a specified slot_ix.
0x3BAccess PubVarAccess a range of public decision variable words at pathway_ix
0x3CAccess PubVarLenGet the length of the value indexed by pathway_ix
0x3DAccess NumSlotsGet the number of decision var or state slots.
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.
0x64TotalControlFlow PanicIfPanic if the condition 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.
  • Short hand names for the operations.

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.