def des.pick

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

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

129# the bits a table picks: entry t is bit t of bs
130def des.pick(tab: List<&2, Nat>, +bs: List<&2, Bool>) -> List<&2, Bool>:
131  match tab:
132    case Nil{}:
133      Nil{}
134    case Con{t, rest}:
135      Con{L.lc.nth(bs, Nat.sub(t, 1n)), des.pick(rest, bs)}

Uses (5)

Used by (2)