def pow2mod
import bend-collections-laws-crypto@1.0.0.0/spec/math/random/rand.bend as Randimport Base
45def pow2mod(w: Nat, +n: Nat) -> Nat:
46 match w:
47 case 0n:
48 Nat.mod(1n, n)
49 case 1n+k:
50 Nat.mod(Nat.double(pow2mod(k, n)), n)
Uses (3)
Used by (20)
- bend-collections-laws-crypto@1.0.0.0/spec/math/random/rand:lemire
- bend-collections-laws-crypto@1.0.0.0/proofs/math/random/lemire:pm
- bend-collections-laws-crypto@1.0.0.0/proofs/math/random/uint64n:hd_of
- bend-collections-laws-crypto@1.0.0.0/proofs/math/random/uint64n:dec
- bend-collections-laws-crypto@1.0.0.0/proofs/math/random/uint64n:pm_one
- …