UNPKG

@li0ard/gost341194

Version:

GOST R 34.11-94 hash function in pure TypeScript

14 lines (13 loc) 536 B
import { Gost341194 } from "./index"; import { pbkdf2 } from "@noble/hashes/pbkdf2"; import { createHasher } from "@noble/hashes/utils"; /** * PBKDF2 implementation for GOST R 34.11-94 * @param password Password from which a derived key is generated * @param salt Salt * @param iterations Number of iterations (aka work factor) * @param dkLen Output length */ export const Gost341194PBKDF2 = (password, salt, iterations, dkLen) => { return pbkdf2(createHasher(Gost341194.create), password, salt, { c: iterations, dkLen }); };