A private key: a 64-octet seed, or a decapsulation key of FIPS 203 (3168 octets).
Optionalopts: MlKemCreateOptions
Options: see MlKemCreateOptions.
A promise that resolves to an MlKemDecapsulatorInterface instance.
import {
createMlKem1024Decapsulator,
createMlKem1024Encapsulator,
generateMlKem1024KeyPair,
} from "@webpqc/mlkem";
const [pk, sk] = await generateMlKem1024KeyPair();
const [ct, _ss] = await (await createMlKem1024Encapsulator(pk)).encap();
const decapsulator = await createMlKem1024Decapsulator(sk);
const ss = await decapsulator.decap(ct);
decapsulator.destroy();
Creates an ML-KEM-1024 (NIST security category 5) decapsulator which holds a private key.
Call
destroy()of the decapsulator to erase the private key which it holds, when it is no longer needed.