Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

browserify-sign

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserify-sign - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

2

package.json
{
"name": "browserify-sign",
"version": "2.2.0",
"version": "2.3.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,3 +13,3 @@ browserify-sign [![Build Status](https://travis-ci.org/calvinmetcalf/browserify-sign.svg)](https://travis-ci.org/calvinmetcalf/browserify-sign)

- ~~tests to make sure we actually did it~~
- chinese remainder theorom?
- ~~chinese remainder theorom?~~
- eliptical curve signing

@@ -16,0 +16,0 @@ - publicEncrypt and privateDecrypt?

@@ -17,8 +17,4 @@ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js

}
hash = pad;
var red = bn.mont(priv.modulus);
hash = new bn(hash).toRed(red);
hash = hash.redPow(priv.privateExponent);
var out = new Buffer(hash.fromRed().toArray());
var out = crt(pad, priv);
if (out.length < len) {

@@ -30,2 +26,17 @@ var prefix = new Buffer(len - out.length);

return out;
}
function crt(msg, priv) {
var c1 = new bn(msg).toRed(bn.mont(priv.prime1));
var c2 = new bn(msg).toRed(bn.mont(priv.prime2));
var qinv = new bn(priv.coefficient);
var p = new bn(priv.prime1);
var q = new bn(priv.prime2);
var m1 = c1.redPow(priv.exponent1)
var m2 = c2.redPow(priv.exponent2);
m1 = m1.fromRed();
m2 = m2.fromRed();
var h = m1.isub(m2).imul(qinv).mod(p);
h.imul(q);
m2.iadd(h);
return new Buffer(m2.toArray());
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc