Determine whether key is compressed from the key itself. ref #61
This commit is contained in:
parent
29ad6b692e
commit
f09890fed1
1 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,7 @@ Message.getHash = function (message) {
|
|||
return Crypto.SHA256(Crypto.SHA256(buffer, {asBytes: true}), {asBytes: true});
|
||||
};
|
||||
|
||||
Message.signMessage = function (key, message, compressed) {
|
||||
Message.signMessage = function (key, message) {
|
||||
var hash = Message.getHash(message);
|
||||
|
||||
var sig = key.sign(hash);
|
||||
|
@ -37,7 +37,7 @@ Message.signMessage = function (key, message, compressed) {
|
|||
var i = ecdsa.calcPubkeyRecoveryParam(key, obj.r, obj.s, hash);
|
||||
|
||||
i += 27;
|
||||
if (compressed) i += 4;
|
||||
if (key.compressed) i += 4;
|
||||
|
||||
var rBa = obj.r.toByteArrayUnsigned();
|
||||
var sBa = obj.s.toByteArrayUnsigned();
|
||||
|
|
Loading…
Reference in a new issue