def low_bytes
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/blake/blake3.bend as Blake3import Base
160# A block holding len bytes (len <= 64) is zero past them: the word at byte
161# offset pos keeps its min(4, len - pos) low bytes.
162def low_bytes(w: U32, k: Nat) -> U32:
163 match k:
164 case 0n: 0
165 case 1n: U32.and(w,255)
166 case 2n: U32.and(w,65535)
167 case 3n: U32.and(w,16777215)
168 case 4n+q: w