def rotr
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
54# FIPS 180-4 section 3.2: ROTR^n(x) = (x >> n) OR (x << 64 - n), 0 < n < 64.
55def rotr(x: T.Lane, +n: Nat) -> T.Lane:
56 match x:
57 case T.W{+hi, +lo}:
58 rotr_split(hi, lo, n, Nat.is_lt(n, 32n))