def des.picks64

bend-osdev-legacy-ciphers@0.1.0.0 · des.bend:283

import bend-osdev-legacy-ciphers@0.1.0.0/des.bend as Des
import Base

283# the bits that tab picks from the 64-bit key hi:lo, appended to acc
284def des.picks64(tab: List<&2, Nat>, +hi: U32, +lo: U32, acc: U32) -> U32:
285  match tab:
286    case Nil{}:
287      acc
288    case Con{+t, rest}:
289      des.picks64(rest, hi, lo, U32.or(U32.shl(acc), des.kbit.pick(Nat.is_lt(32n, t), hi, lo, t)))

Uses (7)

Used by (1)