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

secp256k1 from Bitcoin core v25.0 marks secp256k1_ec_privkey_tweak_add in bip32 as deprecated #5

Open
PMK opened this issue Jul 21, 2023 · 2 comments

Comments

@PMK
Copy link

PMK commented Jul 21, 2023

secp256k1 from Bitcoin core v25.0 marks secp256k1_ec_privkey_tweak_add as deprecated in bip32.h and bip32.c.

$ make check
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o check.o check.c
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o sha256.o sha256.c
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o sha512.o sha512.c
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o ripemd160.o ripemd160.c
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o hmac.o hmac.c
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o hkdf.o hkdf.c
cc  -DHAVE_LITTLE_ENDIAN -O2 -g -I src -Wall -Werror -Wextra -std=c99   -c -o bip32.o bip32.c
bip32.c: In function 'bip32_key_from_parent':
bip32.c:454:9: error: 'secp256k1_ec_privkey_tweak_add' is deprecated: Use secp256k1_ec_seckey_tweak_add instead [-Werror=deprecated-declarations]
  454 |         if (!secp256k1_ec_privkey_tweak_add(ctx, key_out->priv_key + 1,
      |         ^~
In file included from bip32.h:6,
                 from bip32.c:7:
/usr/local/include/secp256k1.h:756:48: note: declared here
  756 | SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bip32.c:477:13: error: 'secp256k1_ec_privkey_tweak_add' is deprecated: Use secp256k1_ec_seckey_tweak_add instead [-Werror=deprecated-declarations]
  477 |             !secp256k1_ec_privkey_tweak_add(ctx, pub_key.data,
      |             ^
In file included from bip32.h:6,
                 from bip32.c:7:
/usr/local/include/secp256k1.h:756:48: note: declared here
  756 | SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: bip32.o] Error 1

Removing -Werror as CFLAGS will prevent the error. However, running make check still returns errors and running ./clightning-dumpkey path/to/hsm_secret results in error while loading shared libraries: libsecp256k1.so.2: cannot open shared object file: No such file or directory. I guess this is due to the errors I get?

Note: I didn't test this on other versions.

@jb55
Copy link
Owner

jb55 commented Jul 25, 2023 via email

@Sjors
Copy link

Sjors commented Aug 1, 2023

This deprecation is older than the first tag. Going back to 3db0560606acb285cc7ef11662ce166ed67e9015 is an effective workaround.

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

3 participants