def mod32

bend-collections-laws-crypto@1.0.0.0 · src/math/w64.bend:135

import bend-collections-laws-crypto@1.0.0.0/src/math/w64.bend as W64
import Base
import bend-collections-laws-crypto@1.0.0.0/src/math/u64.bend as W

135# a mod d for d > 0
136def mod32(+a: W.U64, +d: U32) -> U32:
137  U32.from_nat(mod_step(mod_step(U32.to_nat(U32.mod(hi(a), d)), 65536n, dig1(lo(a)), U32.to_nat(d)), 65536n, dig2(lo(a)), U32.to_nat(d)))

Uses (10)

Used by (7)