UNPKG

1.28 kBTypeScriptView Raw
1export declare const digestLength = 32;
2export declare const blockSize = 64;
3export declare class Hash {
4 digestLength: number;
5 blockSize: number;
6 private state;
7 private temp;
8 private buffer;
9 private bufferLength;
10 private bytesHashed;
11 finished: boolean;
12 constructor();
13 reset(): this;
14 clean(): void;
15 update(data: Uint8Array, dataLength?: number): this;
16 finish(out: Uint8Array): this;
17 digest(): Uint8Array;
18 _saveState(out: Uint32Array): void;
19 _restoreState(from: Uint32Array, bytesHashed: number): void;
20}
21export declare class HMAC {
22 private inner;
23 private outer;
24 blockSize: number;
25 digestLength: number;
26 private istate;
27 private ostate;
28 constructor(key: Uint8Array);
29 reset(): this;
30 clean(): void;
31 update(data: Uint8Array): this;
32 finish(out: Uint8Array): this;
33 digest(): Uint8Array;
34}
35export declare function hash(data: Uint8Array): Uint8Array;
36export default hash;
37export declare function hmac(key: Uint8Array, data: Uint8Array): Uint8Array;
38export declare function hkdf(key: Uint8Array, salt?: Uint8Array, info?: Uint8Array, length?: number): Uint8Array;
39export declare function pbkdf2(password: Uint8Array, salt: Uint8Array, iterations: number, dkLen: number): Uint8Array;