ecmult: Use size_t for array indices #1794

pull real-or-random wants to merge 2 commits into bitcoin-core:master from real-or-random:202601-ecmult-size_t changing 4 files +19 −18
  1. real-or-random commented at 10:43 am on January 7, 2026: contributor

    I don’t think the current code is incorrect, but using size_t improves readability because the type makes it clear that we’re dealing with array indices.

    Also, making the result of the ECMULT_TABLE_SIZE macro (hopefully) a size_t fixes a compiler warning on MSVC, see #1791.

  2. real-or-random added the label tweak/refactor on Jan 7, 2026
  3. ecmult: Use size_t for array indices into tables bb1d199de5
  4. ecmult: Use size_t for array indices in _odd_multiplies_table 47eb70959a
  5. real-or-random force-pushed on Jan 7, 2026
  6. hebasto commented at 11:58 am on January 7, 2026: member

    Concept ACK.

    I came to the same idea while working on #1791, but left it for later :)

  7. hebasto approved
  8. hebasto commented at 12:48 pm on January 7, 2026: member

    ACK 9e7aede41eaf5dd6f4da7e233bc90982476f325e, I have reviewed the code and it looks OK.

    However, there are still more cases to address:

    Also, making the result of the ECMULT_TABLE_SIZE macro (hopefully) a size_t fixes a compiler warning on MSVC, see #1791.

    It does.

  9. real-or-random force-pushed on Jan 7, 2026
  10. real-or-random commented at 2:22 pm on January 7, 2026: contributor

    I think there’s no perfect solution here, but fixing this one will open up the entire business of cleaning up types in secp256k1_ecmult_wnaf (see #1795), and I think this should be a separate PR.

    The same is true for the stuff in ecmult_gen; I think this could be a separate PR.

  11. hebasto approved
  12. hebasto commented at 2:48 pm on January 7, 2026: member
    re-ACK 47eb70959a91bbfa10dc209e8ccbe7350f5b9b04.

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-01-08 23:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me