Comparing version 0.0.3 to 0.1.0
@@ -39,2 +39,3 @@ /* ***** BEGIN LICENSE BLOCK ***** | ||
//var BigInteger = libs.BigInteger; | ||
var BigInteger = libs.BigInteger; | ||
@@ -55,3 +56,3 @@ | ||
// we don't actually need to do modulus here, because of the previous assumption | ||
return new libs.BigInteger(raw_hash, "16"); | ||
return new BigInteger(raw_hash, "16"); | ||
} | ||
@@ -127,3 +128,3 @@ | ||
// result = (c mod (q-1)) + 1 | ||
return new libs.BigInteger(q.bitLength() + 64, rng).mod(q.subtract(BigInteger.ONE)).add(BigInteger.ONE); | ||
return new BigInteger(q.bitLength() + 64, rng).mod(q.subtract(BigInteger.ONE)).add(BigInteger.ONE); | ||
} | ||
@@ -142,5 +143,5 @@ | ||
function keysizeFromObject(obj) { | ||
var p = new libs.BigInteger(obj.p, 16); | ||
var q = new libs.BigInteger(obj.q, 16); | ||
var g = new libs.BigInteger(obj.g, 16); | ||
var p = new BigInteger(obj.p, 16); | ||
var q = new BigInteger(obj.q, 16); | ||
var g = new BigInteger(obj.g, 16); | ||
@@ -221,7 +222,7 @@ var keysize = _getKeySizeFromYBitlength(p.bitLength()); | ||
// check rangeconstraints | ||
if ((r.compareTo(libs.BigInteger.ZERO) < 0) || (r.compareTo(params.q) > 0)) { | ||
if ((r.compareTo(BigInteger.ZERO) < 0) || (r.compareTo(params.q) > 0)) { | ||
console.log("problem with r: " + r.toString(16)); | ||
return false; | ||
} | ||
if ((s.compareTo(libs.BigInteger.ZERO) < 0) || (s.compareTo(params.q) > 0)) { | ||
if ((s.compareTo(BigInteger.ZERO) < 0) || (s.compareTo(params.q) > 0)) { | ||
console.log("problem with s"); | ||
@@ -256,3 +257,3 @@ return false; | ||
PublicKey.prototype.deserializeFromObject = function(obj) { | ||
this.y = new libs.BigInteger(obj.y, 16); | ||
this.y = new BigInteger(obj.y, 16); | ||
@@ -293,3 +294,3 @@ //this.keysize = _getKeySizeFromYBitlength(this.y.bitLength()); | ||
if (r.equals(libs.BigInteger.ZERO)) { | ||
if (r.equals(BigInteger.ZERO)) { | ||
console.log("oops r is zero"); | ||
@@ -308,3 +309,3 @@ continue; | ||
if (s.equals(libs.BigInteger.ZERO)) { | ||
if (s.equals(BigInteger.ZERO)) { | ||
console.log("oops s is zero"); | ||
@@ -311,0 +312,0 @@ continue; |
@@ -18,2 +18,3 @@ preliminaries.js | ||
external/rng.js | ||
bigint-patch.js | ||
exports.js |
{ | ||
"name": "jwcrypto" | ||
, "version": "0.0.3" | ||
, "version": "0.1.0" | ||
, "dependencies": { | ||
"browserify": "1.5.0", | ||
"vows": "0.5.13", | ||
"optimist": "0.2.6" | ||
"optimist": "0.2.6", | ||
"bigint": "https://github.com/benadida/node-bigint/tarball/2ac68" | ||
} | ||
@@ -9,0 +10,0 @@ , "scripts": { |
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
224505
55
5623
4
2