ML-KEM-768 round trip
Key generation, encapsulation and decapsulation in one graph. The result is true when both sides derive the same shared secret.
Overview & Cryptographic Context
In a Key Encapsulation Mechanism (KEM) such as NIST FIPS 203 ML-KEM-768, key establishment proceeds in three operations across two parties: Alice runs ML-KEM.KeyGen() to generate a 1,184-byte encapsulation (public) key ek and a 2,400-byte decapsulation (secret) key dk, sending ek to Bob. Bob runs ML-KEM.Encaps(ek) with fresh CSPRNG randomness to produce a 1,088-byte ciphertext c and his 32-byte shared secret KBob. Finally, Alice runs ML-KEM.Decaps(dk, c) to recover her 32-byte shared secret KAlice.
This workflow wires all three post-quantum nodes together on a single canvas and connects both 32-byte shared secrets into a Value Comparator (==), proving that every randomized execution derives KBob = KAlice (SharedSecretsMatch = true).
Pipeline Architecture & Wiring Flow
- Keypair Generation (
ML-KEM KeyGen (FIPS 203)): Generates a fresh ML-KEM-768 key pair on each run. RoutespublicKey(ek) toML-KEM EncapsulateandsecretKey(dk) toML-KEM Decapsulate. - Encapsulation (
ML-KEM Encapsulate): Encapsulates a fresh 32-byte shared secret againstpublicKey, sendingciphertext(c) toML-KEM DecapsulateandsharedSecretto portaofValue Comparator. - Decapsulation & Equality Check (
ML-KEM Decapsulate→Value Comparator): DecapsulatesciphertextusingsecretKeyand feeds the recoveredsharedSecretto portbofValue Comparator, which outputstruetoWorkflow Output.
Nodes & Configuration
| Node | Node Role & Key Parameters | Count |
|---|---|---|
| Workflow Input | Workflow ingress node (no external arguments required) | 1 |
| ML-KEM KeyGen (FIPS 203) | Configured with variant = 768; generates fresh ek (1,184 B) and dk (2,400 B) | 1 |
| ML-KEM Encapsulate | Configured with variant = 768; produces 1,088-byte ciphertext and 32-byte shared secret | 1 |
| ML-KEM Decapsulate | Configured with variant = 768; recovers 32-byte shared secret from ciphertext and dk | 1 |
| Value Comparator | Configured with operator = "=="; compares encapsulated and decapsulated secrets | 1 |
| Workflow Output | Emits boolean verdict SharedSecretsMatch | 1 |
Inputs, Outputs & Test Vector Verification
Verification Source: Randomized (FIPS 203 ML-KEM-768 round trip); only the boolean verdict is compared
Expected Outputs
| Name | Type | Value |
|---|---|---|
SharedSecretsMatch | bool | true |