← Back to section · Research Resources

Aggregate Libraries: How liboqs and PQClean Differ, and How to Use Each

liboqs gathers many PQC algorithms behind one unified C API, while PQClean collects clean, standalone, portable implementations. Which one a researcher should use, and how to check versions and algorithm coverage, explained item by item.

Published 22 November 2026 · 6 min read · PQ Frontier

Aggregate Libraries: How liboqs and PQClean Differ, and How to Use Each
AI-generated site artwork
Video explainer · Open Source Code Index: from repositories to trusted code

Why aggregate libraries exist

Fetching each algorithm’s submission code one by one quickly becomes exhausting: build systems differ, interface styles differ, license wording differs. Aggregate libraries exist to solve exactly this — they gather many algorithms’ implementations into a single repository with a uniform build and calling interface, so that once a researcher installs one library they can compare a dozen algorithms side by side. The two most representative aggregate projects in the PQC field are liboqs and PQClean, but their design philosophies differ considerably, and choosing the wrong one makes everything awkward.

liboqs: built for research and integration experiments

liboqs, maintained by the Open Quantum Safe project, is a C library covering both key encapsulation mechanisms and digital signature schemes, with coverage that shifts as the NIST standardization process evolves: standardized algorithms such as ML-KEM and ML-DSA have corresponding implementations, while candidates still under evaluation may be added or removed. Its most valuable design feature is the unified API: whatever the underlying algorithm, operations such as key generation, encapsulation, and signing are called through the same set of function signatures, with the algorithm selected by a name string. This makes cross-algorithm benchmarking and protocol prototyping very direct.

Several integration projects have grown on top of liboqs, typically a provider that plugs liboqs into OpenSSL, plus community language bindings (Python, Go, Rust, and others). These derivatives are good for setting up an experiment environment quickly, but note that their versions are managed separately from the main library’s, so upgrades need to be checked in pairs.

It must be emphasized that liboqs’s own project documentation states plainly that it targets research and prototyping, not production deployment: the algorithms it ships may include schemes whose specifications are not yet final and whose parameters may still change, and its interface evolves between versions. Using it for experiments, teaching, and interoperability testing is appropriate; moving it directly into a long-running system contradicts the maintainers’ own stated positioning.

PQClean: a collection point for clean implementations

PQClean takes the other road. It offers no unified runtime interface; instead it collects, algorithm by algorithm, “clean implementations”: each implementation lives in its own directory, depends only on the C standard library, calls no operating-system-specific interfaces, follows a uniform code style, and comes with a complete test-vector checking workflow. Its acceptance bar is deliberately strict — code must be readable, free of extraneous dependencies, and pass its automated checks — which has made PQClean an upstream source for many other projects: when a project needs a portable implementation of some algorithm, it commonly vendors one wholesale from PQClean rather than carving it out of a submission package.

For researchers, PQClean’s best uses are reading and porting. If you want to understand an algorithm’s reference flow, its clean implementations are far more readable than the optimized code in submission packages; if you want to port an algorithm to an embedded platform or another language, its zero-dependency character keeps the work manageable. The cost is performance: clean implementations do not chase speed, so benchmark results should not be compared directly against heavily optimized implementations without saying so.

How to verify algorithm coverage in both libraries

An aggregate library’s algorithm list is not static. Algorithms being standardized, broken, or dropped all change the list: a scheme included in an early phase of the NIST process may be marked disabled or removed outright in a later version, and conversely, once a standard is final, the library switches its implementation from the submission specification to the final FIPS text, subtly changing function behavior. Writing “we used algorithm X from liboqs” in a paper or report is therefore not enough; you must also give the library’s version (release tag or commit hash) and the specification version the algorithm aligns with.

The verification method is direct: read the repository’s release notes and algorithm inventory documentation, which usually list, item by item, each algorithm’s implementation source (which submission package, which upstream repository) and specification version; then run the library’s own test programs against official test vectors to confirm the behavior matches the target specification. Doing this step first when reproducing experiments across versions saves a great deal of pointless debugging.

Building and platform support in practice

Both projects are organized around CMake or a similar cross-platform build, yet first-time users still hit a few shared pitfalls. First, the optimized-implementation switches: for portability, a default build may enable only the portable implementations, so honest performance numbers require explicitly turning on the optimizations for your processor and confirming the optimized path is actually loaded at runtime — otherwise the numbers come out absurdly slow and wholly unrepresentative. Second, algorithm trimming: both projects let you enable only the algorithms you need at build time, so record your build options when reproducing experiments, because “the same version number” does not denote the same set of behaviors under different algorithm switches. Third, platform differences: some optimized implementations depend on specific instruction-set extensions that may be unavailable in older virtual machines or continuous-integration environments; build scripts usually detect this and fall back to portable code, and reports should state which path actually ran.

PQClean’s build is simpler still — each algorithm directory carries its own test program, which checks against the bundled test vectors right after compilation, with no external dependencies anywhere in the flow. This “answers included” design makes it especially suitable for teaching environments and CI pipelines: students or reproducers need not trust any external benchmark first; passing the tests proves the implementation behaves correctly.

Which one should you use: a decision list

Compress the choice into a few sentences: if your goal is comparing many algorithms side by side, prototyping a protocol quickly, or running interoperability experiments, use liboqs; if you want to study a clean implementation of one algorithm, port it to a constrained platform, or need zero-dependency code you can vendor wholesale into your own project, use PQClean; if you need implementations aligned byte-for-byte with the FIPS standards and maintained for the long term, go further and check each algorithm team’s post-standardization repositories and validated implementation lists (see the other guides in this section). Neither aggregate library promises anything beyond a stability contract, and research plans should budget for the adaptation work that version upgrades bring.

Licensing and citation

The liboqs main library uses a permissive open-source license, but individual algorithm implementations it aggregates may carry their own license terms, documented directory by directory in the repository — check them one by one before commercial use or redistribution. Licensing for implementations in PQClean likewise follows the files in each directory. When citing either project, the proper practice is to give the project name, version number, and access date, and to note the implementation source of the algorithm you used; this is both academic courtesy and the key to whether a reproducer can find the very same code.

Tags: liboqsPQCleanopen source librariesalgorithm implementations