Socket
Socket
Sign inDemoInstall

browserify-rsa

Package Overview
Dependencies
2
Maintainers
5
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 3.0.0

LICENSE

16

index.js

@@ -17,3 +17,3 @@ var bn = require('bn.js');

var mod = bn.mont(priv.modulus);
var blinded = new bn(msg).mul(blinds.blinder).mod(priv.modulus);
var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus);
var c1 = blinded.toRed(bn.mont(priv.prime1));

@@ -28,12 +28,6 @@ var c2 = blinded.toRed(bn.mont(priv.prime2));

m2 = m2.fromRed();
var h = m1.isub(m2).imul(qinv).mod(p);
var h = m1.isub(m2).imul(qinv).umod(p);
h.imul(q);
m2.iadd(h);
var out = new Buffer(m2.imul(blinds.unblinder).mod(priv.modulus).toArray());
if (out.length < len) {
var prefix = new Buffer(len - out.length);
prefix.fill(0);
out = Buffer.concat([prefix, out], len);
}
return out;
return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len));
}

@@ -44,6 +38,6 @@ crt.getr = getr;

var r = new bn(randomBytes(len));
while (r.cmp(priv.modulus) >= 0 || !r.mod(priv.prime1) || !r.mod(priv.prime2)) {
while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) {
r = new bn(randomBytes(len));
}
return r;
}
}
{
"name": "browserify-rsa",
"version": "2.0.1",
"description": "",
"version": "3.0.0",
"description": "RSA for browserify",
"main": "index.js",

@@ -12,3 +12,3 @@ "scripts": {

"dependencies": {
"bn.js": "^2.0.0",
"bn.js": "^3.0.0",
"randombytes": "^2.0.1"

@@ -15,0 +15,0 @@ },

@@ -49,6 +49,6 @@ var keys = [

var myEncrypt = crt(buf, priv).toString('hex');
t.equals(nodeEncrypt, myEncrypt, 'equal encrypts');
t.equals(myEncrypt, nodeEncrypt, 'equal encrypts');
});
}
}
keys.forEach(testMessage);
keys.forEach(testMessage);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc