Motivation
- Cover the previously-untested TODO in test_exhaustive_extrakeys to ensure x-only pubkey and keypair tweak APIs are exhaustively validated.
- Validate success/failure behavior for every non-zero internal key and every tweak scalar in the exhaustive test group.
- Ensure consistency between xonly_pubkey_tweak_add, xonly_pubkey_tweak_add_check, and keypair_xonly_tweak_add
and detect edge cases (resulting infinity, parity/x-coordinate mismatches).
Description
Replaced the TODO in src/modules/extrakeys/tests_exhaustive_impl.h with nested loops that exercise every internal non-zero key and every tweak scalar and compute the expected resulting group element and parity. For each case the test exercises secp256k1_xonly_pubkey_tweak_add, secp256k1_keypair_xonly_tweak_add, secp256k1_xonly_pubkey_tweak_add_check, and verifies serialized compressed pubkey bytes and x-only serialization against the expected group point. Fixed test-side issues: call secp256k1_fe_get_b32 without wrapping in CHECK (avoids invalid use of EXPECT), normalize field elements before checking parity and exporting to bytes, reset serialized_pklen prior to reuse, and derive the keypair secret bytes via secp256k1_scalar_get_b32 for deterministic keypair creation in the exhaustive loop. All changes are contained in src/modules/extrakeys/tests_exhaustive_impl.h and only affect the exhaustive test code