Core.len_hi: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/crypto/sha/packed/core.bend as Core Lines 467-478 of bend-collections@1.0.0.0/src/crypto/sha/packed/core.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/crypto/sha/packed/core.bend&start_line=467&end_line=478 import Base # FIPS padding suffix for a message of n bytes, computed with modular # arithmetic. The proofs state the streaming hash in terms of it. def len_hi(+n: Nat) -> U32: +d0 = Nat.div(n, 32n) +d1 = Nat.div(d0, 256n) +d2 = Nat.div(d1, 256n) +d3 = Nat.div(d2, 256n) +d4 = Nat.div(d3, 256n) +d5 = Nat.div(d4, 256n) +d6 = Nat.div(d5, 256n) pack(U32.from_nat(Nat.mod(d6, 256n)), U32.from_nat(Nat.mod(d5, 256n)), U32.from_nat(Nat.mod(d4, 256n)), U32.from_nat(Nat.mod(d3, 256n))) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mod https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/crypto/sha/packed/core.bend&name=pack