Post-Quantum Cryptography Field Notes · Part 1
Does your post-quantum library follow the standard? We ran the public test vectors
We ran Wycheproof's ML-KEM and ML-DSA vectors against 13 major libraries and 30 other implementations. The current version usually passes. What you have installed may not.
Post-quantum cryptography has stopped being a research topic. ML-KEM and ML-DSA are standards (FIPS 203 and FIPS 204), they ship in browsers, in TLS libraries, in operating systems and in language runtimes, and a lot of software now depends on them through a library that someone else wrote.
We wanted to know one narrow thing: do these implementations behave as the standard says? We did not look for new attacks or try to break the mathematics. We checked conformance, on the software people have installed.
This is what we found in three passes. A second part will follow in December.
The method, which is not clever
Project Wycheproof publishes test vectors for ML-KEM and ML-DSA. Each vector is an input and the expected verdict: this signature is valid, this public key must be rejected, this ciphertext must decapsulate to exactly this secret. Many of them are built to hit one specific check in the standard.
We wrote a small adapter for each implementation, fed it the vectors through its public interface, and counted two things: invalid inputs that were accepted, and valid inputs that were rejected or gave a different result.
That is all. The work is in doing it widely, and in not fooling yourself. Several times a result that looked like a finding turned out to be our own adapter: a return code read the wrong way round, an internal function called in place of the public one, a context string passed in the wrong argument. We now require that every valid vector passes before we believe anything else the run says.

Pass 1: the versions people have, not the latest ones
The current code of each of the thirteen major libraries we tested passed everything: OpenSSL, BoringSSL, AWS-LC, wolfSSL, liboqs, Bouncy Castle, the Go standard library and RustCrypto among them (the full list, the code and the log). For most of them that means the development branch on the day of the test, and for the rest the latest release.
So we went backwards. Older releases stay in distributions for years, and wrappers in other languages bundle whatever version existed the day they were published.
The AVX2 verifier nobody updated. In June 2026, Eric Biggers reported to the pq-crystals project that the AVX2 implementation of the Dilithium verifier did not check the size of one component of the signature, and that a rounding helper mishandled one boundary case. Both were fixed upstream the same day.
That code had been copied. We found the unfixed copy in:
- liboqs 0.12.0 to 0.15.0, on any x86-64 processor with AVX2. With the Wycheproof vectors, each of those releases accepts 37, 41 and 49 invalid signatures for the three parameter sets and rejects one valid signature per set. The portable build of the same release is correct, so the answer depends on the processor.
- PQClean, archived before the fix.
- The Rust crate
pqcrypto-mldsa0.1.2, with its default features. - The Rust crate
oqs0.11.0, the latest, which builds a bundled liboqs 0.13.0. - The Rust crate
pqcrypto-dilithium0.5.0, archived. It implements a version of the scheme from before the standard, so the Wycheproof vectors do not apply to it; tested with signatures from its own signer, its AVX2 verifier accepts 20 of 20 that its portable verifier rejects.
liboqs 0.16.0 is not affected, because it replaced that code altogether. But we found no advisory telling anyone on 0.12 to 0.15 to move.
Making such a signature requires the private key, so this is not a forgery. It is a signer being able to produce a signature that some verifiers accept and others reject, which matters wherever several parties must agree.
ML-KEM without input checks. FIPS 203 says a key must have passed two checks before it is used. It allows that assurance to come from somewhere other than the library, but a library that does not check leaves the job to every caller. liboqs 0.12.0 and the crate pqcrypto-mlkem 0.1.1 perform neither: they accept 108, 112 and 116 invalid public keys and two invalid private keys per parameter set.
We published both notes (the verifier, the input checks), opened a public issue in liboqs, asked upstream whether a CVE had been assigned, and sent two advisories to RustSec. RustSec merged them the same day, as RUSTSEC-2026-0586 and RUSTSEC-2026-0585. The maintainers of the Rust wrapper answered within hours, and agree that what is missing is a new release. We have since asked RustSec for a third advisory, for pqcrypto-dilithium.
A check that could not fail. @noble/post-quantum, a JavaScript implementation with about 1.7 million npm downloads a week, had the public key check in its source all along. Before version 0.6.0 the decoding step inside it did not reduce the coefficients, so decoding the key and encoding it again always gave back the input, and the comparison could never fail. Those versions accept the same 108, 112 and 116 invalid public keys as the two packages above. It was fixed in March 2026 without an advisory, and in the week we looked more than half of the package's npm downloads were still of earlier versions (registry figures, 12 to 18 November 2026; note). The maintainer told us that only the latest release is supported and that no further action will be taken.
Pass 2: every processor path, and a negative result
The ML-DSA defect lived in AVX2 code that the portable version did not share. So we asked whether other processor-specific paths hide the same kind of difference, and ran the same vectors again while forcing each path: AVX-512, AVX2 and plain C on x86-64, and then, under emulation, NEON on 64-bit ARM in eight implementations, RISC-V, and s390x, where the byte order is reversed.
Nothing new. Every implementation gave the same answers on every path we could exercise (note).
We are reporting it because it narrows the earlier result: the AVX2 verifier defect is an x86 problem only, and the same releases are correct on ARM. And because a method that only ever reports successes is not being described honestly.
Pass 3: the long tail
If the big C libraries are in good shape, where is the untested code? In two places: implementations that ship inside language runtimes, and the many packages in each registry that carry their own implementation.
We built an inventory and tested 30 of them.
Twenty passed, among them OpenJDK 24 to 27 in five execution modes, the ML-DSA verifier in the Linux kernel, leancrypto, strongSwan, and a number of Rust, Go, Python, Swift and PHP packages. Three of the thirty were also run under emulation on other architectures (ARM, RISC-V, PowerPC, LoongArch, s390x), two of them with hand-written assembly, and gave the same results as on x86-64.
Ten did not. Two of those are still in coordinated disclosure; one has already been fixed in source by its maintainer, the same day we reported it. The other eight implementations (nine findings, described in this note):
- libsodium 1.0.22, ML-KEM-768. Accepts a private key whose stored hash of the public key has been altered
- Zig standard library, 0.16 to current. The same
cipherlib(Dart). The same; its own source carries a note to add the check@umbra-privacy/quick-mlkem768(npm). The samekeeper-mlkem1.0.2 (Python). The public key check is written but can never fail- Nettle, unreleased ML-KEM. The functions return nothing, so they cannot reject a key
gmsm(Go), ML-DSA. Refuses to sign or verify an empty messagegmsm(Go), ML-KEM on PowerPC. Uses a POWER9 instruction while documenting POWER8pqcrypto1.0.0 (Python), ML-DSA. Rejects contexts of 254 and 255 bytes. Already reported by someone else before us
All of them are in the current release, or in code that has not been released yet, and all of them are low severity. None discloses a key. They are places where an implementation and the standard disagree about what is valid.
Three shapes repeat:
- The private key hash check is missing. Four of these implementations. FIPS 203 stores a hash of the public key inside the private key and says the key must not be used unless that hash has been checked, by the library or by someone before it.
- The public key check is missing or does nothing. A check that exists in the source but cannot fail is the more instructive case: reading the code tells you the check is there, and only running it with an input that should fail tells you it is not. It is the
@noble/post-quantumcase again, in a different language. Inkeeper-mlkemthe check decodes the key, encodes it again and compares the two, as the standard describes. But the decoding routine does not reduce the coefficients modulo q, so the round trip always gives back its input and the comparison always succeeds. - A legitimate edge case is refused. The empty message, the longest allowed context. These reject too much and never too little, so nothing breaks until someone else's valid signature arrives.
A check in the source is not a check. Run it with an input that must fail.
Where the reports went, and where they did not
What we did with each finding depended on the project.
Nettle's maintainer was told by mail and gmsm through two public issues, the same day. cipherlib already documents the gap in its own source, the quick-mlkem768 package has no public repository or contact, and the pqcrypto case had been reported by someone else, so we wrote to none of those three.
Two projects do not accept reports produced with AI assistance. Zig's contribution rules say "No LLMs for issues", without exceptions. libsodium says it does not accept contributions written by AI and closes issues that read as such, though it is glad to hear about a bug an AI found if a person has done the homework and explains it in their own words.
This work is AI-assisted and we say so every time, so a report from us would fall under both rules. For those two we filed nothing, and the notes in our repository are the only record. Those are their projects and their rules, and we would rather follow a rule we find inconvenient than work around it.
For one more, the only channel we found was a bounty platform that requires an account and its own terms. For a low-severity finding we decided that was not proportionate, and it is recorded in our notes as well.
What we take from it
- Test what is installed. In the first pass, every project had already fixed the defect in its current release. The gap was between the fix and the people who never heard about it.
- Copied code does not receive fixes. The same defect was alive in five projects five months after upstream closed it.
- Public vectors work. Nearly everything in these notes was found with test vectors that anyone can download, and can be checked the same way.
- A check in the source is not a check. We met one that could not fail in two unrelated projects. Run it with an input that must fail.
If you ship ML-KEM or ML-DSA today
- liboqs: use 0.16.0 or later. 0.12.0 to 0.15.0 have the ML-DSA verifier defect on x86-64 with AVX2, and 0.12.0 also lacks the ML-KEM input checks.
- The Rust crate
oqs0.11.0 builds its own copy of liboqs 0.13.0. Until a release bundles 0.16.0, link it against a system liboqs 0.16.0. @noble/post-quantum: use 0.6.0 or later.npm ls @noble/post-quantumshows whether a dependency pins an older one.pqcrypto-mldsa,pqcrypto-mlkem,pqcrypto-dilithiumand PQClean are archived and will not be fixed. Move to a maintained implementation.- Whatever you use, run the Wycheproof vectors against the build you ship, on the processor you ship it for.
How this was done
The research strategy and the test code were designed and written with AI assistance, and the tests were run with AI tooling (Claude Fable 5.2, by Anthropic), under the direction of RatioLabs. Every finding in this article is reproduced by a script in the repository, from public sources, and so are the runs that found nothing.
Notes, code and logs: https://github.com/RatioLabsEU/pqc-field-notes
Part 2 will cover the results that leave coordinated disclosure in December, a fourth pass with the ML-DSA signing vectors and SLH-DSA, what we found by following upstream fixes into the copies of that code, and what the maintainers answered.