Crypto Lib
    Preparing search index...

    Function bridgedMlKemDecapsulate

    • ML-KEM decapsulation, native where the runtime has ML-KEM: the raw secret key is imported in a PKCS#8 wrapper and crypto.decapsulate() runs in OpenSSL. Falls back to @noble/post-quantum elsewhere.

      Parameters

      • level: NativeMlKemLevel

        ML-KEM security level (512, 768, or 1024).

      • cipherText: Uint8Array

        Ciphertext from bridgedMlKemEncapsulate.

      • secretKey: Uint8Array

        Raw secret (decapsulation) key bytes from bridgedMlKemKeygen.

      Returns Uint8Array

      32-byte shared secret.

      const sharedSecret = bridgedMlKemDecapsulate(768, cipherText, secretKey);