UNPKG

@hpke/dhkem-x25519

Version:

A Hybrid Public Key Encryption (HPKE) module extension for X25519

46 lines 1.32 kB
import type { KdfInterface } from "@hpke/common"; import { Dhkem, KemId, XCurveDhkemPrimitives } from "@hpke/common"; export declare class X25519 extends XCurveDhkemPrimitives { constructor(hkdf: KdfInterface); derive(sk: Uint8Array, pk: Uint8Array): Promise<Uint8Array>; } /** * The DHKEM(X25519, HKDF-SHA256) for HPKE KEM implementing {@link KemInterface}. * * This class is implemented using * {@link https://github.com/paulmillr/noble-curves | @noble/curves}. * * The instance of this class can be specified to the * {@link https://jsr.io/@hpke/core/doc/~/CipherSuiteParams | CipherSuiteParams} as follows: * * @example Use with `@hpke/core`: * * ```ts * import { * Aes128Gcm, * CipherSuite, * HkdfSha256, * } from "@hpke/core"; * import { DhkemX25519HkdfSha256 } from "@hpke/dhkem-x25519"; * * const suite = new CipherSuite({ * kem: new DhkemX25519HkdfSha256(), * kdf: new HkdfSha256(), * aead: new Aes128Gcm(), * }); * ``` */ export declare class DhkemX25519HkdfSha256 extends Dhkem { /** KemId.DhkemX25519HkdfSha256 (0x0020) */ id: KemId; /** 32 */ secretSize: number; /** 32 */ encSize: number; /** 32 */ publicKeySize: number; /** 32 */ privateKeySize: number; constructor(); } //# sourceMappingURL=dhkemX25519.d.ts.map