Crate essential_constraint_vm::asm
source · Expand description
Assembly for checking constraints.
§Op Table
Opcode | Op | Short Description |
---|---|---|
0x01 | Stack Push | Push one word onto the stack. |
0x02 | Stack Pop | Pop one word from the stack. |
0x03 | Stack Dup | Duplicate the top word on the stack. |
0x04 | Stack DupFrom | Duplicate the word at the given stack depth index. |
0x05 | Stack Swap | Swap top two words on stack. |
0x06 | Stack SwapIndex | Swap the top word on the stack with the word at the given stack depth index. |
0x07 | Stack Select | Conditionally keep one of the top two elements on the stack. |
0x08 | Stack SelectRange | Conditionally keep one of the top two ranges on the stack. |
0x09 | Stack Repeat | Repeat a section of code the number of times. |
0x0A | Stack RepeatEnd | Increment or decrements the top counter on the repeat stack. |
0x10 | Pred Eq | Check equality of two words. |
0x11 | Pred EqRange | Check equality of two ranges on the stack. |
0x12 | Pred Gt | Check if left-hand side is greater than right-hand side. |
0x13 | Pred Lt | Check if left-hand side is less than right-hand side. |
0x14 | Pred Gte | Check if left-hand side is greater than or equal to right-hand side. |
0x15 | Pred Lte | Check if left-hand side is less than or equal to right-hand side. |
0x16 | Pred And | Logical AND of two words. |
0x17 | Pred Or | Logical OR of two words. |
0x18 | Pred Not | Logical NOT of a word. |
0x20 | Alu Add | Add two words. |
0x21 | Alu Sub | Subtract two words. |
0x22 | Alu Mul | Multiply two words. |
0x23 | Alu Div | Integer division. |
0x24 | Alu Mod | Modulus of lhs by rhs. |
0x30 | Access DecisionVar | Access the first word in a decision variable slot by slot . |
0x31 | Access DecisionVarAt | Access a word in a decision variable slot by slot and index . |
0x32 | Access DecisionVarRange | Access a range of decision variables slot words starting from a specified slot and index. |
0x33 | Access DecisionVarLen | Get the length of a specified slot . |
0x34 | Access State | Access a state variable by slot . |
0x35 | Access StateRange | Access a range of state variables starting from a specified slot. |
0x36 | Access StateLen | Get the length of a state variable at a specified slot . |
0x37 | Access StateLenRange | Get the lengths of a range of state variables starting from a specified slot . |
0x38 | Access MutKeysLen | Get the number of mutable keys being proposed for mutation. |
0x39 | Access MutKeysContains | Check if the mutable keys being proposed contain the given key. |
0x3A | Access ThisAddress | Get the content hash of this predicate. |
0x3B | Access ThisContractAddress | Get the content hash of the contract this predicate belongs to. |
0x3C | Access ThisPathway | Get the pathway of this predicate. |
0x3D | Access RepeatCounter | Access the top repeat counters current value. |
0x3E | Access Transient | Get the solution data indexed by pathway and key. |
0x3F | Access TransientLen | Get the length of solution data indexed by pathway and key. |
0x40 | Access PredicateAt | Get the predicate at solution data pathway. |
0x41 | Access ThisTransientLen | Get the length of the transient data at this predicate. |
0x42 | Access ThisTransientContains | Check if the transient data at this predicate contains the given key. |
0x50 | Crypto Sha256 | Produce a SHA 256 hash from the specified data. |
0x51 | Crypto VerifyEd25519 | Validate an Ed25519 signature against a public key. |
0x52 | Crypto RecoverSecp256k1 | Recover the public key from a secp256k1 signature. |
0x60 | TotalControlFlow Halt | End the execution of the program. |
0x61 | TotalControlFlow HaltIf | Halt the program if the value is true. |
0x63 | TotalControlFlow JumpForwardIf | Jump forward the given number of instructions if the value is true. |
0x70 | Temporary Alloc | Allocate new memory to the end of the temporary memory. |
0x71 | Temporary Load | Load the value at the index of temporary memory onto the stack. |
0x72 | Temporary Store | Store 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 associatedOpcode
. - 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.