A promise that resolves to a key pair [publicKey, privateKey].
import {
createMlKem1024Decapsulator,
createMlKem1024Encapsulator,
generateMlKem1024KeyPair,
} from "@webpqc/mlkem";
const [pk, sk] = await generateMlKem1024KeyPair();
const encapsulator = await createMlKem1024Encapsulator(pk);
const [ct, ssS] = await encapsulator.encap();
const decapsulator = await createMlKem1024Decapsulator(sk);
const ssR = await decapsulator.decap(ct);
decapsulator.destroy();
// ssS and ssR contain the same bytes
Generates a key pair of ML-KEM-1024 (NIST security category 5).
The private key is the 64-octet seed of FIPS 203 (
d || z), and the public key is 1568 octets in length.