UNPKG

@hackbg/miscreant-esm

Version:

(ESM port) Misuse resistant symmetric encryption library providing AES-SIV (RFC 5297), AES-PMAC-SIV, and STREAM constructions

15 lines (14 loc) 782 B
import { IAEADLike, ICryptoProvider, ISIVLike } from "./interfaces.dist"; /** AEAD interface provider for ISIVLike types */ export declare class AEAD implements IAEADLike { /** Create a new AEAD instance with the given key */ static importKey(keyData: Uint8Array, alg: string, provider?: ICryptoProvider): Promise<AEAD>; private _siv; constructor(siv: ISIVLike); /** Encrypt and authenticate data using AES-SIV */ seal(plaintext: Uint8Array, nonce: Uint8Array, associatedData?: Uint8Array): Promise<Uint8Array>; /** Decrypt and authenticate data using AES-SIV */ open(ciphertext: Uint8Array, nonce: Uint8Array, associatedData?: Uint8Array): Promise<Uint8Array>; /** Make a best effort to wipe memory used by this instance */ clear(): this; }