doc: pass M, not Mi, to normalize in modinv_var #1992

pull fametrano wants to merge 1 commits into bitcoin-core:master from fametrano:doc-safegcd-modinv-var-normalize changing 1 files +1 −1
  1. fametrano commented at 8:56 AM on November 8, 2026: contributor

    modinv_var in section 7 of doc/safegcd_implementation.md calls normalize(f, d, Mi), but normalize takes the modulus M. As written it returns the right inverse for 1 of 2008 inputs; with M, for all 2008.

  2. doc: pass M, not Mi, to normalize in modinv_var f901165097
  3. Yudis-bit commented at 1:27 PM on November 8, 2026: contributor

    Running section 7 modinv_var fails on all inputs other than 1 when passing Mi to normalize. In section 4 and 7 normalize(sign, v, M) expects the modulus M to bring v into [0, M). Fix looks correct.

  4. fametrano commented at 6:59 AM on November 9, 2026: contributor

    The two Wine jobs fail because ubuntu-latest is now ubuntu-26.04: every test exits with wine: socket : Function not implemented. The last green Wine jobs, on master on 2026-11-04 and on PRs up to 2026-11-06, ran on ubuntu-24.04, so master and other PRs should hit this too. Pinning mingw_debian to ubuntu-24.04 would be one way out.

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-11-12 08:15 UTC

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