Files
suaveplan/packages/security-stack/crypto/crypto-hash/src/kdf/hkdf/hkdf.ts
2026-05-27 23:47:53 +01:00

22 lines
568 B
TypeScript

/**
* Public façade for HKDF. Routes through the primitive selector layer.
*/
import type { HashAlgorithm } from "../../hash/sha2/sha2.js";
import { hkdf as selectedHkdf } from "../../primitives/hkdf/hkdf.select/hkdf.select.js";
export interface HkdfOptions {
readonly salt: Uint8Array;
readonly info: Uint8Array;
readonly length: number;
}
/** HKDF-Extract-and-Expand over SHA-256/384/512. */
export function hkdf(
algo: HashAlgorithm,
ikm: Uint8Array,
options: HkdfOptions
): Uint8Array {
return selectedHkdf(algo, ikm, options);
}