Crypto Lib
    Preparing search index...

    Function bridgedMlKemDecapsulate

    • ML-KEM decapsulation using the fastest available backend.

      On Node.js 24.7+ with native PQC support, imports the caller's raw secret key via a DER wrapper and calls crypto.decapsulate() for hardware-accelerated decapsulation. Falls back to @noble/post-quantum on older runtimes.

      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);