![]() |
Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
|
DEMO |
Hybrid Key Encapsulation combining Kyber-768 (post-quantum) and X25519 (classical). More...
#include <post_quantum.hpp>
Classes | |
| struct | HybridEncapsResult |
| Result of hybrid encapsulation. More... | |
| struct | HybridKeyPair |
| Hybrid keypair: Kyber-768 + X25519 components. More... | |
Static Public Member Functions | |
| static expected< HybridKeyPair > | generate_keypair () |
| Generate a hybrid Kyber-768 + X25519 (RFC 7748) keypair. | |
| static expected< HybridEncapsResult > | encapsulate (const HybridKeyPair &recipient_pk) |
| Hybrid encapsulation: Kyber-768 + X25519 DH key agreement. | |
| static expected< std::vector< uint8_t > > | decapsulate (const HybridEncapsResult &encaps, const HybridKeyPair &recipient_sk) |
| Hybrid decapsulation: recovers the same shared secret as encapsulate(). | |
Static Public Attributes | |
| static constexpr size_t | X25519_PUBLIC_KEY_SIZE = 32 |
| X25519 public key size in bytes. | |
| static constexpr size_t | X25519_SECRET_KEY_SIZE = 32 |
| X25519 secret key size in bytes. | |
| static constexpr size_t | HYBRID_SHARED_SECRET_SIZE = 32 |
| Combined shared secret size (SHA-256 output). | |
Hybrid Key Encapsulation combining Kyber-768 (post-quantum) and X25519 (classical).
The shared secret is derived as SHA-256(kyber_ss || x25519_ss), providing defense-in-depth: even if one algorithm is broken, the other still provides security. Follows the NIST/IETF Composite KEM approach.
X25519 uses the real constant-time Montgomery ladder in detail::x25519 (RFC 7748) in both bundled and liboqs modes.
Definition at line 1339 of file post_quantum.hpp.
|
inlinestatic |
Hybrid decapsulation: recovers the same shared secret as encapsulate().
X25519 DH is commutative: X25519(eph_sk, recip_pk) == X25519(recip_sk, eph_pk).
| encaps | Encapsulation result (ciphertext + ephemeral pk). |
| recipient_sk | Recipient's full hybrid keypair (secret keys used). |
Definition at line 1483 of file post_quantum.hpp.
|
inlinestatic |
Hybrid encapsulation: Kyber-768 + X25519 DH key agreement.
| recipient_pk | Recipient's hybrid keypair (only public keys used). |
Definition at line 1418 of file post_quantum.hpp.
|
inlinestatic |
Generate a hybrid Kyber-768 + X25519 (RFC 7748) keypair.
Definition at line 1378 of file post_quantum.hpp.
|
staticconstexpr |
Combined shared secret size (SHA-256 output).
Definition at line 1343 of file post_quantum.hpp.
|
staticconstexpr |
X25519 public key size in bytes.
Definition at line 1341 of file post_quantum.hpp.
|
staticconstexpr |
X25519 secret key size in bytes.
Definition at line 1342 of file post_quantum.hpp.