git ssb

1+

Dominic / ssb-keys



Commit c0fdcee6ac3da05da20ec37431fd85c2a897cacd

make eccjs a devdep

Dominic Tarr committed on 2/24/2016, 9:17:52 AM
Parent: ec16ac523ff4e0a2f22f55668d90fe7601ee560f

Files changed

index.jschanged
package.jsonchanged
index.jsView
@@ -5,9 +5,8 @@
55
66 var crypto = require('crypto')
77 var createHmac = require('hmac')
88
9-var ecc = require('./eccjs')
109 var sodium = require('chloride')
1110 var ssbref = require('ssb-ref')
1211
1312 var pb = require('private-box')
@@ -131,8 +130,10 @@
131130
132131 if(curve !== 'k256')
133132 throw new Error('expected legacy curve (k256) but found:' + curve)
134133
134+ var ecc = require('./eccjs')
135+
135136 return keysToJSON(ecc.restore(toBuffer(private)), 'k256')
136137 }
137138
138139 var toNameFile = exports.toNameFile = function (namefile) {
@@ -201,12 +202,12 @@
201202
202203
203204 // DIGITAL SIGNATURES
204205
205-var curves = {
206- ed25519 : require('./sodium'),
207- k256 : ecc //LEGACY
208-}
206+var curves = {}
207+curves.ed25519 = require('./sodium')
208+try { curves.k256 = require('./eccjs') }
209+catch (_) {}
209210
210211 function getCurve(keys) {
211212 var curve = keys.curve
212213
@@ -308,4 +309,6 @@
308309
309310 var msg = pb.multibox_open(boxed, sk)
310311 if(msg) return JSON.parse(''+msg)
311312 }
313+
314+
package.jsonView
@@ -10,19 +10,20 @@
1010 "dependencies": {
1111 "blake2s": "~1.0.0",
1212 "chloride": "^2.0.1",
1313 "deep-equal": "~0.2.1",
14- "eccjs": "git://github.com/dominictarr/eccjs.git#586f6d47507184a2efe84684ed0a30605cbc43a5",
1514 "hmac": "~1.0.1",
1615 "mkdirp": "~0.5.0",
1716 "private-box": "~0.0.3",
1817 "ssb-ref": "^2.0.0"
1918 },
2019 "devDependencies": {
20+ "eccjs": "git://github.com/dominictarr/eccjs.git#586f6d47507184a2efe84684ed0a30605cbc43a5",
2121 "tape": "^3.0.3"
2222 },
2323 "scripts": {
2424 "test": "set -e; for t in test/*.js; do node $t; done"
2525 },
2626 "author": "Paul Frazee <pfrazee@gmail.com>",
2727 "license": "MIT"
2828 }
29+

Built with git-ssb-web