Skip to content

Commit

Permalink
[Fix] restore node < 4 compat
Browse files Browse the repository at this point in the history
Fixes #314.
  • Loading branch information
ljharb authored Mar 5, 2024
1 parent 43ac7f2 commit 0a78e03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/elliptic/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0a78e03

Please sign in to comment.