Expand description
Fine-grained, BRAM-oriented SHA-profile WOTS context engine.
One instance owns one four-bit scheduler context behind a shared SHA transport. The enclosing top chooses how many of the sixteen encodable context identifiers it instantiates. This engine constructs and retires the exact 1,258 compression tasks for a fused private-seed signature/public-key operation. Every segment advances independently: a resettable stage array, ready mask, and in-flight mask encode the per-segment dependency frontier. There are no whole-wave phase barriers.
The dependency graph is explicit:
- the private-seed hash releases the public-seed task and all 67 segment PRFs concurrently;
- the public-seed result releases all sixteen masks;
- segment PRF plus mask zero release secret data, whose response releases secret padding;
- secret padding and masks one through fifteen release each chain step;
- step fifteen retains the endpoint; and
- each serialized public-key block starts as soon as its endpoint pair and the preceding public-key digest are both ready.
The scheduler priority is public-key, seed, public-seed, masks, then segment work. Public-key work can occupy at most one issue per compression latency, and seed/public-seed/mask classes are finite, so the rotating hierarchical segment selector cannot starve. Segment readiness is stored as nine groups of eight bits (the last five bits are permanently zero); a rotating group cursor selects one nonempty group and a fixed eight-way encoder selects its lowest ready member.
State and final endpoints share two 64-entry, 256-bit memories banked by
segment parity. The banks provide both endpoint operands for public-key
blocks 0 through 32 without duplicating endpoint storage. Masks use a
16-entry memory. Signature segments use matching even/odd 64-entry banks so
one pair read returns 64 bytes. Pair reads 0 through 32 furnish signature
beats 0 through 32; pair 33 furnishes segment 66 alongside public_seed in
beat 33, and public_key_hash occupies the valid half of beat 34.
The unused addresses are unreachable padding imposed by power-of-two RHDL RAM depths.
All wide data and RAM are resetless; separately reset ownership, ready,
in-flight, request-valid, and result-valid bits determine whether the data is
meaningful.
The private seed is architecturally overwritten after its seed request
transfers. A seven-bit counter tracks the one public-seed PRF plus 67
segment PRFs that consume the derived private key; the key is overwritten
when the last of those 68 requests transfers. Both registers are overwritten
again when result_taken releases the retained result. These are logical RTL
assignments only, not evidence of physical zeroization, remanence resistance,
power-analysis resistance, or any other side-channel property.
Each request uses a synchronous-memory prefetch followed by one stable resetless payload register. Accepting a request can launch the next prefetch in the same cycle, so a ready context can issue once every two cycles. A segment made ready by a response is excluded from selection in that response cycle, preventing same-address response-write/prefetch-read behavior. Mask retirement similarly delays all newly awakened segments for one cycle, and a newly completed endpoint cannot launch its public-key read until the next cycle.
§Response and reset contract
Responses may return in any order. The complete 32-bit tag must be canonical,
name this context and generation, and identify a task whose in-flight bit and
current stage agree. Malformed, stale, duplicate, never-issued, or
stage-mismatched responses are rejected without any cryptographic state
write and latch fault.
A fault does not discard the context’s retained storage: if all required
tasks subsequently retire, result_valid and fault may be true together.
The enclosing framer must treat that combination as a failed operation,
emit no result bytes, and acknowledge it with result_taken to release the
reserved credit. The fault remains visible through that acknowledgement
cycle and clears when the retained result is released.
Reset is fail closed and directly suppresses requests, response acceptance, and all memory writes, even on the asserting edge. The enclosing transport and compression lanes must share reset so old tokens are flushed. If a system cannot guarantee a shared flush, it must not reuse a generation until every pre-reset token has drained. Eight-bit generation wrap is safe only under the same no-outstanding-old-token rule.
This module has source and simulation evidence only. Its logical storage mapping is an implementation intent, not evidence that a synthesis tool inferred block RAM or met resource, timing, or throughput targets.
Structs§
- Context
Engine Input - Inputs for one single-context work engine.
- Context
Engine Output - Status, transport request, and retained-result outputs.
- Engine
Control - Resettable ownership, dependency, and in-flight state.
- Prepare
Request Input - Prepared-request inputs after the synchronous memory read.
- Segment
Selection - Result of the hierarchical rotating segment selector.
- Signature
Banks - Structural wrapper keeping the top synchronous-state tuple within Rust’s tuple trait arity while preserving two physical RAM children.
- Signature
Banks Input - Read/write ports for the two signature parity banks.
- Signature
Banks Output - Registered outputs from both signature parity banks.
- Single
Context Work Engine - Complete one-context fine-grained WOTS work engine.
Constants§
- CONTEXT_
LOGICAL_ RAM_ BITS - Total logical RAM bits authored per context.
- ENGINE_
SEGMENTS - Number of independently advancing WOTS segments.
- MASK_
ADDRESS_ BITS - Address bits in the mask memory.
- MASK_
DEPTH - Logical entries in the mask memory.
- MASK_
STORAGE_ BITS - Logical randomization-mask storage bits per context.
- PRIVATE_
KEY_ CONSUMERS - Requests that consume the derived private key: one public-seed plus 67 segment PRFs.
- PUBLIC_
KEY_ FOCUS_ BLOCKS - Consecutive endpoint-stream blocks accelerated ahead of the PK hash.
- SEGMENTS_
PER_ GROUP - Eight segments represented in each ready/in-flight group.
- SEGMENT_
GROUPS - Number of hierarchical segment groups.
- SEGMENT_
STAGE_ CHAIN_ FIRST - First chain stage code; stage
2 + stepnames one-basedstep. - SEGMENT_
STAGE_ CHAIN_ LAST - Last chain stage code, corresponding to chain step fifteen.
- SEGMENT_
STAGE_ ENDPOINT - Completed endpoint stage code.
- SEGMENT_
STAGE_ PRF - Per-segment stage code for its initial PRF.
- SEGMENT_
STAGE_ SECRET_ DATA - Per-segment stage code for the secret-data block.
- SEGMENT_
STAGE_ SECRET_ PADDING - Per-segment stage code for the secret-padding block.
- SIGNATURE_
ADDRESS_ BITS - Address bits in each even/odd signature bank.
- SIGNATURE_
DEPTH - Logical entries in each signature bank.
- SIGNATURE_
STORAGE_ BITS - Logical signature storage bits per context.
- STATE_
BANK_ ADDRESS_ BITS - Address bits in each even/odd state bank.
- STATE_
BANK_ DEPTH - Logical entries in each state bank.
- STATE_
STORAGE_ BITS - Logical state/endpoints storage bits per context.
Functions§
- exclude_
segment_ groups_ kernel - Remove response-cycle wakeups from the selector-visible ready groups.
- increment_
segment_ group_ kernel - Increment a segment-group cursor modulo nine.
- prepare_
request_ kernel - Construct a complete compression request from prefetched context storage.
- public_
key_ endpoints_ ready_ kernel - Return whether one serialized public-key block has all endpoints available.
- segment_
bit_ kernel - Read one segment bit from a nine-group mask.
- segment_
required_ mask_ kernel - Return the randomization mask required by a segment stage.
- segment_
task_ fields_ kernel - Convert a segment stage to its one canonical compression-task tag.
- select_
public_ key_ focus_ segment_ kernel - Select a ready segment in an eight-block endpoint-stream lookahead window.
- select_
ready_ segment_ kernel - Select one ready segment with rotating group fairness.
- set_
segment_ bit_ kernel - Set or clear one segment bit in a nine-group mask.
- signature_
banks_ kernel - Connectivity for
SignatureBanks. - single_
context_ work_ engine_ kernel - State transition and memory connectivity for
SingleContextWorkEngine. - state_
pair_ exclusion_ kernel - Mark both segments sharing a parity-bank address as response-cycle hazards.
- union_
segment_ groups_ kernel - Bitwise union of two segment masks.
- wake_
segments_ for_ mask_ kernel - Wake every dependency-waiting segment that needs a newly retired mask.
Type Aliases§
- Segment
Groups - Nine eight-bit groups used for 67-bit segment masks.
- Segment
Stages - One five-bit dependency stage per segment.