def rotr

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/blake/blake2b.bend:42

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/blake/blake2b.bend as Blake2b
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake2b/types.bend as T

42# Right rotation of a 64-bit word by n (0 <= n < 64).
43def rotr(a: T.Lane, +n: Nat) -> T.Lane:
44  match a n:
45    case T.W{lo,hi} 0n: T.W{lo,hi}
46    case T.W{lo,hi} 32n: T.W{hi,lo}
47    case T.W{lo,hi} n: rotr_split(lo,hi,n,Nat.is_lt(n,32n))

Uses (4)

Used by (14)