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.
0x0BStack ReserveReserve space on the stack for len words.
0x0CStack LoadLoad the value at the given stack depth index relative to the bottom.
0x0DStack StoreStore the value at the given stack depth index relative to the bottom.
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.
0x34Access MutKeysPush the keys of the proposed state mutations 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 NumSlotsGet the number of decision var or state slots.
0x3CAccess PredicateExistsCheck if a solution to a predicate exists within the same solution
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 a new block of memory to the end of the temporary memory.
0x71Temporary FreeFree memory down to the specified index.
0x72Temporary LoadLoad the value at the index of temporary memory onto the stack.
0x73Temporary StoreStore the value at the index of temporary memory.
0x74Temporary LoadRangeLoad a range of words starting at the index of temporary memory.
0x75Temporary StoreRangeStore a range of words starting at the index of temporary memory.

Modules§

bytes_iter
Provides the operation type bytes iterators.
opcode
Typed representation of the opcode, without any associated data.
short
Short hand names for the operations.

Structs§

InvalidOpcodeError
An attempt to parse a byte as an opcode failed.
NotEnoughBytesError
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§

Access
Operations for accessing input data.
Alu
Operations for computing arithmetic and logic.
Constraint
All operations available to the constraint checker.
Crypto
Operations providing cryptographic functionality.
FromBytesError
Errors that can occur while parsing ops from bytes.
Op
All operations available to the constraint checker.
Opcode
All operations available to the constraint checker.
Pred
Operations for computing predicates.
Stack
Operations related to stack manipulation.
Temporary
Operations for temporary memory.
TotalControlFlow
Control flow operations that keep the program total.

Traits§

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

Functions§

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

Type Aliases§

Word
Single unit of data.