bench: Use `ALIGNMENT` macro instead of hardcoded value
What changed, and why it matters
This is a tiny code cleanup in a benchmark program. It replaces a hardcoded number (16) with a named constant (ALIGNMENT) when calculating memory size. There is no security issue here.
No action needed. This is a benign refactoring commit in benchmark code.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In src/bench_ecmult.c, the benchmark’s scratch buffer size calculation changed from STRAUSS_SCRATCH_OBJECTS16 to STRAUSS_SCRATCH_OBJECTSALIGNMENT. This is a maintainability/refactoring change ensuring the benchmark uses the same alignment constant as the rest of the codebase. It does not alter runtime behavior unless ALIGNMENT differs from 16, and even then it only affects benchmark memory allocation, not production cryptographic code.
Changed components
src/bench_ecmult.cInspect captured patch +1 / −1
diff --git a/src/bench_ecmult.c b/src/bench_ecmult.c
index b2bab65..c9a1d90 100644
--- a/src/bench_ecmult.c
+++ b/src/bench_ecmult.c
@@ -334,7 +334,7 @@ int main(int argc, char **argv) {
}
data.ctx = secp256k1_context_create(SECP256K1_CONTEXT_NONE);
- scratch_size = secp256k1_strauss_scratch_size(POINTS) + STRAUSS_SCRATCH_OBJECTS*16;
+ scratch_size = secp256k1_strauss_scratch_size(POINTS) + STRAUSS_SCRATCH_OBJECTS*ALIGNMENT;
if (!have_flag(argc, argv, "simple")) {
data.scratch = secp256k1_scratch_space_create(data.ctx, scratch_size);
} else {
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.