TECHNICAL FIELD

The present disclosure relates to the field of data storage devices, and in particular, the encryption and decryption of data stored on data storage devices.

BACKGROUND

A data storage device is used to store user content data (e.g., in the form of files). A data storage device incorporates a storage medium on which the files are written and from which the files are read. A data storage device can be communicatively connected to a host computer system to provide the host computer system with a means to write files to the storage medium and read files from the storage medium.

A data storage device may incorporate a security engine, as known as a cryptographic processing unit, configured to perform encryption and/or decryption of files and other data stored on the storage medium. Accordingly, the data storage device may be configured to perform encryption of plaintext data being written to or read from the storage medium. Furthermore, in some cases, a data storage device may be configured to perform decryption of encrypted data being written to or read from the storage medium.

To achieve preferred responsiveness of reading and writing operations to the data storage device, it is desirable to achieve a low latency and a high throughput of data through the security engine during the encryption or decryption process. Accordingly, it is desirable to configure a security engine to facilitate high throughput performance, whilst satisfying the specifications of a cryptographic algorithm supported by the security engine.

SUMMARY

The present disclosure provides a method and device for out-of-order cryptographic processing to eliminate or ameliorate data dependency stalls, in the cryptographic pipeline of a data storage device, resulting from the application of cipher text stealing techniques.

According to one aspect of the disclosure there is provided, a data storage device comprising, a non-transitory storage medium, and a cryptographic processing unit, integrated with the data storage device, and configured to perform cryptographic processing of a data object to produce a processed data object, wherein the data object comprises a sequence of data blocks, including, one or more leading data blocks, a penultimate data block, and a last data block, the cryptographic processing unit comprises, a memory store, a cryptographic processing pipeline, and a pipeline controller, the pipeline controller is configured to control the cryptographic processing pipeline to perform the steps of: a) cryptographically process the penultimate data block, to produce a penultimate processed data block, and store a portion of the penultimate processed data block in the memory store; b) cryptographically process at least one of the one or more leading data blocks, to produce one or more processed leading data blocks; and c) cryptographically process a concatenation of the last data block and the portion of the penultimate processed data block, to produce a last processed data block, the pipeline controller is further configured to control the cryptographic processing pipeline to start to perform step b) before the cryptographic processing pipeline completes step a).

In one embodiment, performing cryptographic processing comprises performing encryption. In one embodiment, performing cryptographic processing comprises performing decryption.

In one embodiment, each leading data block has a size equal to a set block size, the penultimate block has a size equal to a set block size, and the last block has a size less than the set block size.

In one embodiment, the cryptographic processing pipeline comprises a plurality of pipeline stages comprising, at least, a first stage and a second stage. In one embodiment, the pipeline controller is further configured to control the first stage of the cryptographic processing pipeline to start to perform step b) while the second stage of the cryptographic processing pipeline continues to perform step a). In one embodiment, the cryptographic processing pipeline is clocked by a clock signal. In one embodiment, the cryptographic processing pipeline stores the portion of the penultimate processed block in the memory store at least one clock cycle of the clock signal before the input stage of the cryptographic processing pipeline starts to perform step c).

In one embodiment, the cryptographic processing pipeline processes all of the one or more leading data blocks in step b).

In one embodiment, the data storage device further comprises an output buffer configured to store the penultimate processed data block; and an output port configured to output processed data blocks from the cryptographic processing unit, and output the last processed data block before outputting the penultimate processed data block, stored in the output buffer.

In one embodiment, the data storage device further comprises an input port in communication with a source of data blocks of the data object, wherein the cryptographic processing unit is configured to request and receive data blocks of the data object from the source via the input port.

In one embodiment, the cryptographic processing unit is further configured to: request and receive a first portion of the data object from the source via the input port, the first portion including the penultimate block; and then request and receive a second portion of the data object from the source via the input port, the second portion including at least one of the one or more leading data blocks.

In one embodiment, step a) comprises determining a tweak value associated with the penultimate data block. In one embodiment, the cryptographic processing unit is configured to determine the tweak value associated with the penultimate data block before performing step a). In one embodiment, the cryptographic processing unit is configured to calculate a tweak value for each block in the sequence of blocks.

In one embodiment, the cryptographic processing unit is configured to perform encryption in accordance with the XTS-AES encryption algorithm. In one embodiment, the cryptographic processing unit is configured to perform decryption in accordance with the XTS-AES decryption algorithm.

According to another aspect of the disclosure, there is provided a method for performing cryptographic processing of a data object to produce a processed data object, the data object comprising a sequence of data blocks, including, one or more leading data blocks, a penultimate data block, and a last data block, the method comprising the ordered steps of: a) performing cryptographic processing of penultimate data block to produce a penultimate processed data block and store a portion of the penultimate processed data block in a memory store; b) performing cryptographic processing of at least one of the one or more leading data blocks to produce one or more processed leading data blocks; and c) performing cryptographic processing of a concatenation of the last data block and the portion of the penultimate processed data block stored in the memory store to produce a last processed data block, wherein step b) is started before step a) is completed.

In one embodiment, the method is performed by a cryptographic unit comprising, a memory store, a hardware circuitry pipeline, configured to encrypt a plaintext data block to produce a cipher text block, and a pipeline controller, configured to control the pipeline,

According to another aspect of the disclosure, there is provided a data storage device for performing cryptographic processing of a data object to produce a processed data object, the data object comprising a sequence of data blocks, including, one or more leading data blocks, a penultimate data block, and a last data block, the data storage device comprising means for: a) cryptographically processing the penultimate data block, to produce a penultimate processed data block, and storing a portion of the penultimate processed data block in a memory store; b) cryptographically processing at least one of the one or more leading data blocks, to produce one or more processed leading data blocks; and c) cryptographically processing a concatenation of the last data block and the portion of the penultimate processed data block, to produce a last processed data block, wherein step b) is started before step a) is completed.

