Compare commits

..

1 Commits

Author SHA1 Message Date
Lee Miller ec7f549383
Add more tests for signatures 2024-03-31 00:21:55 +02:00
1 changed files with 2 additions and 6 deletions

View File

@ -27,7 +27,7 @@ var sha1 = exports.sha1 = platform.sha1;
* @return {Buffer} Resulting hash.
* @function
*/
var sha256 = exports.sha256 = platform.sha256;
exports.sha256 = platform.sha256;
/**
* Calculate SHA-512 hash.
@ -91,11 +91,7 @@ exports.sign = function(privateKey, msg) {
*/
exports.verify = function(publicKey, msg, sig) {
var hash = sha1(msg);
var result = eccrypto.verify(publicKey, hash, sig).catch(function() {
hash = sha256(msg);
return eccrypto.verify(publicKey, hash, sig);
});
return result;
return eccrypto.verify(publicKey, hash, sig);
};
var SECP256K1_TYPE = 714;