API reference for mlkem/main
    Preparing search index...

    Function createMlKem768

    • Creates an ML-KEM-768 instance with synchronous operations which take the keys.

      Returns Promise<MlKemInterface>

      A promise that resolves to an MlKemInterface instance.

      Use createMlKem768Encapsulator and createMlKem768Decapsulator instead. This function will be removed in 4.0.0.

      import { createMlKem768 } from "@webpqc/mlkem";

      const ctx = await createMlKem768();
      const [pk, sk] = ctx.generateKeyPair(); // sync
      const [ct, ssS] = ctx.encap(pk); // sync
      const ssR = ctx.decap(ct, sk); // sync
      // ssS and ssR contain the same bytes