mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-16 16:28:50 +00:00
support old and new versions of libsecp256k1
This commit is contained in:
@ -76,7 +76,15 @@ bool verifySig(secp256k1_context* ctx, std::string_view sig, std::string_view ha
|
|||||||
secp256k1_xonly_pubkey pubkeyParsed;
|
secp256k1_xonly_pubkey pubkeyParsed;
|
||||||
if (!secp256k1_xonly_pubkey_parse(ctx, &pubkeyParsed, (const uint8_t*)pubkey.data())) throw herr("verify sig: bad pubkey");
|
if (!secp256k1_xonly_pubkey_parse(ctx, &pubkeyParsed, (const uint8_t*)pubkey.data())) throw herr("verify sig: bad pubkey");
|
||||||
|
|
||||||
return secp256k1_schnorrsig_verify(ctx, (const uint8_t*)sig.data(), (const uint8_t*)hash.data(), &pubkeyParsed);
|
return secp256k1_schnorrsig_verify(
|
||||||
|
ctx,
|
||||||
|
(const uint8_t*)sig.data(),
|
||||||
|
(const uint8_t*)hash.data(),
|
||||||
|
#ifdef SECP256K1_SCHNORRSIG_EXTRAPARAMS_INIT // old versions of libsecp256k1 didn't take a msg size param, this define added just after
|
||||||
|
hash.size(),
|
||||||
|
#endif
|
||||||
|
&pubkeyParsed
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void verifyNostrEvent(secp256k1_context *secpCtx, const NostrIndex::Event *flat, const tao::json::value &origJson) {
|
void verifyNostrEvent(secp256k1_context *secpCtx, const NostrIndex::Event *flat, const tao::json::value &origJson) {
|
||||||
|
Reference in New Issue
Block a user