def shr
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/sha512.bend as Sha512import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/sha512/types.bend as T
60# FIPS 180-4 section 3.2: SHR^n(x) = x >> n, here for 0 < n < 32.
61def shr(x: T.Lane, +n: Nat) -> T.Lane:
62 match x:
63 case T.W{+hi, +lo}:
64 T.W{U32.shrn(hi, n), U32.or(U32.shrn(lo, n), U32.shln(hi, Nat.sub(32n, n)))}