interface ICryptoProvider {
    createAesCtr: (
        key: Uint8Array,
        iv: Uint8Array,
        encrypt: boolean,
    ) => IAesCtr;
    createAesIge: (key: Uint8Array, iv: Uint8Array) => IEncryptionScheme;
    factorizePQ: (pq: Uint8Array) => MaybePromise<[Uint8Array, Uint8Array]>;
    gunzip: (data: Uint8Array) => Uint8Array;
    gzip: (data: Uint8Array, maxSize: number) => null | Uint8Array;
    hmacSha256: (data: Uint8Array, key: Uint8Array) => MaybePromise<Uint8Array>;
    initialize?: () => MaybePromise<void>;
    pbkdf2: (
        password: Uint8Array,
        salt: Uint8Array,
        iterations: number,
        keylen?: number,
        algo?: string,
    ) => MaybePromise<Uint8Array>;
    randomBytes: (size: number) => Uint8Array;
    randomFill: (buf: Uint8Array) => void;
    sha1: (data: Uint8Array) => Uint8Array;
    sha256: (data: Uint8Array) => Uint8Array;
}

Implemented by

Properties

createAesCtr: (key: Uint8Array, iv: Uint8Array, encrypt: boolean) => IAesCtr
createAesIge: (key: Uint8Array, iv: Uint8Array) => IEncryptionScheme
factorizePQ: (pq: Uint8Array) => MaybePromise<[Uint8Array, Uint8Array]>
gunzip: (data: Uint8Array) => Uint8Array
gzip: (data: Uint8Array, maxSize: number) => null | Uint8Array
hmacSha256: (data: Uint8Array, key: Uint8Array) => MaybePromise<Uint8Array>
initialize?: () => MaybePromise<void>
pbkdf2: (
    password: Uint8Array,
    salt: Uint8Array,
    iterations: number,
    keylen?: number,
    algo?: string,
) => MaybePromise<Uint8Array>
randomBytes: (size: number) => Uint8Array
randomFill: (buf: Uint8Array) => void
sha1: (data: Uint8Array) => Uint8Array
sha256: (data: Uint8Array) => Uint8Array