merge
This commit is contained in:
commit
6edea532ba
4 changed files with 104 additions and 5 deletions
src
|
@ -285,10 +285,12 @@ var ECDSA = {
|
|||
* This function simply tries all four cases and returns the value
|
||||
* that resulted in a successful pubkey recovery.
|
||||
*/
|
||||
calcPubkeyRecoveryParam: function (address, r, s, hash)
|
||||
calcPubkeyRecoveryParam: function (origPubkey, r, s, hash)
|
||||
{
|
||||
var address = origPubkey.getBitcoinAddress().toString();
|
||||
for (var i = 0; i < 4; i++) {
|
||||
var pubkey = ECDSA.recoverPubKey(r, s, hash, i);
|
||||
pubkey.compressed = origPubkey.compressed;
|
||||
if (pubkey.getBitcoinAddress().toString() == address) {
|
||||
return i;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue