Des.des.pick: def of bend-osdev-legacy-ciphers@0.1.0.0 Import: import bend-osdev-legacy-ciphers@0.1.0.0/des.bend as Des Lines 129-135 of bend-osdev-legacy-ciphers@0.1.0.0/des.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/des.bend&start_line=129&end_line=135 import Base import bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend as L # the bits a table picks: entry t is bit t of bs def des.pick(tab: List<&2, Nat>, +bs: List<&2, Bool>) -> List<&2, Bool>: match tab: case Nil{}: Nil{} case Con{t, rest}: Con{L.lc.nth(bs, Nat.sub(t, 1n)), des.pick(rest, bs)} Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend&name=lc.nth