refactor: Rename privkey to seckey in eckey helpers
What changed, and why it matters
This commit is a simple renaming of internal function names from 'privkey' to 'seckey' to match current project terminology. No behavior of the code changes, and there is no security fix or vulnerability introduced.
No security action needed; this is a non-functional rename.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch renames two static helper functions in src/eckey.h and src/eckey_impl.h from secp256k1_eckey_privkey_tweak_add/mul to secp256k1_eckey_seckey_tweak_add/mul, and updates their two call sites in src/secp256k1.c accordingly. The function signatures, bodies, and callers remain otherwise identical. This is a pure refactor with no functional or security changes.
Changed components
src/eckey.hsrc/eckey_impl.hsrc/secp256k1.cInspect captured patch +6 / −6
### src/eckey.h
@@ -14,9 +14,9 @@
#include "ecmult.h"
#include "ecmult_gen.h"
-static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak);
+static int secp256k1_eckey_seckey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak);
static int secp256k1_eckey_pubkey_tweak_add(secp256k1_ge *key, const secp256k1_scalar *tweak);
-static int secp256k1_eckey_privkey_tweak_mul(secp256k1_scalar *key, const secp256k1_scalar *tweak);
+static int secp256k1_eckey_seckey_tweak_mul(secp256k1_scalar *key, const secp256k1_scalar *tweak);
static int secp256k1_eckey_pubkey_tweak_mul(secp256k1_ge *key, const secp256k1_scalar *tweak);
#endif /* SECP256K1_ECKEY_H */
### src/eckey_impl.h
@@ -15,7 +15,7 @@
#include "group.h"
#include "ecmult_gen.h"
-static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak) {
+static int secp256k1_eckey_seckey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak) {
secp256k1_scalar_add(key, key, tweak);
return !secp256k1_scalar_is_zero(key);
}
@@ -32,7 +32,7 @@ static int secp256k1_eckey_pubkey_tweak_add(secp256k1_ge *key, const secp256k1_s
return 1;
}
-static int secp256k1_eckey_privkey_tweak_mul(secp256k1_scalar *key, const secp256k1_scalar *tweak) {
+static int secp256k1_eckey_seckey_tweak_mul(secp256k1_scalar *key, const secp256k1_scalar *tweak) {
int ret;
ret = !secp256k1_scalar_is_zero(tweak);
### src/secp256k1.c
@@ -688,7 +688,7 @@ static int secp256k1_ec_seckey_tweak_add_helper(secp256k1_scalar *sec, const uns
int ret = 0;
secp256k1_scalar_set_b32(&term, tweak32, &overflow);
- ret = (!overflow) & secp256k1_eckey_privkey_tweak_add(sec, &term);
+ ret = (!overflow) & secp256k1_eckey_seckey_tweak_add(sec, &term);
secp256k1_scalar_clear(&term);
return ret;
}
@@ -744,7 +744,7 @@ int secp256k1_ec_seckey_tweak_mul(const secp256k1_context* ctx, unsigned char *s
secp256k1_scalar_set_b32(&factor, tweak32, &overflow);
ret = secp256k1_scalar_set_b32_seckey(&sec, seckey);
- ret &= (!overflow) & secp256k1_eckey_privkey_tweak_mul(&sec, &factor);
+ ret &= (!overflow) & secp256k1_eckey_seckey_tweak_mul(&sec, &factor);
secp256k1_scalar_cmov(&sec, &secp256k1_scalar_zero, !ret);
secp256k1_scalar_get_b32(seckey, &sec);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.