Add random key, IV functions.

Add functions to generate random keys, IVs, and set the cipher state to
the new settings.