Sha512.shr: 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 60-64 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=60&end_line=64 import Base import bend-collections-laws-crypto@1.0.0.0/src/crypto/sha512/types.bend as T # FIPS 180-4 section 3.2: SHR^n(x) = x >> n, here for 0 < n < 32. def shr(x: T.Lane, +n: Nat) -> T.Lane: match x: case T.W{+hi, +lo}: T.W{U32.shrn(hi, n), U32.or(U32.shrn(lo, n), U32.shln(hi, Nat.sub(32n, n)))} 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.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shln https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shrn https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/sha512/types.bend&name=Lane