tests: always use for, it testing style
This commit is contained in:
parent
61b4216afb
commit
f20ffec8b3
4 changed files with 20 additions and 13 deletions
test
|
@ -13,8 +13,8 @@ var fixtures = require('./fixtures/ecdsa.json')
|
|||
|
||||
describe('ecdsa', function() {
|
||||
describe('deterministicGenerateK', function() {
|
||||
it('matches the test vectors', function() {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
it('determines k for \"' + f.message + '\"', function() {
|
||||
var d = BigInteger.fromHex(f.d)
|
||||
var h1 = crypto.sha256(f.message)
|
||||
|
||||
|
@ -40,8 +40,8 @@ describe('ecdsa', function() {
|
|||
})
|
||||
|
||||
describe('sign', function() {
|
||||
it('matches the test vectors', function() {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
it('produces a deterministic signature for \"' + f.message + '\"', function() {
|
||||
var d = BigInteger.fromHex(f.d)
|
||||
var hash = crypto.sha256(f.message)
|
||||
var signature = ecdsa.sign(ecparams, hash, d)
|
||||
|
@ -62,8 +62,8 @@ describe('ecdsa', function() {
|
|||
})
|
||||
|
||||
describe('verifyRaw', function() {
|
||||
it('verifies valid signatures', function() {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
it('verifies a valid signature for \"' + f.message + '\"', function() {
|
||||
var d = BigInteger.fromHex(f.d)
|
||||
var Q = ecparams.getG().multiply(d)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue