An encryption processing system implements an encryption algorithm using a memory
system comprising a multiple-port memory by performing at least one set of parallel
read and write operations to the memory. The algorithm is, for example, the conventional
ARCFOUR (or RC4) algorithm, and the key and state array used in the ARCFOUR algorithm
are stored in the multiple port memory. During execution of the ARCFOUR algorithm,
a read from one port of the multiple port memory of a state array value is done
while another port is used to write a new value to the state array. The use of
such parallel read and write operations uses a comparator system that determines
whether to use certain previously-read values from the state array or to read a
new value from the state array when selecting the pseudorandom K byte to calculate
the output data byte.