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.

  13. jonasnick approved
  14. jonasnick commented at 8:31 PM on January 11, 2026: contributor

    ACK 47eb70959a91bbfa10dc209e8ccbe7350f5b9b04

  15. real-or-random commented at 3:26 PM on January 23, 2026: contributor

    @theStack Want to review this?

  16. theStack approved
  17. theStack commented at 6:38 PM on January 25, 2026: contributor

    ACK 47eb70959a91bbfa10dc209e8ccbe7350f5b9b04

  18. real-or-random merged this on Jan 27, 2026
  19. real-or-random closed this on Jan 27, 2026

  20. fanquake referenced this in commit 2fccbea3c8 on Jan 27, 2026
  21. fjahr referenced this in commit 182197f98a on Jan 29, 2026
  22. fjahr referenced this in commit ea9a84ab3c on Jan 31, 2026
  23. fjahr referenced this in commit 23c2527f12 on Feb 8, 2026
  24. real-or-random referenced this in commit 7a5f153d71 on Mar 4, 2026
  25. vmta referenced this in commit 1ddc2f947f on Apr 26, 2026
  26. vmta referenced this in commit 56c40fe100 on Apr 27, 2026

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-05-19 06:52 UTC