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