eckey: Call ecmult with NULL instead of zero scalar
What changed, and why it matters
This is a one-line internal code cleanup in Bitcoin's secp256k1 cryptographic library. It changes how a public-key tweaking function passes a zero value to the elliptic-curve multiplication routine, switching from an explicit zero scalar to a special NULL pointer that the same routine already understands. The commit message gives no security rationale, and the diff alone does not show a fix for an exploitable bug. It is best treated as a defensive correctness or performance simplification rather than a security patch.
No urgent action. Reviewers may verify that `secp256k1_ecmult` documents and correctly handles NULL for the second scalar argument, and that existing tests for public-key tweak multiplication still pass. Consider whether the NULL convention should be documented more explicitly to prevent future misuse.
Security signals we found
Single-line change in low-level elliptic-curve key tweaking code
No commit-message claim of security relevance
No test, documentation, or changelog changes accompanying the patch
Change is semantically equivalent if the callee treats NULL as zero scalar
Evidence from the diff
In secp256k1_eckey_pubkey_tweak_mul, the call to secp256k1_ecmult is changed so the second scalar argument is NULL instead of &secp256k1_scalar_zero. The ecmult implementation conventionally treats a NULL scalar as zero, so the mathematical result is unchanged. The change removes a dependency on the secp256k1_scalar_zero constant and may let the multiplier take a slightly faster path, but no vulnerability is evident from the diff.
Changed components
src/eckey_impl.hsecp256k1_eckey_pubkey_tweak_mulInspect captured patch +1 / −1
diff --git a/src/eckey_impl.h b/src/eckey_impl.h
index 48745e8..57024e4 100644
--- a/src/eckey_impl.h
+++ b/src/eckey_impl.h
@@ -86,7 +86,7 @@ static int secp256k1_eckey_pubkey_tweak_mul(secp256k1_ge *key, const secp256k1_s
}
secp256k1_gej_set_ge(&pt, key);
- secp256k1_ecmult(&pt, &pt, tweak, &secp256k1_scalar_zero);
+ secp256k1_ecmult(&pt, &pt, tweak, NULL);
secp256k1_ge_set_gej(key, &pt);
return 1;
}
Why this scored 27/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.