From 34a61e9547039b1f0da6255e3c33aa2ba06f8339 Mon Sep 17 00:00:00 2001 From: Christian Bundy Date: Fri, 4 Sep 2020 09:26:40 -0700 Subject: [PATCH] Remove unused argument from crypto_kdf Problem: We're passing an extra argument, which looks like it's using the method signature for `TypedArray.prototype.subarray()`, which gives you the option of setting the end of the array. Since this method doesn't give us an optional third parameter the argument is being ignored. Solution: Remove the unused argument. --- crypto_kdf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_kdf.js b/crypto_kdf.js index d94d312..284c4bf 100644 --- a/crypto_kdf.js +++ b/crypto_kdf.js @@ -26,7 +26,7 @@ module.exports.crypto_kdf_derive_from_key = function crypto_kdf_derive_from_key var ctx_padded = new Uint8Array(blake2b.PERSONALBYTES) var salt = new Uint8Array(blake2b.SALTBYTES) - ctx_padded.set(ctx, 0, module.exports.crypto_kdf_CONTEXTBYTES) + ctx_padded.set(ctx, 0) STORE64_LE(salt, subkey_id) var outlen = Math.min(subkey.length, module.exports.crypto_kdf_BYTES_MAX)