[ 21-DOT-DEV/swift-secp256k1 ] feat(libsecp256k1): Default to small multiplication tables (#1264)
- feat(libsecp256k1): Default to small multiplication tables
The unconditional base compile definitions now build the small profile — ECMULT_WINDOW_SIZE=8 with COMB_BLOCKS=2/COMB_TEETH=5, roughly 10 KiB of lookup tables — replacing the accidental window-15/comb-11 layout that cost consumers about 1 MiB of binary size; signing and verification run about 6–11% slower in exchange, measured with upstream libsecp256k1's own bench binary compiled at each exact macro configuration. Two opt-in package traits recover or shrink further: performanceTables (window 15, comb 43/6, ~1.1 MiB, ~7–9% faster signing and verification) and liteTables (window 4, ~2.5 KiB, ~12% slower verification with signing unaffected). Their .when(traits:) definitions follow the base definitions and override by last-wins macro redefinition, so enabling both resolves to liteTables by documented ordering precedence rather than a compile error — symbol-graph extraction enables every trait, and a hard error would make the package undocumentable.
Because that ordering is not a documented SwiftPM contract, Scripts/verify-table-profiles.sh proves each trait combination by measuring the compiled precomputed_ecmult object files — the profiles differ by orders of magnitude, so a broken override cannot hide — wired into a new CI job, with Projects/Resources/libsecp256k1Tests/Shared.xcconfig mirroring the base values manually and verified against the upstream C suite. Documentation carries the traits: [.defaults, …] adoption pattern (a trait set replaces the defaults rather than adding to them), the warnings-as-errors opt-in limitation, and the probe-verified boundary that the Xcode compilation condition reaches command-line swift build only from the Swift 6.4 toolchain generation. ADR 0009 records the decision; plan, research, and tasks land under Development/Specs/006-table-profiles/.
- docs(Specs): Renumber table-profiles to 008 and codify allocation
https://github.com/21-DOT-DEV/swift-secp256k1/commit/c95acf320e2e9a15aeefcf24200aa8fe1283549e