def rotate
import bend-collections@1.0.0.0/spec/crypto/sha.bend as Shaimport Base
13# FIPS 4.1.2: ROR_n(x) = SHR_n(x) OR SHL_(32-n)(x).
14def rotate(+x: U32, +n: Nat) -> U32:
15 U32.or(U32.shrn(x, n), U32.shln(x, Nat.sub(32n, n)))
import bend-collections@1.0.0.0/spec/crypto/sha.bend as Shaimport Base
13# FIPS 4.1.2: ROR_n(x) = SHR_n(x) OR SHL_(32-n)(x).
14def rotate(+x: U32, +n: Nat) -> U32:
15 U32.or(U32.shrn(x, n), U32.shln(x, Nat.sub(32n, n)))