A technique is described to change the codec or MAC (message
authentication code) size in a packet security unit for PacketCable
communications during realtime voice transmissions is described. An
algorithm that provides fast RC4 key advancing to prevent MIPS (millions
of instruction cycles per second) overflow is used to perform codec or
MAC size changes. The invention is performed without changing the keying
material, where the sender and receiver must continue the RC4 encryption
process from its state prior to the codec or MAC size change. A sender
needs to preserve continuity of the timestamp across a codec change,
since the timestamp reflects realtime. Changing the codec or MAC size is
likely to change the frame parameters. To preserve continuity of the RC4
state and the timestamp across the codec/MAC size change, the sender TX
and receiver RX generates a new frame number. The new frame number is
applied to the first frame generated by the new codec or MAC size.