From 405e29b6fd76f59b16091059c9ab4a4fd2f08bf1 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Wed, 26 Nov 2025 15:52:59 +0100 Subject: [PATCH] Remove deprecated `secp256k1_schnorrsig_sign` alias This function has been deprecated since the rename to `_schnorrsig_sign32` more than three and a half years ago (see PR #1089, commit 99e6568fc6), before the first official release 0.2.0. Removing it should be fine by now. --- CHANGELOG.md | 3 +++ include/secp256k1_schnorrsig.h | 13 +------------ src/modules/schnorrsig/main_impl.h | 4 ---- src/modules/schnorrsig/tests_impl.h | 3 --- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53c787b38f..6de4610fed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +#### Removed +- Removed previously deprecated function alias `secp256k1_schnorrsig_sign`. Use `secp256k1_schnorrsig_sign32` instead. + ## [0.7.0] - 2025-07-21 #### Added diff --git a/include/secp256k1_schnorrsig.h b/include/secp256k1_schnorrsig.h index 013d4ee73d..721b3d2f07 100644 --- a/include/secp256k1_schnorrsig.h +++ b/include/secp256k1_schnorrsig.h @@ -124,20 +124,9 @@ SECP256K1_API int secp256k1_schnorrsig_sign32( const unsigned char *aux_rand32 ) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4); -/** Same as secp256k1_schnorrsig_sign32, but DEPRECATED. Will be removed in - * future versions. */ -SECP256K1_API int secp256k1_schnorrsig_sign( - const secp256k1_context *ctx, - unsigned char *sig64, - const unsigned char *msg32, - const secp256k1_keypair *keypair, - const unsigned char *aux_rand32 -) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) - SECP256K1_DEPRECATED("Use secp256k1_schnorrsig_sign32 instead"); - /** Create a Schnorr signature with a more flexible API. * - * Same arguments as secp256k1_schnorrsig_sign except that it allows signing + * Same arguments as secp256k1_schnorrsig_sign32 except that it allows signing * variable length messages and accepts a pointer to an extraparams object that * allows customizing signing by passing additional arguments. * diff --git a/src/modules/schnorrsig/main_impl.h b/src/modules/schnorrsig/main_impl.h index b410b19eca..853e584824 100644 --- a/src/modules/schnorrsig/main_impl.h +++ b/src/modules/schnorrsig/main_impl.h @@ -202,10 +202,6 @@ int secp256k1_schnorrsig_sign32(const secp256k1_context* ctx, unsigned char *sig return secp256k1_schnorrsig_sign_internal(ctx, sig64, msg32, 32, keypair, secp256k1_nonce_function_bip340, (unsigned char*)aux_rand32); } -int secp256k1_schnorrsig_sign(const secp256k1_context* ctx, unsigned char *sig64, const unsigned char *msg32, const secp256k1_keypair *keypair, const unsigned char *aux_rand32) { - return secp256k1_schnorrsig_sign32(ctx, sig64, msg32, keypair, aux_rand32); -} - int secp256k1_schnorrsig_sign_custom(const secp256k1_context* ctx, unsigned char *sig64, const unsigned char *msg, size_t msglen, const secp256k1_keypair *keypair, secp256k1_schnorrsig_extraparams *extraparams) { secp256k1_nonce_function_hardened noncefp = NULL; void *ndata = NULL; diff --git a/src/modules/schnorrsig/tests_impl.h b/src/modules/schnorrsig/tests_impl.h index 9a1b15f0b2..d4a30e7f56 100644 --- a/src/modules/schnorrsig/tests_impl.h +++ b/src/modules/schnorrsig/tests_impl.h @@ -820,9 +820,6 @@ static void test_schnorrsig_sign_internal(void) { CHECK(secp256k1_keypair_xonly_pub(CTX, &pk, NULL, &keypair)); CHECK(secp256k1_schnorrsig_sign32(CTX, sig, msg, &keypair, NULL) == 1); CHECK(secp256k1_schnorrsig_verify(CTX, sig, msg, sizeof(msg), &pk)); - /* Check that deprecated alias gives the same result */ - CHECK(secp256k1_schnorrsig_sign(CTX, sig2, msg, &keypair, NULL) == 1); - CHECK(secp256k1_memcmp_var(sig, sig2, sizeof(sig)) == 0); /* Test different nonce functions */ CHECK(secp256k1_schnorrsig_sign_custom(CTX, sig, msg, sizeof(msg), &keypair, &extraparams) == 1);