@li0ard/streebog
Version:
Streebog hash function in pure TypeScript
62 lines (61 loc) • 1.89 kB
TypeScript
/**
* Streebog core class
*/
export declare class Streebog {
private is512;
buffer: Uint8Array;
readonly blockLen = 64;
outputLen: number;
/**
* Streebog core constructor
* @param is512 Use 512 bits version of algorithm
*/
constructor(is512: boolean);
/** Reset hash state */
reset(): void;
/** Reset hash state */
destroy(): void;
/** Update hash buffer */
update(data: Uint8Array): this;
/** Finalize hash computation and return result as Uint8Array */
digest(): Uint8Array;
/**
* Finalize hash computation and write result into Uint8Array
* @param buf - Output Uint8Array
*/
digestInto(buf: Uint8Array): Uint8Array;
}
/** Streebog 256 aka `GOST R 34.11-2012 256 bits` */
export declare class Streebog256 extends Streebog {
/** Streebog 256 aka `GOST R 34.11-2012 256 bits` */
constructor();
/** Create hash instance */
static create(): Streebog256;
/** Clone hash instance */
clone(): Streebog256;
_cloneInto(to?: Streebog256): Streebog256;
}
/** Streebog 512 bit aka `GOST R 34.11-2012 512 bits` */
export declare class Streebog512 extends Streebog {
/** Streebog 512 bit aka `GOST R 34.11-2012 512 bits` */
constructor();
/** Create hash instance */
static create(): Streebog512;
/** Clone hash instance */
clone(): Streebog512;
_cloneInto(to?: Streebog512): Streebog512;
}
/**
* Compute hash with `Streebog 256 bit` (aka `GOST R 34.11-2012 256 bits`)
* @param input Input bytes
*/
export declare const streebog256: (input: Uint8Array) => Uint8Array;
/**
* Compute hash with `Streebog 512 bit` (aka `GOST R 34.11-2012 512 bits`)
* @param input Input bytes
* @returns {Uint8Array}
*/
export declare const streebog512: (input: Uint8Array) => Uint8Array;
export * from "./hmac";
export * from "./kdf";
export * from "./pbkdf2";