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

    Interface MlKemInterface

    Interface for synchronous ML-KEM operations which take the keys.

    Use MlKemEncapsulatorInterface and MlKemDecapsulatorInterface instead. This interface will be removed in 4.0.0, with createMlKem512, createMlKem768 and createMlKem1024, which create instances that implement it.

    interface MlKemInterface {
        decap(ct: Uint8Array, sk: Uint8Array): Uint8Array;
        deriveKeyPair(
            seed: Uint8Array,
        ): [Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>];
        encap(
            pk: Uint8Array,
            seed?: Uint8Array,
        ): [Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>];
        generateKeyPair(): [
            Uint8Array<ArrayBufferLike>,
            Uint8Array<ArrayBufferLike>,
        ];
    }
    Index
    • Decapsulates: returns sharedSecret.

      Parameters

      • ct: Uint8Array
      • sk: Uint8Array

      Returns Uint8Array

    • Derives a keypair [publicKey, privateKey] deterministically from a 64-octet seed.

      Parameters

      • seed: Uint8Array

      Returns [Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>]

    • Encapsulates: returns [ciphertext, sharedSecret].

      Parameters

      • pk: Uint8Array
      • Optionalseed: Uint8Array

      Returns [Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>]

    • Generates a keypair [publicKey, privateKey].

      Returns [Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>]