You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The caller passes in the desired keyLength which is expected as a bit count.
The slice call that returns the derived bytes, keyLength, as bits instead of bytes, returns the entire result without truncating.
concat.js
function concatDeriveFn(name) {
...
var N = Math.ceil(keyLen / hashLen), <== keyLen is expected to be in bits to compute # of iterations
idx = 0,
okm = [];
function step() {
if (N === idx++) {
return Buffer.concat(okm).slice(0, keyLen ); <== keyLen is expected to be a byte count for slice()}
...
}
The caller passes in the desired keyLength which is expected as a bit count.
The slice call that returns the derived bytes, keyLength, as bits instead of bytes, returns the entire result without truncating.
concat.js
Dividing by 8 should fix the problem:
The text was updated successfully, but these errors were encountered: