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. jonasnick cross-referenced this on Nov 6, 2021 from issue Function to compute optimal ecmult_multi scratch size for a number of points by jonasnick
  3. 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.

  4. 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?

  5. jonasnick force-pushed on Nov 30, 2021
  6. ecmult: fix definition of STRAUSS_SCRATCH_OBJECTS
    This bug was introduced in 7506e064d791e529d2e57bb52c156deb33b897ef by adding
    an allocation but not updating the constant.
    60bf8890df
  7. jonasnick commented at 7:25 pm on November 30, 2021: contributor
    Good idea. Added comments.
  8. real-or-random approved
  9. real-or-random commented at 7:39 pm on November 30, 2021: contributor
    ACK 60bf8890df5360148df921f26d8dc4d667dd5926
  10. real-or-random commented at 3:05 pm on December 2, 2021: contributor
    @robot-dreams Want give a final review here?
  11. robot-dreams commented at 3:30 pm on December 2, 2021: contributor
    ACK 60bf8890df5360148df921f26d8dc4d667dd5926
  12. real-or-random merged this on Dec 2, 2021
  13. real-or-random closed this on Dec 2, 2021

  14. fanquake referenced this in commit c4a1e09a8c on Dec 3, 2021
  15. sipa referenced this in commit 86dbc4d075 on Dec 15, 2021
  16. sipa cross-referenced this on Dec 15, 2021 from issue Update libsecp256k1 subtree to current master by sipa
  17. jonasnick cross-referenced this on Jan 2, 2022 from issue Sync Upstream by jonasnick
  18. real-or-random referenced this in commit 21e2d65b79 on Jan 5, 2022
  19. gwillen referenced this in commit 35d6112a72 on May 25, 2022
  20. janus referenced this in commit 879a9a27b9 on Jul 10, 2022
  21. patricklodder referenced this in commit 21badcf9d2 on Jul 25, 2022
  22. patricklodder referenced this in commit 03002a9013 on Jul 28, 2022
  23. backpacker69 referenced this in commit 77186f4a04 on Jan 18, 2023
  24. str4d referenced this in commit 6de4698bf9 on Apr 21, 2023
  25. vmta referenced this in commit e1120c94a1 on Jun 4, 2023
  26. vmta referenced this in commit 8f03457eed on Jul 1, 2023

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: 2024-11-22 18:15 UTC

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