Freestanding, zero-allocation implementation of the X-Wing hybrid post-quantum KEM
(ML-KEM-768 + X25519), standalone NIST FIPS 203 ML-KEM-768, RFC 7748
X25519, and FIPS 202 SHA-3/SHAKE behind a crypto-agile vtable (~930 LOC).
- Arithmetic
- Division-free 40-bit Barrett mod 3329 + 5-limb radix-2^51 Curve25519, zero malloc/free
- Benchmark
- ML-KEM Encaps 55.1 us (133k cyc); X-Wing Encaps 126.0 us, Decaps 109.4 us (x86_64 -O3)
- Verified
- NIST ACVP FIPS 203, RFC 7748, IETF X-Wing KATs, dudect (|t| = 0.25), Cortex-M4 build
+ benchmark & verification output
$ make all test ct-check bench [PASS] test_fips202: NIST SHA3-256, SHAKE256, and streaming XOF verified [PASS] test_x25519: RFC 7748 Sec 5.2 & 1,000-iter Monte Carlo verified [PASS] test_mlkem: NIST ACVP FIPS 203 KeyGen, Encaps, Decaps, Implicit-Reject & KeyCheck [PASS] test_xwing: IETF CFRG X-Wing (3/3 KATs) + hybrid tamper independence [PASS] test_vtable: Crypto-agile dispatch verified across X-Wing, ML-KEM-768, X25519 [DUDECT] X-Wing Decaps (valid vs reject) : |t| = 0.25 (threshold <= 4.5, N = 40000) [DUDECT] X25519 Montgomery ladder : |t| = 0.95 (threshold <= 4.5, N = 40000) Scheme / Operation | pk (B) | ct (B) | sk (B) | Cycles | us/op ----------------------------+---------+---------+---------+----------+------ X25519 KeyGen | 32 | 32 | 32 | 84628 | 34.9 ML-KEM-768 KeyGen | 1184 | 1088 | 2400 | 114977 | 47.9 ML-KEM-768 Encaps | 1184 | 1088 | 2400 | 132866 | 55.1 ML-KEM-768 Decaps | 1184 | 1088 | 2400 | 171625 | 73.3 X-Wing Encaps | 1216 | 1120 | 32 | 305008 | 126.0 X-Wing (esk) Decaps | 1216 | 1120 | 2464 | 258186 | 109.4