In a wireless communication system, a method and system for implementing
the A5/3 encryption algorithm for GSM and EDGE compliant handsets are
provided. Input variables may be initialized in a keystream generator and
an intermediate value may be generated with a cipher key parameter and a
key modifier. A number of processing blocks of output bits may be
determined based on a number of bits in an output keystream. The
processing blocks of output bits may be generated utilizing a KASUMI
operation and may be based on an immediately previous processing block of
output bits, the intermediate value, and an indication of the processing
block of output bits being processed. The processing blocks of output
bits may be generated after an indication that an immediately previous
processing block of output bits is available and may be grouped into two
final blocks of output bits in the output keystream.