Sha512.zero_count_if: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/spec/crypto/sha512.bend as Sha512 Lines 156-163 of bend-collections-laws-crypto@1.0.0.0/spec/crypto/sha512.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/sha512.bend&start_line=156&end_line=163 import Base # The k zero bytes with n + 1 + k = 112 (mod 128): a remainder of 0..111 leaves # room for the length in this block, one of 112..127 needs another block. def zero_count_if(r: Nat, fits: Bool) -> Nat: match fits: case True{}: Nat.sub(111n, r) case False{}: Nat.sub(239n, r) Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub