def rotr_split

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

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

46# 32 <= n < 64: rotating by 32 swaps the halves, then rotate by n - 32.
47def rotr_split(+hi: U32, +lo: U32, +n: Nat, small: Bool) -> T.Lane:
48  match small:
49    case True{}:
50      rotr_small(hi, lo, n)
51    case False{}:
52      rotr_small(lo, hi, Nat.sub(n, 32n))

Uses (6)

Used by (1)