Skip to main content

Module ctb

Module ctb 

Source
Expand description

Consistent tail broadcast (CTB): recovery layer 3, workstream W3 (docs/rhdl_ubft-ctb.md).

Two encodings are fixed here, both as kernels so hardware and tests use the same bytes:

  • digest_block: the 128-byte SHA-512 input for one message, "RUB2-CTB" ‖ session ‖ b ‖ idx ‖ len ‖ payload, zero beyond len. The digest is its first 28 bytes.
  • ctb_context: the 48 signed bytes (sign layout v2, role 2): "RUB2" ‖ role 2 ‖ b ‖ 0 0 ‖ session ‖ idx ‖ digest[0..28]. The broadcaster, index and session are named explicitly, so a signature can never be presented as the broadcaster’s statement about another index, broadcaster or run (U33), and a Byzantine receiver cannot frame an honest broadcaster with a signature from elsewhere.

Modules§

broadcaster
The CTB broadcaster (docs/rhdl_ubft-ctb.md): upstream tail-cb/broadcaster.hpp as a step kernel.
receiver
The CTB receiver for one broadcaster (docs/rhdl_ubft-ctb.md).
wire
CTB point-to-point slots: what a sender writes into a receiver’s memory and how the receiver reads it back (U21, U22).

Constants§

CTB_DOMAIN
"RUB2-CTB" as a little-endian word.
MAX_PAYLOAD
Most payload words a CTB message carries (64 bytes: the body of one point-to-point slot, which the fetch engine reads in one request; the digest input stays one 128-byte SHA-512 message).
ROLE_CTB
Role byte of a CTB data signature in sign layout v2 (role 1 is the certify share).

Functions§

bswap64
Byte-reverse a 64-bit word (little-endian bytes to a SHA-512 word).
ctb_context
The 48 signed bytes of a CTB data signature, as six little-endian words (the services sign them zero-extended to 64 bytes).
digest_block
The 128-byte digest input as 16 big-endian SHA-512 words. Payload words at or past len are zeroed, so the encoding is canonical.
digest_of
The digest from a finished SHA-512 state H0..H7 (big-endian words): bytes 0..28 as little-endian words, bytes 28..32 zero.