CPC G06F 21/602 (2013.01) [G06F 21/78 (2013.01)] | 14 Claims |
1. A method, comprising:
detecting whether a next-to-last raw data block in a raw data segment has been written into an input buffer;
reading the next-to-last raw data block from the input buffer for encryption immediately after a current raw data block is read from the input buffer for encryption, in response to detecting that the next-to-last raw data block has been written into the input buffer, wherein reading the next-to-last raw data block comprises:
calculating a sequence number difference between a sequence number of the next-to-last raw data block and a sequence number of the current raw data block; and
reading the next-to-last raw data block from the input buffer, in response to the sequence number difference being equal to or less than a number of operation rounds required for encryption;
continuing to read a subsequent raw data block after the current raw data block from the input buffer for encryption, after the next-to-last raw data block is read from the input buffer for encryption; and
encrypting, using Advanced Encryption Standard (AES) processing and a CipherText Stealing (XTS) working mode, a last raw data block in the raw data segment by providing an intermediate encrypted data block, wherein the intermediate encrypted data block is obtained by encrypting the next-to-last raw data block, and the last raw data block is read from the input buffer.
|