From 0a78e0399ee1f5d919be6aa66b427c67a9df330d Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 4 Mar 2024 23:20:28 -0800 Subject: [PATCH] [Fix] restore node < 4 compat Fixes #314. --- lib/elliptic/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/elliptic/utils.js b/lib/elliptic/utils.js index 627a9f1a..568a3e2c 100644 --- a/lib/elliptic/utils.js +++ b/lib/elliptic/utils.js @@ -14,7 +14,9 @@ utils.encode = minUtils.encode; // Represent num in a w-NAF form function getNAF(num, w, bits) { var naf = new Array(Math.max(num.bitLength(), bits) + 1); - naf.fill(0); + for (var i = 0; i < naf.length; i += 1) { + naf[i] = 0; + } var ws = 1 << (w + 1); var k = num.clone();