Method, system and apparatus for data encryption
Abstract
It is detected whether a next-to-last raw data block in a raw data segment has been written into an input buffer. A sequence number difference is calculated between sequence numbers of the next-to-last raw data block and a current raw data block. It is determined whether the sequence number difference exceeds a number of operation rounds associated with encryption. In response to: (1) detecting that the next-to-last raw data block has been written into the input buffer and (2) determining that the sequence number difference does not exceed the number of operation rounds, a read of the next-to-last raw data block is triggered. The next-to-last raw data block is encrypted, out of a sequence number order and using Advanced Encryption Standard (AES) processing and a CipherText Stealing (XTS) working mode, to produce a next-to-last encrypted data block. A last raw data block is encrypted using the next-to-last encrypted data block.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A system, comprising:
a processor; and a memory coupled to the processor and configured to provide the processor with instructions which when executed cause the processor to:
detect whether a next-to-last raw data block in a raw data segment has been written into an input buffer;
calculate a sequence number difference between a sequence number of the next-to-last raw data block and a sequence number of a current raw data block;
determine whether the sequence number difference exceeds a number of operation rounds associated with encryption; and
in response to: (1) detecting that the next-to-last raw data block has been written into the input buffer and (2) determining that the sequence number difference does not exceed the number of operation rounds associated with encryption, trigger a read of the next-to-last raw data block from the input buffer;
encrypt, out of a sequence number order and using Advanced Encryption Standard (AES) processing and a CipherText Stealing (XTS) working mode, the next-to-last raw data block to produce a next-to-last encrypted data block; and
encrypt, using the AES processing and the XTS working mode, a last raw data block in the raw data segment using the next-to-last encrypted data block.
2 . The system recited in claim 1 , wherein the detection that the next-to-last raw data block has been written into the input buffer triggers calculating the sequence number difference.
3 . The system recited in claim 1 , wherein the read of the next-to-last raw data block includes:
moving the next-to-last raw data block to a position immediately after the current raw data block in the input buffer; pointing an updating read pointer to the next-to-last raw data block by updating a read pointer pointing to the current raw data block after the current raw data block is read; and reading the next-to-last raw data block using the updated read pointer.
4 . The system recited in claim 3 , wherein reading the next-to-last raw data block using the updated read pointer includes:
iteratively updating the updated read pointer to point to each subsequent raw data block to produce an iteratively updated read pointer; and reading said each subsequent raw data block using the iteratively updated read pointer.
5 . The system recited in claim 1 , wherein encrypting the last raw data block includes using an intermediate encrypted data block that is read from a temporary register.
6 . The system recited in claim 1 , wherein an encoder includes a plurality of Data Processing (DP) units, wherein:
a given raw data block is passed from the input buffer to a corresponding DP unit in the plurality of DP units; and the corresponding DP unit encrypts the given raw data block by performing the number of operation rounds associated with encryption.
7 . The system recited in claim 1 , further including an output buffer, wherein the next-to-last encrypted data block and a last encrypted data block are simultaneously written to the output buffer.
8 . The system recited in claim 1 , further including an output buffer, wherein the next-to-last encrypted data block and a last encrypted data block are simultaneously written to the output buffer, including by incrementing a write pointer by 2.
9 . The system recited in claim 1 , further including an output buffer, wherein a plurality of encrypted data blocks generated by an encoder is sequentially written into the output buffer.
10 . The system recited in claim 1 , wherein a size of the last raw data block is strictly smaller than a predetermined data block size specified by the AES processing.
11 . A method, comprising:
detecting whether a next-to-last raw data block in a raw data segment has been written into an input buffer; using a controller to calculate a sequence number difference between a sequence number of the next-to-last raw data block and a sequence number of a current raw data block; using the controller to determine whether the sequence number difference exceeds a number of operation rounds associated with encryption; in response to: (1) detecting that the next-to-last raw data block has been written into the input buffer and (2) determining that the sequence number difference does not exceed the number of operation rounds associated with encryption, using the controller to trigger a read of the next-to-last raw data block from the input buffer; using an encoder to encrypt, out of a sequence number order and using Advanced Encryption Standard (AES) processing and a CipherText Stealing (XTS) working mode, the next-to-last raw data block to produce a next-to-last encrypted data block; and using the encoder to encrypt, using the AES processing and the XTS working mode, a last raw data block in the raw data segment using the next-to-last encrypted data block.
12 . The method recited in claim 11 , wherein the detection that the next-to-last raw data block has been written into the input buffer triggers calculating the sequence number difference.
13 . The method recited in claim 11 , wherein the read of the next-to-last raw data block includes:
moving the next-to-last raw data block to a position immediately after the current raw data block in the input buffer; pointing an updating read pointer to the next-to-last raw data block by updating a read pointer pointing to the current raw data block after the current raw data block is read; and reading the next-to-last raw data block using the updated read pointer.
14 . The method recited in claim 13 , wherein reading the next-to-last raw data block using the updated read pointer includes:
iteratively updating the updated read pointer to point to each subsequent raw data block to produce an iteratively updated read pointer; and reading said each subsequent raw data block using the iteratively updated read pointer.
15 . The method recited in claim 11 , wherein encrypting the last raw data block includes using an intermediate encrypted data block that is read from a temporary register.
16 . The method recited in claim 11 , wherein the encoder includes a plurality of Data Processing (DP) units, wherein:
a given raw data block is passed from the input buffer to a corresponding DP unit in the plurality of DP units; and the corresponding DP unit encrypts the given raw data block by performing the number of operation rounds associated with encryption.
17 . The method recited in claim 11 , further including simultaneously writing the next-to-last encrypted data block and a last encrypted data block to an output buffer.
18 . The method recited in claim 11 , further including simultaneously writing the next-to-last encrypted data block and a last encrypted data block to an output buffer, including by incrementing a write pointer by 2.
19 . The method recited in claim 11 , further including sequentially writing a plurality of encrypted data blocks that is generated by the encoder into an output buffer.
20 . The method recited in claim 11 , wherein a size of the last raw data block is strictly smaller than a predetermined data block size specified by the AES processing.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.