def zero_count_if
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/sha512.bend as Sha512import Base
156# The k zero bytes with n + 1 + k = 112 (mod 128): a remainder of 0..111 leaves
157# room for the length in this block, one of 112..127 needs another block.
158def zero_count_if(r: Nat, fits: Bool) -> Nat:
159 match fits:
160 case True{}:
161 Nat.sub(111n, r)
162 case False{}:
163 Nat.sub(239n, r)