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