Embodiments described herein relate generally to an encryption processing device, an encryption processing method, and a storage device.
Storage devices including nonvolatile semiconductor memories, such as NAND flash memories, are used in various fields. Nowadays, with an increasing awareness of security, it is required to perform encryption also when data is stored in a storage device. For example, a common key cryptosystem or secret key cryptosystem using a common (same) key in encryption and decryption is known as an encryption system.
In general, according to one embodiment, an encryption processing device comprises: a plurality of generating circuits to generate respective mask values for respective second data units, by using identification information to identify a first data unit and first key data, wherein the first data unit includes the second data units, each of which serves as a unit of an encryption operation; and a plurality of arithmetic circuits encrypting the respective second data units, by using the respective mask values, the second data units, and second key data, wherein the generating circuits perform parallel processing.
[1. Configuration of Storage Device]
The controller 21 performs interface processing between the storage device 20 and the host 10, and controls operations (including data writing operation, data reading operation, and data erasing operation) of the storage medium 22 in accordance with an access request from the host 10.
The storage medium 22 is formed of, for example, a nonvolatile semiconductor memory. Specifically, a NAND flash memory, an MRAM (Magnetic Random Access Memory), or the like is used as the storage medium 22.
In encryption, data flows in the order of the buffer 24, the encryption processing device 23, the buffer 25, and the storage medium 22. In decryption, data flows in the order of the storage medium 22, the buffer 25, the encryption processing device 23, and the buffer 24. In the encryption operation, the buffer 24 temporarily stores data transmitted from the host 10, and the buffer 25 temporarily stores data encrypted by the encryption processing device 23. In the decryption operation, the buffer 25 temporarily stores data transmitted from the storage medium 22, and the buffer 24 temporarily stores data decrypted by the encryption processing device 23.
The encryption processing device 23 can perform encryption processing for a plurality of blocks in parallel. To perform parallel processing, the encryption processing device 23 includes an encryption arithmetic circuit 30, mask value generating circuits 31-0 to 31-(n−1), and encryption arithmetic circuits 32-0 to 32-(n−1). The number n of blocks, which are processed in parallel, can be set to a desired value. The number n is equal to or smaller than the number of blocks that form a sector.
The encryption arithmetic circuit 30 generates original data for generating a mask value, by using key data Key2 and a tweak value i. In the present embodiment, for example, a sector number is used as the tweak value i.
The mask value generating circuits 31-0 to 31-(n−1) generate mask values T0 to Tn−1, respectively, used for encryption and decryption. Specifically, the mask value generating circuit 31-0 receives the original data from the encryption arithmetic circuit 30, and generates a mask value T0 by using the original data. The mask value generating circuits 31-1 to 31-(n−1) generate mask values T1 to Tn−1, respectively, by using the mask value T0.
The encryption arithmetic circuits 32-0 to 32-(n−1) receive the respective mask values T0 to Tn−1 from the mask value generating circuits 31-0 to 31-(n−1), respectively. Each of the encryption arithmetic circuits 32-0 to 32-(n−1) also receives corresponding input data (block). Each of the encryption arithmetic circuits 32-0 to 32-(n−1) encrypts and decrypts the input data by using the key data Key1 and the mask value T.
First, processing relating to encryption operation will be explained hereinafter. The exclusive OR circuit 34 calculates an exclusive OR between the input data (data to be encrypted) P and the mask value T. The encryption arithmetic unit 33 performs an encryption operation (including encryption and decryption) based on the AES-XTS mode. The exclusive OR circuit 35 calculates an exclusive OR between the data output from the encryption arithmetic unit 33 and the mask value T, and outputs encrypted data C. In the decryption operation, encrypted data C is input to the exclusive OR circuit 34, and decrypted input data P is output from the exclusive OR circuit 35 through the encryption arithmetic unit 33.
In addition, the encryption arithmetic unit 33 is configured to also be capable of performing processing performed by the encryption arithmetic circuit 30 illustrated in
[2. Operation]
Next, operation of the storage device 20 configured as described above will be explained hereinafter.
First, general encryption processing in the AES-XTS mode will be explained hereinafter.
As described above, in the present embodiment, the AES-XTS mode is used as an encryption system, and a sector number (sector identification information) is used as the tweak value i used for generating the initial mask value T0. Moreover, in the AES-XTS mode, key information is used, and the key information is formed of a pair of the key data Key2 for generating the initial mask value T0 and the key data Key1 for encrypting the data. The key information may be determined for any unit of data. For example, the storage medium 22 is divided into a plurality of areas, and the same key information is used for a divided area. For example, when the storage medium 22 has a capacity of 128 GB, the same key information is used for 32 GB. Thus, the same key information is used for sectors belonging to the same area. Suppose that the controller 21 holds correspondence between the key information and the area, and correspondence between the area and sector numbers in the area, and recognizes key information used for the sector numbers.
Suppose that the sector number is i (i is an integer of 0 or more), and a block number of the block to be processed is j (j is an integer of 0 or more). When encryption processing is successively performed for a plurality of sectors, the sector number is updated, and the processing illustrated in
First, an initial mask value T0 is generated based on the following expression (1), by using the key data Key2, the sector number i, and the block number j (j=0) (Step S10). The reference symbol “Enc ( )” represents an encryption operation in the AES-XTS mode, and the reference symbol “αj” (j=0, 1, 2, . . . , m−1) is a primitive element of a Galois field. Reference symbol m denotes the number of blocks that form a sector.
T
0
=Enc(Key2,i)×α0 (1)
Next, a data encryption operation is started. First, an exclusive OR between input data (data to be encrypted) Pj corresponding to the jth block and the mask value Tj is calculated, based on the following expression (2), and a calculation result PP is obtained (Step S11).
PP=P
j
xor T
j
Next, the calculation result PP is encrypted by using the key data Key1, based on the following expression (3), and a calculation result CC is obtained (Step S12).
CC=Enc(Key1,PP) (3)
Then, an exclusive OR between the mask value Tj and the calculation result CC is calculated based on the following expression (4), and encrypted data Cj is obtained (Step S13).
C
j
=CC xor T
j (4)
Next, it is determined whether j is equal to “m−1” (specifically, whether the block is the last block of the sector) or not (Step S14). When j is equal to “m−1” (Step S14: Yes), the encryption processing of the sector is ended. When J is not equal to “m−1” (Step S14: No), the block number j is incremented by 1 (Step S14). Then, the mask value Tj is updated based on the following expression (5) (Step S15), and the process returns to Step S11.
T
j
=T
j−1×αj−1 (5)
In the present embodiment, mask value generation processing is performed in parallel. To perform the parallel processing, the encryption processing device 23 includes n mask value generating circuits 31-0 to 31-(n−1), as illustrated in
First, the mask value generating circuits 31-0 to 31-(n−1) generate mask values T0 to Tn−1, respectively, in parallel (Step S20). The term “parallel processing” used herein means generating mask values T0 to Tn−1 in parallel in the same clock cycle. Specifically, the mask value generating circuit 31-0 illustrated in
After the mask values T0 to Tn−1 are generated, the encryption arithmetic circuits 32-0 to 32-(n−1) generate respective encrypted data C0 to Cn−1 in parallel, based on the expressions (2) to (4) (Step S21). In other words, the encryption arithmetic circuits 32-0 to 32-(n−1) simultaneously start processing of generating respective encrypted data C0 to Cn−1 (Step S21). The term “parallel processing” used herein means starting generation processing in synchronization with the same clock.
Then, it is determined whether the last block in the sector has been encrypted or not (Step S22). In the case of Yes of Step S22, the encryption processing is ended. In the case of No of Step S22, the mask value generating circuits 31-1 to 31-(n−1) generate the next respective mask values in parallel (Step S23). Thereafter, the encryption arithmetic circuits 32-1 to 32-(n−1) generate a plurality of encrypted data in parallel by using the respective mask values (Step S24). When successive sectors to be encrypted exist, the sector number i is incremented by 1, and the flowchart of
When m is equal to n, all the blocks in a sector are encrypted in parallel by Steps S20 and S21 of
As described above, by including the same number of mask value generating circuits 31 as encryption arithmetic circuits 32, data to be encrypted in the buffer 24, which temporarily stores a large quantity of data transmitted from the host 10, can be encrypted in parallel.
Supposing that the time required for performing encryption processing for a block is V and the time required for performing encryption processing for n blocks is U, U is expressed by the expression “U=V×n” for the comparative example, while U is expressed by the expression “U=V” for the present embodiment. Thereby, the present embodiment enables a significant increase in the speed of encryption processing, in comparison with the comparative example.
Although the encryption operation in the AES-XTS mode is mainly explained in the present embodiment, the similar processing can be performed also for a decryption operation in the AES-XTS mode, except that data flows in the reverse order.
Although the AES-XTS mode is explained as an example in the present embodiment, the present embodiment is also applicable to common key cryptosystems other than the AES-XTS mode.
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
This application claims the benefit of U.S. Provisional Application No. 61/869,181, filed Aug. 23, 2013, the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
61869181 | Aug 2013 | US |