W64.minv: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend as W64 Lines 583-586 of bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend&start_line=583&end_line=586 import Base import bend-collections-laws-crypto@1.0.0.0/src/math/u64.bend as W # -1 / m mod 2^64 for odd m (m is its own inverse mod 8; five Newton steps # reach 96 >= 64 bits) def minv(+m: W.U64) -> W.U64: sub(W.U64{0, 0}, inv_step(m, inv_step(m, inv_step(m, inv_step(m, inv_step(m, m)))))) Uses (3): https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/u64.bend&name=U64 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend&name=inv_step https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend&name=sub