Skip to content

Commit 6dde44b

Browse files
committed
Fix low range check for N
1 parent 2185769 commit 6dde44b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scrypt-async.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ function scrypt(password, salt, logN, r, dkLen, interruptStep, callback, encodin
374374
logN = opts.logN;
375375
if (typeof logN === 'undefined') {
376376
if (typeof opts.N !== 'undefined') {
377-
if (opts.N < 0 || opts.N > MAX_UINT)
377+
if (opts.N < 2 || opts.N > MAX_UINT)
378378
throw new Error('scrypt: N is out of range');
379379

380380
if (opts.N & (opts.N - 1) !== 0)

0 commit comments

Comments
 (0)