TL;DR
While Large Language Model (LLM) agents can rapidly port complex Post-Quantum Cryptographic (PQC) hardware to new FPGAs, their self-generated tests and reviews often share the same blind spots as their code. This paper introduces a seven-stage "verification-gated" workflow that uses mutation testing, scoped adversarial review, and formal verification to catch subtle security flaws that standard tests miss.
What Problem Does This Paper Address?
The world is racing toward a "post-quantum migration" deadline, with NIST scheduling the retirement of current public-key algorithms by 2030-2035. This requires a massive overhaul of hardware—from lattice arithmetic to board bring-up. LLM agents are promising tools for automating this, but they present a "trust" problem: if an agent generates the design, the tests, and the review report, how do we know they haven't all missed the same critical flaw?
Standard "Known-Answer Tests" (KATs) are the industry baseline, but they are insufficient for security. A KAT confirms that a system produces the right output for valid input, but it cannot prove that the system correctly rejects malformed input or that a secret key never leaks out of its "vault."
Methods
The authors developed a seven-stage workflow (illustrated in Figure 1) designed to ensure that every piece of evidence generated by an agent is independently challenged.

Key novel components include:
- Oracle-First Rule: Before any RTL (Register Transfer Level) code is accepted, a software "oracle" must be established and verified against NIST standards.
- Gate Compilation with Mutants: Every claim (e.g., "this module rejects bad signatures") becomes a "gate." A gate is only accepted if it passes on real code but fails on "negative controls" (bad inputs) and "mutants" (intentionally broken versions of the code).
- Adversarial Review: Reviewer agents examine the code through specific "lenses" (e.g., security, correctness). "Skeptic" agents then try to disprove the reviewers' findings.
- Mutation Testing Audit: To measure test strength, the authors used tool-selected netlist mutants (using Yosys
mutate). If a test doesn't "kill" a mutant, the test is considered weak. - Formal Verification: For critical security invariants—like ensuring a secret key is never accessible to the host—the authors used formal tools (SymbiYosys) rather than relying solely on LLM judgment.
Datasets
The study evaluated the workflow by porting an ML-KEM-768/ML-DSA-65 accelerator to a 300 MHz Zynq UltraScale+ card. Evaluation data included:
- NIST ACVP: 85 interface-applicable cases from the Automated Cryptographic Validation Program.
- Known-Answer Tests: 484 ML-DSA known answers.
- Netlist Mutants: A pool of 399 tool-generated mutants used to audit the agent's self-generated tests.
- Flaw Replays: 54 sessions of "flaw replays" where agents were tasked with finding known vulnerabilities in the design.
Key Insights and Ideas
- The "Self-Correction" Mirage: Agents are surprisingly bad at catching their own logic errors when they write both the code and the test. Initial agent-written tests missed 24% of tool-generated mutants.
- Scope is Everything: Asking an LLM to review a "whole design" is largely ineffective for finding verifier flaws. However, when the review is "scoped" to a specific module, the detection rate for known flaws jumped to 100% across 54 sessions.
- KATs Have Blind Spots: Known-answer tests passed perfectly even when critical security checks (like rejecting malformed signature hints) were completely missing.
- Formal Tools > LLM Review for Security: Even when pointed directly at flawed code, LLM reviewer agents only caught planted key-custody flaws in 3 out of 20 sessions. In contrast, formal verification checks flagged every single one.
Key Results
The workflow successfully ported the PQC system to the target FPGA (see Figure 3 for architecture), achieving byte-exact results on the board.

- Performance: The new 300 MHz target achieved a 3.0–5.1x speedup in operations per second compared to the previous 100 MHz Kintex-7 target.
- Verification Strength: By using "survivor-guided" tests (tests written specifically to catch mutants that previous tests missed), the authors raised the decapsulation "kill rate" for mutants from 48% to 74%.
- Efficiency: The port involved over 12,000 lines of RTL code. The logged work spanned 15 weeks, with a median of only 5 operator minutes per unit of work, though the authors note this is a lower bound and doesn't claim an overall speedup over human-only flows.

Limitations and Future Work
The authors acknowledge several limitations:
- Design Specificity: The results are measured on a single family of PQC designs; generality to other hardware types is not yet proven.
- Human in the Loop: The process was "semi-automated," requiring a human operator to rule on scope and perform board actions.
- Model Dependency: The study primarily used the Claude 3.5 Sonnet/Opus family. Results might vary with other models.
- Future Directions: The authors suggest exploring "cross-model" reviewers (where different LLMs audit each other) and applying the flow to from-scratch designs rather than ports.
Summary updated