Rc4.rc4.next: def of bend-osdev-legacy-ciphers@0.1.0.0 Import: import bend-osdev-legacy-ciphers@0.1.0.0/rc4.bend as Rc4 Lines 95-102 of bend-osdev-legacy-ciphers@0.1.0.0/rc4.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/rc4.bend&start_line=95&end_line=102 import Base # i = i + 1; j = j + S[i]; swap S[i] and S[j]; the byte S[S[i] + S[j]] def rc4.next(st: LcRc4State) -> LcRc4Step: match st: case LcRc4State{+s, i, j}: +i2 = U32.and(255, U32.add(i, 1)) +j2 = U32.and(255, U32.add(j, rc4.at(s, i2))) +s2 = rc4.swap(s, i2, j2) LcRc4Step{LcRc4State{s2, i2, j2}, rc4.at(s2, U32.and(255, U32.add(rc4.at(s2, i2), rc4.at(s2, j2))))} Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/rc4.bend&name=LcRc4State https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/rc4.bend&name=LcRc4Step https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/rc4.bend&name=rc4.at https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/rc4.bend&name=rc4.swap