def rc4_pieces

bend-osdev-legacy-ciphers@0.1.0.0 · check.bend:162

import bend-osdev-legacy-ciphers@0.1.0.0/check.bend as Check
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-osdev-legacy-ciphers@0.1.0.0/rc4.bend as R

162# 48 keystream bytes in pieces of 5, 30 and 13
163def rc4_pieces(k: B.Octets) -> String:
164  +o1 = R.LcRc4.keystream(rc4_state(k), 5n)
165  +o2 = R.LcRc4.keystream(R.LcRc4.out_state(o1), 30n)
166  +o3 = R.LcRc4.keystream(R.LcRc4.out_state(o2), 13n)
167  B.Octets.hex(B.Octets.append(R.LcRc4.out_data(o1), B.Octets.append(R.LcRc4.out_data(o2), R.LcRc4.out_data(o3))))

Uses (8)

Used by (1)