Computer and data processing method

The computer system enhances encryption and decryption performance by using parallel processing with vector instructions, addressing the inefficiencies in conventional storage systems without dedicated cryptographic hardware.

JP7583000B2Active Publication Date: 2024-11-13HITACHI VANTARA LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2022141346
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-09-06
Publication Date
2024-11-13
Estimated Expiration
2042-09-06

AI Technical Summary

Technical Problem

Conventional storage systems lack efficient methods to improve the processing performance of user data encryption and decryption, particularly in systems without dedicated hardware support for cryptographic operations.

Method used

A computer system with a processor that utilizes multiple registers to perform cryptographic operations in parallel, including XTS encryption/decryption and DIF generation/inspection, leveraging vector instructions to enhance processing efficiency.

Benefits of technology

The solution significantly improves the processing performance of encryption and decryption operations, enabling faster and more reliable data handling with parallel processing techniques.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007583000000007
    Figure 0007583000000007
  • Figure 0007583000000008
    Figure 0007583000000008
  • Figure 0007583000000009
    Figure 0007583000000009
Patent Text Reader

Abstract

To speed up processing related to data encryption and DIF addition.SOLUTION: A computer comprises a processor having a plurality of registers, a memory, and a storage medium. The processor stores user data in the memory if receiving a write request, performs encryption processing for generating encrypted user data including a plurality of encrypted data blocks by using the plurality of registers, adds a DIF including a CRC to each encrypted data block, and stores it in the storage medium. The encryption processing repeatedly executes: first processing for reading partial data from a predetermined number of data blocks and storing it in a first register; second processing for storing, in a second register, encrypted partial data obtained by encrypting the partial data stored in the first register; and third processing for executing an operation for calculating the CRC by using the encrypted partial data stored in the second register, and storing a result of the operation in a third register.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a technique for encrypting and decrypting user data. [Background technology]

[0002] There is a storage system having a function of encrypting and storing user data so that the user data cannot be illegally read from a built-in storage medium. A storage system having the above-mentioned function encrypts user data input from an external host computer in response to a write command, and stores the encrypted user data in the storage medium. Also, a storage system having the above-mentioned function decrypts the encrypted user data stored in the storage medium in response to a read command, and outputs the user data.

[0003] If the storage system does not have hardware that supports data encryption and decryption, the CPU of the storage system performs encryption of user data accompanying write processing and decryption of encrypted user data accompanying read processing according to program code composed of multiple CPU instructions. The higher the encryption and decryption processing performance of the storage system's CPU, the higher the response of reading and writing user data.

[0004] Some CPUs support encryption-specific instructions to improve the processing performance of encryption and decryption. The instruction set called AES-NI is one example of the encryption-specific instructions.

[0005] Patent Document 1 discloses a technology in which a CPU dispatches a dedicated encryption instruction every cycle to perform independent encryption / decryption in parallel for different data blocks, thereby improving encryption / decryption throughput (see, for example, FIG. 4).

[0006] Patent Document 2 discloses a technology that applies SIMD instructions (instructions that can perform the same processing on multiple data with a single instruction) to stream encryption processing, in which a CPU generates ciphertext data by taking the exclusive OR of plaintext data and a key stream, thereby doubling the performance (see TABLE 3).

[0007] In order to improve the reliability of the information processing device, a storage system is also known that has a function of adding management information called a DIF (Data Integrity Field) to user data so that it can be confirmed that the user data is not erroneously destroyed or mistaken for other user data when processing the user data received from a host computer. A storage system having the above-mentioned function generates and checks the DIF during write processing and read processing. If the storage system does not have hardware that supports the generation and checking of the DIF, the CPU included in the storage system generates and checks the DIF according to program code composed of multiple CPU instructions. [Prior art documents] [Patent documents]

[0008] [Patent Document 1] US Patent No. 8,194,854 [Patent Document 2] US Patent No. 10320558 Summary of the Invention [Problem to be solved by the invention]

[0009] In a storage system having the function of encrypting and storing user data and the function of adding a DIF to the user data, the prior art does not disclose detailed methods for improving the processing performance of the encryption of user data executed by a CPU. [Means for solving the problem]

[0010] A representative example of the invention disclosed in the present application is as follows: A computer for writing and reading user data including a plurality of data blocks, comprising a processor, a memory connected to the processor, a storage medium connected to the processor, and a connection interface connected to the processor, the processor having a plurality of registers, receives a write request for the user data, stores the user data written in accordance with the write request in the memory, performs an encryption process using the plurality of registers to generate encrypted user data including a plurality of encrypted data blocks, adds a first data integrity field including a first error code to each of the plurality of encrypted data blocks included in the encrypted user data, and stores the encrypted user data in the storage medium. In the encryption process, a first process of reading partial data that is a part of the data blocks from a predetermined number of the data blocks and storing the partial data in a first register, a second process of encrypting the partial data stored in the first register to obtain encrypted partial data, and a third process of performing a first operation to calculate the first error code using the encrypted partial data stored in the second register, and storing a result of the first operation in a third register are repeatedly performed. Effect of the Invention

[0011] According to one aspect of the present invention, it is possible to improve the processing performance of the encryption process. Problems, configurations and effects other than those described above will become apparent from the following description of the embodiment. [Brief description of the drawings]

[0012] [Figure 1] FIG. 1 is a diagram illustrating an example of the configuration of a computer system according to a first embodiment. [Figure 2A] 1 is a diagram showing a format of data handled by the storage system of the first embodiment. [Figure 2B] 1 is a diagram showing a format of data handled by the storage system of the first embodiment. [Figure 2C]1 is a diagram showing a format of data handled by the storage system of the first embodiment. [Figure 3A] FIG. 2 is a diagram for explaining the specifications of the WSC according to the first embodiment. [Figure 3B] FIG. 2 is a diagram for explaining the specifications of the WSC according to the first embodiment. [Figure 3C] FIG. 2 is a diagram for explaining the specifications of the WSC according to the first embodiment. [Figure 4] 11 is a flowchart illustrating an example of a write process executed by the storage system of the first embodiment. [Diagram 5] 11 is a flowchart illustrating an example of a read process executed by the storage system of the first embodiment. [Figure 6A] FIG. 1 is a diagram for explaining conventional XTS encryption / decryption. [Figure 6B] FIG. 1 is a diagram for explaining conventional XTS encryption / decryption. [Figure 7A] FIG. 13 is a diagram illustrating XTS encryption / decryption in the storage system of the first embodiment. [Figure 7B] FIG. 13 is a diagram illustrating XTS encryption / decryption in the storage system of the first embodiment. [Figure 7C] FIG. 13 is a diagram illustrating XTS encryption / decryption in the storage system of the first embodiment. [Figure 8] 13 is a diagram showing a structure of input data in XTS encryption / decryption using a Vector command executed by the storage system of the first embodiment. FIG. [Figure 9] 13 is a diagram showing a structure of output data in XTS encryption / decryption using a Vector command executed by the storage system of the first embodiment. FIG. [Figure 10A] 11 is a diagram illustrating a method of calculating a CRC in the storage system of the first embodiment. FIG. [Figure 10B] 11 is a diagram illustrating a method of calculating a CRC in the storage system of the first embodiment. FIG. [Figure 10C] 11 is a diagram illustrating a method of calculating a CRC in the storage system of the first embodiment. FIG. [Figure 11A]FIG. 11 illustrates a parallel method for CRC calculation in the storage system of the first embodiment. [Figure 11B] FIG. 11 illustrates a parallel method for CRC calculation in the storage system of the first embodiment. [Figure 12A] 11 is a diagram illustrating a method for generating DIFs of four data blocks in parallel in the storage system of the first embodiment. FIG. [Figure 12B] 11 is a diagram illustrating a method for generating DIFs of four data blocks in parallel in the storage system of the first embodiment. FIG. [Figure 13A] 11 is a diagram illustrating a method for checking the DIF of four data blocks in parallel in the storage system of the first embodiment. FIG. [Figure 13B] 11 is a diagram illustrating a method for checking the DIF of four data blocks in parallel in the storage system of the first embodiment. FIG. [Figure 13C] 11 is a diagram illustrating a method for checking the DIF of four data blocks in parallel in the storage system of the first embodiment. FIG. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0013] An embodiment of the present invention will be described with reference to the drawings. However, the present invention should not be interpreted as being limited to the description of the embodiment shown below. It will be easily understood by those skilled in the art that the specific configuration can be changed without departing from the concept or spirit of the present invention.

[0014] In the configurations of the invention described below, the same or similar configurations or functions are given the same reference numerals, and duplicated explanations are omitted.

[0015] In this specification, the terms "first," "second," "third," and the like are used to identify components and do not necessarily limit the number or order. EXAMPLES

[0016] FIG. 1 is a diagram illustrating an example of the configuration of a computer system according to a first embodiment.

[0017] The computer system 100 according to the first embodiment includes a host computer 110 and a storage system 120. The host computer 110 and the storage system 120 are connected to each other directly or via a network.

[0018] The storage system 120 is an example of a computer that reads and writes data. The storage system 120 includes a storage controller 130 and a storage device 140. The storage device 140 is, for example, a hard disk drive (HDD) or a solid state drive (SSD). The storage device 140 may be mounted on the storage controller 130.

[0019] The storage controller 130 includes one or more front-end interfaces (FE I / F) 131, one or more back-end interfaces (BE I / F) 132, a CPU 133, and a DRAM (Dynamic Random Access Memory) 134. The DRAM 134 is a volatile memory (memory device) that can be read and written in byte units.

[0020] In FIG. 1, the hardware elements of the storage system 120 are illustrated one by one, but in order to achieve redundancy, high performance, large capacity, or the like, there may be a plurality of each component.

[0021] The storage controller 130 according to the first embodiment provides a logical volume to the host computer 110. The providing method includes the following methods.

[0022] (Provision Method 1) One or more logical volumes (actual logical volumes) are formed from a plurality of storage devices 140 and provided to the host computer 110.

[0023] (Provisioning Method 2) The storage controller 130 provides a logical volume formed by thin provisioning technology to the host computer 110. The logical volume is a virtual volume, and the actual storage area is dynamically allocated.

[0024] The host computer 110 requests writing / reading of user data to / from a logical volume by issuing an I / O command (write command or read command) that specifies the provided logical volume and a location within the logical volume (logical block number, sometimes abbreviated as LBA).

[0025] The FE I / F 131 is an interface device for communicating with the host computer 110. The FE I / F 131 has a function of adding information called a DIF (Data Integrity Field) to user data received from the host computer 110. The FE I / F 131 also has a function of inspecting and removing the DIF added to data to be transmitted to the host computer 110. The DIF is, for example, T10-DIF. T10-DIF is standardized by the American National Standards Institute (ANSI).

[0026] The BE I / F 132 is an interface device for communicating with the storage device 140. The BE I / F 132 is, for example, SAS, SATA, NVMe, Fibre Channel, or the like.

[0027] The CPU 133 has multiple registers used in write processing / read processing, and executes write processing of user data in response to an I / O command (write command), and executes read processing of user data in response to an I / O command (read command). In write processing, user data received from the host computer 110 is encrypted, and the encrypted user data is permanently stored in the storage device 140. In read processing, the encrypted user data stored in the storage device 140 is decrypted to user data and transmitted to the host computer 110. The contents of these write / read processing will be explained in detail below.

[0028] The CPU 133 is, for example, a third generation Xeon (Xeon is a registered trademark, the same applies below) scalable processor (code name: IceLake-SP), which is a microprocessor developed for servers by Intel (Intel is a registered trademark, the same applies below).

[0029] The DRAM 134 stores programs executed by the CPU 133 and data handled by the programs. The DRAM 134 also includes a cache area. The cache area caches user data input in accordance with an I / O command (write command) received from the host computer 110, encrypted user data written to the storage device 140, encrypted user data read from the storage device 140, and user data output in accordance with an I / O command (read command) received from the host computer 110.

[0030] When the CPU 133 caches user data input together with an I / O command (write command) in the cache area, the CPU 133 multiplexes and stores the user data. If damage to the cached user data is detected, the CPU 133 performs write processing, etc., using the multiplexed user data. This makes it possible to prevent loss of user data.

[0031] Furthermore, in order to prevent loss of encrypted user data due to a failure of a storage device 140, the storage system 120 stores the encrypted user data after implementing redundancy based on RAID (Redundant Arrays of Independent Disks) technology. Specifically, when N storage devices 140 (N is an integer equal to or greater than 2) are installed, the CPU 133 distributes data to be written evenly to (N-1) and records the data in each storage device 140, and stores parity generated by exclusive OR of data written in each storage device 140 in one storage device 140. This makes it possible to recover data even if one storage device 140 fails. For example, when N=4, the CPU 133 records data D1, D2, and D3 of the same size in three storage devices 140, and records parity P (P=D1+D2+D3: + indicates exclusive OR) generated by exclusive OR of data D1, D2, and D3 in one storage device 140. For example, if the storage device 140 in which D2 is recorded fails, the CPU 133 recovers the data D2 by exclusive ORing the parity P, the data D1, and the data D3.

[0032] 2A, 2B, and 2C are diagrams showing formats of data handled by the storage system 120 of the first embodiment.

[0033] The data format 200 shown in FIG. 2A is an example of a format of user data sent together with a write command sent from the host computer 110, or user data sent from the storage system 120 to the host computer 110 by a read command.

[0034] User data is made up of one or more user data blocks 201. The size of a user data block 201 is, for example, 512 bytes. The user data shown in Fig. 2 is 2048 bytes of data made up of four user data blocks 201-1, 201-2, 201-3, and 201-4. For example, when the host computer 110 writes or reads 8192 bytes of user data, the user data is made up of 16 user data blocks 201.

[0035] The data format 210 shown in FIG. 2B is an example of a format for user data that the storage system 120 caches in the DRAM 134 .

[0036] The FE I / F 131 of the storage system 120 adds the DIF 202 to the end of each user data block 201 that constitutes the user data. In Fig. 2B, DIFs 202-1, 202-2, 202-3, and 202-4 are added to the user data blocks 201-1, 201-2, 201-3, and 201-4, respectively.

[0037] DIF202 conforms to the T10-DIF standard and is composed of a 2-byte CRC (Cyclic Redundancy Check) 231, a 2-byte ATAG (Application Tag) (0) 232, a 2-byte ATAG (1) 233, and a 4-byte RTAG (Reference Tag) 234.

[0038] The CRC 231 is a 16-bit error detection code calculated from the 512-byte user data block 201 located before the DIF 202. The RTAG 234 is an address associated with the 512-byte user data block 201 located before the DIF 202. The addresses set in the RTAG 234 are set in ascending order from the first user data block 201 of the user data to the last user data block 201. For example, if the address of the user data block 201-1 is K (K is an integer), the address of the user data block 201-2 is K+1, the address of the user data block 201-3 is K+2, and the address of the user data block 201-4 is K+3. The ATAG(0) 232 and the ATA(1) 233 can be used for any purpose. When user data is cached in the DRAM 134, the ATAG(0) 232 and the ATAG(1) 233 are not used, and therefore the storage system 120 sets each of the ATAG(0) 232 and the ATAG(1) 233 to 00h.

[0039] The storage system 120 can detect the occurrence of an error in a write process / read process by adding a DIF 202 to each user data block 201 of user data stored in the DRAM 134. Specifically, the storage system 120 can detect corruption of a user data block 201 by checking the CRC 231. The storage system 120 can detect a change in the order of the user data blocks 201 by checking the RTAG 234. The DIF check performed when the FE I / F 131 transmits user data to the host computer 110 is the check described above.

[0040] A data format 220 shown in Fig. 2C is an example of a format of encrypted user data that the storage system 120 stores in the storage device 140. The encrypted user data shown in Fig. 2C is composed of encrypted user data blocks 203-1, 203-2, 203-3, and 203-4 that are obtained by encrypting user data blocks 201-1, 201-2, 201-3, and 201-4.

[0041] The storage system 120 encrypts each user data block 201 constituting the user data into an encrypted user data block 203 using the XTS (XEX encryption mode with Tweak and ciphertext Stealing) mode of the AES (Advanced Encryption Standard) algorithm.

[0042] AES is a symmetric key encryption algorithm defined as a standard encryption by the US National Institute of Standards and Technology (NIST). The size of the AES key is, for example, 256 bits. However, the size of the ASE key does not have to be 256 bits. XTS mode is a block encryption method for storage devices established in the standard document IEEE1619. In the following explanation, encryption using the XTS mode of the AES algorithm will be referred to as XTS encryption, and decryption using this mode will be referred to as XTS decryption.

[0043] The storage system 120 appends a DIF 204 to each encrypted user data block 203 as well as a cache of the user data.

[0044] Like DIF202, DIF204 conforms to the T10-DIF standard and is composed of a 2-byte CRC241, a 2-byte ATAG(0)242, a 2-byte ATAG(1)243, and a 4-byte RTAG244.

[0045] The CRC 241 is a 16-bit error detection code calculated from the 512-byte encrypted user data block 203 located before the DIF 204. The RTAG 244 is an address associated with the 512-byte encrypted user data block 203 located before the DIF 204. The addresses set in the RTAG 244 are set in ascending order from the first encrypted user data block 203 of the encrypted user data to the last encrypted user data block 203. When storing encrypted user data in the storage device 140, the storage system 120 sets a code called a WSC (write sequence code) in the ATAG(0) 242. The specifications of the WSC will be described with reference to FIG. 3. Since the ATAG(1) 243 is not used, 00h is set.

[0046] The storage system 120 can detect the occurrence of a write error or a read error by adding a DIF 204 to each encrypted user data block 203 of the encrypted user data stored in the storage device 140. Specifically, the storage system 120 can detect corruption of the read encrypted user data block 203 by checking the CRC 241. The storage system 120 can detect an error in the address instructed to read to the storage device 140 by checking the RTAG 244. An error in writing encrypted user data to the storage device 140 can be detected by checking the WSC set in the ATAG(0) 242.

[0047] In the following description, when there is no need to distinguish between the user data block 201 and the encrypted user data block 203, they will be referred to as data blocks.

[0048] 3A, 3B, and 3C are diagrams for explaining the specifications of the WSC according to the first embodiment.

[0049] 3A is an example of a data format of a WSC. A WSC is a 1-byte (8-bit) code stored in ATAG0 (242), and is composed of a 1-bit HEAD flag 301, a 1-bit TAIL flag 302, and a 6-bit SQN (sequence number) 303.

[0050] The HEAD flag 301 is a flag that stores a value indicating whether the encrypted user data block 203 to be written to the storage device 140 is the head or not. The TAIL flag 302 is a flag that stores a value indicating whether the encrypted user data block 203 to be written to the storage device 140 is the end or not.

[0051] If the encrypted user data block 203 to be written to the storage device 140 is the first, the HEAD flag 301 is set to 1, and if the encrypted user data block 203 to be written to the storage device 140 is the last, the TAIL flag 302 is set to 1. The HEAD flag 301 and TAIL flag 302 of an encrypted user data block 203 that is neither the first nor the last is set to 0. When writing encrypted user data consisting of one encrypted user data block 203, the HEAD flag 301 and TAIL flag 302 are set to 1.

[0052] SQN 303 stores the generation number of the encrypted user data to be written to the storage device 140. A different value is used as the generation number each time data is written.

[0053] FIG. 3B shows an example of WSC settings when writing the encrypted user data block 203 to addresses 0 to 9 of the storage device 140. In FIG.

[0054] In state 1, encrypted user data is written that is made up of 10 encrypted user data blocks 203. Here, it is assumed that 0x0A is specified as the SQN.

[0055] The encrypted user data block 203 written to address 0 is the first, so HEAD 301 is 1 and WSC is 0x8A. The encrypted user data block 203 written to address 9 is the last, so TAIL 302 is 1 and WSC is 0x4A. The WSC of encrypted user data blocks 203 written to other addresses is 0x0A.

[0056] In state 2, encrypted user data consisting of five encrypted user data blocks 203 is written to addresses 3 to 7. Here, it is assumed that 0x0B is specified as SQN.

[0057] Since data is overwritten at five addresses, the WSC is updated. Since the encrypted user data block 203 written to address 3 is the head, HEAD 301 becomes 1 and WSC becomes 0x8B. Since the encrypted user data block 230 written to address 7 is the end, TAIL 302 becomes 1 and WSC becomes 0x4B. The WSC of the encrypted user data blocks 203 written to addresses 4 to 6 becomes 0x0B.

[0058] 3C shows an example of rules for checking for a write error based on the WSC. When the storage system 120 writes encrypted user data to the storage device 140, the storage system 120 reads the WSC and checks for a write error according to the rules shown in Table 320.

[0059] In table 320, the following rules are defined: (R1) If the HEAD / TAIL of the WSC of the own block is 1 / 0 or 1 / 1, no check is performed. (R2) If the HEAD / TAIL of the WSC of the current block is 0 / 0 or 0 / 1, and the HEAD / TAIL of the WSC of the previous block is 0 / 1, no check is performed. (R3) If the HEAD / TAIL of the WSC of the current block is 0 / 0 or 0 / 1 and the HEAD / TAIL of the WSC of the previous block is 0 / 0, the storage system 120 checks whether the SQN of the WSC of the current block matches the SQN of the WSC of the previous block. (R4) If the HEAD / TAIL of the WSC of the current block is 0 / 0 or 0 / 1 and the HEAD / TAIL of the WSC of the previous block is 1 / 0, the storage system 120 checks whether the SQN of the WSC of the current block matches the SQN of the WSC of the previous block. (R5) If the HEAD / TAIL of the WSC of the current block is 0 / 0 or 0 / 1, and the HEAD / TAIL of the WSC of the previous block is 1 / 1, no check is performed.

[0060] (R3) and (R4) indicate that if the current block is not the first block and the previous block is not the last block, the SQN of the encrypted user data block 203 is checked for consistency. This allows confirmation of whether the writing of user data consisting of multiple blocks is successful without interruption. For example, the WSC of the addresses included in the rectangles 311, 312, and 313 in FIG. 3B matches the conditions of (R3) and (R4), and is therefore checked. If the writing to address 5 fails in the writing of five blocks to addresses 3 to 7, the WSC of address 5 is not updated and remains 0x0A. This error can be detected by checking the WSC of address 5, as the SQN (0x0A) of address 5 does not match the SQN (0x0B) of address 4. If the writing to address 3 fails in the writing of five blocks to addresses 3 to 7, the WSC of address 3 is not updated and remains 0x0A. This error can be detected when checking the WSC for address 4 because the SQN (0x0B) does not match the SQN (0x0A) for address 3.

[0061] (R1), (R2), and (R5) indicate that if the current block is the first block or the previous block is the last block, no check is performed because there is no need for the SQN of the WSC of the current block to match the SQN of the WSC of the previous block.

[0062] 4 is a flowchart explaining an example of a write process executed by the storage system 120 of the embodiment 1. In the following explanation, the user data block 201 that is not XTS encrypted will be referred to as a plaintext block, and the user data block 203 encrypted by XTS encryption will be referred to as a ciphertext block.

[0063] The storage system 120 receives user data together with a write command from the host computer 110 (step S401).

[0064] The storage system 120 adds the DIF 202 to the plaintext block constituting the user data (step S402). Specifically, the FE I / F 131 calculates a 16-bit error detection code from the plaintext block and sets it as the CRC 231, and also sets the block address as the TRAG 234.

[0065] The CPU 133 of the storage system 120 stores the user data with the DIF 202 added in the DRAM 134 (step S403). At this time, the storage system 120 multiplexes the user data and stores it in the DRAM 134 to prevent loss of the user data.

[0066] The CPU 133 of the storage system 120 reads a part of the plaintext block from the DRAM 134 and loads it into a register (step S404).

[0067] The CPU 133 of the storage system 120 executes an operation (CRC calculation) to calculate the CRC of the plaintext block using the data loaded into the register, and encrypts the data by XTS encryption (step S405). This generates a part of the ciphertext block. The encrypted data is stored in the register and also in the DRAM 134.

[0068] The CPU 133 of the storage system 120 uses the encrypted data stored in the register to perform a CRC calculation to calculate the CRC of the ciphertext block (step S406).

[0069] The CPU 133 of the storage system 120 determines whether or not encryption of all plaintext blocks has been completed (step S407).

[0070] If encryption of all plaintext blocks is not complete, the CPU 133 of the storage system 120 returns to step S404 and executes the same process. In this manner, the storage system 120 sequentially moves the load source point from the beginning of the plaintext block to the end, and sequentially encrypts the data.

[0071] When encryption of all plaintext blocks is completed, the CRC of each of the plaintext blocks and ciphertext blocks is calculated, and encrypted user data is generated.

[0072] The CPU 133 of the storage system 120 compares the calculated CRC of the plaintext block with the CRC 231 included in the DIF 202 to determine whether the user data is corrupted (step S408). Specifically, it is determined whether the CRCs match. If at least one CRC does not match, it is determined that the user data is corrupted.

[0073] If the CRC check detects that the user data is corrupted, the CPU 133 of the storage system 120 recovers the user data using the multiplexed user data (step S410), and then returns to step S404.

[0074] If the CRC check does not detect any corruption of the user data, the CPU 133 of the storage system 120 judges whether the user data is corrupted or not based on the RTAG 234 included in the DIF 202 (step S409). Specifically, it is judged whether the addresses are in ascending order or not. If the addresses are not in ascending order, it is judged that the user data is corrupted.

[0075] If the inspection of the RTAG 234 detects corruption of the user data, the CPU 133 of the storage system 120 recovers the user data using the multiplexed user data (step S410), and then returns to step S404.

[0076] If no corruption of user data is detected by checking the RTAG 234, the CPU 133 of the storage system 120 adds the DIF 204 to each ciphertext block (step S411). Specifically, a 16-bit error detection code calculated from the ciphertext block is set in the CRC 241, the WSC described in FIG. 3 is set in the ATAG0 (242), and the address of the ciphertext block is set in the RTAG 234.

[0077] The CPU 133 of the storage system 120 writes the encrypted user data with the DIF 204 added to the storage device 140 (step S412). At this time, the CPU 133 writes the encrypted user data divided into N-1 equal parts and the parity generated by the RAID technology to the multiple storage devices 140. This concludes the description of the write process.

[0078] FIG. 5 is a flowchart illustrating an example of a read process executed by the storage system 120 of the first embodiment.

[0079] When the CPU 133 of the storage system 120 receives a read command from the host computer 110, it reads the encrypted user data to which the DIF 204 has been added from the storage device 140, and stores it in the DRAM 134 (step S501).

[0080] The CPU 133 of the storage system 120 loads a part of the ciphertext block from the DRAM 134 into a register (step S502).

[0081] The CPU 133 of the storage system 120 executes an operation (CRC calculation) to calculate the CRC of the ciphertext block using the data loaded in the register, and decrypts the data by XTS decryption (step S503). This generates a part of the plaintext block. The decrypted data is stored in the register and also in the DRAM 134.

[0082] The CPU 133 of the storage system 120 executes an operation (CRC calculation) for calculating the CRC of the plaintext block using the decrypted data stored in the register (step S504).

[0083] The CPU 133 of the storage system 120 determines whether or not the decryption of all the ciphertext blocks is complete (step S505).

[0084] If the decryption of all the ciphertext blocks is not complete, the CPU 133 of the storage system 120 returns to step S502 and executes the same process. In this manner, the load source point is moved sequentially from the beginning of the ciphertext block to the end, and the data is decrypted sequentially.

[0085] When all the ciphertext blocks have been decrypted, the CRCs of the ciphertext blocks and plaintext blocks have been calculated, and the user data has been generated.

[0086] The CPU 133 of the storage system 120 compares the calculated CRC of the ciphertext block with the CRC 241 included in the DIF 204 to determine whether the encrypted user data is corrupted (step S506). That is, it is determined whether the read or write of the encrypted user data has failed. Specifically, it is determined whether the CRCs match. If at least one CRC does not match, it is determined that the encrypted user data is corrupted.

[0087] If the CRC check detects corruption of the encrypted user data, the CPU 133 of the storage system 120 reads the parity from the storage system 120 and recovers the encrypted user data (step S509), and then returns to step S502.

[0088] If the CRC check does not detect any corruption of the encrypted user data, the CPU 133 of the storage system 120 judges whether the encrypted user data is corrupted or not based on the WSC included in the DIF 204 (step S507). That is, it is judged whether the read or write of the encrypted user data has failed. Specifically, the check is performed according to the table 320 shown in FIG. 3C.

[0089] If corruption of the encrypted user data is detected by checking the WSC, the CPU 133 of the storage system 120 reads the parity from the storage system 120 and recovers the encrypted user data (step S509), and then returns to step S502.

[0090] If the WSC check does not detect corruption of the encrypted user data, the CPU 133 of the storage system 120 judges whether the encrypted user data is corrupted or not based on the RTAG 234 included in the DIF 204 (step S508). That is, it is judged whether the read or write of the encrypted user data has failed. Specifically, it is judged whether the addresses are in ascending order. If the addresses are not in ascending order, it is judged that the encrypted user data is corrupted.

[0091] If checking the RTAG 234 detects corruption of the encrypted user data, the CPU 133 of the storage system 120 reads the parity from the storage system 120 and recovers the encrypted user data (step S509), and then returns to step S502.

[0092] If no corruption of user data is detected by checking the RTAG 234, the CPU 133 of the storage system 120 adds the DIF 202 to each plaintext block (step S510). Specifically, a 16-bit error detection code calculated from the plaintext block is set in the CRC 231, and the address of the plaintext block is set in the RTAG 234.

[0093] The CPU 133 of the storage system 120 stores the user data to which the DIF 202 has been added in the DRAM 134 (step S511).

[0094] The storage system 120 transmits the user data to the host computer 110 (step S512). At this time, the FE I / F 131 checks the DIF and removes the DIF from the user data. This completes the read process.

[0095] 6A and 6B are diagrams for explaining conventional XTS encryption / decryption.

[0096] Figure 6A shows the procedure for XTS encryption. In XTS encryption, a 512-byte plaintext block is encrypted in 16-byte chunks. First, (E1) a 16-byte tweak is exclusive-ORed with a part of the plaintext block. Next, (E2) encryption is performed based on the AES encryption algorithm. Finally, (E3) the result of the encryption is exclusive-ORed with the tweak to generate a 16-byte ciphertext element. A 512-byte ciphertext block is generated by executing the process cycle (E1), (E2), and (E3) 32 times.

[0097] Tweak is changed every time 16 bytes of data is encrypted, and Tweak is a different value for each 512-byte block.

[0098] In the AES algorithm (E2), encryption is performed using 15 encryption round keys (128 bits). These round keys are generated by applying a prescribed expansion process (Key Expansion) to a 256-bit encryption key. First, (E2-1) AddRoundKey process is executed, then (E2-2) four processes of SubBytes, ShiftRows, MixColumns, and AddRoundKey are repeated 13 times, and finally (E2-3) three processes of SubBytes, ShiftRows, and AddRoundKey are executed. In the AddRoundKey process executed 15 times, encryption round keys 0 to 14 are used.

[0099] Each of the above processes can be mapped to the following CPU instructions. The exclusive OR of data and Tweak corresponds to the XOR instruction. The AddRoundKey process corresponds to the exclusive OR (XOR) of the result of the previous process and the encryption round key as a CPU instruction. The four processes in (E2-2) correspond to the AESENC instruction. In other words, the AESENC instruction must be executed 13 times. The three processes in (E2-3) correspond to the AESENC instruction. The AESENC and AESENCLAST instructions are implemented as part of a dedicated encryption instruction set called AES-NI (AES New Instructions) in microprocessors that Intel has commercialized since around 2010.

[0100] Figure 6B shows the procedure for XTS decryption. In XTS decryption, a 512-byte ciphertext block is decrypted 16 bytes at a time. First, (D1) a 16-byte tweak is exclusive-ORed with a part of the encrypted block. Next, (D2) decryption based on the AES algorithm is performed. Finally, (D3) the result of the decryption is exclusive-ORed with the tweak to generate a 16-byte plaintext element. A 512-byte plaintext block is generated by executing (D1), (D2), and (D3) 32 times.

[0101] Tweak is changed every time 16 bytes of data are decrypted, and Tweak is a different value for each 512-byte block.

[0102] In the AES decryption algorithm (D2), decryption is performed using 15 decryption round keys (128 bits). These round keys are generated by applying a prescribed expansion process (Key Expansion) to a 256-bit encryption key. The 256-bit encryption key is the same as the encryption key used in encryption. First, (D2-1) AddRoundKey processing is performed, then (D2-2) four processes of InvShiftRows, InvSubBytes, AddRoundKey, and InvMixColumns are repeated 13 times, and finally (D2-3) three processes of InvShiftRows, InvSubBytes, and AddRoundKey are performed. In the AddRoundKey processing, which is performed 15 times, decryption round keys 0 to 14 are used.

[0103] Each of the processes mentioned above can be mapped to the following CPU instructions. The exclusive OR of data and Tweak corresponds to the XOR instruction. The AddRoundKey process corresponds to the exclusive OR (XOR) of the previous process result and the decryption round key. The four processes in (D2-2) correspond to the AESDEC instruction. In other words, the AESDEC instruction must be executed 13 times. The three processes in (D2-3) correspond to the AESDECLAST instruction. The AESDEC and AESDECLAST instructions are implemented as part of AES-NI, as above.

[0104] 7A, 7B, and 7C are diagrams illustrating XTS encryption / decryption in the storage system 120 of the first embodiment.

[0105] The CPU 133 is a third generation Xeon Scalable Processor or the like, and supports AES-NI. It also supports instructions that are vectorized versions of the AESENC instruction, AESENCLAST instruction, AESDEC instruction, and AESDECLAST instruction (VAESENC instruction, VAESENCLAST instruction, VAESDEC instruction, and VAESDECLAST instruction).

[0106] A Vector instruction is an instruction that can perform the same operation on multiple data in parallel in one execution. It is also called a SIMD (Single Instruction / Multiple Data) instruction. A Vector instruction uses a 512-bit (64-byte) register called a Zmm register to perform the same operation on four pieces of 128-bit (16-byte) data. The operation result is also stored in the Zmm register. CPU 133 uses 32 Zmm registers (Zmm0 register to Zmm31 register). CPU 133 also supports Vectorized instructions for instructions that perform general operations for microprocessors (addition, subtraction, multiplication, exclusive OR, shift, comparison, etc.).

[0107] The CPU 133 uses these Vector instructions to execute XTS encryption / decryption in parallel, specifically encrypting / decrypting four data blocks (512 bytes) in parallel.

[0108] FIG. 7A shows parallel XTS encryption of four plaintext blocks by CPU 133.

[0109] The CPU 133 loads 16 bytes of data from each of the four plaintext blocks (512 bytes) stored in the DRAM 134 into the Zmm register. A total of 64 bytes of data is stored in the Zmm register.

[0110] CPU 133 executes (P1) a Vector XOR instruction to calculate the exclusive OR of the data stored in the Zmm register and the value of the four tweaks for each plaintext block. Next, CPU 133 executes (P2) a Vector XOR instruction, 13 VAESENC instructions, and a VAESENCLAST instruction to perform XTS encryption of the four plaintext blocks in parallel. Finally, CPU 133 calculates (P3) an exclusive OR of the result of the calculation of (P2) and the value of the four tweaks. As a result, four 16-byte ciphertext elements are generated simultaneously.

[0111] The ciphertext elements are sequentially stored in the DRAM 134 from the Zmm register. Four ciphertext blocks (512 bytes) are generated by executing the process cycles of (P1), (P2), and (P3) multiple times. Note that the encryption round keys 0 to 14 used in (P2) are common to each plaintext block.

[0112] FIG. 7B illustrates parallel XTS decryption of four ciphertext blocks by CPU 133.

[0113] The CPU 133 loads 16 bytes of data from each of the four ciphertext blocks (512 bytes) stored in the DRAM 134 into the Zmm register. A total of 64 bytes of data is stored in the Zmm register.

[0114] CPU 133 executes (P4) a Vector XOR instruction to calculate the exclusive OR of the data stored in the Zmm register and the value of the four tweaks of each ciphertext block. Next, CPU 133 executes (P5) a Vector XOR instruction, thirteen VAESDEC instructions, and a VAESDECLAST instruction to perform XTS decryption of the four ciphertext blocks in parallel. Finally, CPU 133 calculates (P6) an exclusive OR of the operation result of (P5) and the value of the four tweaks. As a result, four 16-byte plaintext elements are generated simultaneously.

[0115] The plaintext elements are sequentially stored in the DRAM 134 from the Zmm register. Four plaintext blocks (512 bytes) are generated by executing the process cycles of (P4), (P5), and (P6) multiple times. Note that the decryption round keys 0 to 14 used in (P5) are common to each ciphertext block.

[0116] FIG. 7C shows a method for optimizing the execution order of the above four vectorized AES instructions.

[0117] VAES* in Figure 7C is replaced by VAESENC, VAESENCLAST, VAESDEC, and VAESDECLAST.

[0118] The arithmetic circuits used in these instructions each have a four-stage pipeline structure 731, and the number of cycles required to complete processing is four. When data moves from the Nth stage to the (N+1)th stage of the pipeline circuit, the Nth stage can accept the next data. Therefore, when four VAES* instructions are executed in a row, data can be supplied to the pipeline in four consecutive cycles, improving processing efficiency. Based on this concept, when loading 16 bytes from each of four data blocks into a Zmm register in the encryption shown in FIG. 7A and the decryption shown in FIG. 7B, the CPU 133 reserves four Zmm registers and performs four loads of 16 bytes x 4 in advance. Then, the CPU 133 executes four VAES* instructions for the four Zmm registers in succession, improving the efficiency of pipeline processing. Hereinafter, a group of data processed by four consecutive VAES* instructions is called a Group.

[0119] FIG. 8 is a diagram showing the structure of input data in XTS encryption / decryption using the Vector command executed by the storage system 120 of the first embodiment.

[0120] In the parallel execution of XTS encryption / decryption of four data blocks, the group shown in Fig. 7C is composed of eight groups, Group 0 to 7. That is, the procedure of "executing four VAES* instructions consecutively on four Zmm registers" is executed eight times in one execution of parallel processing of XTS encryption / decryption of four data blocks.

[0121] The four 64-byte data (16 bytes x 4) that make up one Group are loaded into the Zmm0 to Zmm3 registers, respectively. For example, the data loaded into the Zmm0 register is the 64-byte data enclosed by dashed line 810. Note that the number of the Zmm register to which the data is loaded is just an example, and other register numbers may be used.

[0122] An 8-byte DIF is added to the end of each data block of user data or encrypted user data stored in the DRAM 134. Since the DIF checks of the four data blocks are performed in parallel, the DIF is loaded into one Zmm register. In Fig. 8, the DIFs added to the four data blocks are loaded into the Zmm8 register.

[0123] A Zmm register can hold four 16-byte data. However, since a DIF is 8 bytes, it is loaded into the Zmm register with 8-byte intervals between them. Note that the Zmm register number into which the DIF is loaded is just an example, and other register numbers may be used.

[0124] The addresses of the four data blocks that are input simultaneously to the XTS encryption / decryption process are consecutive in ascending order: 4N, 4N+1, 4N+2, and 4N+3 (N is an integer). For example, if the size of the user data to be written / read is 128 KB (256 blocks), the XTS encryption / decryption of the four data blocks must be performed in parallel 64 times.

[0125] FIG. 9 is a diagram showing the structure of output data in XTS encryption / decryption using the Vector command executed by the storage system 120 of the first embodiment.

[0126] Groups 0 to 7 in Fig. 9 correspond to the output positions when the results of XTS encryption / decryption of the data of Groups 0 to 7 in Fig. 8 are stored in DRAM 134. The positional relationship of the output destination of the results of XTS encryption / decryption is the same as that of the input source. That is, when the input block start position is X and the output block start position is Y, the result of XTS encryption / decryption of data at position X+P, which is P (P is 0 or more) away from the start of the input block, is output to position Y+P.

[0127] The results of XTS encryption / decryption of one Group are held in four registers Zmm4 to 7, and the four 64-byte data (16 bytes x 4) are stored in positions according to this rule. For example, the 64-byte data enclosed by dashed line 910 is the result of XTS encryption / decryption of the 64-byte data enclosed by dashed line 810 in Fig. 8, and is stored in the Zmm4 register. Note that the numbers of these storage source Zmm registers are merely examples, and other register numbers may be used.

[0128] An 8-byte DIF is stored at the end of each data block of user data or encrypted user data stored in the DRAM 134. Since the generation of DIFs for four blocks is performed in parallel, the DIF is read from one Zmm register. In FIG. 9, the DIF is read from Zmm9.

[0129] The DIF stored in the Zmm9 register is stored with 8-byte intervals. Note that the number of the Zmm register from which the DIF is stored is just an example, and other register numbers may be used.

[0130] The addresses of the four data blocks to which the results of the XTS encryption / decryption process are simultaneously output are consecutive in ascending order, as in FIG. 8, and are 4N, 4N+1, 4N+2, and 4N+3 (N is an integer).

[0131] The parallel processing of XTS encryption / decryption of four data blocks described above with reference to FIGS. 7 to 9 is applied in step S405 in FIG. 4 and step S503 in FIG.

[0132] 10A, 10B, and 10C are diagrams illustrating a CRC calculation method in the storage system 120 of the first embodiment.

[0133] First, the theory of CRC calculation will be described with reference to Fig. 10A. In general, the CRC of binary data M of an arbitrary length corresponding to a binary polynomial M(x) is defined by equation (1).

[0134]

number

[0135] where deg represents the degree of the polynomial, P(x) represents the polynomial that defines the CRC algorithm, and the symbol "·" represents carry-less multiplication. For a 16-bit CRC algorithm, P(x) is a polynomial of degree 16. The CRC can be calculated as the remainder polynomial when a large degree polynomial M(x) defined over a Galois field GF(2) is divided by the CRC polynomial P(x).

[0136] 10A shows how a 16-bit CRC is calculated from a typical 512-byte (4096-bit) block in storage system 120. Binary polynomial division can be performed efficiently if there are CPU instructions that can perform carry-less multiplication efficiently.

[0137] 10B and 10C show a method of CRC calculation using the PCLMULQDQ instruction, which can perform carry-less multiplication of up to 64 bits by 64 bits. The PCLMULQDQ instruction is included in microprocessors that Intel has commercialized since around 2010.

[0138] Fig. 10B shows a method for shortening the CRC calculation of 512 bytes (4096 bits) of binary data to that of 128 bits of binary data. The number of bits of the binary data is reduced by 128 by one shortening process. The relationship between the binary polynomial Mk(x) after k shortening processes and the polynomial Mk+1(x) obtained by further shortening the process is given by equation (2).

[0139]

number

[0140] Here, M0(x) = M(x). H(x) represents a polynomial consisting of the upper 64 bits of the binary data represented by Mk(x), and L(x) represents a polynomial consisting of the 64 bits following the upper 64 bits of the binary data represented by Mk(x). Gk(x) represents a polynomial consisting of the remaining data excluding the upper 128 bits of the binary data represented by Mk(x). T represents the number of bits of the remaining data. The symbol "+" represents a bitwise exclusive OR.

[0141] Using the PCLMULQDQ instruction, two 128-bit values ​​are obtained by multiplying the 64-bit values ​​indicated by H(x) and L(x) by a constant, and then the exclusive OR of these values ​​and the remaining data indicated by Gk(x) is calculated, thereby reducing the number of bits of binary data to be subject to the CRC calculation by 128. By performing this reduction process 31 times, the CRC calculation of 512 bytes (4096 bits) of binary data is reduced to the CRC calculation of 128-bit binary data indicated by M31(x).

[0142] FIG. 10C shows a method for performing the CRC calculation (the final calculation in FIG. 10B) on the 128-bit binary data represented by M31(x).

[0143] First, the CPU 133 multiplies the upper 64-bit value by a constant using the PCLMULQDQ instruction to obtain an 80-bit value (1031), and calculates the exclusive OR of the 80-bit value and the lower 64-bit value, thereby reducing the number of bits of the data to be subjected to the CRC calculation to 80. Next, the CPU 133 multiplies the upper 32-bit value by a constant using the PCLMULQDQ instruction to obtain a 48-bit value (1032), and calculates the exclusive OR of the 80-bit value and the lower 48 bits of the 80-bit value (1031), thereby reducing the number of bits of the data to be subjected to the CRC calculation to 48. The result is designated as R. Finally, the CPU 133 calculates a 16-bit CRC from the 48-bit R based on an algorithm called Barrett Reduction. Specifically, the CPU 133 performs the calculations of equations (3), (4), (5), and (6) in this order.

[0144]

number

[0145]

number

[0146]

number

[0147]

number

[0148] Here, R(x) represents a polynomial made up of R, Floor represents the operation of leaving terms of degree 0 or higher of x from the polynomial, and the symbol "+" represents bitwise exclusive OR. The 16-bit value represented by C(x) is the CRC to be calculated. Thus, the Barrett Reduction also uses two carry-less multiplications to which the PCLMULQDQ instruction can be applied.

[0149] The CPU 133 supports the PCLMULQDQ instruction, and also supports the VPCLMULQDQ instruction, which is a vectorized version of the PCLMULQDQ instruction.

[0150] The CPU 133 uses the VPCLMULQDQ instruction to perform CRC calculations on four data blocks in parallel, specifically, to perform CRC calculations on four 512-byte data blocks in parallel.

[0151] 11A and 11B are diagrams showing a parallel method for CRC calculation in the storage system 120 of the embodiment 1. This method is applied to the CRC calculation in steps S405 and S406 in FIG. 4 and steps S503 and S504 in FIG.

[0152] FIG. 11A shows a method of binary data compaction processing (corresponding to the entire processing in FIG. 10B) in parallel processing of CRC calculations of four data blocks by CPU 133.

[0153] Zmm register 1111 is a register that holds 16 bytes of data corresponding to four data blocks, which are components of input data for encryption / decryption or output data for encryption / decryption in the parallel processing of XTS encryption / decryption of four data blocks described with reference to Figures 7 to 9. Specifically, in the case of input data for XTS encryption / decryption, it indicates the Zmm0 register, Zmm1 register, Zmm2 register, or Zmm3 register, and in the case of output data for XTS encryption / decryption, it indicates the Zmm4 register, Zmm5 register, Zmm6 register, or Zmm7 register.

[0154] The present invention performs parallel shortening processing on target data for CRC calculation using data held for XTS encryption / decryption in Zmm register 1111. The 16 bytes of data in Zmm register 1111 correspond to a 128-bit value obtained by arranging two 64-bit values ​​indicated by H(x) and L(x) in Fig. 10B.

[0155] The Zmm register 1112 is a register that holds 128-bit binary data of four data blocks obtained during or after the shortening process. Specifically, the Zmm10 register is indicated for CRC calculation of input data for XTS encryption / decryption, and the Zmm9 register is indicated for CRC calculation of output data for XTS encryption / decryption.

[0156] First, CPU 133 (PP1) multiplies the upper 64 bits of the 16 bytes of data in Zmm register 1111 by the same constant by executing the VPCLMULQDQ instruction. Four 128-bit data items are output as the calculation results. Next, CPU 133 (PP2) multiplies the lower 64 bits of each 16 bytes of data in the Zmm register by the same constant by executing the VPCLMULQDQ instruction. Four 128-bit data items are output as the calculation results. CPU 133 (PP3) calculates the exclusive OR of these two results and Zmm register 1112, and stores the result again in Zmm register 1112. The processes (PP1) to (PP3) correspond to one shortening process.

[0157] In parallel processing of XTS encryption / decryption of four data blocks, CPU 133 repeats the shortening processing shown in (PP1) to (PP3) when the next 16 bytes of data are stored in Zmm register 1111. CPU 133 executes the shortening processing 31 times, and when the last 16 bytes of data of the block (i.e., the fourth of Group 7) is stored in Zmm register 1111, it calculates the exclusive OR of the value of Zmm register 1111 and Zmm register 1112, and stores the result in Zmm register 1112 again.

[0158] FIG. 11B shows a method of final calculation (final process of FIG. 10B) in parallel processing of CRC calculation of four block data by CPU 133.

[0159] Zmm register 1112 holds 128-bit binary data used in the final calculation of four data blocks. In the present invention, the final CRC calculation is performed in parallel using the data held in Zmm register 1112. Here, parallel final calculation 1121 is implemented by replacing the CPU instruction used in the final calculation in FIG. 10B with the corresponding Vector instruction. That is, the XOR instruction is replaced with the Vector XOR instruction, and the PCLMULQDQ instruction is replaced with the VPCLMULQDQ instruction. Each instruction constituting Barrett Reduction is also replaced with the corresponding Vector instruction. The result of the final CRC calculation is stored in Zmm register 1112. Specifically, in the case of CRC calculation of input data for XTS encryption / decryption, Zmm10 register is indicated, and in the case of CRC calculation of output data for XTS encryption / decryption, Zmm9 register is indicated. The position where the results of the four CRC calculations are stored is the first 16 bits of each of the 16 bytes of Zmm register 1112. Note that upon completion of the CRC calculation, the remaining portion of each 16 bytes (112 bits) is unused.

[0160] 12A and 12B are diagrams illustrating a method of generating DIFs of four data blocks in parallel in the storage system 120 of the first embodiment.

[0161] FIG. 12A shows a method in which the CPU 133 appends a 1-byte (8-bit) WSC in parallel to the end of each CRC in the Zmm9 register that holds four CRCs calculated in parallel from the output data of XTS encryption / decryption using the method shown in FIG. 11.

[0162] As explained with reference to Figure 3, the WSC to be added is such that HEAD 301 of the leading block is 1, HEAD 301 of the non-leading block is 0, TAIL 302 of the tail block is 1, TAIL 302 of the non-tail block is 0, and the SQN of all data blocks is a common 6-bit value. A Zmm11 register is prepared to hold a 512-bit pattern (however, 00h is set to each of the 8 bits of ATAG(1) 233 and 243) including the WSC based on this setting rule, and this is overwritten only in the 8-bit portion following each CRC in the Zmm9 register. For example, an instruction that vectorizes the bit-masked MOV instruction is used for the overwriting. As a result, four pairs of CRC and WSC are stored in the Zmm9 register.

[0163] For example, if the size of the user data to be written / read is 128 KB (256 blocks), the parallel processing of appending WSC must be performed 64 times. In the first append, 1 is set to HEAD 301 of the WSC in the DIF of the first block, and in the 64th append, 1 is set to TAIL 302 of the WSC in the DIF of the last block. 0 is set to the other HEAD 301 and TAIL 302.

[0164] FIG. 12B shows how the CPU 133 appends 4-byte RTAGs 234, 244 in parallel to the end of each ATAG(1) 233, 243 in the Zmm9 register.

[0165] The RTAGs 234, 244 to be added are the addresses of the four data blocks arranged in ascending order. A Zmm12 register is prepared to store a 512-bit pattern including the RTAGs 234, 244 based on this setting rule, and this is overwritten only in the 4-byte portion following each ATAG(1) 233, 234 in the Zmm9 register. For example, an instruction that is a vectorized version of a bit-masked MOV instruction is used for the overwriting. As a result, four DIFs (i.e., a set of CRC, WSC, and RTAG) are stored in the Zmm9 register. This corresponds to the Zmm9 register that holds the four DIFs to be added in FIG. 9. A DIF is added to each end of the four output data blocks by a store instruction from this Zmm9 register to DRAM 134.

[0166] The above-described method of generating DIFs in parallel is applied to S411 in FIG. 4 and S509 in FIG.

[0167] 13A, 13B, and 13C are diagrams illustrating a method of checking the DIF of four data blocks in parallel in the storage system 120 of the first embodiment.

[0168] 13A, 13B, and 13C, the Zmm8 register is a Zmm register that stores the DIFs (four in total) that follow each data block of the XTS encrypted / decrypted input data in FIG.

[0169] FIG. 13A shows a method for checking four CRCs in parallel using pairs in the Zmm8 register.

[0170] Using the method shown in Fig. 11, the Zmm10 register holds four CRCs calculated in parallel from the input data for XTS encryption / decryption. These CRCs are checked in parallel to see if they match the CRCs stored in the Zmm8 register. For example, an instruction that is a vectorized version of the bit-masked COMPARE instruction is used for this check. If all four comparison results match, the CRC check is successful. This check method is applied to step S408 in Fig. 4 and step S506 in Fig. 5.

[0171] FIG. 13B shows a method for testing four WSCs in parallel using the Zmm8 register.

[0172] The lower 48 bytes of the Zmm13 register hold the contents of the Zmm8 register shifted 16 bytes to the right, and the upper 16 bytes hold the DIF of the fourth block (i.e., address 4N+3) previously checked. Checks are made in parallel to see if the SQN of each of these WSCs matches the SQN of the WSC in the Zmm8 register. For example, a vectorized version of the COMPARE instruction with a bit mask is used for this check.

[0173] However, the SQN of the WSC that does not meet the conditions (R3) and (R4) shown in table 320 in Fig. 3C is not inspected. In this case, for example, the mask parameters of the COMPARE instruction are partially set to zero.

[0174] After checking the WSC, the lower 16 bytes including the DIF of the fourth block in the Zmm8 register are saved to the register for the next WSC check. As a result, if all valid SQN comparisons (up to four) match, the WSC check is successful. In this way, by holding the WSC shifted by one block in the Zmm13 register, four SQN comparisons between the current WSC and the previous WSC can be performed simultaneously by executing one Vector COMPARE instruction. This check method is applied to step S507 in FIG. 5.

[0175] For example, if the size of the user data to be written / read is 128 KB (256 blocks), 64 parallel checks of the WSC of the four encrypted data blocks must be performed. The lower 16 bytes of the Zmm8 register, including the DIF of the fourth block, are saved during the first through 63rd checks, and are transferred to the upper 16 bytes of the Zmm13 register during the second through 64th checks. Nothing is transferred to the upper 16 bytes of the Zmm13 register during the first check, but because the first WSC is not checked, this location may contain an invalid value.

[0176] FIG. 13C shows a method for checking four RTAGs in parallel using the Zmm8 register.

[0177] The Zmm14 register holds four addresses arranged in ascending order. Each of these addresses is checked in parallel to see if it matches the corresponding RTAG in the Zmm8 register. For example, an instruction that is a vectorized version of the COMPARE instruction with a bit mask is used for this check. If all four addresses match as a result, the RTAG check is successful. This check method is applied to step S409 in FIG. 4 and step S508 in FIG. 5.

[0178] In FIG. 12 and FIG. 13, the numbers of the Zmm registers used for checking / generating DIF (register Zmm11, register Zmm12, register Zmm13, register Zmm14) are merely examples, and other register numbers may be used.

[0179] As described above, the CPU 133 of the storage system 120 to which this invention is applied can execute XTS encryption / decryption, CRC calculation, DIF generation, and DIF checking in parallel using the 512-bit Zmm register and Vector instructions in write / read processing. Furthermore, by following the above-described method of using the Zmm register, the number of loads / stores between the Zmm register and DRAM 134 is kept to a necessary minimum, minimizing overhead cycles other than data operation cycles.

[0180] In addition, if the size of the user data to be written / read is 2048U bytes (U is an integer), it is necessary to perform U times of parallel write / read processing of 4 blocks, but the data reception in step S401, the data write in step S412, the data read in step S501, and the data transmission in step S512 may be performed all at once instead of being divided into U times.

[0181] In addition, the present invention may use a 256-bit Ymm register that holds two pieces of process data instead of a 512-bit Zmm register that holds four pieces of process data. In that case, by applying a Vector instruction to the Ymm register in the same manner as in the above-described method, XTS encryption / decryption, CRC calculation, DIF generation, and DIF checking can all be processed in two blocks in parallel.

[0182] The present invention has the advantage of being able to execute a write process, in which user data received from a host computer 110 is encrypted and stored in a storage device, and a read process, in which encrypted user data stored in the storage device is decrypted and sent to the host computer 110, faster than conventional processes.

[0183] Although one embodiment of the present invention has been described above, this is merely an example for the purpose of explaining the present invention, and the scope of the present invention is not limited to this embodiment. In other words, the present invention can be embodied in various other forms. [Explanation of symbols]

[0184] 110 Host computer 120 Storage System 130 Storage Controller 131 FE I / F 132BE I / F 133 CPU 134 DRAM 140 Storage Devices

Claims

1. A computer that writes and reads user data including a plurality of data blocks, comprising: a processor, a memory connected to the processor, a storage medium connected to the processor, and a connection interface connected to the processor; The processor, A plurality of registers are included. receiving a request to write the user data; storing the user data written in accordance with the write request in the memory; performing an encryption process using the plurality of registers to generate encrypted user data including a plurality of encrypted data blocks; storing two or more first data integrity fields in a first register; performing in parallel a setting process for setting a first address indicating a storage location of the encrypted data block in each of the two or more first data integrity fields stored in the first register; adding a first data integrity field, the first address being set to each of the plurality of encrypted data blocks included in the encrypted user data; storing the encrypted user data on the storage medium; 1. A computer comprising:

2. A computer according to claim 1, A first generation number representing a generation of writing of the data block can be set in the first data integrity field, a first data integrity field storing means for storing a first generation number of the encrypted data block in each of the first data integrity fields stored in the first register, the first generation number being set in the first data integrity field in parallel;

3. A computer according to claim 1, The first data integrity field includes a first error code.

4. A computer according to claim 2, The processor, receiving a request to read the encrypted user data; reading from said storage medium said encrypted user data specified by said read request and storing said encrypted user data in said memory; performing a decryption process for decrypting the encrypted user data using the plurality of registers; storing two or more second data integrity fields in a second register; performing in parallel a setting process for setting a second address indicating a storage location of the encrypted data block in each of the two or more second data integrity fields stored in the second register; adding a second data integrity field, in which the second address is set, to each of the plurality of data blocks included in the decrypted user data, and storing the data in the memory; 1. A computer comprising:

5. A computer according to claim 4, A second generation number representing a generation of writing of the data block can be set in the second data integrity field, a second data integrity field storing means for storing a second generation number of the data block in each of the two or more second data integrity fields stored in the second register, the second generation number being set in the second data integrity field in parallel;

6. The computer of claim 5, The processor, performing a setting operation in parallel using a SIMD instruction to set each of the two or more first data integrity fields stored in the first register to the first address; executing, in parallel, a setting process for setting the first generation number in each of the two or more first data integrity fields stored in the first register using the SIMD instruction; performing a setting operation in parallel using the SIMD instruction to set the second address in each of the two or more second data integrity fields stored in the second register; a setting process for setting the second generation number in each of the two or more second data integrity fields stored in the second register in parallel using the SIMD instruction.

7. The computer of claim 4, The second data integrity field includes a first error code.

8. A computer that writes and reads user data including a plurality of data blocks, comprising: a processor, a memory connected to the processor, a storage medium connected to the processor, and a connection interface connected to the processor; The processor, A plurality of registers are included. receiving a request to write the user data; storing the user data written in accordance with the write request in the memory; performing an encryption process using the plurality of registers to generate encrypted user data including a plurality of encrypted data blocks; performing a first test process using the plurality of registers to detect corruption of the user data; storing the encrypted user data on the storage medium; a first data integrity field including a first error code is added to each of the plurality of data blocks included in the user data; In the encryption process, a first process of reading partial data, which is a part of the data blocks, from a predetermined number of the data blocks and storing the partial data in a first register; a second process of encrypting the partial data stored in the first register and storing the encrypted partial data in a second register; a third process of executing a first operation for generating the first error-correcting code by using the partial data stored in the first register, and storing a result of the first operation in a third register; is executed repeatedly, The first inspection process includes: reading said first data integrity field of a predetermined number of said data blocks into a fourth register; determining whether the user data read from the memory is corrupted by comparing the first error code stored in the third register with the first error code included in the first data integrity field stored in the fourth register; 23. A computer comprising:

9. 9. The computer of claim 8, the first data integrity field includes a first address indicating a storage location of the data block; The first inspection process includes: reading the first addresses of a predetermined number of the data blocks into a fifth register; determining whether the user data read from the memory is corrupted by comparing the first address stored in the fifth register with the first address included in the first data integrity field stored in the fourth register; 23. A computer comprising:

10. 10. The computer of claim 9, The processor, receiving a request to read the encrypted user data; reading from said storage medium said encrypted user data specified by said read request and storing said encrypted user data in said memory; performing a decryption process for decrypting the encrypted user data using the plurality of registers; performing a second checking process using the plurality of registers to detect corruption of the encrypted user data; storing said user data in said memory; a second data integrity field including a second error code is added to each of the plurality of encrypted data blocks included in the encrypted user data; In the decoding process, an eighth process of reading partial encrypted data, which is a part of the encrypted data blocks, from a predetermined number of the encrypted data blocks and storing the partial encrypted data in a sixth register; a ninth process of storing the partial data obtained by decrypting the partially encrypted data stored in the sixth register in a seventh register; a tenth process of executing a second operation for generating the second error code by using the encrypted partial data stored in the sixth register, and storing a result of the second operation in an eighth register; is executed repeatedly, The second inspection process includes: reading said second data integrity field of a predetermined number of said encrypted data blocks into a ninth register; determining whether the encrypted user data read from the storage medium is corrupted by comparing the second error code stored in the eighth register with the second error code included in the first data integrity field stored in the ninth register; 23. A computer comprising:

11. 11. The computer of claim 10, the second data integrity field includes a second address indicating a storage location of the encrypted data block; The second inspection process includes: reading, into a tenth register, the second addresses corresponding to a predetermined number of the encrypted data blocks; determining whether the encrypted user data read from the storage medium is corrupted by comparing the second address contained in the second data integrity field stored in the ninth register with the second address stored in the tenth register; 23. A computer comprising:

12. 12. The computer of claim 11, the second data integrity field includes a second generation number representing a generation of writing of the data block; The second inspection process includes: reading, into an eleventh register, the second generation numbers corresponding to a predetermined number of the encrypted data blocks; determining whether the encrypted user data read from the storage medium is corrupted by comparing the second generation number included in the first data integrity field stored in the ninth register with the second generation number stored in the eleventh register; 23. A computer comprising:

13. 13. The computer of claim 12, The processor executes processing on the plurality of data blocks and the plurality of encrypted data blocks in parallel using SIMD instructions.

14. 1. A computer-implemented data processing method for writing and reading user data including a plurality of data blocks, comprising: the computer includes a processor, a memory connected to the processor, a storage medium connected to the processor, and a connection interface connected to the processor; The processor has a plurality of registers; The data processing method includes: receiving a request by the processor to write the user data; storing, by the processor, in the memory, the user data to be written in accordance with the write request; performing an encryption process using the plurality of registers to generate encrypted user data including a plurality of encrypted data blocks; The processor executes a test process using the plurality of registers to detect corruption of the user data; the processor appending a first data integrity field including a first error code to each of the plurality of encrypted data blocks included in the encrypted user data; storing, by the processor, the encrypted user data on the storage medium; Including, In the encryption process, a first process of reading partial data, which is a part of the data blocks, from a predetermined number of the data blocks and storing the partial data in a first register; a second process of encrypting the partial data stored in the first register and storing the encrypted partial data in a second register; a third process of performing a first operation for calculating the first error code by using the encrypted partial data stored in the second register, and storing a result of the first operation in a third register; is executed repeatedly, The inspection process includes: reading said first data integrity field of a predetermined number of said data blocks into a fourth register; determining whether the user data read from the memory is corrupted by comparing the first error code stored in the third register with the first error code included in the first data integrity field stored in the fourth register; 13. A data processing method comprising:

15. A computer for writing and reading user data including a plurality of data blocks, comprising: a processor, a memory connected to the processor, a storage medium connected to the processor, and a connection interface connected to the processor; The processor, A plurality of registers are included. receiving a request to write the user data; storing the user data written in accordance with the write request in the memory; performing an encryption process using the plurality of registers to generate encrypted user data including a plurality of encrypted data blocks; appending a first data integrity field including a first error code to each of the plurality of encrypted data blocks included in the encrypted user data; storing the encrypted user data on the storage medium; In the encryption process, a first process of reading partial data, which is a part of the data blocks, from a predetermined number of the data blocks and storing the partial data in a first register; a second process of encrypting the partial data stored in the first register and storing the encrypted partial data in a second register; a third process of performing a first operation for calculating the first error code by using the encrypted partial data stored in the second register, and storing a result of the first operation in a third register; is executed repeatedly, A first address indicating a storage location of the encrypted data block may be set in the first data integrity field, The processor, reading the first error code for a predetermined number of the encrypted data blocks into a fourth register; generating the first data integrity field by appending to the first error code stored in the fourth register the first address of the encrypted data block to which the first error code is to be appended; A first generation number representing a generation of writing of the data block can be set in the first data integrity field, The processor generates the first data integrity field by adding the first generation number of the encrypted data block to which the first error code is added to the first error code stored in the fourth register.

16. The computer of claim 15, The processor, receiving a request to read the encrypted user data; reading from said storage medium said encrypted user data specified by said read request and storing said encrypted user data in said memory; performing a decryption process for decrypting the encrypted user data using the plurality of registers; adding a second data integrity field including a second error code to each of the plurality of data blocks included in the decoded user data, and storing the second data integrity field in the memory; In the decoding process, a fourth process of reading partial encrypted data, which is a part of the encrypted data blocks, from a predetermined number of the encrypted data blocks and storing the partial encrypted data in a fifth register; a fifth process of storing the partial data obtained by decrypting the partially encrypted data stored in the fifth register in a sixth register; an eighth process of performing a second operation for calculating the second error code by using the partial data stored in the sixth register, and storing a result of the second operation in a seventh register; A computer characterized in that:

17. The computer of claim 16, A second address indicating a storage location of the encrypted data block may be set in the second data integrity field, The processor, reading the second error codes of a predetermined number of the data blocks into an eighth register; generating the second data integrity field by appending to the second error code stored in the eighth register the second address of the data block to which the second error code is to be added.

18. The computer of claim 17, A second generation number representing a generation of writing of the data block can be set in the second data integrity field, The processor generates the second data integrity field by adding the second generation number of the data block to which the second error code is added to the second error code stored in the eighth register.

19. The computer of claim 18, The processor executes processing on the plurality of data blocks and the plurality of encrypted data blocks in parallel using SIMD instructions.

20. A computer-implemented data processing method for writing and reading user data including a plurality of data blocks, comprising: the computer includes a processor, a memory connected to the processor, a storage medium connected to the processor, and a connection interface connected to the processor; The processor has a plurality of registers; The data processing method includes: receiving a request by the processor to write the user data; storing, by the processor, in the memory, the user data to be written in accordance with the write request; performing an encryption process using the plurality of registers to generate encrypted user data including a plurality of encrypted data blocks; storing two or more first data integrity fields in a first register by the processor; a step of executing, in parallel, a setting process by the processor, setting a first address indicating a storage location of the encrypted data block in each of the two or more first data integrity fields stored in the first register; the processor appending a first data integrity field, the first address being set to each of the plurality of encrypted data blocks included in the encrypted user data; storing, by the processor, the encrypted user data on the storage medium; 13. A data processing method comprising:

21. A computer-implemented data processing method for writing and reading user data including a plurality of data blocks, comprising: a processor, a memory connected to the processor, a storage medium connected to the processor, and a connection interface connected to the processor; The processor has a plurality of registers; The data processing method includes: receiving a request by the processor to write the user data; storing, by the processor, in the memory, the user data to be written in accordance with the write request; performing an encryption process using the plurality of registers to generate encrypted user data including a plurality of encrypted data blocks; the processor appending a first data integrity field including a first error code to each of the plurality of encrypted data blocks included in the encrypted user data; storing, by the processor, the encrypted user data on the storage medium; Including, In the encryption process, a first process of reading partial data, which is a part of the data blocks, from a predetermined number of the data blocks and storing the partial data in a first register; a second process of encrypting the partial data stored in the first register and storing the encrypted partial data in a second register; a third process of performing a first operation for calculating the first error code by using the encrypted partial data stored in the second register, and storing a result of the first operation in a third register; is executed repeatedly, A first address indicating a storage location of the encrypted data block may be set in the first data integrity field, The processor, reading the first error code for a predetermined number of the encrypted data blocks into a fourth register; generating the first data integrity field by appending to the first error code stored in the fourth register the first address of the encrypted data block to which the first error code is to be appended; A first generation number representing a generation of writing of the data block can be set in the first data integrity field, The data processing method, characterized in that the processor generates the first data integrity field by adding the first generation number of the encrypted data block to which the first error code is added to the first error code stored in the fourth register.

Citation Information

Patent Citations

  • Storage system and encryption processing method

    JP2021132342A

  • Method and apparatus for a secure and deduplicated write once read many virtual disk

    US10320558B2

  • VM encryption of block storage with end-to-end data integrity protection in a smartnic

    US20210150074A1

  • Method and apparatus for optimizing advanced encryption standard (AES) encryption and decryption in parallel modes of operation

    US8194854B2