From 024cc1806f06c069182df75521a1f061d2108c9f Mon Sep 17 00:00:00 2001 From: ricmoo Date: Mon, 1 Aug 2016 14:14:53 -0400 Subject: [PATCH] Re-ordered some parameters, fixed typo. --- lib/secret-storage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/secret-storage.js b/lib/secret-storage.js index 95c553e0c..4fe91ecdb 100644 --- a/lib/secret-storage.js +++ b/lib/secret-storage.js @@ -237,7 +237,7 @@ utils.defineProperty(secretStorage, 'encrypt', function(privateKey, password, op // Check the password if (!Buffer.isBuffer(password)) { throw new Error('password must be a buffer'); } - // Check/generate the DAO + // Check/generate the salt var salt = options.salt; if (salt) { salt = utils.hexOrBuffer(salt, 'salt'); @@ -260,11 +260,11 @@ utils.defineProperty(secretStorage, 'encrypt', function(privateKey, password, op } // Override the scrypt password-based key derivation function parameters - var N = (1 << 17), p = 1, r = 8; + var N = (1 << 17), r = 8, p = 1; if (options.scrypt) { if (options.scrypt.N) { N = options.scrypt.N; } - if (options.scrypt.p) { p = options.scrypt.p; } if (options.scrypt.r) { r = options.scrypt.r; } + if (options.scrypt.p) { p = options.scrypt.p; } } // We take 64 bytes: