ecmult: fix definition of STRAUSS_SCRATCH_OBJECTS #1004

pull jonasnick wants to merge 1 commits into bitcoin-core:master from jonasnick:fix-strauss changing 1 files +9 −3
  1. jonasnick commented at 8:45 PM on November 6, 2021: contributor

    This bug was introduced in 7506e064d791e529d2e57bb52c156deb33b897ef by adding an allocation but not updating the constant.

  2. real-or-random commented at 10:24 AM on November 8, 2021: contributor

    Good to move this to a separate PR.

    Unfortunately the constants are highly coupled with the allocation code. Can you add a comment to the allocation code that says that the constant must be updated when this is changed (also for pippenger)? Otherwise I bet we'll get this wrong again in the future.

  3. robot-dreams commented at 5:19 PM on November 28, 2021: contributor

    Thanks for catching this. Looks good to me—I confirmed that:

    • secp256k1_ecmult_strauss_batch now has 7 calls to secp256k1_scratch_alloc instead of 6
    • What matters for STRAUSS_SCRATCH_OBJECTS is the number of allocations (not the total size being allocated), since it's used to account for per-allocation alignment padding

    I agree with @real-or-random 's suggestion. In addition, do the functions secp256k1_strauss_scratch_size and secp256k1_pippenger_scratch_size also need to be kept in sync when allocations are updated?

  4. jonasnick force-pushed on Nov 30, 2021
  5. ecmult: fix definition of STRAUSS_SCRATCH_OBJECTS
    This bug was introduced in 7506e064d791e529d2e57bb52c156deb33b897ef by adding
    an allocation but not updating the constant.
    60bf8890df
  6. jonasnick commented at 7:25 PM on November 30, 2021: contributor

    Good idea. Added comments.

  7. real-or-random approved
  8. real-or-random commented at 7:39 PM on November 30, 2021: contributor

    ACK 60bf8890df5360148df921f26d8dc4d667dd5926

  9. real-or-random commented at 3:05 PM on December 2, 2021: contributor

    @robot-dreams Want give a final review here?

  10. robot-dreams commented at 3:30 PM on December 2, 2021: contributor

    ACK 60bf8890df5360148df921f26d8dc4d667dd5926

  11. real-or-random merged this on Dec 2, 2021
  12. real-or-random closed this on Dec 2, 2021

  13. fanquake referenced this in commit c4a1e09a8c on Dec 3, 2021
  14. sipa referenced this in commit 86dbc4d075 on Dec 15, 2021
  15. real-or-random referenced this in commit 21e2d65b79 on Jan 5, 2022
  16. gwillen referenced this in commit 35d6112a72 on May 25, 2022
  17. janus referenced this in commit 879a9a27b9 on Jul 10, 2022
  18. patricklodder referenced this in commit 21badcf9d2 on Jul 25, 2022
  19. patricklodder referenced this in commit 03002a9013 on Jul 28, 2022
  20. backpacker69 referenced this in commit 77186f4a04 on Jan 18, 2023
  21. str4d referenced this in commit 6de4698bf9 on Apr 21, 2023
  22. vmta referenced this in commit e1120c94a1 on Jun 4, 2023
  23. vmta referenced this in commit 8f03457eed on Jul 1, 2023
  24. Fabcien referenced this in commit f7c5b7db0d on Jan 14, 2026
  25. Fabcien referenced this in commit 7b5fa55012 on Jan 14, 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