← Back to section · Research Resources
Protocol Stack Integration Code: Where the Post-Quantum Entry Points in TLS, SSH, and IPsec Live
Algorithm libraries are only the raw material; protocol stacks are where PQC actually lands. This guide maps where post-quantum code sits in mainstream implementations such as OpenSSL, BoringSSL, OpenSSH, and strongSwan, and how their maturity differs.
From algorithm library to protocol stack: what lies between
Aggregate libraries provide only algorithmic primitives: encapsulate this data, verify that signature. Real-world encrypted communication runs over protocols — TLS, SSH, IPsec — and protocols must decide when algorithms are negotiated, how much larger public keys and ciphertexts fit into existing message formats, and how to fall back when things fail. So a researcher who wants to reproduce a deployment fact such as “browsers already use post-quantum key exchange” will find the relevant code not in algorithm libraries but in protocol stack repositories. This category of code resources shares a trait: the algorithm is only a small part of it; far more space goes to negotiation logic, message encoding and decoding, and compatibility handling.
Three forms of integration
Mainstream protocol stacks adopt PQC in three ways. The first is native, built-in support: the protocol stack project takes the algorithm implementations into its own tree and ships them with main releases — OpenSSH building hybrid key exchange into its releases, and OpenSSL directly incorporating implementations of standardized algorithms such as ML-KEM and ML-DSA in its newer mainline versions, are typical examples. Native support has unified versioning and rides along with the mainline’s security updates; the cost is that the algorithm lineup is the project’s choice, and experimental algorithms usually do not get in.
The second is plug-in integration: the protocol stack offers a provider or module interface, and a third-party project packages algorithms as dynamically loadable modules. The most typical example is the provider the Open Quantum Safe project maintains for OpenSSL, which connects liboqs’s algorithm lineup to OpenSSL’s standard interfaces, so that upper-layer software such as Nginx and curl can use it without code changes. This form is the most flexible and is the workhorse of interoperability experiments and early deployment, but it adds a version-matching relationship: the provider, the aggregate library, and the protocol stack must all be aligned at once.
The third form is a stack that handles only negotiation and the message layer itself, linking algorithms from an external library — common in embedded-oriented implementations (of the wolfSSL and mbed TLS kind), which provide PQC interfaces and partial implementations whose coverage evolves quickly between versions; consult their release notes as the authority when using them.
TLS: the code entry point for hybrid key exchange
TLS is the fastest-deploying post-quantum protocol and the one researchers meet most often. In modern TLS implementations, key exchange appears as “groups” in the extensions of the ClientHello, and a hybrid group combines a classical elliptic curve with ML-KEM into a single named group; browser and large-server deployment happened precisely by adding such groups. At the code level, this means anyone reproducing the experiment should look in three places: the group registry (names and code points), the handshake state machine branches that handle the group, and the message-layer code that fragments and reassembles the enlarged key shares. Reading only the algorithm implementation and skipping these three places cannot reproduce real interoperability behavior.
BoringSSL also deserves note: as Chromium’s TLS library, it experimented with post-quantum key exchange in real traffic relatively early, and its repository and experiment records are primary material for studying deployment history — but it serves Google’s own product line, its interface stability commitments differ from a general-purpose library’s, and that should be kept in mind when citing its code for experiments.
SSH and IPsec: two lines catching up
OpenSSH’s route is to make hybrid key exchange part of the default configuration: its releases adopted a hybrid of NTRU Prime and X25519 as the default key exchange, and later added a hybrid of ML-KEM with X25519. In its release notes and key-exchange source code, researchers can see the engineering trade-off — hybrid first, and on by default — which closely matches the path of the TLS world.
On the IPsec side, strongSwan is representative: it supports post-quantum key exchange and signatures through its plugin mechanism, work that echoes the IETF’s standardization of multiple key exchanges for IKEv2. Code maturity on this line trails TLS, most deployments are still at the evaluation stage, and when consulting the code you should go by the support status stated in the project’s official documentation rather than treating an experimental branch as released capability.
How to locate post-quantum code inside a repository
Protocol stack repositories are usually large, and blind searching is inefficient; a few entry points speed up localization considerably. First, changelogs and release notes: post-quantum features are almost always highlighted there, giving you the introducing version and the feature’s scope directly. Second, the group and algorithm registry files in the source tree: TLS implementations define all supported key-exchange groups in one central place, where hybrid group additions and code point assignments are visible at a glance. Third, the test-case directories: interoperability and regression tests often include handshake cases for post-quantum groups, which serve both as behavioral specifications and as ready-made reproduction scaffolding. Fourth, build options: many implementations gate post-quantum features behind compile-time switches, and the build documentation states the switch names and their defaults — which directly decides whether the situation is “code present but off by default” or “on by default”.
Also mind the detail of draft numbers. IETF post-quantum mechanisms mostly evolve as Internet-Drafts, and different versions of a protocol stack may implement different draft revisions of the same mechanism, with possibly incompatible wire formats. When two implementations “both support” a mechanism yet the handshake fails, the cause is, nine times out of ten, mismatched draft revisions. Confirming the draft revision in release notes and code comments is a required exercise for protocol-level reproduction, no less important than aligning algorithm parameter sets.
Notes on consulting and using this code
First, record the version triple: protocol stack version, integration module version, and algorithm specification version — all three belong in the experiment record, and none may be omitted. Second, distinguish “code exists” from “enabled by default”: many implementations keep PQC groups behind optional configuration, and code in the repository does not mean default traffic uses it. Third, note the knock-on changes that message sizes force: PQC makes keys and signatures larger, and the fragmentation, retransmission, and middlebox-compatibility logic protocol stacks changed in response often affects interoperability results more than the algorithm calls themselves — do not skip it when reading the code. Fourth, licenses follow each project; the protocol stack’s and the algorithm implementations’ licenses may differ, so check item by item before vendoring code wholesale.
Tags: TLSOpenSSLOpenSSHprotocol integration