UNPKG

@li0ard/gost341194

Version:

GOST R 34.11-94 hash function in pure TypeScript

40 lines (39 loc) 1.28 kB
import { type Sbox } from "@li0ard/magma"; /** GOST R 34.11-94 class */ export declare class Gost341194 { private data; private sbox; readonly blockLen: number; readonly outputLen = 32; /** * GOST R 34.11-94 constructor * @param data Data to be hashed (optional, can be updated using `update` method) * @param sbox S-Box (optional, default is `ID_GOSTR_3411_94_CRYPTOPRO_PARAM_SET`) */ constructor(data?: Uint8Array, sbox?: Sbox); /** Create hash instance */ static create(): Gost341194; /** Reset hash state */ reset(): void; /** Reset hash state */ destroy(): void; /** Clone hash instance */ clone(): Gost341194; _cloneInto(to?: Gost341194): Gost341194; /** Update hash buffer */ update(data: Uint8Array): this; /** * Finalize hash computation and write result into Uint8Array * @param buf Output Uint8Array */ digestInto(buf: Uint8Array): Uint8Array; /** Finalize hash computation and return result as Uint8Array */ digest(): Uint8Array; } /** * Compute hash with GOST R 34.11-94 * @param input Input bytes */ export declare const gost341194: (input: Uint8Array, sbox?: Sbox) => Uint8Array; export { sboxes } from "./const"; export * from "./pbkdf2";