more keypair stuff.
This commit is contained in:
parent
99fac69127
commit
a367674584
@ -279,8 +279,6 @@ script.getSubscript = function getSubscript(s, lastSep) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
script.checksig = function checksig(msg, sig, key) {
|
script.checksig = function checksig(msg, sig, key) {
|
||||||
var k;
|
|
||||||
|
|
||||||
if (key.getPublic)
|
if (key.getPublic)
|
||||||
key = key.getPublic();
|
key = key.getPublic();
|
||||||
|
|
||||||
@ -292,18 +290,6 @@ script.checksig = function checksig(msg, sig, key) {
|
|||||||
|
|
||||||
sig = sig.slice(0, -1);
|
sig = sig.slice(0, -1);
|
||||||
|
|
||||||
try {
|
|
||||||
k = bcoin.ecdsa.keyPair({ pub: key });
|
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Points at Infinity make verify() throw.
|
|
||||||
// This specifically throws on wallet-test.js
|
|
||||||
// where [1] is concatted to the pubkey.
|
|
||||||
if (k.getPublic().isInfinity())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Use a try catch in case there are
|
// Use a try catch in case there are
|
||||||
// any uncaught errors for bad inputs in verify().
|
// any uncaught errors for bad inputs in verify().
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -670,10 +670,10 @@ Wallet.prototype.createKey = function createKey(change, index) {
|
|||||||
delete this._firstKey;
|
delete this._firstKey;
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
key = bcoin.ecdsa.genKeyPair();
|
key = bcoin.keypair();
|
||||||
return {
|
return {
|
||||||
privateKey: key.getPrivate().toArray(),
|
privateKey: key.privateKey,
|
||||||
publicKey: key.getPublic(true, 'array')
|
publicKey: key.publicKey
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user