def rotr_small

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/sha512.bend:40

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/sha512.bend as Sha512
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/sha512/types.bend as T

40# ROTR^n on the halves for 0 < n < 32: each half keeps its bits shifted right
41# and takes the other half's low n bits at the top.
42def rotr_small(+hi: U32, +lo: U32, +n: Nat) -> T.Lane:
43  T.W{U32.or(U32.shrn(hi, n), U32.shln(lo, Nat.sub(32n, n))),
44    U32.or(U32.shrn(lo, n), U32.shln(hi, Nat.sub(32n, n)))}

Uses (7)

Used by (1)