What changed, and why it matters
This commit removes a test-only debug printout that displayed a random 16-byte value at the end of the exhaustive test suite. It does not change any cryptographic code, network behavior, or production logic. There is no security relevance.
No action required. This is a benign test-cleanup change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes the testrand_finish() function and its single call in tests_exhaustive.c. The function only called testrand256() to obtain 32 random bytes and printed the first 16 bytes as a hex string labeled ‘random run = ‘. It was used solely for test reproducibility logging and had no effect on secp256k1’s runtime, API, or cryptographic operations.
Changed components
src/testrand.hsrc/testrand_impl.hsrc/tests_exhaustive.cInspect captured patch +0 / −11
diff --git a/src/testrand.h b/src/testrand.h
index 3c1ed3d..215b6fc 100644
--- a/src/testrand.h
+++ b/src/testrand.h
@@ -42,7 +42,4 @@ static void testrand_flip(unsigned char *b, size_t len);
/** Initialize the test RNG using (hex encoded) array up to 16 bytes, or randomly if hexseed is NULL. */
static void testrand_init(const char* hexseed);
-/** Print final test information. */
-static void testrand_finish(void);
-
#endif /* SECP256K1_TESTRAND_H */
diff --git a/src/testrand_impl.h b/src/testrand_impl.h
index b84f573..6d9fd63 100644
--- a/src/testrand_impl.h
+++ b/src/testrand_impl.h
@@ -158,10 +158,4 @@ static void testrand_init(const char* hexseed) {
testrand_seed(seed16);
}
-static void testrand_finish(void) {
- unsigned char run32[32];
- testrand256(run32);
- printf("random run = %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n", run32[0], run32[1], run32[2], run32[3], run32[4], run32[5], run32[6], run32[7], run32[8], run32[9], run32[10], run32[11], run32[12], run32[13], run32[14], run32[15]);
-}
-
#endif /* SECP256K1_TESTRAND_IMPL_H */
diff --git a/src/tests_exhaustive.c b/src/tests_exhaustive.c
index 13bda61..68d4bec 100644
--- a/src/tests_exhaustive.c
+++ b/src/tests_exhaustive.c
@@ -459,8 +459,6 @@ int main(int argc, char** argv) {
secp256k1_context_destroy(ctx);
}
- testrand_finish();
-
printf("no problems found\n");
return EXIT_SUCCESS;
}
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.