feat: Post-Quantum Extended Diffie–Hellman (PQXDH) on the TEE Server #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the server-side PQXDH (Post-Quantum Extended Diffie-Hellman) protocol in the TEE prover server, completing the quantum-resistant key exchange implementation started in #1315. The TEE now supports hybrid X25519 + ML-KEM-768 (Kyber) key exchange, protecting against quantum computer attacks while maintaining backward compatibility with legacy P-256 clients.
How It Works
Suite Negotiation Flow
hellowithsupported_suites: ["Self-PQXDH-1", "legacy-p256"]PQXDH Handshake
Key Derivation (Signal PQXDH Spec)
Changes
New Files
src/lib.rsexamples/pqxdh_test_server.rs--features test_mode(no DB, no circuits, mock attestation)debug_get_session_keyendpoint for cross-language test verificationtests/store_tests.rsModified Files
Cargo.tomltest_modefeature flag for local testing without TEE infrastructuresrc/types.rsHelloResponsewith:selected_suite: String- negotiated cipher suitex25519_pubkey: Option<Vec<u8>>- server's X25519 public key (PQXDH only)kyber_pubkey: Option<Vec<u8>>- server's Kyber public key (PQXDH only)src/store.rsKeyMaterialenum for multi-state session managementget_key_material()- retrieves KeyMaterial for state inspectionupdate_key_material()- transitions PqxdhPending -> PqxdhCompleteget_shared_secret()- handles all KeyMaterial variantssrc/server.rshello()RPC method:supported_suitesparameterkey_exchange()RPC method:src/utils.rs#[cfg(feature = "test_mode")]mock attestation function:Testing
Unit Tests (Rust)
Integration Tests (Cross-Language)
test_modefeature