Make scalar_add_bit test's overflow detection exact #134

pull sipa wants to merge 1 commits into bitcoin-core:master from sipa:nooverflow changing 4 files +13 −8
  1. sipa commented at 5:31 PM on December 3, 2014: contributor

    The current test does not detect an addition that would end up between the order and 2^256, and very occasionally makes the unit tests fail.

    Do the overflow detection in secp256k1_scalar_add instead, where it can trivially be exact, and use that. Add some bounds checking too.

  2. Make scalar_add_bit test's overflow detection exact 29ae1310ce
  3. sipa force-pushed on Dec 3, 2014
  4. gmaxwell commented at 12:22 AM on December 4, 2014: contributor

    Can you add a test that would have made the original error reliably reproducable?

  5. sipa commented at 12:23 AM on December 4, 2014: contributor

    You want me to add a test that would catch a non-existing bug in the tests?

  6. gmaxwell commented at 12:40 AM on December 4, 2014: contributor

    Oh. derp. I hadn't read the change yet and I was concerned that I hadn't reproduced it here, and misread "the current test" as in the check for overflow.

  7. gmaxwell commented at 1:30 AM on December 4, 2014: contributor

    ACK.

  8. sipa merged this on Dec 4, 2014
  9. sipa closed this on Dec 4, 2014

  10. sipa referenced this in commit 4d879a3a66 on Dec 4, 2014
Contributors

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-04-14 11:15 UTC

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