def rc4.swap

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

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

63# S with entries i and j exchanged
64def rc4.swap(+s: L.LcTab, +i: U32, +j: U32) -> L.LcTab:
65  +a = rc4.at(s, i)
66  +b = rc4.at(s, j)
67  rc4.set(rc4.set(s, rc4.path(8n, i), b), rc4.path(8n, j), a)

Uses (5)

Used by (2)