Skip to content

Commit d769e60

Browse files
committed
attempt fix by defining global vars
1 parent a1c0301 commit d769e60

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

ellipticcurve/math.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ var toJacobian = function (p) {
7474
};
7575

7676

77+
let z = undefined;
7778
var fromJacobian = function (p, P) {
7879
// Convert point back from Jacobian coordinates
7980

@@ -114,6 +115,18 @@ var jacobianDouble = function (p, A, P) {
114115
};
115116

116117

118+
let U1 = undefined;
119+
let U2 = undefined;
120+
let S1 = undefined;
121+
let S2 = undefined;
122+
let H = undefined;
123+
let R = undefined;
124+
let H2 = undefined;
125+
let H3 = undefined;
126+
let U1H2 = undefined;
127+
let nx = undefined;
128+
let ny = undefined;
129+
let nz = undefined;
117130
var jacobianAdd = function (p, q, A, P) {
118131
// Add two points in elliptic curves
119132

ellipticcurve/utils/der.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const bytesHexF = Buffer.from(hexF).toString('binary');
2727
exports.encodeSequence = function () {
2828
let sequence = [];
2929
let totalLengthLen = 0;
30-
for (i=0; i < arguments.length; i++) {
30+
for (let i=0; i < arguments.length; i++) {
3131
sequence.push(arguments[i]);
3232
totalLengthLen += arguments[i].length;
3333
}
@@ -97,7 +97,7 @@ exports.encodeConstructed = function (tag, value) {
9797
return String.fromCharCode(hex129 + tag) + _encodeLength(value.length) + value;
9898
}
9999

100-
100+
let endSeq = undefined;
101101
exports.removeSequence = function (string) {
102102
_checkSequenceError(string, bytesHex0, "03");
103103

@@ -177,7 +177,8 @@ exports.removeBitString = function (string) {
177177
return [body, rest];
178178
}
179179

180-
180+
let body = undefined;
181+
let rest = undefined;
181182
exports.removeOctetString = function (string) {
182183
_checkSequenceError(string, bytesHexD, "04");
183184

@@ -192,6 +193,8 @@ exports.removeOctetString = function (string) {
192193
}
193194

194195

196+
let s0 = undefined;
197+
let tag = undefined;
195198
exports.removeConstructed = function (string) {
196199
s0 = _extractFirstInt(string);
197200
if ((s0 & hex224) != hex129) {
@@ -224,12 +227,12 @@ exports.fromPem = function (pem) {
224227
return Base64.decode(stripped);
225228
}
226229

227-
230+
let lines = undefined;
228231
exports.toPem = function (der, name) {
229232
let b64 = Base64.encode(der);
230233
lines = [("-----BEGIN " + name + "-----\n")];
231234

232-
for (start = 0; start <= b64.length; start += 64) {
235+
for (let start = 0; start <= b64.length; start += 64) {
233236
lines.push(b64.slice(start, start + 64) + "\n")
234237
}
235238
lines.push("-----END " + name + "-----\n");
@@ -280,6 +283,7 @@ function _encodeNumber (n) {
280283
}
281284

282285

286+
let num = undefined;
283287
function _readLength (string) {
284288
num = _extractFirstInt(string);
285289
if (!(num & hex160)) {
@@ -300,6 +304,7 @@ function _readNumber (string) {
300304
let number = 0;
301305
let lengthLen = 0;
302306
let d;
307+
// eslint-disable-next-line
303308
while (true) {
304309
if (lengthLen > string.length) {
305310
throw new Error("ran out of length bytes");

ellipticcurve/utils/integer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ function secureRandomNumber(minimum, maximum) { // bigint, bigint
6666

6767
let range = maximum.minus(minimum);
6868

69+
// eslint-disable-next-line no-unused-vars
6970
let {bitsNeeded, bytesNeeded, mask} = calculateParameters(range);
7071

7172
let randomBytes = crypto.randomBytes(bytesNeeded);

0 commit comments

Comments
 (0)