Post Quantum Cryptography Benchmark for models

57 tasks, seven tiers, four validation gates - and the three bugs the gates caught in my own grading code.

57 tasks 7 tiers 74 sources 4 gates Python 3.11–3.13 MIT

Ask a language model when post-quantum migration has to happen and you get a confident answer. Ask the same model twice, in two different ways, and you get two different confident answers. That gap - between fluency and correctness - is the only reason this benchmark exists.

PQC-Eval is a benchmark for evaluating language models on post-quantum cryptography: the algorithms, the standards that govern them, and the engineering work around them. I released v1.0.0 this week. This post is about what it measures, and more usefully, what broke while I was building it.

Why another crypto benchmark

There are already evaluations for cryptographic reasoning, and several are better resourced than mine. What none of them measure is the thing organisations will actually be judged on: whether a model can reason about which migration requirement applies, in whose jurisdiction, to which asset - and then do the engineering work.

That distinction matters because post-quantum migration is not one deadline. US federal high-value assets target 2030 and exclusive use by 2033. India's CII guidance points at 2029, and it is a proposed milestone rather than a universal mandate. The UK says 2035. Germany's BSI says 2031 for specific categories. A model that has memorised “2035” is not wrong so much as answering a question nobody asked.

So the benchmark has three jobs: check whether the standards reasoning is jurisdiction-aware, check whether the implementation is correct against real reference outputs, and check whether the model can find cryptography in a codebase it has never seen.

Fifty-seven tasks across seven tiers

57tasks
7tiers
74source URLs
4validation gates
tiertaskswhat it askshow it is graded
Knowledge10Algorithm facts, parameter setsExact match
Standards20NIST, CNSA 2.0, CERT-In, TEC, DST, BSI, ANSSIExact match
Implementation9Write a FIPS 203 componentExecuted against kyber-py
Debugging6Find the defect in real PQC codeExecuted, bug injected
Judgment3IoT signature choice, TLS trade-offsWeighted rubric
Scenarios4India bank migration, SSH fleet, firmware signingWeighted rubric + sources
Engineering5Repo discovery, CBOM, patching, ML-KEM encapsulationP/R/F1, fixture tests, KAT vectors

30 multiple choice, 15 executable code, 5 repository-level, 7 rubric-scored. 74 source URLs, all verified on 2026-11-25.

Multiple choice30 · 53%
Executable code15 · 26%
Rubric-scored7 · 12%
Repository-level5 · 9%

Brief idea of current version's distribution.

Every task is bound to at least one primary source, and the build fails if one is missing. That is not decoration: a benchmark about standards has no business being loose about which document says what.

I optimised for my own convenience

The first version was 68% multiple choice. The reason was not that knowledge questions are the most interesting - it is that a letter match grades deterministically and I could verify it in a second. Executable tasks need a checker, and a wrong checker quietly corrupts every score it produces.

That is a bad reason to shape a benchmark, and an audit by me later helped me figuring it out in blunter terms than I would have. The current split is 53% multiple choice, with fifteen executable code tasks and five repository-level tasks.

Four gates, and the bugs they caught

Four checks run on every push, and CI runs them on Python 3.11, 3.12 and 3.13. Provenance - every task resolves to at least one real source URL. Ground truth - my zeta tables and compress/decompress formulas are compared against kyber-py, and the schemes round-trip at the byte sizes the standards specify. Integrity - a gold answer must score 1.0, an empty answer 0.0, and every deliberately injected bug must be rejected. Plumbing - providers, cache, scorer, report generation, and a syntax guard.

Three of the bugs those gates caught were mine, and all three are worth describing because they are the failure modes any benchmark will have.

The version hash didn't hash the questions

The report stamped a benchmark_version so a score could be tied to the exact task set that produced it. It hashed each task's id, answer, gold and rubric - but not the prompt. I could rewrite a question completely and the version would not change. Two different benchmarks, identical labels. It now hashes the full task, the contents of each checker file, and the scorer source itself.

Rejecting an algorithm counted as recommending it

One rubric criterion asked whether the model recommended ML-DSA-44 for a bandwidth-constrained IoT signature. The scorer looked for the string “ml-dsa-44”. So an answer that said “I would reject ML-DSA-44 and use SLH-DSA” scored 0.60 - it earned the point for recommending the exact thing it argued against.

The fix is criterion-level exclusion: a criterion can declare that certain phrases cancel it. That answer now scores 0.40. It is still a keyword method, and I say so in the README rather than pretending it is semantic.

My own guard was wrong

Python 3.11 rejects a backslash inside an f-string replacement field; 3.12 relaxed that. One line in my report formatter did exactly that, and the 3.11 CI job failed. I fixed the line and added a guard that walks the AST looking for the pattern.

Then the guard failed CI - on legal code. ast.get_source_segment on a FormattedValue spans the whole f-string in 3.12, so it was flagging literal newlines outside the braces. Seven false positives. The guard now inspects only the expression part, and it has its own two tests: one input that must be caught, one that must not.

A detector without tests is indistinguishable from one that always says “clean”.

The FIPS 203 detail that separates reading from remembering

ML-KEM encapsulation derives a shared secret and a ciphertext from the encapsulation key and a random message. In the round-3 Kyber submission, the final shared secret went through an extra derivation step: KDF(K || H(c)).

FIPS 203 removed that step. Encapsulation returns K directly. Decapsulation recomputes the ciphertext, compares, and returns an implicit-rejection value - SHAKE256(z || c, 32) - when the comparison fails.

A model that learned Kyber from 2021 material writes the KDF. It looks right, it runs, and it produces the wrong shared secret. I put that exact bug into a fixture and graded it against three fixed vectors generated from the reference implementation. Gold passes; the round-3 version fails on vector 0 with a shared-secret mismatch.

No rubric would catch that. A test does, in milliseconds, with a reason attached.

What a single model did, with caveats attached

I ran the standards and scenarios subset - 21 tasks - against Sarvam AI's sarvam-105b. Mean score: 0.48. Nine responses came back empty, because I had capped output at 4,096 tokens and this model reasons for thousands of tokens before answering. That was my configuration error, not a model failure.

Re-running the four scenarios at 16,384 tokens gave 0.75. After applying the critical-criteria caps, the standards subset rescored to 0.50.

The most useful single observation: asked about NSA's CNSA 2.0 requirements, the model gave three different wrong answers across three phrasings - ML-KEM-768, then ECDH P-384 “by 2025”, then Diffie-Hellman MODP-3072 “by 2024”. The correct position is ML-KEM-1024, with exclusive use by 2033. It was fluent and confident in all three.

That is an anecdote with a receipt, not a result. One model, no repeats, no confidence intervals.

What this does not establish
  • Not a validated leaderboard: no published baselines, no held-out split, no confidence intervals.
  • No human-calibrated scoring. The rubric tier is keyword coverage with a negation guard - a proxy, not a semantic judge.
  • Not a conformance suite. Round-trip consistency is not ACVP vector conformance, and passing these tasks does not certify an implementation.
  • Not agentic. Repository tasks receive fixture files in the prompt; they do not get a filesystem or a terminal.

The unit of evaluation has to change

The next version adds a tool loop: read-only discovery first - list files, read files, grep, inspect manifests - with the model deciding what to look at and a trajectory logged for every step. Then patching, graded by the fixture's own test suite. Then protocol integration.

That changes the unit of evaluation from one response to one episode, which changes the harness, the scoring, and how noisy the numbers are. Agents vary far more between runs than single completions do. Doing that badly would produce numbers that fall apart on the first rerun, so it is a separate track with its own leaderboard rather than more rows in this one.

The thing I keep coming back to is that a benchmark is only useful if it is wrong in public. Every audit of this repository found something real - a scorer that rewarded contradiction, a version hash that didn't cover the questions, a repository task where the model never saw the repository. If you find a task this grades wrong, that is the most useful thing you can send me.

Verified2026-11-25 · four gates · CI on Python 3.11, 3.12, 3.13
ScopeIndependent research artefact. Not a certification, not a compliance attestation, not endorsed by NIST, CERT-In, TEC, the DST or any government body.