law rc4_involution
import bend-osdev-legacy-ciphers@0.1.0.0/LAWS.bend as LAWSimport 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
192# the cipher is its own inverse: from one state, applied twice, the data
193# comes back
194law rc4_involution:
195 for +st: R.LcRc4State
196 for +m: B.Octets
197 {R.LcRc4.out_data(R.LcRc4.update(st, R.LcRc4.out_data(R.LcRc4.update(st, m)))) == m : B.Octets}