refactor: the whole thing (#102)

This commit is contained in:
David Dias
2017-07-22 10:57:27 -07:00
committed by GitHub
parent c2c6fde394
commit 2f8e234044
43 changed files with 769 additions and 976 deletions

View File

@ -10,28 +10,17 @@ const curves = ['P-256', 'P-384', 'P-521']
curves.forEach((curve) => {
suite.add(`ephemeral key with secrect ${curve}`, (d) => {
crypto.generateEphemeralKeyPair('P-256', (err, res) => {
if (err) {
throw err
}
crypto.keys.generateEphemeralKeyPair('P-256', (err, res) => {
if (err) { throw err }
res.genSharedKey(res.key, (err, secret) => {
if (err) {
throw err
}
if (err) { throw err }
secrets.push(secret)
d.resolve()
})
})
}, {
defer: true
})
}, { defer: true })
})
suite
.on('cycle', (event) => {
console.log(String(event.target))
})
.run({
async: true
})
suite.on('cycle', (event) => console.log(String(event.target)))
.run({async: true})