Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error: too few arguments to function ‘int secp256k1_schnorrsig_verify #2

Closed
arbedout opened this issue Jan 10, 2023 · 3 comments

Comments

@arbedout
Copy link

Running into this when trying to make HEAD of master branch`. (First pre-coffee thought: do I have the right secp256k1 C++ lib, or should I be downloading and installing https://github.com/bitcoin-core/secp256k1 instead?)

# uname -a
Linux relay-001 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/quadrable/include -MMD -MP -MT src/events.o -MF src/events.d -c src/events.cpp -o src/events.o
src/events.cpp: In function ‘std::string nostrHash(const value&)’:
src/events.cpp:66:16: warning: ‘int SHA256_Init(SHA256_CTX*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
   66 |     SHA256_Init(&sha256);
      |     ~~~~~~~~~~~^~~~~~~~~
In file included from src/events.h:3,
                 from src/events.cpp:1:
/usr/include/openssl/sha.h:73:27: note: declared here
   73 | OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c);
      |                           ^~~~~~~~~~~
src/events.cpp:67:18: warning: ‘int SHA256_Update(SHA256_CTX*, const void*, size_t)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
   67 |     SHA256_Update(&sha256, encoded.data(), encoded.size());
      |     ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/events.h:3,
                 from src/events.cpp:1:
/usr/include/openssl/sha.h:74:27: note: declared here
   74 | OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c,
      |                           ^~~~~~~~~~~~~
src/events.cpp:68:17: warning: ‘int SHA256_Final(unsigned char*, SHA256_CTX*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
   68 |     SHA256_Final(hash, &sha256);
      |     ~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from src/events.h:3,
                 from src/events.cpp:1:
/usr/include/openssl/sha.h:76:27: note: declared here
   76 | OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c);
      |                           ^~~~~~~~~~~~
src/events.cpp: In function ‘bool verifySig(secp256k1_context*, std::string_view, std::string_view, std::string_view)’:
src/events.cpp:79:102: error: invalid conversion from ‘secp256k1_xonly_pubkey*’ to ‘size_t’ {aka ‘long unsigned int’} [-fpermissive]
   79 |     return secp256k1_schnorrsig_verify(ctx, (const uint8_t*)sig.data(), (const uint8_t*)hash.data(), &pubkeyParsed);
      |                                                                                                      ^~~~~~~~~~~~~
      |                                                                                                      |
      |                                                                                                      secp256k1_xonly_pubkey*
src/events.cpp:79:39: error: too few arguments to function ‘int secp256k1_schnorrsig_verify(const secp256k1_context*, const unsigned char*, const unsigned char*, size_t, const secp256k1_xonly_pubkey*)’
   79 |     return secp256k1_schnorrsig_verify(ctx, (const uint8_t*)sig.data(), (const uint8_t*)hash.data(), &pubkeyParsed);
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/events.h:4,
                 from src/events.cpp:1:
/usr/include/secp256k1_schnorrsig.h:158:48: note: declared here
  158 | SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_schnorrsig_verify(
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [golpe/rules.mk:26: src/events.o] Error 1
@hoytech
Copy link
Owner

hoytech commented Jan 10, 2023

Ack... Yeah I was building against the older version of secp256k1 that was included with debian. I think in this version they didn't require the length parameter, but added that later. I'm looking into if it's possible to work with both versions now.

@hoytech
Copy link
Owner

hoytech commented Jan 10, 2023

Can you please git pull and try again? It should work with both versions of libsecp256k now. Thanks for the report!

@arbedout
Copy link
Author

Awesome, that fixed it. Thank you so much, looking forward to trying strfry out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants