@stacks/encryption
Advanced tools
Comparing version 4.3.1-beta.6 to 4.3.1-beta.7
@@ -267,3 +267,3 @@ "use strict"; | ||
const contentHash = (0, sha2Hash_1.hashSha256Sync)(contentBuffer); | ||
return (0, secp256k1_1.verify)(signature, contentHash, publicKey); | ||
return (0, secp256k1_1.verify)(signature, contentHash, publicKey, { strict: false }); | ||
} | ||
@@ -275,3 +275,3 @@ exports.verifyECDSA = verifyECDSA; | ||
const hashedMsg = typeof message === 'string' ? (0, messageSignature_1.hashMessage)(message) : message; | ||
return (0, secp256k1_1.verify)(sig, hashedMsg, publicKey); | ||
return (0, secp256k1_1.verify)(sig, hashedMsg, publicKey, { strict: false }); | ||
} | ||
@@ -278,0 +278,0 @@ exports.verifyMessageSignature = verifyMessageSignature; |
@@ -255,3 +255,3 @@ import { hmac } from '@noble/hashes/hmac'; | ||
const contentHash = hashSha256Sync(contentBuffer); | ||
return verify(signature, contentHash, publicKey); | ||
return verify(signature, contentHash, publicKey, { strict: false }); | ||
} | ||
@@ -262,3 +262,3 @@ export function verifyMessageSignature({ signature, message, publicKey, }) { | ||
const hashedMsg = typeof message === 'string' ? hashMessage(message) : message; | ||
return verify(sig, hashedMsg, publicKey); | ||
return verify(sig, hashedMsg, publicKey, { strict: false }); | ||
} | ||
@@ -265,0 +265,0 @@ export function verifyMessageSignatureRsv({ signature, message, publicKey, }) { |
{ | ||
"name": "@stacks/encryption", | ||
"version": "4.3.1-beta.6", | ||
"version": "4.3.1-beta.7", | ||
"description": "Encryption utilities for Stacks", | ||
@@ -26,3 +26,3 @@ "license": "MIT", | ||
"@scure/bip39": "^1.0.0", | ||
"@stacks/common": "^4.3.1-beta.6", | ||
"@stacks/common": "^4.3.1-beta.7", | ||
"@types/node": "^14.14.43", | ||
@@ -79,3 +79,3 @@ "bs58": "^5.0.0", | ||
}, | ||
"gitHead": "fea12be33771bde23340e4a614f4cf21e973f6b5" | ||
"gitHead": "91b4d7c7a89629471f6d5c9735823bc9fb265d09" | ||
} |
@@ -515,3 +515,6 @@ import { hmac } from '@noble/hashes/hmac'; | ||
const contentHash = hashSha256Sync(contentBuffer); | ||
return verify(signature, contentHash, publicKey); | ||
// verify() is strict: true by default. High-s signatures are rejected, which mirrors libsecp behavior | ||
// Set verify options to strict: false, to support the legacy stacks implementations | ||
// Reference: https://github.com/paulmillr/noble-secp256k1/releases/tag/1.4.0 | ||
return verify(signature, contentHash, publicKey, { strict: false }); | ||
} | ||
@@ -538,3 +541,6 @@ | ||
const hashedMsg = typeof message === 'string' ? hashMessage(message) : message; | ||
return verify(sig, hashedMsg, publicKey); | ||
// verify() is strict: true by default. High-s signatures are rejected, which mirrors libsecp behavior | ||
// Set verify options to strict: false, to support the legacy stacks implementations | ||
// Reference: https://github.com/paulmillr/noble-secp256k1/releases/tag/1.4.0 | ||
return verify(sig, hashedMsg, publicKey, { strict: false }); | ||
} | ||
@@ -541,0 +547,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
811590
4390
Updated@stacks/common@^4.3.1-beta.7