← Back to documentation
Snapshot of projects/fog-crypto-core/design/decision-log.md — 28 Nov 2026

Fog-Crypto Core — Decision Log (DAR)

Project instance of process/templates/decision-log.md. Each decision records criteria, options, decision, rationale, and impacted requirements. Status: Proposed / Accepted / Superseded. Decisions marked Accepted close an audit/review finding. Revision 1.4 (D-1 … D-15).

D-1 — Reference line rate: 1 GbE

  • Criteria: timing-closure feasibility on ZU3EG, board class, KPI verifiability.
  • Options: 1 GbE (RGMII) · 10 GbE (SFP+).
  • Decision: freeze 1 GbE as the reference line; 10 GbE deferred.
  • Rationale: a defined "line" is required for the throughput budget (NC/RD-2); 1 GbE is achievable with margin at ≥ 250 MHz on ZU3EG.
  • Impacted requirements: REQ-FOG-PERF-002, REQ-FOG-PERF-003, REQ-FOG-HW-002.
  • Status: Accepted.

D-2 — Target FPGA: ZU3EG definitive baseline

  • Criteria: logic/resources, DSP/BRAM headroom, DPA share-isolation congestion.
  • Options: ZU2CG (47k LUTs, 240 DSP) · ZU3EG (70 560 LUTs, 360 DSP).
  • Decision: ZU3EG is the definitive baseline; the ZU2CG fallback is eliminated; package XCZU3EG-SFVC784 (3 HP banks = 156 HP pins; SBVA484/SFVA625 have only 72 HP pins).
  • Rationale: masked AES + PRNG/TRNG + GHASH + 2× SG-DMA + CDC FIFOs + PL MAC + DSP pushes the ensemble past ~75–80 % of ZU2CG LUTs, and physical share isolation worsens routing congestion; ZU3EG removes the placement/routing risk.
  • Impacted requirements: REQ-FOG-HW-002, REQ-FOG-HW-003.
  • Status: Accepted.

D-3 — AES mode & sizing

  • Criteria: confidentiality + integrity, NIST/FIPS alignment, ZU3EG LUT budget.
  • Options: AES-ECB (rejected) · AES-CTR (no integrity) · AES-CCM · AES-256-GCM.
  • Decision: AES-256-GCM, right-sized to a 128-bit bus at ≥ 1 block / 16 cycles (≥ 2 Gbps @ 250 MHz) with a single 4-stage pipelined GF(2¹²⁸) GHASH (H⁴ interleaving).
  • Rationale: a fully-unrolled 128b/cycle (32 Gbps) masked core + 4× GHASH would blow the ZU3EG budget; ≥ 2 Gbps is sizing-matched to 1 GbE with headroom.
  • Impacted requirements: REQ-FOG-FUNC-001, REQ-FOG-SEC-002, REQ-FOG-PERF-002.
  • Status: Accepted.

D-4 — Key management & PL firewall

  • Criteria: key confidentiality, resistance to software/JTAG/glitch exfiltration.
  • Options: AXI-Lite key register (rejected) · CSU eFUSE/BBRAM · PUF derivation.
  • Decision: CSU hardware PUF (XAPP1333) + RSA_EN/ENC_ONLY eFUSEs decrypt a **per-board Black Key Blob at boot (TF-A EL3); session keys wrapped with AES-256-KW (NIST SP 800-38F)**; key aperture on M_AXI_HPM0_LPD behind a dedicated RTL AXI4-Lite TrustZone filter (awprot[1]==0/arprot[1]==0, else SLVERR + WSTRB=0).
  • Rationale: PS XMPU/XPPU protect only PS slaves; the Xilinx AXI Protocol Firewall (PG293) is an anti-hang IP and does not filter AxPROT (AUD-5.3). A constant KEK in a shared bitstream compromises the whole fleet, and a soft PUF needs a 3–6 kLUT Fuzzy Extractor — so the CSU hardware PUF + per-board blob + AES-256-KW is the right call (AUD-5.4).
  • Impacted requirements: REQ-FOG-SEC-001.
  • Status: Accepted.

D-5 — DMA topology & split caching

  • Criteria: cache coherence, latency, zero-copy, L2 pollution control.
  • Options: S_AXI_HP (non-coherent) · S_AXI_HPC (coherent) · S_AXI_HPC + split AxCACHE.
  • Decision: route SG-DMA through S_AXI_HPCx_FPD (CCI-400/SMMU); because HPC is **ACE-Lite "no L2 allocation", descriptor rings are OCM-resident (256 KB via SMMU) or** read in batches of B ≥ 8 with prefetch (prfm pldl1keep / dc zva); payload writes use AxCACHE = 4'b1010 (no Write-Allocate).
  • Rationale: the HP-port cache trap (audit §4.1) is avoided, and no AxCACHE value makes HPC allocate L2 lines (AUD-5.1), so rings must be OCM-resident or batched to bound L2D_CACHE_REFILL ≤ 0.25/packet.
  • Impacted requirements: REQ-FOG-IF-001, REQ-FOG-PERF-001, REQ-FOG-IF-004.
  • Status: Accepted.

D-6 — Driver model: strict VFIO from Phase 1

  • Criteria: DMA support, IOMMU isolation, no throwaway code.
  • Options: UIO then VFIO · custom LKM · vfio-platform from Phase 1.
  • Decision: VFIO (vfio-platform + libvfio) from Phase 1 across all data & control apertures; *zero /dev/uio and zero /dev/mem** anywhere in the stack.
  • Rationale: UIO does not support DMA properly and its programming model is discarded on VFIO migration (audit §4.2); the earlier D-14 reintroduced /dev/uio — now explicitly forbidden.
  • Impacted requirements: REQ-FOG-IF-002, REQ-FOG-SW-002.
  • Status: Accepted.

D-7 — Data-plane language & ring synchronization

  • Criteria: line-rate throughput, deterministic latency, no GIL/GC overhead.
  • Options: Python asyncio (rejected) · C · Rust.
  • Decision: C for the data plane (Rust acceptable); ring ownership synchronized with ARMv8 ldar/stlr Inner-Shareable acquire/release (not stalling dmb osh).
  • Rationale: asyncio caps at tens of thousands of events/s and would overrun FIFOs at 1.488 Mpps; acquire/release barriers are the correct, cheaper ownership handshake.
  • Impacted requirements: REQ-FOG-SW-001, REQ-FOG-IF-004.
  • Status: Accepted.

D-8 — Build & toolchain

  • Criteria: reproducibility, cross-compilation, Yocto/PetaLinux integration.
  • Options: ad-hoc builds · strict Yocto from day one · phased (loose coupling → Yocto).
  • Decision: Phase 1 loose coupling (meson + gcc for C middleware, uv for Python control plane); Phase 2 strict Yocto recipes (.bb) with immutable read-only rootfs.
  • Rationale: keeps MVP velocity while frozen dependencies land in Yocto at production.
  • Impacted requirements: REQ-FOG-SW-001, REQ-FOG-SW-002.
  • Status: Accepted.

D-9 — Memory model: zero-copy inside the C data plane

  • Criteria: latency, no data duplication, buffer-lifecycle safety.
  • Options: Python memoryview hand-off (rejected) · C-internal zero-copy via PL MAC + VFIO.
  • Decision: zero-copy realized within the C data plane (DMA buffer → PL MAC via VFIO); the Python memoryview hand-off is dropped.
  • Rationale: memoryview avoids byte copies but not Python object/GC overhead (audit §5); ownership is handled by the Status/Submission ring protocol.
  • Impacted requirements: REQ-FOG-IF-004, REQ-FOG-SW-001, REQ-FOG-PERF-003.
  • Status: Accepted.

D-10 — Nonce/IV construction (96-bit)

  • Criteria: IV uniqueness, NIST SP 800-38D compliance, no runtime eFUSE wear.
  • Options: host-supplied nonce (rejected) · 64-bit counter only · 96-bit GCM IV.
  • Decision: IV[95:0] = Session_Epoch_Salt[31:0] ‖ HW_Monotonic_Counter[63:0] (J0 = IV ‖ 0x00000001); mandatory new session key + new salt on warm reboot / partial reconfig / counter wrap-warning; eFUSEs never written at runtime (epoch persisted in PUF-HMAC-signed QSPI/eMMC if needed).
  • Rationale: a 64-bit counter alone is not a full 96-bit NIST IV and eFUSE OTP cannot be rewritten per boot (AUD-4.4).
  • Impacted requirements: REQ-FOG-SEC-005, REQ-FOG-IF-006.
  • Status: Accepted.

D-11 — 64-byte saturation strategy: Poll Mode Driver

  • Criteria: CPU budget and packet rate (1.488 Mpps @ 64 B = ~806 cycles/packet @ 1.2 GHz).
  • Options: IRQ-driven with coalescing · busy-polling (PMD) with no active IRQ.
  • Decision: IRQ + coalescing for normal traffic; PMD (busy-polling) at 64-byte saturation; ≤ 8.5 % CPU applies to 1500-byte frames only; the 64-byte stress budget is ≤ 400 cycles/packet (PMU non-halted cycles).
  • Rationale: ≤ 8.5 % of 806 cycles/packet ≈ 68 cycles is untenable under IRQ; a PMD's raw scheduler % is meaningless, so the metric is cycles/packet via PMU.
  • Impacted requirements: REQ-FOG-PERF-001, REQ-FOG-IF-003, REQ-FOG-SW-001.
  • Status: Accepted.

D-12 — FMC I/O bank routing

  • Criteria: I/O voltage compatibility, IDELAYE3/ISERDESE3 availability, ADC capture timing.
  • Options: HD banks for 3.3 V (rejected — no IDELAYE3) · HP banks + passive shifters · **HP banks + unidirectional fast shifters**.
  • Decision: VADJ = 1.8 V; high-speed ADC clock/data wired exclusively to HP banks (native IDELAYE3/ISERDESE3) with no level-shifters on native 1.8 V LVDS pairs; only 2.5/3.3 V CMOS inputs use unidirectional SN74AXC/AVC shifters; HD banks restricted to slow GPIOs ≤ 10 MHz.
  • Rationale: HD banks lack IDELAYE3/ISERDESE3, so routing high-speed ADC to them would lose per-lane eye calibration (AUD-4.1).
  • Impacted requirements: REQ-FOG-HW-001, REQ-FOG-FUNC-003.
  • Status: Accepted.

D-13 — Network egress & fail-safe

  • Criteria: end-to-end latency, CPU budget, driver coherence, fault containment.
  • Options: PS GEM + netdev + AF_XDP · PL MAC + VFIO userspace pipeline.
  • Decision: PL-integrated MAC driven end-to-end by VFIO (AF_XDP/raw sockets dropped); the MAC physical interface is RGMII (1.8 V) or SGMII-over-LVDS on an HP bank (ZU3EG has **0 GTH transceivers); on crypto/integrity fault the engine halts, zeroizes, and asserts tx_er to poison the FCS**.
  • Rationale: a kernel netdev reintroduces the copy/context-switch cost that defeats ≤ 8.5 %; tx_er guarantees no corrupted frame leaves the boundary (AUD-4.8).
  • Impacted requirements: REQ-FOG-SW-001, REQ-FOG-IF-001, REQ-FOG-SEC-002.
  • Status: Accepted.

D-14 — L2 / PHY & PAUSE split

  • Criteria: keep the PMD hot loop lean; no netdev owns L2/PHY; PAUSE latency.
  • Options: L2/PHY in PMD (rejected) · Python control plane · split HW/SW.
  • Decision: IEEE 802.3x PAUSE handled 100 % in the PL MAC hardware (sub-µs); ARP punted via a lockless POSIX shared-memory ring to the control plane; PHY MDIO via kernel mdio_bus/netlink or a shared VFIO aperture — never /dev/uio.
  • Rationale: Python at ≤ 100 Hz cannot answer PAUSE frames; hardware termination + async ARP keeps the PMD loop at zero syscalls (AUD-4.6).
  • Impacted requirements: REQ-FOG-SW-001, REQ-FOG-SW-002, REQ-FOG-IF-002.
  • Status: Accepted.

D-15 — DSP sensor alert path

  • Criteria: low-latency sensor alerting, CPU offload, deterministic capture.
  • Options: poll AXI-Lite status · coalesced crypto IRQ · dedicated non-coalesced PL_PS_IRQ0.
  • Decision: dedicated non-coalesced PL_PS_IRQ0 (≤ 2 µs) for threshold-crossing alerts + AXI-Lite status/threshold map + BRAM pre/post-trigger sample FIFO.
  • Rationale: the sensor path must wake the PS only on anomalies with bounded latency, and freeze the offending samples for analysis (AUD-4.7).
  • Impacted requirements: REQ-FOG-FUNC-002, REQ-FOG-PERF-003, REQ-FOG-IF-003, REQ-FOG-IF-006.
  • Status: Accepted.

D-16 — Decryption mode: Store-and-Forward

  • Criteria: authenticated decryption must not emit unverified plaintext (NIST SP 800-38D §5.2.2).
  • Options: cut-through decrypt (rejected — leaks plaintext before tag check) · **Store-and-Forward Packet Mode (BRAM FIFO until tag_ok)**.
  • Decision: decryption holds the plaintext in a BRAM FIFO until the GCM tag verifies, and **purges it silently on tag_ok == 0**; tx_er poisoning remains as the egress (encryption-path) fail-safe.
  • Rationale: on WAN→LAN, a cut-through core would already have emitted the full unverified plaintext before the tag check (AUD-5.2); store-and-forward makes the 20 µs latency bound apply to processing, excluding the 12.14 µs wire serialization.
  • Impacted requirements: REQ-FOG-SEC-002, REQ-FOG-PERF-003.
  • Status: Accepted.

D-17 — De-escalation & convergence freeze rule

  • Criteria: break the audit/fix escalation loop (hysteresis); right-size the MVP; keep an upgrade path.
  • Options: keep escalating production targets (rejected) · MVP (Phase 1) + Phase 2 backlog.
  • Decision: freeze an MVP baseline (100 MbE, ÷ 2 CPU, ≥ 150 MHz, unmasked AES-256-GCM, BBRAM key, CAVP only, simple VFIO) and defer the hardening (1 GbE, ÷ 10, DPA/FIPS, CSU PUF + AES-256-KW
    • RTL TZ filter, PMD/batching, SFVC784, 250 MHz) to Phase 2. Convergence freeze rule: no new
    Mandatory requirement may be added by later reviews; new findings are Desirable / Phase 2 unless they are a blocking security flaw or a factual correctness error.
  • Rationale: each review corrected one defect while adding a micro-constraint that invited the next defect; a minimal, achievable MVP breaks the loop, and the freeze rule prevents re-escalation.
  • Impacted requirements: REQ-FOG-PERF-001/002, SEC-001/003/004, IF-001/003/004, HW-001/002/003, SW-001.
  • Status: Accepted.

D-18 — Pipelined GHASH: CLMUL + reduction (timing closure)

  • Criteria: close 150 MHz (6.667 ns) on the GF(2^128) GHASH multiply without feedback stall (REQ-FOG-PERF-002), bit-exact vs NIST.
  • Options: combinational 128-iteration shift-and-add (rejected — ~128-level XOR chain, ~30 ns) · nibble-serial table (fallback) · 4-stage pipelined carryless-multiply + polynomial reduction.
  • Decision: ghash_core computes bitrev(reduce(clmul(bitrev(x), bitrev(h)))) in 4 register stages (bit-reverse → CLMUL → reduction x^128=x^7+x^2+x+1 → bit-reverse), throughput 1 multiply/cycle, latency 4. No H^4 interleaving needed at 100 MbE.
  • Rationale: the CLMUL tree has ~7 XOR levels (vs 128 for the shift-and-add), so it pipelines into few stages and meets 150 MHz; it is the standard "single pipelined GHASH" of PERF-002.
  • Impacted requirements: REQ-FOG-PERF-002, PERF-003, HW-002/003, FUNC-001.
  • Status: Accepted.

D-19 — Golden Reference Model A: oracle-only, never the shipped core

  • Criteria: de-risk vibecoded crypto RTL with an independent oracle; keep the shipped core in SystemVerilog (REQ-FOG-FUNC-001).
  • Options: reuse the BLu85 VHDL core as the implementation (rejected — VHDL, no store-and-forward, no tag verify) · vendor BLu85 as a bit-exact golden reference and write our own SV core.
  • Decision: vendor the Apache-2.0 BLu85 AES-256-GCM IP under testbench/golden_model_a/ as "Model A", validate it against NIST CAVP, and cross-check our SystemVerilog core against the same corpus (bit-exactness). Model A cannot cover store-and-forward / fail-safe (it streams plaintext and never verifies a tag), so those are tested by fault injection on our core.
  • Rationale: bit-exactness proves the function, not the security; an independent, published, NIST-validated oracle is the strongest available check on vibecoded crypto, while keeping the deliverable in SystemVerilog.
  • Impacted requirements: REQ-FOG-FUNC-001, SEC-002/004, VV-002.
  • Status: Accepted.

Source: raw markdown — published as-is from the source repository.