Patent ID: 7606364

Claim:
In a storage device having a cipher state memory and a storage media, a method for cipher processing multiple logical data streams of a physical data stream, comprising: maintaining cipher information for the logical data streams in the cipher state memory; receiving a command to write a logical data stream to, or read a logical data stream from, the storage media; if currently cipher processing a previous logical data stream, then switching to cipher processing a received logical data stream by (i) interrupting cipher processing the previous logical data stream, and (ii) storing the cipher information of the previous logical data stream in the cipher state memory, wherein the cipher information of the previous logical data stream includes state information based on the previous logical data stream at the interrupting that enables resumption of cipher processing the previous logical data stream; and if the received logical data stream is a previously interrupted logical data stream, then retrieving the cipher information of the received logical data stream from the cipher state memory and cipher processing the received logical data stream using the cipher information of the received logical data stream; wherein the cipher processing switching occurs in response to the storage device gaining access to a data block on the storage media during a latency period in which the storage device cannot read the logical data streams from or write the logical data streams to the storage media.