RC4 rng and state saving & restoring