MCPcopy Create free account
hub / github.com/nodejs/node / hkdfDeriveBits

Function hkdfDeriveBits

lib/internal/crypto/hkdf.js:154–168  ·  view source on GitHub ↗
(algorithm, baseKey, length)

Source from the content-addressed store, hash-verified

152}
153
154function hkdfDeriveBits(algorithm, baseKey, length) {
155 validateHkdfDeriveBitsLength(length);
156 const { hash, salt, info } = algorithm;
157
158 if (length === 0)
159 return PromiseResolve(new ArrayBuffer(0));
160
161 return jobPromise(() => new HKDFJob(
162 kCryptoJobWebCrypto,
163 normalizeHashName(hash.name),
164 getCryptoKeyHandle(baseKey),
165 salt,
166 info,
167 length / 8));
168}
169
170module.exports = {
171 hkdf,

Callers

nothing calls this directly

Calls 4

jobPromiseFunction · 0.85
normalizeHashNameFunction · 0.85
getCryptoKeyHandleFunction · 0.85

Tested by

no test coverage detected