<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc [
  <!ENTITY nbsp "&#160;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" category="info" submissionType="independent"
     docName="draft-saxena-pqclink-00" ipr="trust200902" tocInclude="true" sortRefs="true" symRefs="true">
<front>
<title abbrev="pqclink">pqclink: A Hybrid Post-Quantum Authenticated Key Exchange and Encapsulation for Layer 2 Link Encryptors</title>
<seriesInfo name="Internet-Draft" value="draft-saxena-pqclink-00"/>
<author fullname="Mohit Chandra Saxena" initials="M. C." surname="Saxena">
  <organization>Secure Systems Research Labs Pvt Ltd</organization>
  <address><postal><country>India</country></postal><email>m22aie240@alumni.iitj.ac.in</email></address>
</author>
<date year="2026" month="November" day="30"/>
<area>Security</area>
<keyword>post-quantum</keyword><keyword>ML-KEM</keyword><keyword>ML-DSA</keyword><keyword>link encryption</keyword><keyword>Ethernet</keyword><keyword>bulk encryptor</keyword>
<abstract>
<t>This document specifies pqclink, a protocol for protecting point-to-point Ethernet circuits against both classical and quantum-capable adversaries. pqclink is designed to be inserted next to an existing bulk link encryptor, or to replace one, on a transparent Layer 2 service. It needs no IP address on either port. Two devices authenticate each other with ML-DSA-87 against pinned public keys and establish keys with a hybrid of X25519 and ML-KEM-1024. Each session has forward secrecy, keys are confirmed explicitly, and the whole transcript, including the negotiated cipher, is bound into the keys. Ethernet frames are then carried in authenticated and encrypted pqclink frames with a dedicated EtherType. The data-plane cipher is negotiated in every handshake and can be changed on a running link without frame loss. The protocol fails closed: the protected port is held down whenever the link is not verified.</t>
</abstract>
</front>
<middle>
<section anchor="re-introduction"><name>Introduction</name>
<t>Many organisations protect inter-site Ethernet circuits with dedicated bulk encryptors placed between a router and a service provider's multiplexer. Two problems are common with such equipment:</t>
<ol><li><t>Symmetric keys are generated centrally, carried to each site and entered by hand. Key changes are rare and costly, and a key, once stolen, exposes all past and future traffic until it is replaced.</t></li><li><t>Key establishment, where any exists, relies on classical public-key cryptography. Traffic recorded today can be decrypted later once a cryptographically relevant quantum computer exists ("harvest now, decrypt later").</t></li></ol>
<t>pqclink addresses both problems without changing the network around the encryptor. It is a Layer 2 protocol between exactly two devices:</t>
<ul><li><t>It establishes fresh keys automatically, authenticated with ML-DSA-87 <xref target="FIPS204"/> and agreed with a hybrid of X25519 <xref target="RFC7748"/> and ML-KEM-1024 <xref target="FIPS203"/>. The session stays secure as long as either of the two key agreements holds.</t></li><li><t>It rekeys periodically with forward secrecy. No secret key material is ever entered by an operator.</t></li><li><t>It carries every Ethernet frame, including control-plane frames such as STP, LLDP and 802.1X, inside authenticated and encrypted pqclink frames with their own EtherType, in the way MACsec <xref target="IEEE802.1AE"/> uses 0x88E5. No IP, ARP or IPv6 traffic is exposed on the service provider circuit.</t></li><li><t>It makes the data cipher a negotiated, signed parameter, so a cipher can be replaced in the field without a protocol change.</t></li><li><t>It fails closed. The port facing the protected network is administratively down until the far device has been authenticated and traffic is flowing, and it goes down again within a bounded time when authenticated traffic stops.</t></li></ul>
<t>IKEv2 can already add post-quantum key exchanges <xref target="RFC9370"/>, but IPsec needs network-layer addresses and routing on the protected path, which the deployments targeted here cannot add.</t>
<t>The protocol is deliberately narrow. It has two peers, pinned identities, and a single fixed suite per link for key establishment, signature and hash. This keeps the state machine small enough to audit and to implement in constrained hardware.</t>
<section anchor="re-requirements-language"><name>Requirements Language</name>
<t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>
</section>
<section anchor="re-terminology"><name>Terminology</name>
<dl newline="true"><dt>Box</dt><dd><t>A device implementing pqclink. Each box has a <em>plain port</em>, facing the protected network (for example a router or a legacy encryptor), and a <em>line port</em>, facing the service provider circuit.</t></dd><dt>Initiator, Responder</dt><dd><t>The roles in a handshake. By default the box whose identity fingerprint is numerically lower is the Initiator (<xref target="roles"/>).</t></dd><dt>Session</dt><dd><t>A pair of directional AEAD keys with their counters and replay state, produced by one handshake.</t></dd><dt>Suite base</dt><dd><t>The KEM, signature and hash algorithms. These are fixed per link and configured identically on both boxes.</t></dd><dt>Cipher</dt><dd><t>The AEAD algorithm used for data frames. It is negotiated in each handshake.</t></dd><dt><tt>||</tt></dt><dd><t>Byte-string concatenation.</t></dd></dl>
<t>All multi-byte integers are unsigned and in network byte order (big-endian), except where a referenced algorithm specifies otherwise.</t>
</section>
</section>
<section anchor="re-architecture-overview"><name>Architecture Overview</name>
<figure><name>Placement of pqclink boxes</name><artwork type="ascii-art"><![CDATA[
 Site A                                         Site B
+--------+ +--------+ +-----+         +-----+ +--------+ +--------+
| Router |-| Legacy |-| Box |=========| Box |-| Legacy |-| Router |
+--------+ |  BEU   | |  A  |   SP    |  B  | |  BEU   | +--------+
           |(option)| +-----+ circuit +-----+ |(option)|
           +--------+                         +--------+
]]></artwork></figure>
<t>A box bridges frames between its plain port and its line port. Every frame received on the plain port is encrypted and sent on the line port as one pqclink frame, or as several pqclink frames if it is too large (<xref target="data-frag"/>). Every authenticated pqclink data frame received on the line port is decrypted and sent on the plain port. Nothing else crosses between the ports.</t>
<t>The line port normally needs no network-layer address. On a transparent Ethernet service (for example dark fibre, EoSDH, EoMPLS or VPLS), pqclink frames are sent between the two boxes' MAC addresses (<xref target="ethernet"/>). When the service provider offers only a routed service, the same pqclink packets are carried in UDP (<xref target="udp"/>).</t>
</section>
<section anchor="algorithms"><name>Algorithms and Identifiers</name>
<t>Each algorithm has a one-octet identifier. Identifiers appear in handshake messages and are covered by signatures, so a box always knows exactly which algorithms its peer used. An identifier <bcp14>MUST NOT</bcp14> be reassigned to a different algorithm.</t>
<section anchor="kem"><name>Key Encapsulation</name>
<table><name>KEM identifiers</name><thead><tr><th>Value</th><th>Name</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>x25519-mlkem1024</td><td>X25519 + ML-KEM-1024 hybrid (<xref target="hybrid"/>)</td></tr><tr><td>2</td><td>x25519-ssrl-mlkem1024</td><td>As value 1, provided by an independent implementation (see below)</td></tr></tbody></table>
<t>Values 1 and 2 are the same algorithm with identical encodings. The reference implementation uses value 2 to select its own FIPS 203 implementation and to make both boxes state which one they run. A future revision of this document may fold value 2 into value 1.</t>
</section>
<section anchor="re-signature"><name>Signature</name>
<table><name>Signature identifiers</name><thead><tr><th>Value</th><th>Name</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>mldsa87</td><td>ML-DSA-87 <xref target="FIPS204"/>, hedged signing, context string "pqclink v2"</td></tr><tr><td>2</td><td>ssrl-mldsa87</td><td>As value 1, provided by an independent implementation</td></tr></tbody></table>
<t>Values 1 and 2 are the same algorithm: the same 32-octet seed gives the same key pair, so key files are shared. As for the KEM, a box states which implementation it runs, and both boxes <bcp14>MUST</bcp14> use the same value.</t>
</section>
<section anchor="re-hash"><name>Hash</name>
<table><name>Hash identifiers</name><thead><tr><th>Value</th><th>Name</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>sha384</td><td>SHA-384 <xref target="RFC6234"/>, used for the transcript hash, HKDF <xref target="RFC5869"/> and HMAC <xref target="RFC2104"/></td></tr></tbody></table>
</section>
<section anchor="re-data-cipher"><name>Data Cipher</name>
<t>Every cipher is an AEAD algorithm in the sense of <xref target="RFC5116"/>, with a 32-octet key, a 12-octet nonce as seen by this protocol, and a 16-octet tag.</t>
<table><name>Cipher identifiers</name><thead><tr><th>Value</th><th>Name</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>aes256gcm</td><td>AES-256-GCM <xref target="SP800-38D"/></td></tr><tr><td>2</td><td>chacha20poly1305</td><td>ChaCha20-Poly1305 <xref target="RFC8439"/></td></tr><tr><td>3</td><td>aegis256</td><td>AEGIS-256 <xref target="RFC10032"/> with a 128-bit tag (<xref target="aegis-nonce"/>)</td></tr></tbody></table>
<section anchor="aegis-nonce"><name>AEGIS-256 Nonce</name>
<t>AEGIS-256 takes a 32-octet nonce. pqclink builds it from the 12-octet protocol nonce N as:</t>
<figure><artwork type="ascii-art"><![CDATA[
nonce32 = "pqclink/AEGIS-256/v1" || N
]]></artwork></figure>
<t>where the prefix is the 20 ASCII octets shown, without a terminator.</t>
</section>
</section>
<section anchor="hybrid"><name>The X25519 + ML-KEM-1024 Hybrid</name>
<t>The hybrid KEM provides three operations:</t>
<dl newline="true"><dt>Generate()</dt><dd><t>Make an X25519 key pair (xsk, xpk) and an ML-KEM-1024 key pair (dk, ek). The public key is <tt>xpk || ek</tt> (32 + 1568 = 1600 octets).</t></dd><dt>Encapsulate(pk)</dt><dd><t>Split pk into xpk_peer (32 octets) and ek (1568 octets). Reject ek if it fails the modulus check of <xref target="FIPS203"/>. Run ML-KEM.Encaps(ek) to get (ss_k, ct_k), make a fresh X25519 key pair (esk, epk), and compute ss_x = X25519(esk, xpk_peer). An all-zero ss_x <bcp14>MUST</bcp14> be rejected. The output is the shared secret <tt>ss_x || ss_k</tt> (64 octets) and the ciphertext <tt>epk || ct_k</tt> (32 + 1568 = 1600 octets).</t></dd><dt>Decapsulate(sk, ct)</dt><dd><t>Split ct, compute ss_x = X25519(xsk, epk), rejecting an all-zero result, and ss_k = ML-KEM.Decaps(dk, ct_k). The output is <tt>ss_x || ss_k</tt>.</t></dd></dl>
<t>The concatenated secret is never used directly. It is the input keying material to HKDF-Extract, salted with a hash of the complete transcript, which contains both public keys and both ciphertexts (<xref target="key-schedule"/>).</t>
</section>
</section>
<section anchor="formats"><name>Packet Formats</name>

<section anchor="re-common-header"><name>Common Header</name>
<t>Every pqclink packet begins with two octets:</t>
<figure><artwork type="ascii-art"><![CDATA[
 0       1
+-------+-------+
|  ver  | type  |
+-------+-------+
]]></artwork></figure>
<dl newline="true"><dt>ver</dt><dd><t>Protocol version. This document specifies version 2.</t></dd><dt>type</dt><dd><t>4 = data packet (<xref target="data"/>), 5 = handshake fragment (<xref target="hs-frag"/>). A receiver <bcp14>MUST</bcp14> silently discard packets with any other version or type.</t></dd></dl>
</section>
<section anchor="ethernet"><name>Ethernet Encapsulation</name>
<table><name>pqclink over Ethernet</name><thead><tr><th>Field</th><th>Size (octets)</th></tr></thead><tbody><tr><td>Destination MAC address</td><td>6</td></tr><tr><td>Source MAC address</td><td>6</td></tr><tr><td>802.1Q tag (optional)</td><td>4</td></tr><tr><td>EtherType</td><td>2</td></tr><tr><td>length</td><td>2</td></tr><tr><td>pqclink packet</td><td>variable</td></tr><tr><td>padding (to the Ethernet minimum frame size)</td><td>0 or more</td></tr></tbody></table>
<dl newline="true"><dt>EtherType</dt><dd><t>The value is configurable. The default is 0x88B5 (IEEE 802 Local Experimental EtherType 1 <xref target="IEEE802"/>), pending the assignment requested in <xref target="iana"/>.</t></dd><dt>length</dt><dd><t>Length in octets of the pqclink packet. The receiver uses it to remove Ethernet padding.</t></dd></dl>
<t>The destination MAC address <bcp14>MAY</bcp14> be configured. Otherwise a box sends handshake frames to the broadcast address and <em>learns</em> the peer's MAC address from a handshake message whose signature has verified. An optional 802.1Q tag allows the line port to use one VLAN of a trunk. The <em>line MTU</em> is the largest pqclink packet plus the length field that the circuit carries.</t>
</section>
<section anchor="hs-frag"><name>Handshake Fragments</name>
<t>Handshake messages are about 6.3 kilooctets and are always fragmented:</t>
<figure><name>Handshake fragment</name><artwork type="ascii-art"><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    ver = 2    |   type = 5    |    msgtype    |      idx      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      cnt      |       0       |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+          message id           +
|                               |             total             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                   chunk (at most 1200 octets)                 ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork></figure>
<dl newline="true"><dt>msgtype</dt><dd><t>1 = Init, 2 = Resp, 3 = Confirm.</t></dd><dt>idx, cnt</dt><dd><t>Fragment index (from 0) and fragment count. 1 &lt;= cnt &lt;= 255, idx &lt; cnt.</t></dd><dt>message id</dt><dd><t>4 octets, random per message; it groups the fragments.</t></dd><dt>total</dt><dd><t>2 octets, the total message length, at most 16384 octets.</t></dd><dt>chunk</dt><dd><t>At most 1200 octets of the message.</t></dd></dl>
<t>Reassembly holds unauthenticated data. A receiver <bcp14>MUST</bcp14> bound it: the reference implementation keeps at most 4 partial messages per source, each discarded 3 seconds after its first fragment. A completed message is authenticated as a whole by its signature or MAC (<xref target="handshake"/>).</t>
</section>
<section anchor="data"><name>Data Packets</name>
<figure><name>Data packet</name><artwork type="ascii-art"><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    ver = 2    |   type = 4    |     flags     |       0       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        receiver index                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                       counter (64 bits)                       +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                          ciphertext                           ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                        tag (16 octets)                        |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork></figure>
<dl newline="true"><dt>flags</dt><dd><t>0x01 KEEPALIVE: empty payload, proves liveness. 0x02 FRAGMENT: the payload starts with a fragment header (<xref target="data-frag"/>). 0x04 CONTROL: the payload is a list of control messages (<xref target="control"/>). Other bits <bcp14>MUST</bcp14> be sent as zero and ignored on receipt.</t></dd><dt>receiver index</dt><dd><t>The index the receiving box chose for this session in the handshake. It selects the session (current, previous, or newly established).</t></dd><dt>counter</dt><dd><t>The sender's per-session packet counter, starting at 0 and increasing by one for every packet.</t></dd></dl>
<t>The 16-octet header is the AEAD associated data. The 12-octet nonce is <tt>0x00000000 || counter</tt>. The plaintext is the Ethernet frame (destination MAC to the end of the payload, without FCS), the fragment, the control list, or nothing for a keepalive. The overhead on the line is therefore 34 octets: the 16-octet header, the 16-octet tag and the 2-octet length field, plus the Ethernet header of the line frame.</t>
</section>
</section>
<section anchor="handshake"><name>Handshake</name>

<section anchor="roles"><name>Roles</name>
<t>Each box has a long-term ML-DSA-87 key pair and the pinned public key of exactly one peer. The fingerprint of a public key is the first 16 octets of SHA-384 over its encoding. Unless configured otherwise, the box with the lower fingerprint (compared as unsigned big-endian integers) is the Initiator. A box that receives a valid Init while it is itself configured as Initiator <bcp14>MUST NOT</bcp14> respond and <bcp14>SHOULD</bcp14> report a role conflict.</t>
</section>
<section anchor="re-messages"><name>Messages</name>
<figure><name>Handshake flow</name><artwork type="ascii-art"><![CDATA[
Initiator                                             Responder
Init: base ids, cipher offer, index_i, ts, nonce_i,
      fp_i, hybrid public key, SIG_i       -------->
                                         verify SIG_i (pinned key)
                                         check ts > last accepted ts
                                         choose cipher, encapsulate
             <--------  Resp: base ids, chosen cipher, index_r,
                              index_i, nonce_r, fp_r, hybrid
                              ciphertext, SIG_r over Init || Resp
verify SIG_r, decapsulate, derive keys
Confirm: index_r, HMAC(k_confirm, TH) -------->
                                         verify, session is live
]]></artwork></figure>
<section anchor="re-init"><name>Init</name>
<table><name>Init</name><thead><tr><th>Field</th><th>Size (octets)</th></tr></thead><tbody><tr><td>msgtype = 1</td><td>1</td></tr><tr><td>ver = 2</td><td>1</td></tr><tr><td>KEM id, signature id, hash id</td><td>3</td></tr><tr><td>n = number of ciphers offered (1..8)</td><td>1</td></tr><tr><td>cipher ids, most preferred first</td><td>n</td></tr><tr><td>index_i</td><td>4</td></tr><tr><td>ts</td><td>8</td></tr><tr><td>nonce_i</td><td>32</td></tr><tr><td>fp_i (fingerprint of the Initiator's public key)</td><td>16</td></tr><tr><td>hybrid public key</td><td>1600</td></tr><tr><td>SIG_i</td><td>4627</td></tr></tbody></table>
<t>SIG_i is ML-DSA-87.Sign(sk_i, "pqclink v2 init" || Init', ctx = "pqclink v2"), where Init' is the message up to and excluding SIG_i, and the label is the 15 ASCII octets shown. ts is a 64-bit value that <bcp14>MUST</bcp14> be greater than every ts the Initiator has sent before to this peer. The reference implementation uses the wall-clock time in nanoseconds and persists a reserved upper bound, so a box without a real-time clock never reuses a value after a reboot.</t>
</section>
<section anchor="re-resp"><name>Resp</name>
<table><name>Resp</name><thead><tr><th>Field</th><th>Size (octets)</th></tr></thead><tbody><tr><td>msgtype = 2</td><td>1</td></tr><tr><td>ver = 2</td><td>1</td></tr><tr><td>KEM id, signature id, hash id</td><td>3</td></tr><tr><td>chosen cipher id</td><td>1</td></tr><tr><td>index_r</td><td>4</td></tr><tr><td>index_i (echoed)</td><td>4</td></tr><tr><td>nonce_r</td><td>32</td></tr><tr><td>fp_r</td><td>16</td></tr><tr><td>hybrid ciphertext</td><td>1600</td></tr><tr><td>SIG_r</td><td>4627</td></tr></tbody></table>
<t>SIG_r is ML-DSA-87.Sign(sk_r, "pqclink v2 resp" || Init || Resp', ctx = "pqclink v2"), where Init is the complete Init message and Resp' is the Resp up to and excluding SIG_r.</t>
</section>
<section anchor="re-confirm"><name>Confirm</name>
<table><name>Confirm</name><thead><tr><th>Field</th><th>Size (octets)</th></tr></thead><tbody><tr><td>msgtype = 3</td><td>1</td></tr><tr><td>ver = 2</td><td>1</td></tr><tr><td>index_r</td><td>4</td></tr><tr><td>HMAC-SHA-384(k_confirm, "pqclink v2 confirm" || TH)</td><td>48</td></tr></tbody></table>
</section>
</section>
<section anchor="re-processing-rules"><name>Processing Rules</name>
<t>The Responder, on receiving Init:</t>
<ol><li><t><bcp14>MUST</bcp14> discard it unless ver = 2, the base identifiers equal its own, the offer count is 1 to 8 and the length is exact. If the base identifiers differ, it <bcp14>SHOULD</bcp14> report a suite mismatch.</t></li><li><t><bcp14>MUST</bcp14> compare fp_i with the pinned peer fingerprint in constant time and discard the message on mismatch.</t></li><li><t><bcp14>MUST</bcp14> verify SIG_i with the pinned peer key.</t></li><li><t><bcp14>MUST</bcp14> discard the message unless ts is greater than the largest ts of any Init that led to a confirmed session with this peer.</t></li><li><t><bcp14>MUST</bcp14> choose the first cipher in the offer that its own configuration allows. The Initiator's order decides and the Responder only filters. If there is none, it discards the message and reports it.</t></li><li><t>Encapsulates to the hybrid public key, builds and signs Resp, derives the session (<xref target="key-schedule"/>) and sends Resp. It <bcp14>MUST NOT</bcp14> send data under the new session until the session is <em>confirmed</em>: either a Confirm verifies, or a data packet under the new session authenticates. Only then is the session installed and ts recorded.</t></li></ol>
<t>The Initiator, on receiving Resp for its outstanding Init:</t>
<ol><li><t><bcp14>MUST</bcp14> check ver, base identifiers, exact length, that the chosen cipher is one it allows, that index_i matches, and fp_r against the pinned peer fingerprint.</t></li><li><t><bcp14>MUST</bcp14> verify SIG_r over Init || Resp'. This binds the Responder's choices to the exact Init, including the cipher offer, so a downgrade of the offer is detected.</t></li><li><t>Decapsulates, derives the session, sends Confirm, installs the session and erases the ephemeral private keys.</t></li></ol>
<t>An Initiator retransmits Init (with a new ts, index and ephemeral key pair) if no valid Resp arrives within a retry interval (2 seconds in the reference implementation).</t>
</section>
<section anchor="key-schedule"><name>Key Schedule</name>
<figure><artwork type="ascii-art"><![CDATA[
TH        = SHA-384(Init || Resp)
PRK       = HKDF-Extract(salt = TH, IKM = ss_x || ss_k)
k_i2r     = HKDF-Expand(PRK, "pqclink v2 initiator to responder", 32)
k_r2i     = HKDF-Expand(PRK, "pqclink v2 responder to initiator", 32)
k_confirm = HKDF-Expand(PRK, "pqclink v2 confirm", 48)
]]></artwork></figure>
<t>HKDF uses SHA-384. Labels are ASCII without a terminator. The Initiator sends with k_i2r and receives with k_r2i; the Responder does the reverse. The shared secret and PRK <bcp14>MUST</bcp14> be erased once the keys are derived.</t>
</section>
</section>
<section anchor="re-data-transfer"><name>Data Transfer</name>

<section anchor="re-sending-and-receiving"><name>Sending and Receiving</name>
<t>A sender increments the session counter for every packet and <bcp14>MUST</bcp14> stop using a session before the counter reaches 2^60. A receiver:</t>
<ol><li><t>Finds the session by receiver index: the current session, the previous session during its grace period (<xref target="rekey"/>), or a Responder session waiting for confirmation.</t></li><li><t>Discards the packet if the counter is outside a sliding replay window (4096 packets in the reference implementation) or already marked as seen.</t></li><li><t>Opens the AEAD with the header as associated data. On failure it discards the packet and counts an authentication failure. It <bcp14>MUST NOT</bcp14> release any part of an unauthenticated plaintext.</t></li><li><t>Marks the counter as seen. Only then does it act on the packet.</t></li></ol>
</section>
<section anchor="data-frag"><name>Fragmentation of Data Frames</name>
<t>A plain frame that does not fit the line MTU after encapsulation is split <em>before</em> encryption. Each piece is sent as its own data packet with the FRAGMENT flag, and its payload starts with:</t>
<figure><artwork type="ascii-art"><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      idx      |      cnt      |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+          fragment id          +
|                               |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
~                             piece                             ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork></figure>
<t>Because each piece is authenticated, a receiver only ever holds authenticated data for reassembly. Reassembly <bcp14>MUST</bcp14> be bounded. The reference implementation allows at most 4 pieces per frame and 32 frames in progress, and drops a frame 250 milliseconds after its first piece.</t>
</section>
<section anchor="control"><name>Control Messages</name>
<t>A data packet with the CONTROL flag carries a list of type-length-value entries (type: 1 octet, length: 1 octet, value):</t>
<table><name>Control messages</name><thead><tr><th>Type</th><th>Length</th><th>Meaning</th></tr></thead><tbody><tr><td>1</td><td>0</td><td>Rekey request. Sent by the Responder to ask the Initiator to start a handshake.</td></tr><tr><td>2</td><td>1</td><td>Set cipher. The value is a cipher identifier the sender now prefers.</td></tr></tbody></table>
<t>Unknown types <bcp14>MUST</bcp14> be skipped. Control messages are authenticated like all data, so only the genuine peer can send them.</t>
</section>
</section>
<section anchor="rekey"><name>Rekeying and Cipher Agility</name>
<t>The Initiator starts a new handshake when any of these holds: there is no session; no authenticated packet has arrived for the dead interval; the session is older than the rekey interval (120 seconds by default); the session has sent 2^40 packets; or a rekey was requested. Every handshake uses fresh ephemeral keys, so compromising a later session or a long-term signing key does not expose earlier sessions.</t>
<t>When a session is installed, the old one becomes the <em>previous</em> session and stays usable for receiving during a grace period (30 seconds in the reference implementation). Packets in flight under the old keys are therefore still accepted, and a rekey causes no loss.</t>
<t>To change the cipher on a running link, an operator puts the new cipher first in the preference list of either box. That box sends a Set-cipher control message, and the peer moves the same cipher to the front of its own list if, and only if, its configuration allows it. A rekey follows. The next Init offers the new order, and the change takes effect under the new session without frame loss. Because the offer and the choice are both signed, an attacker can neither force a cipher that both boxes do not allow nor suppress one silently.</t>
</section>
<section anchor="fail-closed"><name>Liveness and Fail-Closed Operation</name>
<t>Each box sends a KEEPALIVE packet whenever it has sent nothing for the keepalive interval (1 second by default). A box considers the link <em>protected</em> only while it holds a confirmed session and has received an authenticated packet within the dead interval (3 seconds by default).</t>
<t>While the link is not protected, a box <bcp14>MUST</bcp14> keep its plain port administratively down. The device on the plain side then sees no carrier. This makes the failure visible to it, and no frame can be forwarded unprotected. A box <bcp14>MUST</bcp14> also take the plain port down when its pqclink process stops for any reason. The reference implementation does this from the service manager's stop hook. On an Ethernet line, a box <bcp14>SHOULD</bcp14> refuse to start if the line port has a network-layer address, and <bcp14>SHOULD</bcp14> disable IPv6 on both ports, so the host itself never emits traffic on the circuit.</t>
</section>
<section anchor="udp"><name>UDP Transport</name>
<t>When the service provider circuit is routed, pqclink packets are carried unchanged as the payload of UDP datagrams between configured addresses and ports. The length field of <xref target="ethernet"/> is not used. Everything else in this document applies unchanged.</t>
</section>
<section anchor="re-security-considerations"><name>Security Considerations</name>
<dl newline="true"><dt>Threat model</dt><dd><t>The adversary controls the service provider circuit. It can read, record, drop, delay, reorder, replay, modify and inject frames, and it may in the future have a cryptographically relevant quantum computer. It does not control either box.</t></dd><dt>Confidentiality and integrity</dt><dd><t>Every frame from the plain port is protected with an AEAD under keys that only the two boxes can derive. The header is associated data, so the index, counter and flags cannot be changed. The counter, the replay window and per-direction keys prevent replay and reflection.</t></dd><dt>Hybrid key establishment</dt><dd><t>The session keys stay secret as long as either X25519 or ML-KEM-1024 is secure, because both secrets enter HKDF-Extract, salted with a transcript hash that contains both public keys and both ciphertexts. This follows the usual concatenation-based hybrid design.</t></dd><dt>Authentication and pinning</dt><dd><t>Each box accepts exactly one peer key, configured out of band as public data only. No secret is ever entered by hand. ML-DSA-87 signatures cover every handshake field, and the Responder's signature covers the Initiator's message as well. Labels and the ML-DSA context string separate pqclink signatures from any other use of the keys.</t></dd><dt>Key confirmation</dt><dd><t>The Responder installs a session only after Confirm (or an authenticated data packet) proves that the Initiator derived the same keys.</t></dd><dt>Replay of Init</dt><dd><t>An old Init is refused once the Responder has recorded a larger ts. If a Responder loses that state, a replayed Init costs it one signature check, one encapsulation and one signature. No session results, because the attacker cannot decapsulate or produce Confirm.</t></dd><dt>Downgrade</dt><dd><t>The suite base is fixed per link, and the cipher offer and choice are signed. An attacker can remove a cipher from neither side's view.</t></dd><dt>Denial of service</dt><dd><t>An attacker on the circuit can always deny service by dropping frames. Unauthenticated work is bounded: fragment reassembly is limited, and a cheap fingerprint check precedes signature verification. An attacker who replays a genuine Init can still make a Responder perform signature and encapsulation work; implementations <bcp14>SHOULD</bcp14> rate-limit Init processing. Fail-closed operation turns denial of service into a visible link-down event instead of a silent fallback to clear text.</t></dd><dt>Traffic analysis</dt><dd><t>Frame sizes and timing are visible. pqclink does not pad frames. Deployments that need traffic-flow confidentiality <bcp14>SHOULD</bcp14> keep the legacy encryptor, if it provides that, or add padding and constant-rate traffic.</t></dd><dt>Implementation</dt><dd><t>Implementations <bcp14>MUST</bcp14> perform all operations on secret data in constant time. That includes AEAD tag checks, fingerprint comparison, ML-KEM decapsulation with implicit rejection, and the re-encryption check. Implementations <bcp14>MUST</bcp14> erase ephemeral secrets after use.</t></dd></dl>
</section>
<section anchor="iana"><name>IANA Considerations</name>
<t>This document has no IANA actions. A request will be made to the IEEE Registration Authority for an EtherType for pqclink. Until one is assigned, deployments use a Local Experimental EtherType.</t>
<t>If this specification progresses, registries for the KEM, signature, hash and cipher identifiers of <xref target="algorithms"/> would be created, with a Specification Required policy.</t>
</section>

</middle>
<back>
<references><name>References</name>
<references><name>Normative References</name>
<reference anchor="RFC2104" target="https://www.rfc-editor.org/info/rfc2104"><front><title>HMAC: Keyed-Hashing for Message Authentication</title><author initials="H." surname="Krawczyk" fullname="H. Krawczyk"/><author initials="M." surname="Bellare" fullname="M. Bellare"/><author initials="R." surname="Canetti" fullname="R. Canetti"/><date month="February" year="1997"/></front><seriesInfo name="RFC" value="2104"/><seriesInfo name="DOI" value="10.17487/RFC2104"/></reference>
<reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119"><front><title>Key words for use in RFCs to Indicate Requirement Levels</title><author initials="S." surname="Bradner" fullname="S. Bradner"/><date month="March" year="1997"/></front><seriesInfo name="BCP" value="14"/><seriesInfo name="RFC" value="2119"/><seriesInfo name="DOI" value="10.17487/RFC2119"/></reference>
<reference anchor="RFC5116" target="https://www.rfc-editor.org/info/rfc5116"><front><title>An Interface and Algorithms for Authenticated Encryption</title><author initials="D." surname="McGrew" fullname="D. McGrew"/><date month="January" year="2008"/></front><seriesInfo name="RFC" value="5116"/><seriesInfo name="DOI" value="10.17487/RFC5116"/></reference>
<reference anchor="RFC5869" target="https://www.rfc-editor.org/info/rfc5869"><front><title>HMAC-based Extract-and-Expand Key Derivation Function (HKDF)</title><author initials="H." surname="Krawczyk" fullname="H. Krawczyk"/><author initials="P." surname="Eronen" fullname="P. Eronen"/><date month="May" year="2010"/></front><seriesInfo name="RFC" value="5869"/><seriesInfo name="DOI" value="10.17487/RFC5869"/></reference>
<reference anchor="RFC6234" target="https://www.rfc-editor.org/info/rfc6234"><front><title>US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)</title><author initials="D." surname="Eastlake 3rd" fullname="D. Eastlake 3rd"/><author initials="T." surname="Hansen" fullname="T. Hansen"/><date month="May" year="2011"/></front><seriesInfo name="RFC" value="6234"/><seriesInfo name="DOI" value="10.17487/RFC6234"/></reference>
<reference anchor="RFC7748" target="https://www.rfc-editor.org/info/rfc7748"><front><title>Elliptic Curves for Security</title><author initials="A." surname="Langley" fullname="A. Langley"/><author initials="M." surname="Hamburg" fullname="M. Hamburg"/><author initials="S." surname="Turner" fullname="S. Turner"/><date month="January" year="2016"/></front><seriesInfo name="RFC" value="7748"/><seriesInfo name="DOI" value="10.17487/RFC7748"/></reference>
<reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174"><front><title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title><author initials="B." surname="Leiba" fullname="B. Leiba"/><date month="May" year="2017"/></front><seriesInfo name="BCP" value="14"/><seriesInfo name="RFC" value="8174"/><seriesInfo name="DOI" value="10.17487/RFC8174"/></reference>
<reference anchor="RFC8439" target="https://www.rfc-editor.org/info/rfc8439"><front><title>ChaCha20 and Poly1305 for IETF Protocols</title><author initials="Y." surname="Nir" fullname="Y. Nir"/><author initials="A." surname="Langley" fullname="A. Langley"/><date month="June" year="2018"/></front><seriesInfo name="RFC" value="8439"/><seriesInfo name="DOI" value="10.17487/RFC8439"/></reference>
<reference anchor="RFC10032" target="https://www.rfc-editor.org/info/rfc10032"><front><title>The AEGIS Family of Authenticated Encryption Algorithms</title><author initials="F." surname="Denis" fullname="F. Denis"/><author initials="S." surname="Lucas" fullname="S. Lucas"/><date month="September" year="2026"/></front><seriesInfo name="RFC" value="10032"/><seriesInfo name="DOI" value="10.17487/RFC10032"/></reference>
<reference anchor="FIPS203" target="https://doi.org/10.6028/NIST.FIPS.203"><front><title>Module-Lattice-Based Key-Encapsulation Mechanism Standard</title><author><organization>National Institute of Standards and Technology</organization></author><date month="August" year="2024"/></front><seriesInfo name="FIPS" value="203"/><seriesInfo name="DOI" value="10.6028/NIST.FIPS.203"/></reference>
<reference anchor="FIPS204" target="https://doi.org/10.6028/NIST.FIPS.204"><front><title>Module-Lattice-Based Digital Signature Standard</title><author><organization>National Institute of Standards and Technology</organization></author><date month="August" year="2024"/></front><seriesInfo name="FIPS" value="204"/><seriesInfo name="DOI" value="10.6028/NIST.FIPS.204"/></reference>
<reference anchor="SP800-38D" target="https://doi.org/10.6028/NIST.SP.800-38D"><front><title>Recommendation for Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC</title><author><organization>National Institute of Standards and Technology</organization></author><date month="November" year="2007"/></front><seriesInfo name="NIST SP" value="800-38D"/><seriesInfo name="DOI" value="10.6028/NIST.SP.800-38D"/></reference>
</references>
<references><name>Informative References</name>
<reference anchor="RFC7942" target="https://www.rfc-editor.org/info/rfc7942"><front><title>Improving Awareness of Running Code: The Implementation Status Section</title><author initials="Y." surname="Sheffer" fullname="Y. Sheffer"/><author initials="A." surname="Farrel" fullname="A. Farrel"/><date month="July" year="2016"/></front><seriesInfo name="BCP" value="205"/><seriesInfo name="RFC" value="7942"/><seriesInfo name="DOI" value="10.17487/RFC7942"/></reference>
<reference anchor="RFC9370" target="https://www.rfc-editor.org/info/rfc9370"><front><title>Multiple Key Exchanges in the Internet Key Exchange Protocol Version 2 (IKEv2)</title><author initials="CJ." surname="Tjhai" fullname="CJ. Tjhai"/><author initials="M." surname="Tomlinson" fullname="M. Tomlinson"/><author initials="G." surname="Bartlett" fullname="G. Bartlett"/><author initials="S." surname="Fluhrer" fullname="S. Fluhrer"/><author initials="D." surname="Van Geest" fullname="D. Van Geest"/><author initials="O." surname="Garcia-Morchon" fullname="O. Garcia-Morchon"/><author initials="V." surname="Smyslov" fullname="V. Smyslov"/><date month="May" year="2023"/></front><seriesInfo name="RFC" value="9370"/><seriesInfo name="DOI" value="10.17487/RFC9370"/></reference>
<reference anchor="IEEE802.1AE"><front><title>IEEE Standard for Local and Metropolitan Area Networks--Media Access Control (MAC) Security</title><author><organization>IEEE</organization></author><date/></front><seriesInfo name="IEEE" value="802.1AE"/></reference>
<reference anchor="IEEE802"><front><title>IEEE Standard for Local and Metropolitan Area Networks: Overview and Architecture</title><author><organization>IEEE</organization></author><date/></front><seriesInfo name="IEEE" value="802"/></reference>
</references>
</references>
<section anchor="re-message-sizes"><name>Message Sizes</name>
<table><name>Handshake message sizes for suite base (1, 1, 1)</name><thead><tr><th>Message</th><th>Size (octets)</th><th>Fragments at 1200 octets</th></tr></thead><tbody><tr><td>Init (3 ciphers offered)</td><td>6296</td><td>6</td></tr><tr><td>Resp</td><td>6289</td><td>6</td></tr><tr><td>Confirm</td><td>54</td><td>1</td></tr></tbody></table>
</section>
<section anchor="re-implementation-status"><name>Implementation Status</name>
<t>This section records the status of known implementations of this specification at the time of writing, as described in <xref target="RFC7942"/>.</t>
<t>The reference implementation is pqclink 2.3.0 by Secure Systems Research Labs Pvt Ltd, written in Go for Linux (x86-64 and AArch64). It includes:</t>
<ul><li><t>its own AEGIS-256 implementation with AES-NI and ARMv8 assembly, checked against all <xref target="RFC10032"/> test vectors;</t></li><li><t>SSRL-ML-KEM, its own ML-KEM-1024 implementation (KEM value 2), checked against all ML-KEM-1024 test vectors from the NIST ACVP server, and interoperable with the Go standard library implementation (KEM value 1);</t></li><li><t>SSRL-ML-DSA, its own ML-DSA-87 implementation (signature value 2), checked against the NIST ACVP ML-DSA-87 key generation, signature generation and signature verification vectors, and interoperable with Cloudflare CIRCL (signature value 1).</t></li></ul>
<t>A single configuration setting selects the standard or the SSRL implementations of both algorithms.</t>
<t>An end-to-end test bench in Linux network namespaces exercises 40 checks. These include the following:</t>
<ul><li><t>no address on any port;</t></li><li><t>fail-closed start, stop and recovery;</t></li><li><t>delivery of STP, LLDP, 802.1X, VLAN and Q-in-Q frames byte for byte;</t></li><li><t>analysis of a passive tap: no clear frames, ciphertext entropy and no repeated counters;</t></li><li><t>live cipher changes with zero loss;</t></li><li><t>rekeys under load;</t></li><li><t>replay, tamper and impostor attacks;</t></li><li><t>a 1500-octet circuit MTU with fragmentation;</t></li><li><t>the UDP transport.</t></li></ul>
</section>

</back>
</rfc>
