[Pkg-javascript-commits] [node-diffie-hellman] 02/88: deps
Bastien Roucariès
rouca at moszumanska.debian.org
Thu May 4 10:19:11 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-diffie-hellman.
commit 911fcfb2ffb579f2668a5e5dbd927bbaa36660fe
Author: Calvin Metcalf <calvin.metcalf at state.ma.us>
Date: Sun Nov 2 17:59:09 2014 -0500
deps
---
dh.js | 14 +-------------
package.json | 5 ++++-
2 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/dh.js b/dh.js
index 4b8614f..0ee4136 100644
--- a/dh.js
+++ b/dh.js
@@ -1,18 +1,6 @@
-
var BN = require('bn.js');
-dh.generateKeys();
-
-var priv = new BN(dh.getPrivateKey().toString('hex'), 16);
-console.log('priv', priv);
-var gen = new BN(dh.getGenerator().toString('hex'), 16);
-console.log('gen', gen);
-var prime = BN.mont(new BN(dh.getPrime().toString('hex'), 16));
-console.log('prime', prime);
-var publ = new BN(dh.getPublicKey().toString('hex'), 16);
-console.log('publ', publ);
-var calcpubl = gen.toRed(prime).redPow(priv).fromRed()
-console.log('compare', publ.toString(16) === calcpubl.toString(16));
+module.exports = DH;
function DH(prime, crypto) {
this.setGenerator(new Buffer([2]));
diff --git a/package.json b/package.json
index aac7286..1ec03c7 100644
--- a/package.json
+++ b/package.json
@@ -21,5 +21,8 @@
"bugs": {
"url": "https://github.com/calvinmetcalf/diffie-hellman/issues"
},
- "homepage": "https://github.com/calvinmetcalf/diffie-hellman"
+ "homepage": "https://github.com/calvinmetcalf/diffie-hellman",
+ "dependencies": {
+ "bn.js": "^0.15.0"
+ }
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-diffie-hellman.git
More information about the Pkg-javascript-commits
mailing list