ML-KEM encapsulation, native where the runtime has ML-KEM: the raw public key is imported in an SPKI wrapper and crypto.encapsulate() runs in OpenSSL. Falls back to @noble/post-quantum elsewhere.
crypto.encapsulate()
ML-KEM security level (512, 768, or 1024).
Raw public (encapsulation) key bytes from bridgedMlKemKeygen.
bridgedMlKemKeygen
Ciphertext and 32-byte shared secret.
const { cipherText, sharedSecret } = bridgedMlKemEncapsulate(768, publicKey); Copy
const { cipherText, sharedSecret } = bridgedMlKemEncapsulate(768, publicKey);
ML-KEM encapsulation, native where the runtime has ML-KEM: the raw public key is imported in an SPKI wrapper and
crypto.encapsulate()runs in OpenSSL. Falls back to @noble/post-quantum elsewhere.