import type { JsonWebKeyExtended, KemInterface, RecipientContextParams, SenderContextParams } from "@hpke/common"; import { KemId } from "@hpke/common"; interface MlKemInterface { generateKeyPair(): Promise<[Uint8Array, Uint8Array]>; deriveKeyPair(seed: Uint8Array): Promise<[Uint8Array, Uint8Array]>; encap(pk: Uint8Array, seed?: Uint8Array): Promise<[Uint8Array, Uint8Array]>; decap(ct: Uint8Array, sk: Uint8Array): Promise; } /** * The base class of ML-KEM. */ export declare class MlKemBase implements KemInterface { readonly id: KemId; readonly name: string; readonly secretSize: number; readonly encSize: number; readonly publicKeySize: number; readonly privateKeySize: number; readonly auth: boolean; protected _prim: MlKemInterface | undefined; private _api; constructor(); serializePublicKey(key: CryptoKey): Promise; deserializePublicKey(key: ArrayBufferLike | ArrayBufferView): Promise; serializePrivateKey(key: CryptoKey): Promise; deserializePrivateKey(key: ArrayBufferLike | ArrayBufferView): Promise; generateKeyPair(): Promise; deriveKeyPair(ikm: ArrayBufferLike | ArrayBufferView): Promise; importKey(format: "raw" | "jwk", key: ArrayBuffer | JsonWebKeyExtended, isPublic?: boolean): Promise; encap(params: SenderContextParams): Promise<{ sharedSecret: ArrayBuffer; enc: ArrayBuffer; }>; decap(params: RecipientContextParams): Promise; private _setup; private _serializePublicKey; private _deserializePublicKey; private _serializePrivateKey; private _deserializePrivateKey; private _importJWK; } /** * The ML-KEM-512 for HPKE KEM implementing {@link KemInterface}. * * The instance of this class can be specified to the * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteParams | CipherSuiteParams} as follows: * * @example * * ```ts * import { Aes128Gcm, CipherSuite, HkdfSha256 } from "@hpke/core"; * import { MlKem512 } from "@hpke/ml-kem"; * const suite = new CipherSuite({ * kem: new MlKem512(), * kdf: new HkdfSha256(), * aead: new Aes128Gcm(), * }); * ``` */ export declare class MlKem512 extends MlKemBase { id: KemId; name: string; secretSize: number; encSize: number; publicKeySize: number; privateKeySize: number; auth: boolean; _prim: MlKemInterface | undefined; constructor(); } /** * The ML-KEM-768 for HPKE KEM implementing {@link KemInterface}. * * The instance of this class can be specified to the * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteParams | CipherSuiteParams} as follows: * * @example * * ```ts * import { Aes256Gcm, CipherSuite, HkdfSha384 } from "@hpke/core"; * import { MlKem768 } from "@hpke/ml-kem"; * const suite = new CipherSuite({ * kem: new MlKem768(), * kdf: new HkdfSha384(), * aead: new Aes256Gcm(), * }); * ``` */ export declare class MlKem768 extends MlKemBase { id: KemId; name: string; secretSize: number; encSize: number; publicKeySize: number; privateKeySize: number; auth: boolean; _prim: MlKemInterface | undefined; constructor(); } /** * The ML-KEM-1024 for HPKE KEM implementing {@link KemInterface}. * * The instance of this class can be specified to the * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteParams | CipherSuiteParams} as follows: * * @example * * ```ts * import { Aes256Gcm, CipherSuite, HkdfSha512 } from "@hpke/core"; * import { MlKem1024 } from "@hpke/ml-kem"; * const suite = new CipherSuite({ * kem: new MlKem1024(), * kdf: new HkdfSha512(), * aead: new Aes256Gcm(), * }); * ``` */ export declare class MlKem1024 extends MlKemBase { id: KemId; name: string; secretSize: number; encSize: number; publicKeySize: number; privateKeySize: number; auth: boolean; _prim: MlKemInterface | undefined; constructor(); } export {}; //# sourceMappingURL=mlKem.d.ts.map