Class ModuleLatticeKemExample
java.lang.Object
net.jrodolfo.java_evolution.java24.quantum_resistant_crypto.ModuleLatticeKemExample
Demonstrates Java 24 module-lattice key encapsulation support.
ML-KEM is a post-quantum key encapsulation mechanism. Like the Java 21 KEM example, the sender uses the receiver's public key to create a shared secret and an encapsulation message. The receiver uses the private key and the encapsulation message to recover the same shared secret.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
ALGORITHM
Standard algorithm name for module-lattice key encapsulation.- See Also:
-
-
Constructor Details
-
ModuleLatticeKemExample
public ModuleLatticeKemExample()
-
-
Method Details
-
exchange
public ModuleLatticeKemResult exchange() throws NoSuchAlgorithmException, InvalidKeyException, DecapsulateExceptionRuns a complete in-memory ML-KEM exchange.- Returns:
- sender secret, receiver secret, and encapsulation bytes
- Throws:
NoSuchAlgorithmException- if ML-KEM is not available from the active providersInvalidKeyException- if generated keys cannot be used by the KEM providerDecapsulateException- if the encapsulation cannot be decoded by the receiver
-