Rand.pow2mod: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/spec/math/random/rand.bend as Rand Lines 45-50 of bend-collections-laws-crypto@1.0.0.0/spec/math/random/rand.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/math/random/rand.bend&start_line=45&end_line=50 import Base def pow2mod(w: Nat, +n: Nat) -> Nat: match w: case 0n: Nat.mod(1n, n) case 1n+k: Nat.mod(Nat.double(pow2mod(k, n)), n) Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.double https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mod