Fix bad Bitcoin.Crypto reference in ecdsa.js
This commit is contained in:
parent
be7406d9a9
commit
c3fbd63c84
1 changed files with 7 additions and 6 deletions
13
src/ecdsa.js
13
src/ecdsa.js
|
@ -3,6 +3,7 @@ var util = require('./util');
|
|||
var SecureRandom = require('./jsbn/rng');
|
||||
var BigInteger = require('./jsbn/jsbn');
|
||||
var conv = require('./convert')
|
||||
var Crypto = require('./crypto-js/crypto.js')
|
||||
|
||||
var ECPointFp = require('./jsbn/ec').ECPointFp;
|
||||
|
||||
|
@ -42,12 +43,12 @@ function deterministicGenerateK(hash,key) {
|
|||
var k = [];
|
||||
for (var i = 0;i < 32;i++) v.push(1);
|
||||
for (var i = 0;i < 32;i++) k.push(0);
|
||||
k = Bitcoin.Crypto.HMAC(Bitcoin.Crypto.SHA256,v.concat([0]).concat(key).concat(hash),k,{ asBytes: true })
|
||||
v = Bitcoin.Crypto.HMAC(Bitcoin.Crypto.SHA256,v,k,{ asBytes: true })
|
||||
k = Bitcoin.Crypto.HMAC(Bitcoin.Crypto.SHA256,v.concat([1]).concat(key).concat(hash),k,{ asBytes: true })
|
||||
v = Bitcoin.Crypto.HMAC(Bitcoin.Crypto.SHA256,v,k,{ asBytes: true })
|
||||
v = Bitcoin.Crypto.HMAC(Bitcoin.Crypto.SHA256,v,k,{ asBytes: true })
|
||||
return Bitcoin.BigInteger.fromByteArrayUnsigned(v);
|
||||
k = Crypto.HMAC(Crypto.SHA256,v.concat([0]).concat(key).concat(hash),k,{ asBytes: true })
|
||||
v = Crypto.HMAC(Crypto.SHA256,v,k,{ asBytes: true })
|
||||
k = Crypto.HMAC(Crypto.SHA256,v.concat([1]).concat(key).concat(hash),k,{ asBytes: true })
|
||||
v = Crypto.HMAC(Crypto.SHA256,v,k,{ asBytes: true })
|
||||
v = Crypto.HMAC(Crypto.SHA256,v,k,{ asBytes: true })
|
||||
return BigInteger.fromByteArrayUnsigned(v);
|
||||
}
|
||||
|
||||
var ECDSA = {
|
||||
|
|
Loading…
Add table
Reference in a new issue