Top-level module for internal MASM precompile support.<br /><br />Concrete precompile support modules live here and in submodules. The helper procedures in this<br />module are shared by generated and hand-written wrappers.<br />
## miden::core::precompiles
| Procedure | Description |
| ----------- | ------------- |
| word_eq | Returns whether two words are equal, consuming both words.<br /><br />This helper keeps generated precompile modules independent of `miden-core`. Importing<br />`miden::core::word::eq` here would create a dependency cycle because `miden-core` dynamically<br />depends on `miden-precompiles`.<br /><br />Inputs: [RHS, LHS]<br />Outputs: [is_equal]<br /><br />Where:<br />- RHS is the first word to compare.<br />- LHS is the second word to compare.<br />- is_equal is one if the words are equal, and zero otherwise.<br /><br />Invocation: exec<br /> |
| digest_expr | Registers the expression node currently laid out in Poseidon2 sponge order and returns its<br />content-addressed digest.<br /><br />`adv.register_deferred` interns the node host-side (no stack or advice output); `hperm` then<br />derives the digest inside the VM from the same operand-stack payload. The helper expects the<br />stack in Poseidon2 sponge layout — `[R0=PAYLOAD_LO, R1=PAYLOAD_HI, C=TAG]` — so one `hperm`<br />produces the permuted state and the digest is its rate0 word (`state[0..4]`), matching<br />`Node::digest`.<br /><br />Input: [PAYLOAD_LO, PAYLOAD_HI, TAG, ...]<br />Output: [NODE_DIGEST, ...]<br /> |
| register_expr | Registers an expression-bodied node `(tag, payload)` in the deferred-computation DAG and returns<br />its content-addressed digest on top of the operand stack.<br /><br />Input: [TAG, PAYLOAD_LO, PAYLOAD_HI, ...]<br />Output: [NODE_DIGEST, ...]<br /> |
| register_value | Registers an expression-bodied node `(tag, payload)` in the deferred-computation DAG and returns<br />its content-addressed digest on top of the operand stack.<br /><br />This is the root-module compatibility helper for value-node callers. It is equivalent to<br />`register_expr`.<br /><br />Input: [TAG, PAYLOAD_LO, PAYLOAD_HI, ...]<br />Output: [NODE_DIGEST, ...]<br /> |
| register_mem | Registers a data-bodied node (`n` rate-sized blocks of bulk data at `ptr`) in the<br />deferred-computation DAG and returns its content-addressed digest on top of the operand stack.<br /><br />`adv.register_deferred_data` interns the node host-side by reading `8n` felts from memory at<br />`ptr`, where `n` is the stack-supplied `n_chunks`; it produces no stack or advice output. The<br />event leaves those stack arguments unchanged, but its direct host read adds no AIR memory access.<br />This wrapper binds the registration input by applying a Poseidon2 linear hash with VM instructions<br />to the exact same `TAG` and ordered chunk sequence, using `TAG` as the initial capacity and one<br />`hperm` per 8-felt block loaded by `mem_stream`. The rate0 word matches `Node::digest`. Empty data<br />bodies are forbidden, so `n ≥ 1` and the linear-hash loop always runs at least one permutation.<br /><br />Input: [TAG, ptr, n_chunks, ...]<br />Output: [NODE_DIGEST, ...]<br /> |
| register_chunks_mem | Registers memory as framework CHUNKS data and returns its content-addressed digest.<br /><br />Input: [ptr, n_chunks, ...]<br />Output: [CHUNKS_DIGEST, ...]<br /> |
| register_chunks_mem_1 | Registers exactly one 8-felt memory chunk as framework CHUNKS data.<br /><br />Input: [ptr, ...]<br />Output: [CHUNKS_DIGEST, ...]<br /> |
| register_chunks_mem_2 | Registers exactly two contiguous 8-felt memory chunks as framework CHUNKS data.<br /><br />Input: [ptr, ...]<br />Output: [CHUNKS_DIGEST, ...]<br /> |
| register_chunks_mem_3 | Registers exactly three contiguous 8-felt memory chunks as framework CHUNKS data.<br /><br />Input: [ptr, ...]<br />Output: [CHUNKS_DIGEST, ...]<br /> |
| log_deferred | Folds a deferred node digest into the rolling deferred root using `log_deferred`.<br />The digest must reference a node that will reduce to TRUE under the installed precompiles.<br /><br />Pads the operand stack so `log_deferred`'s implicit `[_, STMNT, _, ...]` shape sees<br />NODE_DIGEST at stack[4..8] (the HPERM rate1 lanes). The opcode folds with framework AND<br />capacity `[1, 0, 0, 0]`, then this helper drops the three words it writes to stack[0..12].<br /><br />Input: [NODE_DIGEST, ...]<br />Output: `[...]` (the deferred commitment root advances; node is folded in)<br /> |