UNPKG

@hpke/common

Version:

A Hybrid Public Key Encryption (HPKE) internal-use common module for @hpke family modules.

35 lines 1.68 kB
import type { DhkemInterface } from "../interfaces/dhkemInterface.js"; import type { KdfInterface } from "../interfaces/kdfInterface.js"; import type { KemInterface } from "../interfaces/kemInterface.js"; import type { SenderContextParams } from "../interfaces/senderContextParams.js"; import type { RecipientContextParams } from "../interfaces/recipientContextParams.js"; import { KemId } from "../identifiers.js"; export declare class Hybridkem implements KemInterface { readonly id: KemId; readonly name: string; readonly secretSize: number; readonly encSize: number; readonly publicKeySize: number; readonly privateKeySize: number; protected _a: DhkemInterface; protected _b: KemInterface; protected _kdf: KdfInterface; constructor(id: KemId, a: DhkemInterface, b: KemInterface, kdf: KdfInterface); serializePublicKey(key: CryptoKey): Promise<ArrayBuffer>; deserializePublicKey(key: ArrayBuffer): Promise<CryptoKey>; serializePrivateKey(key: CryptoKey): Promise<ArrayBuffer>; deserializePrivateKey(key: ArrayBuffer): Promise<CryptoKey>; generateKeyPair(): Promise<CryptoKeyPair>; deriveKeyPair(ikm: ArrayBuffer): Promise<CryptoKeyPair>; importKey(format: "raw" | "jwk", key: ArrayBuffer | JsonWebKey, isPublic?: boolean): Promise<CryptoKey>; encap(params: SenderContextParams): Promise<{ sharedSecret: ArrayBuffer; enc: ArrayBuffer; }>; decap(params: RecipientContextParams): Promise<ArrayBuffer>; private _serializePublicKey; private _deserializePublicKey; private _serializePrivateKey; private _deserializePrivateKey; } //# sourceMappingURL=hybridkem.d.ts.map