def rc4.path

bend-osdev-legacy-ciphers@0.1.0.0 · rc4.bend:22

import bend-osdev-legacy-ciphers@0.1.0.0/rc4.bend as Rc4
import Base
import bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend as L

22# the bits of i (below 2^d) that pick its entry, most significant first
23def rc4.path(d: Nat, +i: U32) -> List<&2, Bool>:
24  match d:
25    case 0n:
26      Nil{}
27    case 1n+(+p):
28      Con{U32.is_eq(L.lc.bit(i, p), 1), rc4.path(p, i)}

Uses (6)

Used by (2)