UNPKG

@li0ard/gost341194

Version:

GOST R 34.11-94 hash function in pure TypeScript

12 lines (11 loc) 529 B
import { Gost341194 } from "./index.js"; import { pbkdf2 } from "@noble/hashes/pbkdf2.js"; import { createHasher } from "@noble/hashes/utils.js"; /** * 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) => pbkdf2(createHasher(Gost341194.create), password, salt, { c: iterations, dkLen });