Des.des.perm32: 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 169-175 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=169&end_line=175 import Base import bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend as L # a permutation of a 32-bit word (P): entry t is bit t of x def des.perm32(tab: List<&2, Nat>, +x: U32, acc: U32) -> U32: match tab: case Nil{}: acc case Con{t, rest}: des.perm32(rest, x, U32.or(U32.shl(acc), L.lc.bit(x, Nat.sub(32n, t)))) Uses (7): 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=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shl https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend&name=lc.bit