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.

RatioLabs · · 9 min read

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.

The method: public test vectors go through a small adapter into the public interface of each implementation, and the verdict is compared with the expected one. Pass 1: 13 major libraries, then older releases and wrappers. Pass 2: every processor path. Pass 3: 30 other implementations.
The method, and where each pass pointed it.

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.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):

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:

  1. 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.
  2. 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-quantum case again, in a different language. In keeper-mlkem the 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.
  3. 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

If you ship ML-KEM or ML-DSA today

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.