secp: Don't build benchmarks/tests for deps
What changed, and why it matters
This change adjusts the build settings for a cryptographic dependency (libsecp256k1) so that its benchmark and test programs are not compiled into the firmware build. It is a build-hygiene and size-reduction change, not a fix for an exploitable vulnerability. It removes unnecessary code from the build but does not change any runtime security logic.
No urgent action required. Treat as routine build cleanup. Continue to verify that secp256k1 library code itself is kept up to date and that only required modules are enabled.
Security signals we found
Build-system hardening: disables compilation of unused secp256k1 test/benchmark binaries
Reduces build-time attack surface and firmware image size
No runtime code path or cryptographic implementation change
No vendor security disclosure or CVE referenced
Evidence from the diff
The commit adds four CMake cache variables to external/CMakeLists.txt to disable building secp256k1 benchmarks, tests, exhaustive tests, and constant-time tests. These are build-only targets that are not linked into the firmware. The change reduces attack surface and binary size by excluding test/benchmark executables from the build graph, but it does not patch any cryptographic bug or alter secp256k1 library code used by the firmware.
Changed components
external/CMakeLists.txtlibsecp256k1 build configurationInspect captured patch +4 / −0
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index ee7e6d5..cbf5c16 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -25,6 +25,10 @@ string(REPLACE "-mfpu=fpv4-sp-d16" "" MODIFIED_C_FLAGS ${MODIFIED_C_FLAGS_TMP})
set(SECP256K1_ENABLE_MODULE_RECOVERY ON) # needed only in Rust unit tests.
set(SECP256K1_ECMULT_WINDOW_SIZE 2 CACHE STRING "Window size for ecmult precomputation for verification, specified as integer in range [2..24]. \"AUTO\" is a reasonable setting for desktop machines (currently 15). [default=AUTO]" FORCE)
set(SECP256K1_ECMULT_GEN_PREC_BITS 2 CACHE STRING "Precision bits to tune the precomputed table size for signing, specified as integer 2, 4 or 8. \"AUTO\" is a reasonable setting for desktop machines (currently 4). [default=AUTO]" FORCE)
+set(SECP256K1_BUILD_BENCHMARK OFF CACHE BOOL "Build benchmarks.")
+set(SECP256K1_BUILD_TESTS OFF CACHE BOOL "Build tests.")
+set(SECP256K1_BUILD_EXHAUSTIVE_TESTS OFF CACHE BOOL "Build exhaustive tests.")
+set(SECP256K1_BUILD_CTIME_TESTS OFF CACHE BOOL "Build constant-time tests.")
# Suppress all warnings in this directory, we don't have control over them.
set_directory_properties(PROPERTIES
COMPILE_OPTIONS "-w"
Why this scored 18/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.