JP2009303032A - Encryption operation unit, and method and program of encryption operation - Google Patents

Encryption operation unit, and method and program of encryption operation Download PDF

Info

Publication number
JP2009303032A
JP2009303032A JP2008156803A JP2008156803A JP2009303032A JP 2009303032 A JP2009303032 A JP 2009303032A JP 2008156803 A JP2008156803 A JP 2008156803A JP 2008156803 A JP2008156803 A JP 2008156803A JP 2009303032 A JP2009303032 A JP 2009303032A
Authority
JP
Japan
Prior art keywords
bis
bit string
unit
bit
integer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2008156803A
Other languages
Japanese (ja)
Other versions
JP4990843B2 (en
Inventor
Junko Takahashi
順子 高橋
Toshinori Fukunaga
利徳 福永
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2008156803A priority Critical patent/JP4990843B2/en
Publication of JP2009303032A publication Critical patent/JP2009303032A/en
Application granted granted Critical
Publication of JP4990843B2 publication Critical patent/JP4990843B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To improve safety against a DFA attack while suppressing an increase in circuit scale and operation time resulting from error detection or error correction. <P>SOLUTION: An encryption operation unit defines a W-bit string starting from a "Wä(R+1)×c+r}+1" bit of a round key K<SB>n-1</SB>(E*)ä0, 1}<SP>L</SP>having a bit length of L=W×(C+1)×(R+1) of the (n-1)-th round to a Wä(R+1)×c+r+1} bit as BIS<SB>n-1, r, c</SB>, and executes round key generation processing such as an exclusive-OR operation by using each of bit strings BIS<SB>n-1, r, 0</SB>, BIS<SB>n-1, r, 1</SB>, ..., BIS<SB>n-1, r, c</SB>corresponding to each r as a processing unit. (E*) is a symbol representing "belong to". <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、ラウンド鍵を用いて暗号演算を行うための演算技術に関し、特に、DFA攻撃対策が施された演算技術に関する。   The present invention relates to an arithmetic technique for performing a cryptographic operation using a round key, and more particularly to an arithmetic technique with a DFA attack countermeasure.

ICカード等の暗号演算装置の暗号演算中に故障を発生させ、正しい演算結果と故障が発生したときの演算結果との差を利用して、秘密鍵を不正に取得する差分故障利用解析攻撃(DFA攻撃:Differential Fault Analysis)が知られている(例えば、非特許文献1参照)。特に、近年、共通鍵暗号方式AES(Advanced Encryption Standard)の拡大鍵生成部へのDFA攻撃が提案されている(例えば、非特許文献2参照)。   A differential failure utilization analysis attack that causes a failure during cryptographic computation of a cryptographic computation device such as an IC card and illegally obtains a secret key using the difference between the correct computation result and the computation result when the failure occurs ( A DFA attack (Differential Fault Analysis) is known (for example, see Non-Patent Document 1). In particular, in recent years, a DFA attack on the extended key generation unit of the common key encryption method AES (Advanced Encryption Standard) has been proposed (for example, see Non-Patent Document 2).

AESの暗号化処理では、128ビット(16バイト)の平文データを128ビットの秘密鍵を用いて暗号化する。その暗号化処理は複数のラウンドから構成され、ラウンドごとに、拡大鍵生成部での秘密鍵に基づいた拡大鍵(ラウンド鍵)の更新と、暗号演算部での暗号対象データのSubBytes(バイトごとの置換)処理、ShiftRows(行のシフト)処理、MixColumns(列の混合)処理及びAddRoundKey(ラウンド鍵との排他的論理和)処理とが行われる。また、復号処理は暗号化処理を逆向きに実行する処理となる。   In the AES encryption process, 128-bit (16-byte) plaintext data is encrypted using a 128-bit secret key. The encryption process consists of multiple rounds. For each round, the extended key (round key) is updated based on the private key in the extended key generation unit, and the SubBytes (per byte) of the encryption target data in the cryptographic operation unit ) Processing, ShiftRows processing, MixColumns processing, and AddRoundKey processing (exclusive OR with a round key) are performed. The decryption process is a process for executing the encryption process in the reverse direction.

図1は、従来の拡大鍵生成部の処理を説明するための図である。また、図2は、9ラウンド目で故障が発生した場合の従来の拡大鍵生成部の処理を説明するための図である。なお、図1及び図2のBISn−1,r,c(nは1以上11以下の整数、c及びrは0以上3以下の整数)は、n−1ラウンド目のラウンド鍵Kn−1∈{0,1}128(ラウンド鍵Kは秘密鍵)の8(4・c+r)+1ビット目から8(4・c+r+1)ビット目までからなる8ビット(1バイト)のビット列を意味する。また、Rconn−1は32ビットの定数である。 FIG. 1 is a diagram for explaining processing of a conventional extended key generation unit. FIG. 2 is a diagram for explaining the processing of the conventional extended key generation unit when a failure occurs in the ninth round. 1 and 2, BIS n-1, r, c (n is an integer from 1 to 11 and c and r are integers from 0 to 3) is the round key K n− of the (n−1) -th round. 1 ∈ {0, 1} 128 (round key K 0 is a secret key) means 8 (4 · c + r) +1 bit to 8 (4 · c + r + 1) bit sequence of 8 bits (1 byte) . Rcon n-1 is a 32-bit constant.

図1に示すように、従来の拡大鍵生成部では、鍵長128ビットの鍵を連続する32ビットずつ4列のブロックに区切って計10ラウンドの演算を行い、11個の128ビットのラウンド鍵K,…,K10が生成される。例えば、nラウンド目の処理では、ラウンド鍵Kn−1の4列目のブロックであるビット列BISn−1,0,3,…,BISn−1,3,3をバイト単位でローテーション(RotWord)し、それをバイト単位で置換した(SubWord)ビット列と定数Rconとの排他的論理和を行い、その演算結果とラウンド鍵Kn−1の1列目のブロックであるビット列BISn−1,0,0,…,BISn−1,3,0との排他的論理和をラウンド鍵Kの1列目のブロックであるビット列BISn,0,0,…,BISn,3,0とする。そして、ラウンド鍵Kn−1のc+1列目のブロックであるビット列BISn−1,0,c+1,…,BISn―1,3,c+1と、ラウンド鍵Kのc列目のブロックであるビット列BISn,0,c,…,BISn,3,cとの排他的論理和を、ラウンド鍵Kのc+1列目のブロックであるビット列BISn,0,c+1,…,BISn,3,c+1とする。 As shown in FIG. 1, the conventional extended key generation unit performs a total of 10 rounds by dividing a key having a key length of 128 bits into 4 blocks each having 32 bits in succession, and has 11 128-bit round keys. K 0 ,..., K 10 are generated. For example, in the processing of the n-th round, the bit string BIS n−1,0,3 ,..., BIS n−1,3,3 which is the block of the fourth column of the round key K n−1 is rotated in units of bytes (RotWord ), and it performs the exclusive OR of the substituted in bytes (SubWord) bit stream and the constant Rcon n, bit strings BIS n-1 is a result of the operation and the round key K n-1 of the first column of the block , 0,0, ..., BIS n- 1,3,0 bit sequence XOR is a block of the first column of the round key K n with BIS n, 0,0, ..., BIS n, 3,0 And The bit sequence BIS n−1,0, c + 1 ,..., BIS n−1,3, c + 1, which is the block in the c + 1 column of the round key K n−1, and the c column block of the round key K n. bit string BIS n, 0, c, ... , BIS n, 3, the exclusive OR is c, the bit string is c + 1 column of the block of the round key K n BIS n, 0, c + 1, ..., BIS n, 3 , C + 1 .

ここで、図2に示すように、攻撃者がある時点で故意に発生させた故障により、9ラウンド目の0列目32ビットのブロックを構成するビット列BIS9,0,0,…,BIS9,3,0に誤りが生じたとする。この故障には、演算途中に発生するものや、演算結果が格納された記憶部に発生するものが含まれる。従来のアルゴリズムの場合、この誤りは9ラウンド目のラウンド鍵の1列目から3列目のすべてのビット列に伝播し、さらに、10ラウンド目の0列目から3列目のすべてのビット列にも伝播する。その結果、9,10ラウンド目のラウンド鍵K,K10のすべてのビット列に攻撃者の故意に発生させた故障の影響が及ぶ。その結果、9,10ラウンド目にラウンド鍵K,K10を用いて行われるAddRoundKey(ラウンド鍵との排他的論理和)処理の結果得られるすべてのビット列にも攻撃者の故意に発生させた故障の影響が及ぶ。10ラウンド目のAddRoundKeyの処理結果は暗号文として攻撃者が取得可能である。DFA攻撃では、攻撃者が故障を発生させた場合の暗号文と故障を発生させない場合の暗号文とを取得し、それらの差分を用い、差分が生じたバイト位置に対応する共通鍵の情報を取得する。従来の構成では、攻撃者がある時点で故意に発生させた故障の影響がその後に演算されるすべてのビット列の演算結果に及ぶため、DFA攻撃によって攻撃者に多くの情報を与えてしまう。 Here, as shown in FIG. 2, the fault that caused intentionally at some point attacker bit string BIS 9,0,0 constituting the 0 row 32-bit block of 9 round, ..., BIS 9 , 3 and 0 have errors. This failure includes one that occurs in the middle of calculation and one that occurs in the storage unit in which the calculation result is stored. In the case of the conventional algorithm, this error propagates to all the bit strings from the first column to the third column of the round key of the ninth round, and also to all the bit strings from the 0th column to the third column in the tenth round. Propagate. As a result, all the bit strings of the round keys K 9 and K 10 in the ninth and tenth rounds are affected by a failure that is intentionally generated by the attacker. As a result, the attacker intentionally generated all bit strings obtained as a result of AddRoundKey (exclusive OR with round keys) processing performed using round keys K 9 and K 10 in the ninth and tenth rounds. It is affected by the failure. The attacker can obtain the processing result of the 10th round of AddRoundKey as ciphertext. In the DFA attack, the ciphertext when the attacker causes a failure and the ciphertext when the failure does not occur are obtained, and the difference between them is used to obtain information on the common key corresponding to the byte position where the difference has occurred. get. In the conventional configuration, since the influence of a fault intentionally generated at a certain point in time reaches the calculation result of all bit strings calculated thereafter, the DFA attack gives a lot of information to the attacker.

このような攻撃に対抗する従来の手段として、暗号演算部の他にエラー検知コードを生成する処理部を設け、暗号演算結果とエラー検知コードとを用いて暗号演算中のエラーの有無を判定したり、エラー訂正を行ったりする方法がある(例えば、非特許文献3,4参照)。
E. Biham and A. Shamir, "Differential Fault Analysis of Secret Key Cryptosystems," Advances in Cryptology, CRYPTO'97, LNCS 1294, Springer-Verlag, pp. 513-525, 1997. J. Takahashi, T. Fukunaga and K. Yamakoshi, "DFA Mechanism on the AES Key Schedule", Fourth International Workshop on Fault Diagnosis and Tolerance in Cryptography -- FDTC 2007. G. Bertoni, L. Breveglieri, I. Koren, P. Maistri and V. Piuri, "Error analysis and detection procedures for a hardware implementation of the advanced encryption standard", IEEE Transactions on Computers, Vol. 52, No.4, 2003. M. Karpovsky, K.J. Kulikowski and A. Taubin, "Robust protection against fault-injection attacks on smart cards implementing the advanced encryption standard", International Conference on Dependable Systems and Networks -- DSN'04.
As a conventional means to counter such attacks, a processing unit that generates an error detection code is provided in addition to the cryptographic operation unit, and the presence or absence of an error during the cryptographic operation is determined using the cryptographic operation result and the error detection code. Or error correction (for example, see Non-Patent Documents 3 and 4).
E. Biham and A. Shamir, "Differential Fault Analysis of Secret Key Cryptosystems," Advances in Cryptology, CRYPTO'97, LNCS 1294, Springer-Verlag, pp. 513-525, 1997. J. Takahashi, T. Fukunaga and K. Yamakoshi, "DFA Mechanism on the AES Key Schedule", Fourth International Workshop on Fault Diagnosis and Tolerance in Cryptography-FDTC 2007. G. Bertoni, L. Breveglieri, I. Koren, P. Maistri and V. Piuri, "Error analysis and detection procedures for a hardware implementation of the advanced encryption standard", IEEE Transactions on Computers, Vol. 52, No. 4, 2003. M. Karpovsky, KJ Kulikowski and A. Taubin, "Robust protection against fault-injection attacks on smart cards implementing the advanced encryption standard", International Conference on Dependable Systems and Networks-DSN'04.

しかし、従来のDFA攻撃への対抗方法では、暗号演算とは別にエラー検知やエラー訂正を行う必要があるため、暗号演算をハードウェア実装した場合には暗号回路の規模が増大してしまい、ソフトウェア実装した場合には暗号演算処理時間が増大してしまうという問題がある。このような問題は、鍵長128ビットのAESに限らず、ラウンド鍵を連続するビット列からなる複数のブロックに分断し、ブロック単位で排他的論理和演算を行ってラウンド鍵を更新し、暗号処理を行う方式に共通する問題である。   However, in the conventional countermeasure method against the DFA attack, it is necessary to perform error detection and error correction separately from the cryptographic calculation. Therefore, when the cryptographic calculation is implemented in hardware, the scale of the cryptographic circuit increases, and software When implemented, there is a problem that the cryptographic operation processing time increases. Such a problem is not limited to AES with a key length of 128 bits, but the round key is divided into a plurality of blocks each consisting of a continuous bit string, and the round key is updated by performing an exclusive OR operation on a block-by-block basis. It is a problem common to the method of performing.

本発明はこのような点に鑑みてなされたものであり、エラー検知やエラー訂正に伴う回路規模や演算時間の増大を抑制しつつ、DFA攻撃に対する安全性を向上させることが可能な技術を提供することを目的とする。   The present invention has been made in view of these points, and provides a technology capable of improving the safety against DFA attacks while suppressing an increase in circuit scale and calculation time associated with error detection and error correction. The purpose is to do.

本発明では上記課題を解決するために、ラウンド鍵を用いて暗号演算を行う暗号演算装置であって、R,C及びWを1以上の整数の定数とし、nを1以上の整数の変数とした場合における、n−1ラウンド目のL=W・(C+1)・(R+1)ビット長のラウンド鍵Kn−1∈{0,1}を格納する記憶部と、0以上R以下の整数rを選択する選択部と、cを0以上C以下の整数の変数とし、ラウンド鍵Kn−1の上位W{(R+1)・c+r}+1ビット目からW{(R+1)・c+r+1}ビット目までからなるWビットのビット列をBISn−1,r,cとし、BISn−1,r(0)=BISn−1,r,0|BISn−1,r,1|…|BISn−1,r,Cとし、iを0以上C−1以下の各整数とした場合における、ビット列BISn−1,r(i)を下位にWビットシフトさせたビット列BISn−1,r(i+1)を生成する右シフト部と、0以上C以下の各jにそれぞれ対応する各ビット列BISn−1,r(j)の排他的論理和であるビット列XORBISn−1,r(C)を求める第1排他的論理和演算部と、kを−R以上R以下の整数の定数とし、記憶部に格納されたビット列BISn−1,(r+k)mod(R+1),Cに対して一義的に定まるWビットのビット列をCBISn−1,r,Cとし、XORBISn−1,r(C)=XORBISn−1,r,0|XORBISn−1,r,1|...|XORBISn−1,r,Cを満たすWビットの各ビット列をXORBISn−1,r,cとした場合における、CBISn−1,r,CとXORBISn−1,r,cとの排他的論理和を各cについて計算し、各cに対応する各演算結果をnラウンド目のラウンド鍵K∈{0,1}の上位W{(R+1)・c+r}+1ビット目からW{(R+1)・c+r+1}ビット目までのビット列BISn,r,cとして出力する第2排他的論理和演算部と、0以上R以下のすべての整数rについてラウンド鍵Kの各ビット列BISn,r,cが得られるまで、選択部、右シフト部、第1排他的論理和演算部、及び第2排他的論理和演算部の各処理を繰返し実行させる制御部と、を有する暗号演算装置が提供される。 In the present invention, in order to solve the above-described problem, a cryptographic operation apparatus that performs a cryptographic operation using a round key, wherein R, C, and W are integer constants of 1 or more, and n is an integer variable of 1 or more. And a storage unit for storing the round key K n-1 ε {0, 1} L of L = W · (C + 1) · (R + 1) bits in the ( n-1 ) th round, and an integer of 0 to R a selection unit that selects r, and c is an integer variable between 0 and C, and the upper W {(R + 1) · c + r} +1 bit to W {(R + 1) · c + r + 1} bit of the round key K n−1 a bit string of W bits consisting of up to a BIS n-1, r, c , BIS n-1, r (0) = BIS n-1, r, 0 | BIS n-1, r, 1 | ... | BIS n -1, r, in the case where it is C, and the i is 0 or C-1 following each integer, And Tsu preparative column BIS n-1, r (i ) bit string BIS n-1 was W-bit shift to the lower and right-shift unit for generating r (i + 1), each corresponding to each of 0 or more C or less j A first exclusive OR operation unit for obtaining a bit string XORBIS n−1, r (C) which is an exclusive OR of the bit string BIS n−1, r (j), and k is an integer constant between −R and R And the bit string BIS n−1, (r + k) mod (R + 1), C stored in the storage unit is defined as CBIS n−1, r, C, and the bit string BIS n−1, (r + k) mod (R + 1), C , XORBIS n−1, r (C) = XORBIS n- 1, r, 0 | XORBIS n-1, r, 1 | ... | XORBIS n-1, r, XORBIS each bit string of W bits which satisfies the C n-1, r, in case of the c, CBIS n- , R, C and XORBIS n-1, r, the exclusive OR of the c was calculated for each c, the round key for each operation result n round corresponding to c K n{0,1} L A second exclusive OR operation unit that outputs as a bit string BIS n, r, c from the upper W {(R + 1) · c + r} +1 bit to the W {(R + 1) · c + r + 1} bit, and 0 to R Until each bit string BIS n, r, c of the round key K n is obtained for all integers r of the selection unit, the right shift unit, the first exclusive OR operation unit, and the second exclusive OR operation unit. A cryptographic operation device is provided that includes a control unit that repeatedly executes each process.

ここで、右シフト部、第1排他的論理和演算部及び第2排他的論理和演算部の各処理は、連続するビット列からなる列方向(縦方向)のブロック単位で実行されるのではなく、ラウンド鍵の上位W{(R+1)・c+r}+1ビット目からW{(R+1)・c+r+1}ビット目までのビット列(c=0,…,C)からなる行方向(横方向)のブロック単位で実行される。そのため、攻撃者がある時点で故意に故障を発生させた場合であっても、その影響は故障を発生させたビット列と同じ行にしか及ばない。そのため、DFA攻撃によって攻撃者が得ることができる情報は、故障を発生させたビット列と同じ行に対応する部分に限られる。その結果、DFA攻撃に対する安全性が向上する。   Here, each process of the right shift unit, the first exclusive OR operation unit, and the second exclusive OR operation unit is not executed in block units in the column direction (vertical direction) composed of continuous bit strings. , Block unit in the row direction (horizontal direction) composed of the bit string (c = 0,..., C) from the upper W {(R + 1) · c + r} +1 bit to the W {(R + 1) · c + r + 1} bit of the round key Is executed. For this reason, even if an attacker intentionally causes a failure at a certain point in time, the influence only affects the same row as the bit string that caused the failure. Therefore, the information that can be obtained by the attacker by the DFA attack is limited to the portion corresponding to the same row as the bit string that caused the failure. As a result, security against DFA attacks is improved.

また、本発明において好ましくは、選択部は0以上R以下のランダムな整数rを選択する。ここで、整数rをランダムな値とすることにより、右シフト部、第1排他的論理和演算部及び第2排他的論理和演算部の各処理が実行される行方向のブロック単位の選択がランダムとなる。その結果、攻撃者はラウンド鍵の生成手順を予測することが困難となり、ラウンド鍵生成手順中の所望の演算結果に故意に故障を発生させることが困難となる。その結果、DFA攻撃に対する安全性がより向上する。   In the present invention, the selection unit preferably selects a random integer r of 0 or more and R or less. Here, by setting the integer r to a random value, selection of the block unit in the row direction in which each process of the right shift unit, the first exclusive OR operation unit, and the second exclusive OR operation unit is executed can be performed. Random. As a result, it is difficult for an attacker to predict a round key generation procedure, and it is difficult to intentionally cause a failure in a desired calculation result during the round key generation procedure. As a result, security against DFA attacks is further improved.

また、整数rをランダムな値とする場合において、選択部で選択された整数rに対するビット列BISn,r,cが既に得られている場合には、当該整数rに対応する右シフト部、第1排他的論理和演算部、及び第2排他的論理和演算部の各処理を繰返し実行させることなく、選択部に新たなランダムな整数rを選択させる構成としてもよい。これにより、ラウンド鍵の生成過程において同じ行に対応する演算が重複して行われることを防止できるため、演算効率が向上する。 When the integer r is a random value and the bit string BIS n, r, c for the integer r selected by the selection unit has already been obtained, the right shift unit corresponding to the integer r, The selection unit may be configured to select a new random integer r without repeatedly executing the processes of the 1 exclusive OR operation unit and the second exclusive OR operation unit. Accordingly, it is possible to prevent the calculation corresponding to the same row from being performed repeatedly in the round key generation process, thereby improving the calculation efficiency.

また、整数rをランダムな値とする場合において、選択部で選択された整数rに対するビット列BISn,r,cが既に得られているか否かにかかわらず、当該整数rに対応する右シフト部、第1排他的論理和演算部、及び第2排他的論理和演算部の各処理を実行させる構成としてもよい。この場合には、整数rの値に応じて繰り返し処理の有無が変化しないため、演算内容の変化に伴う消費電力の変化等によって攻撃者に演算順序等の情報が漏洩することを防止できる。その結果、安全性が向上する。 Further, when the integer r is a random value, the right shift unit corresponding to the integer r regardless of whether the bit string BIS n, r, c for the integer r selected by the selection unit has already been obtained. The first exclusive OR operation unit and the second exclusive OR operation unit may be configured to execute each process. In this case, since the presence or absence of the repetitive processing does not change according to the value of the integer r, it is possible to prevent information such as the calculation order from leaking to the attacker due to a change in power consumption accompanying a change in calculation contents. As a result, safety is improved.

また、本形態において、記憶部に格納されたビット列BISn−1,(r+k)mod(R+1),Cから所定の規則に従ってビット列CBISn−1,r,Cを生成する置換部をさらに有し、制御部が、選択部の処理、置換部の処理、右シフト部の処理、第1排他的論理和演算部の処理、第2排他的論理和演算部の処理の順序で各処理を繰り返し実行させ、第2排他的論理和演算部から出力されたビット列BISn,r,cが、記憶部のビット列BISn−1,r,cが格納されていた領域に上書きされる構成でもよい。この場合、kを1又は−1とし、選択部、置換部、右シフト部、第1排他的論理和演算部、及び第2排他的論理和演算部の各処理が繰り返されるたびに、選択部が(r+k)mod(R+1)を新たな整数rとして選択する構成とすることが望ましい。このようにした場合、置換部がビット列BISn−1,(r+k)mod(R+1),Cからビット列CBISn−1,r,Cを生成するときまでに、ビット列BISn−1,(r+k)mod(R+1),Cがビット列BISn,(r+k)mod(R+1),Cによって上書きされる状況を1回のみとすることができる。そのため、置換部での処理を行うために別の領域に複製しておくビット列BISn−1,(r+k)mod(R+1),Cの数を1個のみとすることができ、演算に必要な記憶領域を削減できる。 Further, in the present embodiment, there is further provided a replacement unit that generates the bit string CBIS n−1, r, C from the bit string BIS n−1, (r + k) mod (R + 1), C stored in the storage unit according to a predetermined rule. The control unit repeatedly executes each process in the order of selection unit processing, replacement unit processing, right shift unit processing, first exclusive OR operation unit processing, and second exclusive OR operation unit processing. The bit string BIS n, r, c output from the second exclusive OR operation unit may be overwritten on the area where the bit string BIS n-1, r, c of the storage unit is stored. In this case, k is set to 1 or −1, and each time the selection unit, replacement unit, right shift unit, first exclusive OR operation unit, and second exclusive OR operation unit are repeated, the selection unit Preferably, (r + k) mod (R + 1) is selected as a new integer r. In such a case, the replacement unit bit string BIS n-1, (r + k) mod (R + 1), bit string from C CBIS n-1, r, the time to generate the C, the bit string BIS n-1, (r + k) The situation where mod (R + 1), C is overwritten by the bit string BIS n, (r + k) mod (R + 1), C can be made only once. Therefore, the number of bit strings BIS n−1, (r + k) mod (R + 1), C to be copied to another area for processing in the replacement unit can be reduced to one, which is necessary for the calculation. Storage area can be reduced.

本発明では、エラー検知やエラー訂正に伴う回路規模や演算時間の増大を抑制しつつ、DFA攻撃に対する安全性を向上させることが可能となる。   In the present invention, it is possible to improve the safety against a DFA attack while suppressing an increase in circuit scale and calculation time accompanying error detection and error correction.

以下、図面を参照して本発明の実施形態を説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

〔記号の定義〕
まず、本発明の実施形態で用いる記号を定義する。
α|β:αとβとのビット結合。
α(+)β:αとβとの排他的論理和。
R:予め設定された1以上の整数の定数。ラウンド鍵の行番号の最大値。AESの例ではR=3。
C:予め設定された1以上の整数の定数。ラウンド鍵の列番号の最大値。AESの例ではC=3。
W:予め設定された1以上の整数の定数。演算処理単位となるビット長。AESの例ではW=8。
N:予め設定されたラウンド数。AESの例ではN=10。
r:0以上R以下の整数。
c:0以上C以下の整数の変数。
n:1以上N以下の整数の変数。
k:予め設定された−R以上R以下の整数の定数。RotWordのローテーション方向とローテーション量に対応。AESの例ではk=1。
(Definition of symbols)
First, symbols used in the embodiment of the present invention are defined.
α | β: Bit combination of α and β.
α (+) β: Exclusive OR of α and β.
R: An integer constant of 1 or more set in advance. The maximum line number of the round key. In the AES example, R = 3.
C: A preset integer constant of 1 or more. Maximum value of the round key column number. In the AES example, C = 3.
W: An integer constant of 1 or more set in advance. Bit length that is the unit of arithmetic processing. In the AES example, W = 8.
N: A preset number of rounds. In the example of AES, N = 10.
r: An integer from 0 to R.
c: An integer variable of 0 to C.
n: An integer variable of 1 to N.
k: an integer constant set in advance from −R to R. Supports rotation direction and rotation amount of RotWord. In the AES example, k = 1.

p:r+k mod (R+1)を除く0以上R以下の各整数。
n−1∈{0,1}:n−1ラウンド目のラウンド鍵。
L:ラウンド鍵のビット長L=W・(C+1)・(R+1)。AESの例ではL=128。
BISn−1,r,c:ラウンド鍵Kn−1の上位W{(R+1)・c+r}+1ビット目からW{(R+1)・c+r+1}ビット目までからなるWビットのビット列。
BISn−1,r(0):BISn−1,r,0|BISn−1,r,1|…|BISn−1,r,Cからなるビット列。
BISn−1,r(i+1):ビット列BISn−1,r(i)を下位にWビットシフトさせたビット列。
p: Each integer from 0 to R excluding r + k mod (R + 1).
K n−1 ε {0,1} L : Round key for the (n−1) th round.
L: Bit length of the round key L = W · (C + 1) · (R + 1). In the example of AES, L = 128.
BIS n−1, r, c : W bit string consisting of the upper W {(R + 1) · c + r} +1 bit to W {(R + 1) · c + r + 1} bit of the round key K n−1 .
BIS n-1, r (0): BIS n-1, r, 0 | BIS n-1, r, 1 | ... | A bit string composed of BIS n-1, r, C.
BIS n-1, r (i + 1): A bit string obtained by shifting the bit string BIS n-1, r (i) by W bits downward.

i:0以上C−1以下の各整数。
XORBISn−1,r(i+1):XORBISn−1,r(i)とビット列BISn−1,r(i+1)との排他的論理和値。XORBISn−1,r(0)=BISn−1,r(0)。
CBISn−1,r,C:ビット列BISn−1,(r+k)mod(R+1),Cから所定の規則に従って生成されたWビットのビット列。CBISn−1,r,CとBISn−1,(r+k)mod(R+1),Cとは一対一で対応する。
XORBISn−1,r,c:XORBISn−1,r(C)=XORBISn−1,r,0|XORBISn−1,r,1|...|XORBISn−1,r,Cを満たすWビットの各ビット列。
i: Each integer from 0 to C-1.
XORBIS n-1, r (i + 1): Exclusive OR value of XORBIS n-1, r (i) and bit string BIS n-1, r (i + 1). XORBIS n-1, r (0) = BIS n-1, r (0).
CBIS n−1, r, C : Bit string BIS n−1, (r + k) mod (R + 1), a W-bit bit string generated according to a predetermined rule. CBIS n-1, r, C and BIS n-1, (r + k) mod (R + 1), C have a one-to-one correspondence.
XORBIS n-1, r, c : XORBIS n-1, r (C) = XORBIS n-1, r, 0 | XORBIS n-1, r, 1 | ... | XORBIS n-1, r, C Each bit string of W bits to fill.

〔第1実施形態〕
次に、本発明の第1実施形態について説明する。本形態は、暗号演算が記述されたソフトウェアをCPUに実行させることにより、本形態の暗号演算を実装する形態である。
<構成>
図3(a)は、第1実施形態の暗号演算装置10のハードウェア構成を説明するためのブロック図である。
[First Embodiment]
Next, a first embodiment of the present invention will be described. In the present embodiment, the cryptographic operation of this embodiment is implemented by causing the CPU to execute software in which the cryptographic operation is described.
<Configuration>
FIG. 3A is a block diagram for explaining a hardware configuration of the cryptographic operation apparatus 10 according to the first embodiment.

図3(a)に示すように、本形態の暗号演算装置10は、CPU(central processing unit)11と、RAM(random-access memory)12と、ROM(read-only memory)13と、EEPROM14と、乱数生成器15と、入力インタフェース(IF)16と、出力インタフェース(IF)17と、データバス18を有する。ここで、乱数生成器15は、真性乱数を生成する集積回路であってもよいし、擬似乱数生成アルゴリズムが記述されたソフトウェアをハードウェアで実行して構築されるものであってもよい。また、EEPROM14には、所定のプログラムと0ラウンド目のラウンド鍵K∈{0,1}とが格納されている。これらのプログラム及びラウンド鍵KはそれぞれRAM12に書き込まれ、さらにCPU11がRAM12に書き込まれたプログラムを実行し、ラウンド鍵Kを用いた暗号演算処理を行うことにより、本形態の暗号演算装置10が構築される。 As shown in FIG. 3A, the cryptographic operation device 10 of this embodiment includes a central processing unit (CPU) 11, a random-access memory (RAM) 12, a read-only memory (ROM) 13, an EEPROM 14, A random number generator 15, an input interface (IF) 16, an output interface (IF) 17, and a data bus 18. Here, the random number generator 15 may be an integrated circuit that generates a true random number, or may be constructed by executing, in hardware, software in which a pseudo-random number generation algorithm is described. The EEPROM 14 stores a predetermined program and a round key K 0 ε {0, 1} L for the 0th round. Each of these programs and the round key K 0 is written in the RAM 12, and the CPU 11 executes the program written in the RAM 12 and performs a cryptographic calculation process using the round key K 0 , whereby the cryptographic calculation device 10 of the present embodiment. Is built.

図3(b)は、図3(a)のCPU11がRAM12に書き込まれたプログラムを実行し、ラウンド鍵Kを用いた暗号演算処理を行うことによって構築される暗号演算装置10の機能構成を説明するためのブロック図である。 FIG. 3B shows the functional configuration of the cryptographic operation device 10 constructed by the CPU 11 of FIG. 3A executing the program written in the RAM 12 and performing cryptographic operation processing using the round key K 0. It is a block diagram for demonstrating.

図3(b)に示すように、本形態の暗号演算装置10の機能構成は、記憶部10aと、一時記憶部10bと、制御部10cと、入力部10dと、出力部10eと、選択部10fと、右シフト部10gと、排他的論理和演算部10h(第1排他的論理和演算部)と、置換部10iと、排他的論理和演算部10j(第2排他的論理和演算部)と、暗号演算部10kとを有する。なお、記憶部10aは、例えば、RAM12やEEPROM14やレジスタなどによって構成される記憶領域であり、一時記憶部10bは、例えば、レジスタやキャッシュメモリなどによって構成される記憶領域である。また、制御部10c、右シフト部10g、排他的論理和演算部10h、置換部10i、排他的論理和演算部10j、及び暗号演算部10kは、例えば、CPU11に所定のプログラムが読み込まれて構成される処理手段である。また、選択部10fは、例えば、乱数生成器15や所定のプログラムが読み込まれたCPU11によって構成される処理手段である。また、入力部10dや出力部10eは、入力IF16や出力IF17によって構成される。また、本形態の暗号演算装置10は、制御部10cの制御のもと各処理を実行する。また、各演算に必要な各データは、記憶部10aから読み出された後、一時記憶部10bに格納され、その演算結果は一時記憶部10bに格納された後、記憶部10aに格納される。しかし、以下ではその説明を省略する。   As shown in FIG. 3B, the functional configuration of the cryptographic operation device 10 according to the present embodiment includes a storage unit 10a, a temporary storage unit 10b, a control unit 10c, an input unit 10d, an output unit 10e, and a selection unit. 10f, right shift unit 10g, exclusive OR operation unit 10h (first exclusive OR operation unit), replacement unit 10i, exclusive OR operation unit 10j (second exclusive OR operation unit) And a cryptographic operation unit 10k. The storage unit 10a is a storage area configured by, for example, the RAM 12, the EEPROM 14, or a register, and the temporary storage unit 10b is a storage area configured by, for example, a register or a cache memory. Further, the control unit 10c, the right shift unit 10g, the exclusive OR operation unit 10h, the replacement unit 10i, the exclusive OR operation unit 10j, and the cryptographic operation unit 10k are configured by, for example, a predetermined program being read by the CPU 11 Processing means. The selection unit 10f is a processing unit configured by, for example, the random number generator 15 or the CPU 11 into which a predetermined program is read. The input unit 10d and the output unit 10e are configured by an input IF 16 and an output IF 17. Further, the cryptographic operation apparatus 10 according to the present embodiment executes each process under the control of the control unit 10c. Each data necessary for each calculation is read from the storage unit 10a and then stored in the temporary storage unit 10b. The calculation result is stored in the temporary storage unit 10b and then stored in the storage unit 10a. . However, the description thereof is omitted below.

<処理>
次に、本形態の処理について説明する。以下では、本形態の処理を一般化して説明した後、本形態をAESに適用した場合の処理を具体的に例示する。また、以下では、暗号演算装置10が暗号化装置であり、暗号演算部10kがラウンド鍵を用いて暗号化を行う場合を説明する。しかし、ラウンド鍵の生成処理は暗号化を行う場合と復号を行う場合とで同じであり、以下の説明を暗号演算装置10が復号装置であり、暗号演算部10kがラウンド鍵を用いて復号を行う場合に拡張するのは容易である。
<Processing>
Next, the processing of this embodiment will be described. In the following, after generalizing the processing of this embodiment, the processing when this embodiment is applied to AES will be specifically exemplified. In the following, a case will be described in which the cryptographic operation device 10 is an encryption device and the cryptographic operation unit 10k performs encryption using a round key. However, the round key generation process is the same when encryption is performed and when decryption is performed. In the following explanation, the cryptographic operation device 10 is the decryption device, and the cryptographic operation unit 10k performs decryption using the round key. It is easy to extend when doing.

[一般化した処理内容]
図4及び図5は、第1実施形態のnラウンド目におけるラウンド鍵の生成処理を説明するためのフローチャートである。以下、これらの図を用いて本形態の一般化した処理を説明する。
[Generalized processing contents]
4 and 5 are flowcharts for explaining round key generation processing in the n-th round according to the first embodiment. Hereinafter, generalized processing of this embodiment will be described with reference to these drawings.

まず、入力部10dに入力されたL=W・(C+1)・(R+1)ビットの平文Mが記憶部10aの領域10aaに格納される。また、n−1ラウンド目のL=W・(C+1)・(R+1)ビット長のラウンド鍵Kn−1∈{0,1}が記憶部10aの領域10aaに格納される(ステップS1)。すなわち、ラウンド鍵Kn−1の上位W{(R+1)・c+r}+1ビット目からW{(R+1)・c+r+1}ビット目までからなるWビットのビット列BISn−1,r,cが、0以上R以下のすべての整数r及び0以上C以下のすべての整数cについて、領域10aaに格納される。さらに、制御部10cが、このラウンド鍵Kn−1を複製して記憶部10aの領域10abに格納する(ステップS2)。次に、選択部10fが、0以上R以下のランダムな整数rを選択する(ステップS3)。この選択は、そのつど発生させた乱数や擬似乱数に基づき選択されてもよいし、予め生成或いは設定された乱数表から選択されてもよい。選択された整数rは一時記憶部10bに格納され、以後必要に応じて各処理部に読み出される。次に、制御部10cが、r+k mod (R+1)を除く0以上R以下の各整数pに対応する各ビット列BISn−1,p,Cを領域10aaから読み込み、それらを複製してR・Wビットの領域10acに格納する(ステップS4)。 First, L = W · (C + 1) · (R + 1) bits of plaintext M input to the input unit 10d is stored in the area 10aa of the storage unit 10a. In addition, the round key K n−1 ∈ {0, 1} L having the length L = W · (C + 1) · (R + 1) bits in the ( n−1 ) th round is stored in the area 10aa of the storage unit 10a (step S1). . That is, the W bit bit sequence BIS n−1, r, c consisting of the upper W {(R + 1) · c + r} +1 bit to the W {(R + 1) · c + r + 1} bit of the round key K n−1 is 0. All integers r above R and below and all integers c above 0 and below C are stored in the area 10aa. Further, the control unit 10c duplicates this round key K n-1 and stores it in the area 10ab of the storage unit 10a (step S2). Next, the selection unit 10f selects a random integer r of 0 or more and R or less (Step S3). This selection may be selected based on a random number or pseudo-random number generated each time, or may be selected from a random number table generated or set in advance. The selected integer r is stored in the temporary storage unit 10b and thereafter read out to each processing unit as necessary. Next, the control unit 10c reads each bit string BIS n−1, p, C corresponding to each integer p not less than 0 and not more than R except r + k mod (R + 1) from the area 10aa, and duplicates them to read R · W Store in the bit area 10ac (step S4).

次に、置換部10iが、領域10aa又は領域10acに格納されたビット列BISn−1,(r+k)mod(R+1),Cから所定の規則に従ってWビットのビット列CBISn−1,r,Cを生成し、生成したビット列CBISn−1,r,Cによって、その領域10aa又は領域10acを更新する(ステップS5)。なお、所定の規則とは、ビット列BISn−1,(r+k)mod(R+1),Cを、それと一対一に対応するビット列CBISn−1,r,Cに置換する規則をいう。すなわち、ビット列CBISn−1,r,Cはビット列BISn−1,(r+k)mod(R+1),Cに対して一義的に定まる。また、置換部10iの具体的な処理の例は、予め設定された置換テーブルに従ってビット列BISn−1,(r+k)mod(R+1),Cをビット列CBISn−1,r,Cに置換する処理や、予め設定された演算式に従ってビット列BISn−1,(r+k)mod(R+1),Cをビット列CBISn−1,r,Cに置換する処理である。また、nラウンド目で初めてステップS5の処理を行う場合には、ビット列BISn−1,(r+k)mod(R+1),Cは必ず領域10aaに格納されているため、置換部10iは領域10aaに格納されたビット列BISn−1,(r+k)mod(R+1),Cを用いて本ステップの処理を行う。一方、nラウンド目でステップS5の処理を2回目以降に行う場合には、ビット列BISn−1,(r+k)mod(R+1),Cが領域10aaに格納されているとは限らないため、置換部10iは領域10acに格納されたビット列BISn−1,(r+k)mod(R+1),Cを用いて本ステップの処理を行う。ただし、nラウンド目でステップS5の処理を2回目以降に行う場合にビット列BISn−1,(r+k)mod(R+1),Cが領域10aaに格納されていることが判定できる場合には、置換部10iが領域10aaに格納されたビット列BISn−1,(r+k)mod(R+1),Cを用いて本ステップの処理を行う処理も可能である。また、攻撃者がステップS5の処理に故障を発生させることも想定されるため、ステップS5で正しい処理が行われたことを確認する検算処理を追加すると好適である。検算処理の例は、置換部10iがビット列CBISn−1,r,Cの逆演算(逆変換)を実行し、その結果がビット列BISn−1,(r+k)mod(R+1),Cになることを確認する処理や、置換部10iがビット列BISn−1,(r+k)mod(R+1),Cをビット列CBISn−1,r,Cに変換する処理を複数回繰り返し、それらが同一の結果となることを確認する処理などである。 Next, the replacement unit 10i converts the bit string BIS n−1, (r + k) mod (R + 1), C stored in the area 10aa or the area 10ac into a W-bit bit string CBIS n−1, r, C according to a predetermined rule. The region 10aa or the region 10ac is updated with the generated bit string CBIS n-1, r, C (step S5). The predetermined rule refers to a rule for replacing the bit string BIS n−1, (r + k) mod (R + 1), C with the bit string CBIS n−1, r, C corresponding to the one-to-one correspondence therewith. That is, the bit string CBIS n−1, r, C is uniquely determined with respect to the bit string BIS n−1, (r + k) mod (R + 1), C. An example of a specific process of the replacement unit 10i is a process of replacing the bit string BIS n−1, (r + k) mod (R + 1), C with the bit string CBIS n−1, r, C according to a preset replacement table. Alternatively, the bit string BIS n−1, (r + k) mod (R + 1), C is replaced with the bit string CBIS n−1, r, C according to a preset arithmetic expression. When the process of step S5 is performed for the first time in the n-th round, since the bit string BIS n−1, (r + k) mod (R + 1), C is always stored in the area 10aa, the replacement unit 10i is stored in the area 10aa. The processing of this step is performed using the stored bit string BIS n−1, (r + k) mod (R + 1), C. On the other hand, when the process of step S5 is performed after the second round in the n-th round, the bit string BIS n−1, (r + k) mod (R + 1), C is not always stored in the area 10aa. The unit 10i performs the process of this step using the bit string BIS n−1, (r + k) mod (R + 1), C stored in the area 10ac. However, if it is determined that the bit string BIS n−1, (r + k) mod (R + 1), C is stored in the area 10aa when the process of step S5 is performed after the second round in the n-th round, the replacement is performed. It is also possible to perform processing of this step using the bit string BIS n−1, (r + k) mod (R + 1), C stored in the area 10aa by the unit 10i. Moreover, since it is also assumed that an attacker causes a failure in the process in step S5, it is preferable to add a verification process for confirming that the correct process has been performed in step S5. In the example of the verification process, the replacement unit 10i performs an inverse operation (inverse conversion) of the bit string CBIS n-1, r, C , and the result is the bit string BIS n-1, (r + k) mod (R + 1), C. And the replacement unit 10i repeats the process of converting the bit string BIS n-1, (r + k) mod (R + 1), C into the bit string CBIS n-1, r, C a plurality of times, and the same result For example, processing for confirming that

次に、制御部10cが、変数iを0に設定し、それを一時記憶部10bに格納する(ステップS6)。その後、右シフト部10gが、領域10aaに格納されたビット列BISn−1,r(i)を下位に(右に)Wビットシフトさせたビット列BISn−1,r(i+1)を生成する。なお、BISn−1,r(0)=BISn−1,r,0|BISn−1,r,1|…|BISn−1,r,Cである。また、ビット列BISn−1,r(i)を下位にWビットシフトさせるとは、ビット列BISn−1,r(i)の下位Wビットが削除され、残りのビットが下位へWビットシフトされ、上位にWビットの0が付加されたビット列を生成する処理を意味する(具体例は後述する)。CPU11がこのような演算機能を備えている場合には、その演算命令によってこの処理を行ってもよいし、また、ビット列BISn−1,r(i)の下位Wビット以外のビットを複製し、複製されたビット列の上位にWビットの0を付加することによってこの処理を行ってもよい。このように生成されたビット列BISn−1,r(i+1)は、領域10aaのビット列BISn−1,r(i)が格納されていた位置に上書きされ、領域10aaが更新される(ステップS7)。 Next, the control unit 10c sets the variable i to 0 and stores it in the temporary storage unit 10b (step S6). Thereafter, the right shift unit 10g generates a bit string BIS n-1, r (i + 1) obtained by shifting the bit string BIS n-1, r (i) stored in the region 10aa to the lower (right) W bits. BIS n-1, r (0) = BIS n-1, r, 0 | BIS n-1, r, 1 | ... | BIS n-1, r, C. Further, shifting the bit string BIS n-1, r (i) to the lower order by W bits means that the lower W bits of the bit string BIS n-1, r (i) are deleted and the remaining bits are shifted to the lower order by W bits. , Which means a process of generating a bit string with W bits 0 added to the upper part (a specific example will be described later). When the CPU 11 has such an arithmetic function, this processing may be performed by the arithmetic instruction, or a bit other than the lower W bits of the bit string BIS n−1, r (i) is copied. This process may be performed by adding a W bit 0 to the top of the replicated bit string. Such bit stream is generated BIS n-1, r (i + 1) is overwritten in a position where the bit string region 10aa BIS n-1, r ( i) is stored, the area 10aa is updated (step S7 ).

次に、排他的論理和演算部10hが、領域10abに格納されたビット列XORBISn−1,r(i)と、領域10aaに格納されたビット列BISn−1,r(i+1)との排他的論理和値XORBISn−1,r(i+1)=XORBISn−1,r(i)(+)BISn−1,r(i+1)を計算する。なお、XORBISn−1,r(0)=BISn−1,r(0)である。算出されたビット列XORBISn−1,r(i+1)は、領域10abのビット列XORBISn−1,r(i)が格納されていた位置に上書きされ、領域10abが更新される(ステップS8)。 Next, the exclusive OR operation unit 10h exclusives the bit string XORBIS n−1, r (i) stored in the area 10ab and the bit string BIS n−1, r (i + 1) stored in the area 10aa. OR value XORBIS n-1, r (i + 1) = XORBIS n-1, r (i) (+) BIS n-1, r (i + 1) is calculated. XORBIS n-1, r (0) = BIS n-1, r (0). Calculated bit string XORBIS n-1, r (i + 1) is overwritten in a position where the bit string regions 10ab XORBIS n-1, r ( i) is stored, the area 10ab is updated (step S8).

次に、制御部10cが、一時記憶部10bに格納しておいた変数iの値を参照し、i=C−1であるか否かを判定する(ステップS9)。ここで、i=C−1でないと判定された場合、制御部10cは、i+1を新たな変数iの値として変数iを更新し、この変数iを一時記憶部10bに格納して、処理をステップS7に戻す(ステップS10)。   Next, the control unit 10c refers to the value of the variable i stored in the temporary storage unit 10b, and determines whether i = C-1 (step S9). When it is determined that i = C−1 is not satisfied, the control unit 10c updates the variable i with i + 1 as the value of the new variable i, stores the variable i in the temporary storage unit 10b, and performs processing. It returns to step S7 (step S10).

一方、ステップS9でi=C−1であると判定された場合には、排他的論理和演算部10jが、領域10aa又は領域10acに格納されたビット列CBISn−1,r,Cと、領域10abに格納されたWビットのビット列XORBISn−1,r,cとを読み込み、それらの排他的論理和を各c=0,1,…,Cについて計算し、各cに対応する各演算結果をnラウンド目のラウンド鍵K∈{0,1}の上位W{(R+1)・c+r}+1ビット目からW{(R+1)・c+r+1}ビット目までのビット列BISn,r,c=CBISn−1,r,C(+)XORBISn−1,r,cとし、ビット列BISn,r,cで領域10abを更新する(ステップS11)。なお、ビット列XORBISn−1,r,cは、それぞれ、XORBISn−1,r(C)=XORBISn−1,r,0|XORBISn−1,r,1|...|XORBISn−1,r,Cを満たすWビットのビット列である。 On the other hand, if it is determined in step S9 that i = C−1, the exclusive OR operation unit 10j includes the bit string CBIS n−1, r, C stored in the region 10aa or the region 10ac, and the region 10b is read from the bit string XORBIS n-1, r, c stored in 10ab, and their exclusive OR is calculated for each c = 0, 1,..., C, and each operation result corresponding to each c is calculated. The bit string BIS n, r, c = from the upper W {(R + 1) · c + r} +1 bit to the W {(R + 1) · c + r + 1} bit of the n-th round key K n ε {0,1} L CBIS n-1, r, C (+) XORBIS n-1, r, c is used , and the area 10ab is updated with the bit string BIS n, r, c (step S11). The bit strings XORBIS n-1, r, c are respectively XORBIS n-1, r (C) = XORBIS n-1, r, 0 | XORBIS n-1, r, 1 |. . . | XORBIS is a bit string of W bits satisfying n-1, r, C.

次に、制御部10cが、0以上R以下のすべての整数rにそれぞれ対応するビット列BISn,r,cが生成済みであるか否かを判定する(ステップS12)。ここで、0以上R以下のすべての整数rに対応するビット列BISn,r,cがそれぞれ生成済みであると判定された場合には、nラウンド目のラウンド鍵生成処理が終了する。 Next, the control unit 10c determines whether or not the bit strings BIS n, r, c respectively corresponding to all integers r greater than or equal to 0 and less than or equal to R have been generated (step S12). Here, when it is determined that the bit strings BIS n, r, c corresponding to all integers r between 0 and R have been generated, the round key generation process for the n-th round is completed.

一方、0以上R以下の何れかの整数rに対応するビット列BISn,r,cが生成済みでないと判定された場合には、選択部10fがステップS3と同様に0以上R以下の新たな整数rを選択する。選択された整数rは一時記憶部10bに格納され、これによって一時記憶部10bに格納された整数rが更新され、以後必要に応じて各処理部に読み出される。次に、制御部10cが、ステップS13で選択された整数rに対応するビット列BISn,r,cが生成済みであるか否かを判定する(ステップS14)。ここで、ステップS13で選択された整数rに対応するビット列BISn,r,cが生成済みであると判定された場合には、ステップS13の処理に戻る。一方、ステップS13で選択された整数rに対応するビット列BISn,r,cが生成済みでないと判定された場合には、制御部10cが、領域10abのビット列を複製して領域10aaに格納し(ステップS15)、処理をステップS5に戻す。 On the other hand, when it is determined that the bit string BIS n, r, c corresponding to any integer r between 0 and R has not been generated, the selection unit 10f selects a new one between 0 and R as in step S3. Select the integer r. The selected integer r is stored in the temporary storage unit 10b, whereby the integer r stored in the temporary storage unit 10b is updated, and thereafter read out to each processing unit as necessary. Next, the control unit 10c determines whether or not the bit string BIS n, r, c corresponding to the integer r selected in step S13 has been generated (step S14). If it is determined that the bit string BIS n, r, c corresponding to the integer r selected in step S13 has been generated, the process returns to step S13. On the other hand, when it is determined that the bit string BIS n, r, c corresponding to the integer r selected in step S13 has not been generated, the control unit 10c duplicates the bit string of the area 10ab and stores it in the area 10aa. (Step S15), the process returns to Step S5.

以上のように生成された各ラウンドのラウンド鍵K0,,…,Kと平文Mとは暗号演算部10kに読み込まれ、暗号演算部10kは、AES等の所定の暗号化手順に従い、ラウンド鍵K0,,…,Kを用いて平文Mを暗号化し、その暗号文enc(M)を領域10adに格納する。当該暗号演算部10kの暗号演算処理は、すべてのラウンド鍵K0,,…,Kが生成された後にまとめて実行されてもよいし、ラウンド鍵Kを生成したら1ラウンド目の暗号演算を行い、ラウンド鍵Kを生成したら2ラウンド目の暗号演算を行いというように、各ラウンド鍵が生成されるたびにそのラウンドの暗号演算処理が実行されてもよい。領域10adに格納された暗号文enc(M)は出力部10eに送られ、そこから出力される。 The round keys K 0, K 1 ,..., K N and plaintext M of each round generated as described above are read into the cryptographic operation unit 10k, and the cryptographic operation unit 10k follows a predetermined encryption procedure such as AES. ., K N is encrypted using the round keys K 0, K 1 ,..., K N and the cipher text enc (M) is stored in the area 10ad. The cryptographic computation processing of the cryptographic computation unit 10k may be executed collectively after all the round keys K 0, K 1 ,..., K N are generated, or the first round when the round key K 1 is generated perform cryptographic operations, so that perform second round of cryptographic operation After generating round keys K 2, the encryption processing rounds may be performed after each round key is generated. The ciphertext enc (M) stored in the area 10ad is sent to the output unit 10e and output therefrom.

[本形態をAESに適用した場合の処理内容]
次に、第1実施形態をAESに適用した場合の処理を説明する。この場合、R及びCは3であり、Wは8であり、Lは128であり、kは1であり、CBISn−1,r,Cは、ビット列BISn−1,(r+1)mod4,3を所定の置換規則に従って置換した8ビットのビット列である。
[Processing contents when this form is applied to AES]
Next, processing when the first embodiment is applied to AES will be described. In this case, R and C are 3, W is 8, L is 128, k is 1, and CBIS n-1, r, C is a bit string BIS n-1, (r + 1) mod 4, This is an 8-bit bit string in which 3 is replaced according to a predetermined replacement rule.

図6は、第1実施形態をAESに適用した場合のr=2における処理の全体を示す図である。また、図7から図11は、第1実施形態をAESに適用した場合に、記憶部10aの各領域10aa〜10acに格納されるビット列を例示した図である。また、図12(a)は、第1実施形態をAESに適用した場合に選択部10fで選択される整数rの一例を説明するための図であり、図12(b)から図12(e)は、選択された各整数rに対応する処理対象を示す図である。以下、これらの図を用いて本形態をAESに適用した場合における、nラウンド目のラウンド鍵の生成処理を説明する。   FIG. 6 is a diagram illustrating the entire processing at r = 2 when the first embodiment is applied to AES. 7 to 11 are diagrams exemplifying bit strings stored in the areas 10aa to 10ac of the storage unit 10a when the first embodiment is applied to AES. FIG. 12A is a diagram for explaining an example of the integer r selected by the selection unit 10f when the first embodiment is applied to AES. FIG. 12B to FIG. ) Is a diagram showing a processing target corresponding to each selected integer r. In the following, an n-th round key generation process when the present embodiment is applied to AES will be described with reference to these drawings.

このラウンド鍵の生成処理の例では、まず、n−1ラウンド目の128ビット長のラウンド鍵Kn−1∈{0,1}128が記憶部10aの領域10aaに格納される(ステップS1)。すなわち、ラウンド鍵Kn−1の上位8(4・c+r)+1ビット目から8(4・c+r+1)ビット目までからなる8ビットのビット列BISn−1,r,cが、0以上3以下のすべての整数r及び0以上3以下のすべての整数cについて、領域10aaに格納される(図6、図7(a))。さらに、制御部10cが、このラウンド鍵Kn−1を複製して記憶部10aの領域10abに格納する(ステップS2、図7(a))。次に、選択部10fが、0以上3以下のランダムな整数rを選択する(ステップS3)。この例ではr=2が選択されたとする(図12(a))。次に、制御部10cが、2+1 mod (3+1)=3を除く0以上3以下の各整数p=0,1,2に対応する各ビット列BISn−1,p,3を領域10aaから読み込み、それらを複製して24ビットの領域10acに格納する(ステップS4、図7(a))。 In this example of round key generation processing, first, the 128-bit round key K n-1 ε {0, 1} 128 of the ( n-1) th round is stored in the area 10aa of the storage unit 10a (step S1). . That is, the 8-bit bit string BIS n−1, r, c consisting of the upper 8 (4 · c + r) +1 bit to 8 (4 · c + r + 1) bit of the round key K n−1 is 0 or more and 3 or less. All integers r and all integers c not smaller than 0 and not larger than 3 are stored in the area 10aa (FIG. 6, FIG. 7A). Further, the control unit 10c duplicates this round key K n−1 and stores it in the area 10ab of the storage unit 10a (step S2, FIG. 7A). Next, the selection unit 10f selects a random integer r of 0 or more and 3 or less (Step S3). In this example, it is assumed that r = 2 is selected (FIG. 12A). Next, the control unit 10c reads each bit string BIS n−1, p, 3 corresponding to each integer p = 0, 1, 2 except for 2 + 1 mod (3 + 1) = 3 from the area 10aa, These are duplicated and stored in the 24-bit area 10ac (step S4, FIG. 7A).

次に、置換部10iが、領域10aaに格納されたビット列BISn−1,(2+1)mod(3+1),3=BISn−1,3,3から所定の置換規則に従って8ビットのビット列CBISn−1,2,3を生成し(SubWord処理)、生成したビット列CBISn−1,2,3によって、その領域10aaを更新する(ステップS5、図6、図7(b))。 Next, the replacement unit 10i uses the bit string BIS n−1, (2 + 1) mod (3 + 1), 3 = BIS n− 1, 3, 3 stored in the area 10aa from the 8-bit bit string CBIS n according to a predetermined replacement rule. generates -1,2,3 by (SubWord processing), the bit string CBIS n-1, 2, 3 which generated, updates the area lOaa (step S5, Fig. 6, FIG. 7 (b)).

次に、制御部10cが、変数iを0に設定し、それを一時記憶部10bに格納する(ステップS6)。その後、右シフト部10gが、領域10aaに格納されたビット列BISn−1,2(0)=BISn−1,2,0|BISn−1,2,1|…|BISn−1,2,3(図12(b))を下位に8ビットシフトさせたビット列BISn−1,2(1)を生成する(図6)。このように生成されたビット列BISn−1,r(1)は、領域10aaのビット列BISn−1,r(0)が格納されていた位置に上書きされ、領域10aaが更新される(ステップS7、図7(b))。 Next, the control unit 10c sets the variable i to 0 and stores it in the temporary storage unit 10b (step S6). Thereafter, the right shift unit 10g receives the bit string BIS n−1,2 (0) = BIS n−1,2,0 | BIS n−1,2,1 |... | BIS n−1 stored in the area 10aa . 2 and 3 (FIG. 12B) are generated by shifting the lower 8 bits to the bit string BIS n−1,2 (1) (FIG. 6). The bit string BIS n-1, r (1) generated in this way is overwritten at the position where the bit string BIS n-1, r (0) of the area 10aa was stored, and the area 10aa is updated (step S7). FIG. 7 (b)).

次に、排他的論理和演算部10hが、領域10abに格納されたビット列XORBISn−1,2(0)=BISn−1,2(0)と、領域10aaに格納されたビット列BISn−1,2(1)との排他的論理和値XORBISn−1,2(1)=BISn−1,2(0)(+)BISn−1,2(1)を計算する(図6)。算出されたビット列XORBISn−1,2(1)は、領域10abのビット列XORBISn−1,2(0)=BISn−1,2(0)が格納されていた位置に上書きされ、領域10abが更新される(ステップS8、図7(b))。 Next, the exclusive OR operation unit 10h generates the bit string XORBIS n−1,2 (0) = BIS n−1,2 (0) stored in the area 10ab and the bit string BIS n− stored in the area 10aa. 1,2 (1) exclusive OR value XORBIS n-1,2 (1) and = BIS n-1,2 (0) (+) calculating the BIS n-1,2 (1) (FIG. 6 ). The calculated bit string XORBIS n−1,2 (1) is overwritten in the area 10ab where the bit string XORBIS n−1,2 (0) = BIS n−1,2 (0) was stored. Is updated (step S8, FIG. 7B).

次に、制御部10cが、一時記憶部10bに格納しておいた変数iの値を参照し、i=2であるか否かを判定する(ステップS9)。ここで、i=2でないため、1を新たな変数iの値として変数iを更新し、この変数iを一時記憶部10bに格納して、処理をステップS7に戻す(ステップS10)。その後、i=1,2についてステップS7、S8の処理が繰り返された後(図6、図8、図9)、ステップS9でi=2であると判定される。これにより、排他的論理和演算部10jが、領域10aaに格納されたビット列CBISn−1,2,3と、領域10abに格納された8ビットのビット列XORBISn−1,2,cとを読み込み、それらの排他的論理和を各c=0,1,2,3について計算し、各cに対応する各演算結果をnラウンド目のラウンド鍵K∈{0,1}128の上位8(4・c+2)+1ビット目から8(4・c+2+1)ビット目までのビット列BISn,2,c=CBISn−1,2,3(+)XORBISn−1,2,cとし、ビット列BISn,2,cで領域10abを更新する(ステップS11、図6、図10)。 Next, the control unit 10c refers to the value of the variable i stored in the temporary storage unit 10b, and determines whether i = 2 (step S9). Here, since i = 2, the variable i is updated with 1 as the value of the new variable i, the variable i is stored in the temporary storage unit 10b, and the process returns to step S7 (step S10). Thereafter, after the processes in steps S7 and S8 are repeated for i = 1 and 2 (FIGS. 6, 8, and 9), it is determined in step S9 that i = 2. Thereby, the exclusive OR operation unit 10j reads the bit string CBIS n-1,2,3 stored in the area 10aa and the 8-bit bit string XORBIS n-1,2, c stored in the area 10ab. , Their exclusive OR is calculated for each c = 0, 1, 2, 3, and each operation result corresponding to each c is calculated as the upper 8 of the n-th round key K n ε {0, 1} 128 ( 4 · c + 2) +1 from bit 8 (4 · c + 2 + 1) bit string to bit BIS n, 2, c = CBIS n-1,2,3 (+) XORBIS n-1,2, and is c, the bit string BIS n , 2 and c , the area 10ab is updated (step S11, FIG. 6 and FIG. 10).

次に、0以上3以下のすべての整数rにそれぞれ対応するビット列BISn,r,cが生成済みではないため(ステップS12)、選択部10fがステップS3と同様に0以上3以下の新たな整数rを選択する。ここでは、r=0が選択されたとする(図12(a))。ここで、ステップS13で選択された整数r=0に対応するビット列BISn,0,cは生成済みではないため(ステップS14)、制御部10cが、領域10abのビット列を複製して領域10aaに格納し(ステップS15、図11)、処理をステップS5に戻す。 Next, since the bit strings BIS n, r, c respectively corresponding to all the integers r greater than or equal to 0 and less than or equal to 3 have not been generated (step S12), the selection unit 10f selects a new value greater than or equal to 0 and less than or equal to 3 as in step S3 Select the integer r. Here, it is assumed that r = 0 is selected (FIG. 12A). Here, since the bit string BIS n, 0, c corresponding to the integer r = 0 selected in step S13 has not been generated (step S14), the control unit 10c duplicates the bit string of the area 10ab to the area 10aa. Store (step S15, FIG. 11), and the process returns to step S5.

その後、r=0(図12(c))についてステップS5からS15の処理が行われ、さらに、r=1(図12(d))についてステップS5からS13の処理が行われる。ここで、r=1についてのステップS13でr=0が選択されたため、ステップS13の処理がやり直され、次に選択されたr=3(図12(e))についてステップS5からS12の処理が実行され、0以上3以下のすべての整数rに対応するビット列BISn,r,cが生成済みとなり、nラウンド目のラウンド鍵生成処理が終了する。 Thereafter, the process from step S5 to S15 is performed for r = 0 (FIG. 12C), and the process from step S5 to S13 is performed for r = 1 (FIG. 12D). Here, since r = 0 is selected in step S13 for r = 1, the processing in step S13 is repeated, and the processing in steps S5 to S12 is performed for the next selected r = 3 (FIG. 12E). The bit string BIS n, r, c corresponding to all integers r between 0 and 3 is generated, and the round key generation process for the nth round is completed.

<本形態の特徴>
図13及び図14は、第1実施形態をAESに適用した場合のラウンド鍵生成過程に誤りが混入された様子を例示する図である。
<Features of this embodiment>
FIGS. 13 and 14 are diagrams illustrating an example in which an error is mixed in the round key generation process when the first embodiment is applied to AES.

[32ビットの誤りの混入]
9ラウンド目のラウンド鍵の生成中に、攻撃者が外部から暗号演算装置10の電源電圧を故意に変動させ、図13に示すように9ラウンド目のr=1の行の32ビットに故障が起きたとする。しかし、本形態での処理は列単位で行われ、処理時に記憶部10aに格納されるデータも列単位であるため(図7から図11)、これによって9ラウンド目では列方向に同じ誤り値が伝播することはないため、この誤り値の情報を得ることができるバイト数が減少する。このことにより攻撃時の解析が困難となるため、DFA攻撃に対する安全性が向上する。
[Mixture of 32-bit error]
During the generation of the round key for the ninth round, an attacker intentionally changes the power supply voltage of the cryptographic operation device 10 from the outside, and a failure occurs in 32 bits in the r = 1 row of the ninth round as shown in FIG. Suppose you woke up. However, since the processing in this embodiment is performed in units of columns, and the data stored in the storage unit 10a at the time of processing is also in units of columns (FIGS. 7 to 11), the same error value in the column direction is thus obtained in the ninth round. Does not propagate, the number of bytes from which this error value information can be obtained is reduced. This makes it difficult to analyze at the time of attack, and thus improves the safety against DFA attacks.

[16ビットの誤りの混入]
9ラウンド目のラウンド鍵の生成中に、攻撃者が外部から暗号演算装置10の電源電圧を故意に変動させ、図13に示すように9ラウンド目のr=1の行のビット列BIS9,1,0及びBIS9,1,1の16ビットに故障が起きたとする。しかし、本形態での処理は列単位で行われ、処理時に記憶部10aに格納されるデータも列単位であるため(図7から図11)、これによって挿入された16ビットの誤りは10ラウンド目のr=1の行のみに伝播し、列方向に伝播することはない。よって、10ラウンド目のラウンド鍵に伝播する誤りはr=1の行のみであり、その他の行には誤りが生じない。そのため、このDFA攻撃によって攻撃者が得ることができる情報は、故障を発生させたr=1の行に対応する部分に限られる。その結果、1度の故障の挿入によって攻撃者が得ることができる情報量が小さくなり、攻撃時の解析が困難となるため、DFA攻撃に対する安全性が向上する。
[Mixture of 16-bit error]
During the generation of the round key for the ninth round, the attacker intentionally changes the power supply voltage of the cryptographic operation device 10 from the outside, and as shown in FIG. 13, the bit string BIS 9, 1 in the row of r = 1 in the ninth round , 0 and BIS 9 , 1, 1 16 bits are assumed to have failed. However, since the processing in this embodiment is performed in units of columns, and the data stored in the storage unit 10a at the time of processing is also in units of columns (FIGS. 7 to 11), the inserted 16-bit error is 10 rounds. It propagates only to the row of r = 1 of the eye and does not propagate in the column direction. Therefore, the error propagated to the round key of the 10th round is only the row of r = 1, and no error occurs in the other rows. Therefore, the information that can be obtained by the attacker through this DFA attack is limited to the portion corresponding to the row of r = 1 that caused the failure. As a result, the amount of information that can be obtained by an attacker by inserting a single failure is reduced, and analysis at the time of the attack becomes difficult, thus improving the safety against DFA attacks.

[ランダムな整数rを選択することによる特徴]
本形態では、処理対象の行を特定する整数rをランダムな整数とした。これにより、ラウンド鍵の生成時におけるラウンド鍵の各行の処理順序がランダムになり、攻撃者が狙う特定の位置のビットに故障を起こさせることが困難となる。その結果、攻撃者はDFA攻撃によって秘密鍵を取得することが困難となる。
[Features by selecting random integer r]
In this embodiment, the integer r that identifies the row to be processed is a random integer. As a result, the processing order of each row of the round key at the time of generation of the round key becomes random, and it becomes difficult to cause a failure in a bit at a specific position aimed by the attacker. As a result, it becomes difficult for an attacker to obtain a secret key by a DFA attack.

以上のように、本形態の方法では、エラー検知やエラー訂正を行うことなくDFA攻撃を抑制することができるため、本形態のようなソフトウェア実装では、エラー検知やエラー訂正に伴う演算処理の増加をまねくことなく、DFA攻撃に対する安全性を向上させることができる。   As described above, since the DFA attack can be suppressed without performing error detection or error correction in the method according to the present embodiment, an increase in arithmetic processing associated with error detection or error correction is required in the software implementation as in the present embodiment. It is possible to improve the safety against DFA attacks without imitating.

〔第2実施形態〕
次に、本発明の第2実施形態について説明する。
第1実施形態と同様、本形態でもnラウンド目に生成されたビット列BISn,r,cは、記憶部10aのビット列BISn−1,r,cが格納されていた領域10aaに上書きされる。また、ビット列BISn,r,cを求めるためには、ビット列BISn−1,r,cとビット列BISn−1,(r+k)mod(R+1),Cとが必要である。ここで、例えば、k=1であり、ビット列BISn,1,cを求め、それらをビット列BISn−1,r,cが格納されていた領域10aaに上書きした後、r=0が選択され、ビット列BISn,0,cを求める処理を実行する場合を想定する。この場合、ビット列BISn,0,cを求めるためにビット列BISn−1,0,cとビット列BISn−1,1,Cとが必要であるが、領域10aaのビット列BISn−1,1,Cはビット列BISn,1,Cによって上書きされている。そのため、第1実施形態では、別の領域10acを確保し、そこにビット列BISn−1,1,C等を格納していた。
[Second Embodiment]
Next, a second embodiment of the present invention will be described.
Similarly to the first embodiment, in this embodiment, the bit string BIS n, r, c generated in the n-th round is overwritten on the area 10aa in which the bit string BIS n-1, r, c of the storage unit 10a was stored. . Further, in order to obtain the bit string BIS n, r, c , the bit string BIS n-1, r, c and the bit string BIS n-1, (r + k) mod (R + 1), C are required. Here, for example, k = 1, bit string BIS n, 1, c is obtained, and after overwriting the area 10aa in which bit string BIS n-1, r, c is stored, r = 0 is selected. Assume that a process for obtaining the bit string BIS n, 0, c is executed. In this case, in order to obtain the bit string BIS n, 0, c , the bit string BIS n-1,0, c and the bit string BIS n-1,1, C are required, but the bit string BIS n-1,1 in the region 10aa is required. , C is overwritten by the bit string BIS n, 1, C. Therefore, in the first embodiment, another area 10ac is secured, and the bit string BIS n-1, 1, C and the like are stored therein.

本形態では、k=1又は−1とし、選択部10f、置換部10i、右シフト部10g、排他的論理和演算部10h,10jの各処理が繰り返されるたびに、選択部10fは(r+k)mod(R+1)を新たな整数rとして選択する。これにより、各ラウンドの最後の行を除き、ビット列BISn−1,(r+k)mod(R+1),CがBISn,(r+k)mod(R+1),Cによって上書きされる前にビット列BISn,r,cの生成に利用される。その結果、領域10acに格納するデータ量を削減できる。以下では、第1実施形態との相違点のみを説明する。 In this embodiment, k = 1 or −1, and each time the selection unit 10f, the replacement unit 10i, the right shift unit 10g, and the exclusive OR operation units 10h and 10j are repeated, the selection unit 10f is (r + k). Select mod (R + 1) as the new integer r. Thus, except for the last row of each round, the bit string BIS n−1, (r + k) mod (R + 1), C is overwritten by BIS n, (r + k) mod (R + 1), C before the bit string BIS n, Used to generate r and c . As a result, the amount of data stored in the area 10ac can be reduced. Hereinafter, only differences from the first embodiment will be described.

図15は、第2実施形態のnラウンド目におけるラウンド鍵の生成処理を説明するためのフローチャートである。また、図16は、第2実施形態のnラウンド目における各処理対象を説明するための図である。以下、これらの図を用い、第2実施形態の第1実施形態との相違点を説明する。   FIG. 15 is a flowchart for explaining round key generation processing in the n-th round according to the second embodiment. FIG. 16 is a diagram for explaining each processing target in the n-th round of the second embodiment. Hereinafter, the difference between the second embodiment and the first embodiment will be described with reference to these drawings.

図15に示すように、本形態では第1実施形態のステップS1からS3の処理を実行し、制御部10cが、ビット列BISn−1,r,Cを複製し、それを記憶部10aのWビットの領域10acに格納する(ステップS104)。次に、第1実施形態のステップS5と同様の処理を実行する。ただし、本形態の置換部10iは、原則、領域10aaに格納されたビット列BISn−1,(r+k)mod(R+1),Cから所定の規則に従ってWビットのビット列CBISn−1,r,Cを生成し、生成したビット列CBISn−1,r,Cによって、その領域10aaを更新する(ステップS5)。そして、領域10aaにビット列BISn−1,(r+k)mod(R+1),Cが存在しない最後の列の処理時にのみ、置換部10iは、領域10aaに格納されたビット列BISn−1,(r+k)mod(R+1),Cからビット列CBISn−1,r,Cを生成する。 As shown in FIG. 15, in the present embodiment, the processing of steps S1 to S3 of the first embodiment is executed, and the control unit 10c duplicates the bit string BIS n-1, r, C and stores it in the W of the storage unit 10a. Store in the bit area 10ac (step S104). Next, the same process as step S5 of the first embodiment is executed. However, the replacement unit 10i according to the present embodiment, as a general rule, uses the bit string BIS n−1, (r + k) mod (R + 1), C stored in the area 10aa according to a predetermined rule according to a predetermined rule CBIS n−1, r, C And the area 10aa is updated with the generated bit string CBIS n-1, r, C (step S5). Then, only when processing the last column in which the bit string BIS n−1, (r + k) mod (R + 1), C does not exist in the area 10aa, the replacement unit 10i performs the bit string BIS n−1, (r + k) stored in the area 10aa. ) A bit string CBIS n-1, r, C is generated from mod (R + 1), C.

その後、第1実施形態のステップS6からS12の処理が実行され、ステップS12で0以上R以下のすべての整数rにそれぞれ対応するビット列BISn,r,cが生成済みであると判定された場合には、nラウンド目のラウンド鍵生成処理が終了し、生成済みでないと判定された場合には、選択部10fが(r+k)mod(R+1)を新たな整数rとして選択する(ステップS113)。選択された整数rは一時記憶部10bに格納され、これによって一時記憶部10bに格納された整数rが更新され、以後必要に応じて各処理部に読み出される。次に、制御部10cが、領域10abのビット列を複製して領域10aaに格納し(ステップS15)、処理をステップS5に戻す。 After that, the processing of steps S6 to S12 of the first embodiment is executed, and it is determined in step S12 that the bit strings BIS n, r, c respectively corresponding to all integers r of 0 or more and R or less have been generated. When the round key generation process for the n-th round is completed and it is determined that it has not been generated, the selection unit 10f selects (r + k) mod (R + 1) as a new integer r (step S113). The selected integer r is stored in the temporary storage unit 10b, whereby the integer r stored in the temporary storage unit 10b is updated, and thereafter read out to each processing unit as necessary. Next, the control unit 10c duplicates the bit string of the area 10ab and stores it in the area 10aa (step S15), and returns the process to step S5.

以上の処理により、領域10acに格納すべきデータ量を削減することができる。例えば、図16に例示するように、k=1、C=R=3であり、ステップS3でr=1が選択された場合には、処理対象の列はr=1、2、3、0の順序で変化する。この場合、各r=1、2、3に対応するビット列BISn,r,cを求める時点(図16(a)から(c))では、それらを求めるために必要な領域10aaのビット列BISn−1,(r+1)mod 4,3は、BISn,(r+1)mod 4,cによって上書きされておらず、利用可能な状態にある。一方、各r=0に対応するビット列BISn,0,cを求める時点(図16(d))では、それらを求めるために必要な領域10aaのビット列BISn−1,1,3は、図16(a)の処理結果であるBISn,1,cによって上書きされており、利用できない。よって、最後の行に対応するビット列BISn,0,cを求める際には、ステップS104で領域10acに格納しておいたビット列BISn−1,1,3を用いる。すなわち、この場合に領域10acに格納しておく必要があるのはビット列BISn−1,1,3のみである。 With the above processing, the amount of data to be stored in the area 10ac can be reduced. For example, as illustrated in FIG. 16, when k = 1 and C = R = 3 and r = 1 is selected in step S3, the columns to be processed are r = 1, 2, 3, 0. Change in order. In this case, at the time of obtaining the bit string BIS n, r, c corresponding to each of r = 1, 2, 3 (FIG. 16 (a) to (c)), the bit string BIS n of the area 10aa necessary for obtaining them. −1, (r + 1) mod 4 , 3 is not overwritten by BIS n, (r + 1) mod 4, c and is in an available state. On the other hand, at the time of obtaining the bit string BIS n, 0, c corresponding to each r = 0 (FIG. 16 (d)), the bit string BIS n-1,1,3 of the area 10aa necessary for obtaining them is It is overwritten by BIS n, 1, c which is the processing result of 16 (a) and cannot be used. Therefore, when obtaining the bit string BIS n, 0, c corresponding to the last row, the bit string BIS n-1,1,3 stored in the area 10ac in step S104 is used. That is, in this case, only the bit string BIS n-1,1,3 needs to be stored in the area 10ac.

〔第3実施形態〕
次に、本発明の第3実施形態について説明する。本形態は、第1実施形態の変形例であり、選択された整数rに対するビット列BISn,r,cが既に得られているか否かにかかわらず、当該整数rに対応する各処理を実行する点が第1実施形態との相違点である。すなわち、ステップS14の判定を行わない。以下では、第1実施形態との相違点のみを説明する。
[Third Embodiment]
Next, a third embodiment of the present invention will be described. The present embodiment is a modification of the first embodiment, and executes each process corresponding to the integer r regardless of whether or not the bit string BIS n, r, c for the selected integer r has already been obtained. This is the difference from the first embodiment. That is, the determination in step S14 is not performed. Hereinafter, only differences from the first embodiment will be described.

図17は、第3実施形態のnラウンド目におけるラウンド鍵の生成処理を説明するためのフローチャートである。また、図18から図22は、第3実施形態をAESに適用した場合に、記憶部10aの各領域10aa〜10acに格納されるビット列を例示した図である。第3実施形態をAESに適用した場合、R及びCは3であり、Wは8であり、Lは128であり、kは1であり、CBISn−1,r,Cは、ビット列BISn−1,(r+1)mod4,3を所定の置換規則に従って置換した8ビットのビット列である。 FIG. 17 is a flowchart for explaining round key generation processing in the n-th round according to the third embodiment. 18 to 22 are diagrams exemplifying bit strings stored in the respective areas 10aa to 10ac of the storage unit 10a when the third embodiment is applied to AES. When the third embodiment is applied to AES, R and C are 3, W is 8, L is 128, k is 1, and CBIS n-1, r, C is a bit string BIS n. This is an 8-bit bit string obtained by replacing -1, (r + 1) mod 4 , 3 according to a predetermined replacement rule.

本形態におけるnラウンド目のラウンド鍵の生成処理では、まず、n−1ラウンド目のL=W・(C+1)・(R+1)ビット長のラウンド鍵Kn−1∈{0,1}が記憶部10aの領域10acに格納される(ステップS201)。また、制御部10cが、このラウンド鍵Kn−1を複製して記憶部10aの領域10aa,10abに格納する(ステップS302,S2、図18(a))。 In the round key generation process of the n-th round in this embodiment, first, the round key K n-1 ε {0, 1} L having the length L = W · (C + 1) · (R + 1) bits in the ( n−1 ) th round is first obtained. It is stored in the area 10ac of the storage unit 10a (step S201). Further, the control unit 10c duplicates the round key K n−1 and stores it in the areas 10aa and 10ab of the storage unit 10a (steps S302 and S2, FIG. 18A).

次に、選択部10fが、0以上R以下のランダムな整数rを選択する(ステップS3)。なお、図18から図22の例ではr=2が選択されている。   Next, the selection unit 10f selects a random integer r of 0 or more and R or less (Step S3). In the example shown in FIGS. 18 to 22, r = 2 is selected.

次に、置換部10iが、領域10acに格納されたビット列BISn−1,(r+k)mod(R+1),Cから所定の規則に従ってWビットのビット列CBISn−1,r,Cを生成し、生成したビット列CBISn−1,r,Cによって、その領域10aaを更新する(ステップS205、図18(b))。 Next, the replacement unit 10i generates a W-bit bit string CBIS n-1, r, C from the bit string BIS n-1, (r + k) mod (R + 1), C stored in the area 10ac according to a predetermined rule. The area 10aa is updated with the generated bit string CBIS n-1, r, C (step S205, FIG. 18B).

その後、第1実施形態のステップS6からS11が実行された後(図18(b)〜図21)、制御部10cが、0以上R以下のすべての整数rにそれぞれ対応するビット列BISn,r,cが生成済みであるか否かを判定する(ステップS12)。ここで、0以上R以下のすべての整数rに対応するビット列BISn,r,cがそれぞれ生成済みであると判定された場合には、nラウンド目のラウンド鍵生成処理が終了する。 Thereafter, after steps S6 to S11 of the first embodiment are executed (FIGS. 18B to 21), the control unit 10c performs bit sequences BIS n, r respectively corresponding to all integers r of 0 or more and R or less. , C are determined (step S12). Here, when it is determined that the bit strings BIS n, r, c corresponding to all integers r between 0 and R have been generated, the round key generation process for the n-th round is completed.

一方、0以上R以下の何れかの整数rに対応するビット列BISn,r,cが生成済みでないと判定された場合には、制御部10cが、領域10abのビット列を複製して領域10aaに格納し(ステップS15、図22)、処理をステップS3に戻す。 On the other hand, when it is determined that the bit string BIS n, r, c corresponding to any integer r between 0 and R is not generated, the control unit 10c duplicates the bit string of the area 10ab and stores it in the area 10aa. Store (step S15, FIG. 22), and the process returns to step S3.

<本形態の特徴>
以上のように、本形態は、選択された整数rに対するビット列BISn,r,cが既に得られているか否かにかかわらず、0以上R以下のすべての整数rに対応するビット列BISn,r,cが生成されていない限り、当該整数rに対応する各処理を実行することとした。この場合、整数rの値に応じて繰り返し処理の有無が変化しないため、演算内容の変化に伴う消費電力の変化等によって攻撃者に演算順序等の情報が漏洩することを防止できる。その結果、安全性が向上する。
<Features of this embodiment>
As described above, according to the present embodiment, regardless of whether or not the bit string BIS n, r, c for the selected integer r has already been obtained, the bit string BIS n, Unless r and c are generated, each process corresponding to the integer r is executed. In this case, since the presence or absence of the iterative process does not change according to the value of the integer r, it is possible to prevent information such as the calculation order from leaking to the attacker due to a change in power consumption accompanying a change in calculation contents. As a result, safety is improved.

〔第4実施形態〕
次に、本発明の第4実施形態について説明する。本形態は、第1実施形態の変形例であり、記憶部へのデータの格納方法を工夫することにより、ランダムな整数rを用いつつ、使用する記憶領域を第1実施形態よりも削減可能な形態である。以下では、第1実施形態との相違点を中心に説明する。
[Fourth Embodiment]
Next, a fourth embodiment of the present invention will be described. This embodiment is a modification of the first embodiment. By devising a method for storing data in the storage unit, the storage area to be used can be reduced as compared with the first embodiment while using a random integer r. It is a form. Below, it demonstrates centering on difference with 1st Embodiment.

図23及び図24は、第4実施形態のnラウンド目におけるラウンド鍵の生成処理を説明するためのフローチャートである。また、図25から図28は、第4実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。   23 and 24 are flowcharts for explaining round key generation processing in the n-th round according to the fourth embodiment. FIGS. 25 to 28 are diagrams exemplifying bit strings stored in the respective areas of the storage unit when the fourth embodiment is applied to AES.

本形態では、まず、第1実施形態のステップS1からS3の処理を実行した後、制御部10cが、領域10aaに格納されたビット列BISn−1,r,Cを複製し、それをWビットの領域10acに格納する(図25(a))。その後、第1実施形態のステップS6からS10の処理を実行する(図25(b)から図27)。ここで、ステップS9でi=C−1と判定された場合には、置換部10iが、領域10aa又は領域10acに格納されたビット列BISn−1,(r+k)mod(R+1),Cから所定の規則に従ってWビットのビット列CBISn−1,r,Cを生成し、最初に何れかのビット列BISn−1,r,cが格納されていた領域10aaの領域に上書きする(ステップS255、図28)。そして、排他的論理和演算部10jが、領域10aaに格納されたビット列CBISn−1,r,Cと、領域10abに格納されたWビットのビット列XORBISn−1,r,cとを読み込み、それらの排他的論理和を各c=0,1,…,Cについて計算し、各cに対応する各演算結果をnラウンド目のラウンド鍵K∈{0,1}の上位W{(R+1)・c+r}+1ビット目からW{(R+1)・c+r+1}ビット目までのビット列BISn,r,c=CBISn−1,r,C(+)XORBISn−1,r,cとし、ビット列BISn,r,cで領域10abを更新する(ステップS261、図28)。その後、第1実施形態のステップS12からS14までの処理を実行し、ステップS14でステップS13で選択された整数rに対応するビット列BISn,r,cが生成済みでないと判定された場合には、制御部10cが、ビット列BISn−1,r,Cを複製し、それを領域10aaの使用済みの領域に上書きし、処理をステップS6に戻す。なお、領域10aaの使用済みの領域とは、ステップS7からS10の処理で既に使用された領域10aaの領域を意味する。このように、シフト演算の終了後にビット列CBISn−1,r,Cを生成し、領域10aaの使用済みの領域を利用することにより、必要な領域10acのビット数をWビットに削減することができる。 In the present embodiment, first, after executing the processing of steps S1 to S3 of the first embodiment, the control unit 10c duplicates the bit string BIS n-1, r, C stored in the area 10aa and outputs it as W bits. In the area 10ac (FIG. 25A). Then, the process of step S6 to S10 of 1st Embodiment is performed (FIG.25 (b) to FIG.27). If it is determined in step S9 that i = C−1, the replacement unit 10i determines from the bit string BIS n−1, (r + k) mod (R + 1), C stored in the region 10aa or the region 10ac. The W-bit bit string CBIS n-1, r, C is generated in accordance with the above rule, and is overwritten on the area 10aa where any bit string BIS n-1, r, c was initially stored (step S255, FIG. 28). Then, the exclusive OR operation unit 10j reads the bit string CBIS n-1, r, C stored in the area 10aa and the W bit bit string XORBIS n-1, r, c stored in the area 10ab, The exclusive OR of these is calculated for each c = 0, 1,..., C, and each operation result corresponding to each c is converted into an upper round W {( n) of the round key K n ε {0, 1} L of the n- th round. Bit sequence BIS n, r, c = CBIS n-1, r, C (+) XORBIS n-1, r, c from R + 1) · c + r} +1 bit to W {(R + 1) · c + r + 1} bit, The area 10ab is updated with the bit string BIS n, r, c (step S261, FIG. 28). Thereafter, the processing from step S12 to S14 of the first embodiment is executed, and when it is determined in step S14 that the bit string BIS n, r, c corresponding to the integer r selected in step S13 has not been generated. The control unit 10c duplicates the bit string BIS n-1, r, C , overwrites the used area in the area 10aa, and returns the process to step S6. The used area of the area 10aa means an area of the area 10aa that has already been used in the processing from step S7 to S10. In this way, the bit string CBIS n-1, r, C is generated after the end of the shift operation, and the used area of the area 10aa is used to reduce the necessary number of bits of the area 10ac to W bits. it can.

〔第5実施形態〕
次に、本発明の第5実施形態について説明する。本形態は、第1,2実施形態の変形例であり、暗号演算を実行する暗号プロセッサによって本形態の暗号演算を実装し、さらに、第2実施形態と同様に、k=1又は−1とし、選択部10f、置換部10i、右シフト部10g、排他的論理和演算部10h,10jの各処理が繰り返されるたびに、選択部10fは(r+k)mod(R+1)を新たな整数rとして選択する形態である。以下では、第1,2実施形態との相違点を中心に説明する。
[Fifth Embodiment]
Next, a fifth embodiment of the present invention will be described. The present embodiment is a modification of the first and second embodiments. The cryptographic operation of the present embodiment is implemented by a cryptographic processor that performs cryptographic operations, and k = 1 or −1 as in the second embodiment. Each time the selection unit 10f, the replacement unit 10i, the right shift unit 10g, and the exclusive OR operation units 10h and 10j are repeated, the selection unit 10f selects (r + k) mod (R + 1) as a new integer r. It is a form to do. Below, it demonstrates centering on difference with 1st, 2 embodiment.

<構成>
図29は、第5実施形態の暗号演算装置110のハードウェア構成を説明するためのブロック図である。
図29に示すように、本形態の暗号演算装置110は、CPU(central processing unit)11と、RAM(random-access memory)12と、ROM(read-only memory)13と、EEPROM14と、乱数生成器15と、入力インタフェース(IF)16と、出力インタフェース(IF)17と、データバス18と暗号プロセッサ111とを有する。また、EEPROM14には、所定のプログラムと0ラウンド目のラウンド鍵K∈{0,1}とが格納されている。これらのプログラム及びラウンド鍵KはそれぞれRAM12に書き込まれ、さらにCPU11がRAM12に書き込まれたプログラムを実行し、ラウンド鍵Kを用いた暗号演算処理を行うことにより、本形態の暗号演算装置110が構築される。なお、本形態の暗号演算装置110によって構築される機能構成は図3(b)に示したのと同様である。
<Configuration>
FIG. 29 is a block diagram for explaining a hardware configuration of the cryptographic operation device 110 according to the fifth embodiment.
As shown in FIG. 29, the cryptographic operation device 110 of this embodiment includes a central processing unit (CPU) 11, a random-access memory (RAM) 12, a read-only memory (ROM) 13, an EEPROM 14, and random number generation. Device 15, input interface (IF) 16, output interface (IF) 17, data bus 18, and cryptographic processor 111. The EEPROM 14 stores a predetermined program and a round key K 0 ε {0, 1} L for the 0th round. These programs and the round key K 0 are respectively written in the RAM 12, and further, the CPU 11 executes the program written in the RAM 12 and performs cryptographic calculation processing using the round key K 0 , whereby the cryptographic calculation device 110 of the present embodiment. Is built. The functional configuration constructed by the cryptographic operation device 110 of this embodiment is the same as that shown in FIG.

<処理>
次に、本形態の処理について説明する。以下では、本形態の処理を一般化して説明した後、本形態をAESに適用した場合の処理を具体的に例示する。
[一般化した処理内容]
図30は、第5実施形態のnラウンド目におけるラウンド鍵の生成処理を説明するためのフローチャートである。以下、この図を用いて本形態の一般化した処理を説明する。
本形態のnラウンド目のラウンド鍵の生成処理では、まず、n−1ラウンド目のL=W・(C+1)・(R+1)ビット長のラウンド鍵Kn−1∈{0,1}が記憶部10aの領域10aaに格納される(ステップS1)。次に、選択部10fが、0以上R以下のランダムな整数rを選択する(ステップS3)。次に、制御部10cが、ビット列BISn−1,r,Cを複製し、それを記憶部10aのWビットの領域10acに格納し(ステップS104)、さらに、ビット列BISn−1,r,0, BISn−1,r,1,…,BISn−1,r,Cを複製し、それらを領域10abに格納する(ステップS304)。
<Processing>
Next, the processing of this embodiment will be described. In the following, after generalizing the processing of this embodiment, the processing when this embodiment is applied to AES will be specifically exemplified.
[Generalized processing contents]
FIG. 30 is a flowchart for explaining round key generation processing in the n-th round according to the fifth embodiment. Hereinafter, the generalized processing of this embodiment will be described with reference to FIG.
In the round key generation process of the n-th round in this embodiment, first, the round key K n−1 ε {0, 1} L having the length L = W · (C + 1) · (R + 1) bits in the ( n−1 ) th round is obtained. It is stored in the area 10aa of the storage unit 10a (step S1). Next, the selection unit 10f selects a random integer r of 0 or more and R or less (Step S3). Next, the control unit 10c duplicates the bit string BIS n-1, r, C and stores it in the W-bit area 10ac of the storage unit 10a (step S104). Further, the bit string BIS n-1, r, C 0 , BIS n-1, r, 1 ,..., BIS n-1, r, C are duplicated and stored in the area 10ab (step S304).

次に、置換部10iが、領域10aa又は領域10acに格納されたビット列BISn−1,(r+k)mod(R+1),Cから所定の規則に従ってWビットのビット列CBISn−1,r,Cを生成し、生成したビット列CBISn−1,r,Cを領域10acに格納する(ステップS305)。なお、nラウンド目で最後にステップS305の処理を行う場合以外には、ビット列BISn−1,(r+k)mod(R+1),Cは必ず領域10aaに格納されているため、置換部10iは領域10aaに格納されたビット列BISn−1,(r+k)mod(R+1),Cを用いて本ステップの処理を行う。一方、nラウンド目で最後にステップS305の処理を行う場合には、ビット列BISn−1,(r+k)mod(R+1),Cが領域10aaに格納されていないため、置換部10iは領域10acに格納されたビット列BISn−1,(r+k)mod(R+1),Cを用いて本ステップの処理を行う。また、攻撃者がステップS305の処理に故障を発生ることも想定されるため、ステップS305で正しい処理が行われたことを確認する検算処理を追加すると好適である。 Next, the replacement unit 10i converts the bit string BIS n−1, (r + k) mod (R + 1), C stored in the area 10aa or the area 10ac into a W-bit bit string CBIS n−1, r, C according to a predetermined rule. The generated bit string CBIS n-1, r, C is stored in the area 10ac (step S305). Since the bit string BIS n−1, (r + k) mod (R + 1), C is always stored in the area 10aa except for the case where the process of step S305 is performed last in the n-th round, the replacement unit 10i The processing of this step is performed using the bit string BIS n−1, (r + k) mod (R + 1), C stored in 10aa. On the other hand, when the process of step S305 is performed at the end of the n-th round, since the bit string BIS n−1, (r + k) mod (R + 1), C is not stored in the area 10aa, the replacement unit 10i is in the area 10ac. The processing of this step is performed using the stored bit string BIS n−1, (r + k) mod (R + 1), C. In addition, since it is also assumed that an attacker will cause a failure in the process of step S305, it is preferable to add a verification process for confirming that the correct process has been performed in step S305.

次に、制御部10cが、変数iを0に設定し、それを一時記憶部10bに格納する(ステップS6)。その後、右シフト部10gが、領域10abに格納されたビット列BISn−1,r(i)を下位にWビットシフトさせたビット列BISn−1,r(i+1)を生成する。このように生成されたビット列BISn−1,r(i+1)は、領域10abのビット列BISn−1,r(i)が格納されていた位置に上書きされ、領域10abが更新される(ステップS307)。 Next, the control unit 10c sets the variable i to 0 and stores it in the temporary storage unit 10b (step S6). Thereafter, the right shift unit 10g generates a bit string BIS n−1, r (i + 1) obtained by shifting the bit string BIS n−1, r (i) stored in the area 10ab by W bits downward. Thus generated bit string BIS n-1, r (i + 1) is overwritten in a position where the bit string regions 10ab BIS n-1, r ( i) is stored, the area 10ab is updated (step S307 ).

次に、排他的論理和演算部10hが、領域10aaに格納されたビット列XORBISn−1,r(i)と、領域10abに格納されたビット列BISn−1,r(i+1)との排他的論理和値XORBISn−1,r(i+1)=XORBISn−1,r(i)(+)BISn−1,r(i+1)を計算する。算出されたビット列XORBISn−1,r(i+1)は、領域10aaのビット列XORBISn−1,r(i)が格納されていた位置に上書きされ、領域10aaが更新される(ステップS308)。 Next, the exclusive OR operation unit 10h exclusives the bit string XORBIS n−1, r (i) stored in the area 10aa and the bit string BIS n−1, r (i + 1) stored in the area 10ab. OR value XORBIS n-1, r (i + 1) = XORBIS n-1, r (i) (+) BIS n-1, r (i + 1) is calculated. Calculated bit string XORBIS n-1, r (i + 1) is overwritten in a position where the bit string region 10aa XORBIS n-1, r ( i) is stored, the area 10aa is updated (step S308).

次に、制御部10cが、一時記憶部10bに格納しておいた変数iの値を参照し、i=C−1であるか否かを判定する(ステップS9)。ここで、i=C−1でないと判定された場合、制御部10cは、i+1を新たな変数iの値として変数iを更新し、この変数iを一時記憶部10bに格納して、処理をステップS307に戻す(ステップS10)。   Next, the control unit 10c refers to the value of the variable i stored in the temporary storage unit 10b, and determines whether i = C-1 (step S9). When it is determined that i = C−1 is not satisfied, the control unit 10c updates the variable i with i + 1 as the value of the new variable i, stores the variable i in the temporary storage unit 10b, and performs processing. The process returns to step S307 (step S10).

一方、ステップS9でi=C−1であると判定された場合には、排他的論理和演算部10jが、領域10acに格納されたビット列CBISn−1,r,Cと、領域10aaに格納されたWビットのビット列XORBISn−1,r,cとを読み込み、それらの排他的論理和を各c=0,1,…,Cについて計算し、各cに対応する各演算結果をnラウンド目のラウンド鍵K∈{0,1}の上位W{(R+1)・c+r}+1ビット目からW{(R+1)・c+r+1}ビット目までのビット列BISn,r,c=CBISn−1,r,C(+)XORBISn−1,r,cとし、ビット列BISn,r,cで領域10aaを更新する(ステップS311)。 On the other hand, if it is determined in step S9 that i = C-1, the exclusive OR operation unit 10j stores the bit string CBIS n-1, r, C stored in the area 10ac and the area 10aa. Read W-bit bit string XORBIS n−1, r, c, and calculates an exclusive OR of them for each c = 0, 1,..., C, and n rounds each operation result corresponding to each c Bit string BIS n, r, c = CBIS n− from the upper W {(R + 1) · c + r} +1 bit to the W {(R + 1) · c + r + 1} bit of the round key K n ε {0,1} L 1, r, C (+) XORBIS n-1, r, c, and the area 10aa is updated with the bit string BIS n, r, c (step S311).

次に、制御部10cが、0以上R以下のすべての整数rにそれぞれ対応するビット列BISn,r,cが生成済みであるか否かを判定する(ステップS12)。ここで、0以上R以下のすべての整数rに対応するビット列BISn,r,cがそれぞれ生成済みであると判定された場合には、nラウンド目のラウンド鍵生成処理が終了する。一方、0以上R以下の何れかの整数rに対応するビット列BISn,r,cが生成済みでないと判定された場合には、選択部10fが(r+k)mod(R+1)を新たな整数rとして選択し(ステップS113)、処理がステップS304に戻される。 Next, the control unit 10c determines whether or not the bit strings BIS n, r, c respectively corresponding to all integers r greater than or equal to 0 and less than or equal to R have been generated (step S12). Here, when it is determined that the bit strings BIS n, r, c corresponding to all integers r between 0 and R have been generated, the round key generation process for the n-th round is completed. On the other hand, if it is determined that the bit string BIS n, r, c corresponding to any integer r between 0 and R is not generated, the selection unit 10f sets (r + k) mod (R + 1) to a new integer r. (Step S113), and the process returns to step S304.

[本形態をAESに適用した場合の処理内容]
次に、第5実施形態をAESに適用した場合の処理を説明する。この場合、R及びCは3であり、Wは8であり、Lは128であり、kは1であり、CBISn−1,r,Cは、ビット列BISn−1,(r+1)mod4,3を所定の置換規則に従って置換した8ビットのビット列である。
[Processing contents when this form is applied to AES]
Next, processing when the fifth embodiment is applied to AES will be described. In this case, R and C are 3, W is 8, L is 128, k is 1, and CBIS n-1, r, C is a bit string BIS n-1, (r + 1) mod 4, This is an 8-bit bit string in which 3 is replaced according to a predetermined replacement rule.

図31から図34は、第5実施形態をAESに適用した場合に、記憶部10aの各領域10aa〜10acに格納されるビット列を例示した図である。以下、これらの図を用いて本形態をAESに適用した場合における、nラウンド目のラウンド鍵の生成処理を説明する。   FIGS. 31 to 34 are diagrams illustrating bit strings stored in the respective areas 10aa to 10ac of the storage unit 10a when the fifth embodiment is applied to AES. In the following, an n-th round key generation process when the present embodiment is applied to AES will be described with reference to these drawings.

このラウンド鍵の生成処理の例では、まず、n−1ラウンド目の128ビット長のラウンド鍵Kn−1∈{0,1}128が記憶部10aの領域10aaに格納される(ステップS1)。すなわち、ビット列BISn−1,r,c(0≦r,c≦3を満たすすべてのr,c)が領域10aaに格納される(図31(a))。次に、選択部10fが、0以上3以下のランダムな整数rを選択する(ステップS3)。この例ではr=1が選択されたとする。 In this example of round key generation processing, first, the 128-bit round key K n-1 ε {0, 1} 128 of the ( n-1) th round is stored in the area 10aa of the storage unit 10a (step S1). . That is, the bit string BIS n−1, r, c (all r, c satisfying 0 ≦ r, c ≦ 3) is stored in the area 10aa (FIG. 31 (a)). Next, the selection unit 10f selects a random integer r of 0 or more and 3 or less (Step S3). In this example, it is assumed that r = 1 is selected.

次に、制御部10cが、ビット列BISn−1,1,3を複製し、それを記憶部10aの8ビットの領域10acに格納し(ステップS104)、さらに、ビット列BISn−1,1,0, BISn−1,1,1,BISn−1,1,2,BISn−1,1,3を複製し、それらを領域10abに格納する(ステップS304、図31(a))。 Next, the control unit 10c duplicates the bit string BIS n-1,1,3 , stores it in the 8-bit area 10ac of the storage unit 10a (step S104), and further, the bit string BIS n- 1,1,3 . 0 , BIS n-1,1,1 , BIS n-1,1,2 , BIS n-1,1,3 are duplicated and stored in the area 10ab (step S304, FIG. 31 (a)).

次に、置換部10iが、領域10aaに格納されたビット列BISn−1,2,3から所定の規則に従って8ビットのビット列CBISn−1,1,3を生成し、生成したビット列CBISn−1,1,3を領域10acに格納する(ステップS305、図31(a))。 Next, the replacement unit 10i generates an 8-bit bit string CBIS n-1,1,3 from the bit string BIS n-1,2,3 stored in the area 10aa according to a predetermined rule, and the generated bit string CBIS n- 1, 1, and 3 are stored in area | region 10ac (step S305, Fig.31 (a)).

次に、制御部10cが、変数iを0に設定し、それを一時記憶部10bに格納する(ステップS6)。その後、右シフト部10gが、領域10abに格納されたビット列BISn−1,1(0)=BISn−1,1,0|BISn−1,1,1|BISn−1,1,2|BISn−1,1,3を下位に8ビットシフトさせたビット列BISn−1,1(1)=0|BISn−1,1,0|BISn−1,1,1|BISn−1,1,2を生成する。このように生成されたビット列BISn−1,1(1)は、領域10abのビット列BISn−1,1(0)が格納されていた位置に上書きされ、領域10abが更新される(ステップS307、図31(b))。 Next, the control unit 10c sets the variable i to 0 and stores it in the temporary storage unit 10b (step S6). Thereafter, the right shift unit 10g receives the bit string BIS n−1,1 (0) = BIS n−1,1,0 | BIS n−1,1,1 | BIS n−1,1, stored in the area 10ab . 2 | BIS n-1,1,3 is a bit string BIS n-1,1 (1) = 0 shifted to the lower 8 bits BIS n-1,1,0 | BIS n-1,1,1 | BIS n-1,1,2 are generated. The bit string BIS n-1,1 (1) generated in this way is overwritten at the position where the bit string BIS n-1,1 (0) of the area 10ab was stored, and the area 10ab is updated (step S307). FIG. 31 (b)).

次に、排他的論理和演算部10hが、領域10aaに格納されたビット列XORBISn−1,1(0)=BISn−1,1,0|BISn−1,1,1|BISn−1,1,2|BISn−1,1,3と、領域10abに格納されたビット列BISn−1,r(1)=0|BISn−1,1,0|BISn−1,1,1|BISn−1,1,2との排他的論理和値XORBISn−1,1(1)=XORBISn−1,1(0)(+)BISn−1,1(1)を計算する。算出されたビット列XORBISn−1,1(1)は、領域10aaのビット列XORBISn−1,1(0)が格納されていた位置に上書きされ、領域10aaが更新される(ステップS308、図31(b))。 Next, the exclusive OR operation unit 10h uses the bit string XORBIS n−1,1 (0) = BIS n−1,1,0 | BIS n−1,1,1 | BIS n− stored in the area 10aa. 1, 1, 2 | BIS n−1,1,3 and the bit string BIS n−1, r (1) = 0 stored in the area 10ab = 0 | BIS n−1,1,0 | BIS n−1,1 , 1 | BIS exclusive-OR value XORBIS n-1,1 (1) with n-1,1,2 = XORBIS n-1,1 to (0) (+) BIS n -1,1 (1) calculate. The calculated bit string XORBIS n-1,1 (1) is overwritten at the position where the bit string XORBIS n-1,1 (0) of the area 10aa was stored, and the area 10aa is updated (step S308, FIG. 31). (B)).

次に、制御部10cが、一時記憶部10bに格納しておいた変数iの値を参照し、i=2であるか否かを判定する(ステップS9)。ここで、i=2でないため、制御部10cは、1を新たな変数iの値として変数iを更新し、この変数iを一時記憶部10bに格納して、処理をステップS307に戻す(ステップS10)。その後、i=1,2についてステップS307、S308の処理が繰り返された後(図32、図33)、ステップS9でi=2であると判定される。これにより、排他的論理和演算部10jが、領域10acに格納されたビット列CBISn−1,1,3と、領域10aaに格納されたWビットのビット列XORBISn−1,1,3とを読み込み、それらの排他的論理和を各c=0,1,2,3について計算し、各cに対応する各演算結果をnラウンド目のラウンド鍵K∈{0,1}のビット列BISn,1,cとし、領域10aaを更新する(ステップS311、図34)。 Next, the control unit 10c refers to the value of the variable i stored in the temporary storage unit 10b, and determines whether i = 2 (step S9). Here, since i is not 2, the control unit 10c updates the variable i with 1 as the value of the new variable i, stores the variable i in the temporary storage unit 10b, and returns the process to step S307 (step S307). S10). Thereafter, after the processes of steps S307 and S308 are repeated for i = 1, 2 (FIGS. 32 and 33), it is determined that i = 2 in step S9. As a result, the exclusive OR operation unit 10j reads the bit string CBIS n-1,1,3 stored in the area 10ac and the W bit bit string XORBIS n-1,1,3 stored in the area 10aa. The exclusive OR of these is calculated for each c = 0, 1, 2, 3, and each operation result corresponding to each c is calculated as the bit string BIS n of the n- th round key K n ε {0, 1} L. , 1 and c , and the area 10aa is updated (step S311, FIG. 34).

次に、制御部10cが、0以上R以下のすべての整数rにそれぞれ対応するビット列BISn,r,cが生成済みであるか否かを判定する(ステップS12)。ここで、0以上3以下のすべての整数rに対応するビット列BISn,r,cがそれぞれ生成済みであると判定された場合には、nラウンド目のラウンド鍵生成処理が終了する。一方、0以上3以下の何れかの整数rに対応するビット列BISn,r,cが生成済みでないと判定された場合には、選択部10fが2を新たな整数rとして選択し(ステップS113)、処理がステップS304に戻される。 Next, the control unit 10c determines whether or not the bit strings BIS n, r, c respectively corresponding to all integers r greater than or equal to 0 and less than or equal to R have been generated (step S12). Here, when it is determined that the bit strings BIS n, r, c corresponding to all integers r of 0 or more and 3 or less have been generated, the round key generation process for the n-th round ends. On the other hand, when it is determined that the bit string BIS n, r, c corresponding to any integer r between 0 and 3 has not been generated, the selection unit 10f selects 2 as a new integer r (step S113). ), The process returns to step S304.

その後、r=2,3,0についてステップS304からS311の処理が行われ、0以上3以下のすべての整数rに対応するビット列BISn,r,cが生成済みとなり、nラウンド目のラウンド鍵生成処理が終了する。 Thereafter, the processing from step S304 to S311 is performed for r = 2, 3, 0, and the bit string BIS n, r, c corresponding to all integers r of 0 or more and 3 or less has been generated, and the n-th round key The generation process ends.

<本形態の特徴>
本形態の方法では、エラー検知やエラー訂正を行うことなくDFA攻撃を抑制することができるため、本形態のようなハードウェア実装では、エラー検知やエラー訂正を行うための回路を増設することに伴う回路規模の増大をまねくことなく、DFA攻撃に対する安全性を向上させることができる。
<Features of this embodiment>
In the method of this embodiment, a DFA attack can be suppressed without performing error detection or error correction. Therefore, in a hardware implementation such as this embodiment, a circuit for performing error detection and error correction is added. The safety against DFA attacks can be improved without causing the accompanying increase in circuit scale.

なお、本発明は上述の実施の形態に限定されるものではない。例えば、ラウンド鍵が生成されるまで各データを上書きすることなく記憶部に格納するなど、上述した以外の方法によって各データを記憶部に格納することとしてもよい。また、上述の各種の処理は、記載に従って時系列に実行されるのみならず、処理を実行する装置の処理能力あるいは必要に応じて並列的にあるいは個別に実行されてもよい。その他、本発明の趣旨を逸脱しない範囲で適宜変更が可能であることはいうまでもない。   The present invention is not limited to the embodiment described above. For example, each data may be stored in the storage unit by a method other than the above, such as storing each data in the storage unit without overwriting until a round key is generated. In addition, the various processes described above are not only executed in time series according to the description, but may be executed in parallel or individually according to the processing capability of the apparatus that executes the processes or as necessary. Needless to say, other modifications are possible without departing from the spirit of the present invention.

また、上述の構成をコンピュータによって実現する場合、各装置が有すべき機能の処理内容はプログラムによって記述される。そして、このプログラムをコンピュータで実行することにより、上記処理機能がコンピュータ上で実現される。   Further, when the above-described configuration is realized by a computer, processing contents of functions that each device should have are described by a program. The processing functions are realized on the computer by executing the program on the computer.

この処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体に記録しておくことができる。コンピュータで読み取り可能な記録媒体としては、例えば、磁気記録装置、光ディスク、光磁気記録媒体、半導体メモリ等どのようなものでもよい。   The program describing the processing contents can be recorded on a computer-readable recording medium. As the computer-readable recording medium, for example, any recording medium such as a magnetic recording device, an optical disk, a magneto-optical recording medium, and a semiconductor memory may be used.

また、このプログラムの流通は、例えば、そのプログラムを記録したDVD、CD−ROM等の可搬型記録媒体を販売、譲渡、貸与等することによって行う。さらに、このプログラムをサーバコンピュータの記憶装置に格納しておき、ネットワークを介して、サーバコンピュータから他のコンピュータにそのプログラムを転送することにより、このプログラムを流通させる構成としてもよい。   The program is distributed by selling, transferring, or lending a portable recording medium such as a DVD or CD-ROM in which the program is recorded. Furthermore, the program may be distributed by storing the program in a storage device of the server computer and transferring the program from the server computer to another computer via a network.

このようなプログラムを実行するコンピュータは、例えば、まず、可搬型記録媒体に記録されたプログラムもしくはサーバコンピュータから転送されたプログラムを、一旦、自己の記憶装置に格納する。そして、処理の実行時、このコンピュータは、自己の記録媒体に格納されたプログラムを読み取り、読み取ったプログラムに従った処理を実行する。また、このプログラムの別の実行形態として、コンピュータが可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することとしてもよく、さらに、このコンピュータにサーバコンピュータからプログラムが転送されるたびに、逐次、受け取ったプログラムに従った処理を実行することとしてもよい。また、サーバコンピュータから、このコンピュータへのプログラムの転送は行わず、その実行指示と結果取得のみによって処理機能を実現する、いわゆるASP(Application Service Provider)型のサービスによって、上述の処理を実行する構成としてもよい。なお、本形態におけるプログラムには、電子計算機による処理の用に供する情報であってプログラムに準ずるもの(コンピュータに対する直接の指令ではないがコンピュータの処理を規定する性質を有するデータ等)を含むものとする。   A computer that executes such a program first stores, for example, a program recorded on a portable recording medium or a program transferred from a server computer in its storage device. When executing the process, the computer reads a program stored in its own recording medium and executes a process according to the read program. As another execution form of the program, the computer may directly read the program from a portable recording medium and execute processing according to the program, and the program is transferred from the server computer to the computer. Each time, the processing according to the received program may be executed sequentially. Also, the program is not transferred from the server computer to the computer, and the above-described processing is executed by a so-called ASP (Application Service Provider) type service that realizes the processing function only by the execution instruction and result acquisition. It is good. Note that the program in this embodiment includes information that is used for processing by an electronic computer and that conforms to the program (data that is not a direct command to the computer but has a property that defines the processing of the computer).

本発明は、例えば、AESのDFA防止対策に利用できる。   The present invention can be used, for example, for AES DFA prevention measures.

図1は、従来の拡大鍵生成部の処理を説明するための図である。FIG. 1 is a diagram for explaining processing of a conventional extended key generation unit. 図2は、9ラウンド目で故障が発生した場合の従来の拡大鍵生成部の処理を説明するための図である。FIG. 2 is a diagram for explaining the processing of the conventional extended key generation unit when a failure occurs in the ninth round. 図3(a)は、第1実施形態の暗号演算装置のハードウェア構成を説明するためのブロック図である。図3(b)は、図3(a)のCPU11がRAMに書き込まれたプログラムを実行し、ラウンド鍵Kを用いた暗号演算処理を行うことによって構築される暗号演算装置の機能構成を説明するためのブロック図である。FIG. 3A is a block diagram for explaining a hardware configuration of the cryptographic operation apparatus according to the first embodiment. FIG. 3 (b), illustrating the functional configuration of the cryptographic computation apparatus which is constructed by performing a cryptographic operation processing CPU11 executes the program written in the RAM, using a round key K 0 in FIGS. 3 (a) It is a block diagram for doing. 図4は、第1実施形態のnラウンド目におけるラウンド鍵の生成処理を説明するためのフローチャートである。FIG. 4 is a flowchart for explaining round key generation processing in the n-th round according to the first embodiment. 図5は、第1実施形態のnラウンド目におけるラウンド鍵の生成処理を説明するためのフローチャートである。FIG. 5 is a flowchart for explaining round key generation processing in the n-th round according to the first embodiment. 図6は、第1実施形態をAESに適用した場合のr=2における処理の全体を示す図である。FIG. 6 is a diagram illustrating the entire processing at r = 2 when the first embodiment is applied to AES. 図7は、第1実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 7 is a diagram illustrating a bit string stored in each area of the storage unit when the first embodiment is applied to AES. 図8は、第1実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 8 is a diagram illustrating a bit string stored in each area of the storage unit when the first embodiment is applied to AES. 図9は、第1実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 9 is a diagram illustrating a bit string stored in each area of the storage unit when the first embodiment is applied to AES. 図10は、第1実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 10 is a diagram illustrating a bit string stored in each area of the storage unit when the first embodiment is applied to AES. 図11は、第1実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 11 is a diagram illustrating a bit string stored in each area of the storage unit when the first embodiment is applied to AES. 図12(a)は、第1実施形態をAESに適用した場合に選択部で選択される整数rの一例を説明するための図であり、図12(b)から図12(e)は、選択された各整数rに対応する処理対象を示す図である。FIG. 12A is a diagram for explaining an example of the integer r selected by the selection unit when the first embodiment is applied to AES. FIG. 12B to FIG. It is a figure which shows the process target corresponding to each selected integer r. 図13は、第1実施形態をAESに適用した場合のラウンド鍵生成過程に誤りが混入された様子を例示する図である。FIG. 13 is a diagram illustrating a state in which an error is mixed in the round key generation process when the first embodiment is applied to AES. 図14は、第1実施形態をAESに適用した場合のラウンド鍵生成過程に誤りが混入された様子を例示する図である。FIG. 14 is a diagram illustrating a state in which an error is mixed in the round key generation process when the first embodiment is applied to AES. 図15は、第2実施形態のnラウンド目におけるラウンド鍵の生成処理を説明するためのフローチャートである。FIG. 15 is a flowchart for explaining round key generation processing in the n-th round according to the second embodiment. 図16は、第2実施形態のnラウンド目における各処理対象を説明するための図である。FIG. 16 is a diagram for explaining each processing target in the n-th round of the second embodiment. 図17は、第3実施形態のnラウンド目におけるラウンド鍵の生成処理を説明するためのフローチャートである。FIG. 17 is a flowchart for explaining round key generation processing in the n-th round according to the third embodiment. 図18は、第3実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 18 is a diagram illustrating a bit string stored in each area of the storage unit when the third embodiment is applied to AES. 図19は、第3実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 19 is a diagram illustrating a bit string stored in each area of the storage unit when the third embodiment is applied to AES. 図20は、第3実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 20 is a diagram illustrating a bit string stored in each area of the storage unit when the third embodiment is applied to AES. 図21は、第3実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 21 is a diagram illustrating a bit string stored in each area of the storage unit when the third embodiment is applied to AES. 図22は、第3実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 22 is a diagram illustrating a bit string stored in each area of the storage unit when the third embodiment is applied to AES. 図23は、第4実施形態のnラウンド目におけるラウンド鍵の生成処理を説明するためのフローチャートである。FIG. 23 is a flowchart for explaining round key generation processing in the n-th round according to the fourth embodiment. 図24は、第4実施形態のnラウンド目におけるラウンド鍵の生成処理を説明するためのフローチャートである。FIG. 24 is a flowchart for explaining round key generation processing in the n-th round according to the fourth embodiment. 図25は、第4実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 25 is a diagram illustrating a bit string stored in each area of the storage unit when the fourth embodiment is applied to AES. 図26は、第4実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 26 is a diagram illustrating a bit string stored in each area of the storage unit when the fourth embodiment is applied to AES. 図27は、第4実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 27 is a diagram illustrating a bit string stored in each area of the storage unit when the fourth embodiment is applied to AES. 図28は、第4実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 28 is a diagram illustrating a bit string stored in each area of the storage unit when the fourth embodiment is applied to AES. 図29は、第5実施形態の暗号演算装置のハードウェア構成を説明するためのブロック図である。FIG. 29 is a block diagram for explaining a hardware configuration of the cryptographic operation apparatus according to the fifth embodiment. 図30は、第5実施形態のnラウンド目におけるラウンド鍵の生成処理を説明するためのフローチャートである。FIG. 30 is a flowchart for explaining round key generation processing in the n-th round according to the fifth embodiment. 図31は、第5実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 31 is a diagram illustrating a bit string stored in each area of the storage unit when the fifth embodiment is applied to AES. 図32は、第5実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 32 is a diagram illustrating a bit string stored in each area of the storage unit when the fifth embodiment is applied to AES. 図33は、第5実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 33 is a diagram illustrating a bit string stored in each area of the storage unit when the fifth embodiment is applied to AES. 図34は、第5実施形態をAESに適用した場合に、記憶部の各領域に格納されるビット列を例示した図である。FIG. 34 is a diagram illustrating a bit string stored in each area of the storage unit when the fifth embodiment is applied to AES.

符号の説明Explanation of symbols

10,110 暗号演算装置 10,110 Cryptographic operation device

Claims (12)

ラウンド鍵を用いて暗号演算を行う暗号演算装置であって、
R,C及びWを1以上の整数の定数とし、nを1以上の整数の変数とした場合における、n−1ラウンド目のL=W・(C+1)・(R+1)ビット長のラウンド鍵Kn−1∈{0,1}を格納する記憶部と、
0以上R以下の整数rを選択する選択部と、
cを0以上C以下の整数の変数とし、ラウンド鍵Kn−1の上位W{(R+1)・c+r}+1ビット目からW{(R+1)・c+r+1}ビット目までからなるWビットのビット列をBISn−1,r,cとし、BISn−1,r(0)=BISn−1,r,0|BISn−1,r,1|…|BISn−1,r,Cとし、iを0以上C−1以下の各整数とした場合における、ビット列BISn−1,r(i)を下位にWビットシフトさせたビット列BISn−1,r(i+1)を生成する右シフト部と、
0以上C以下の各jにそれぞれ対応する各ビット列BISn−1,r(j)の排他的論理和であるビット列XORBISn−1,r(C)を求める第1排他的論理和演算部と、
kを−R以上R以下の整数の定数とし、前記記憶部に格納されたビット列BISn−1,(r+k)mod(R+1),Cに対して一義的に定まるWビットのビット列をCBISn−1,r,Cとし、XORBISn−1,r(C)=XORBISn−1,r,0|XORBISn−1,r,1|...|XORBISn−1,r,Cを満たすWビットの各ビット列をXORBISn−1,r,cとした場合における、CBISn−1,r,CとXORBISn−1,r,cとの排他的論理和を各cについて計算し、各cに対応する各演算結果をnラウンド目のラウンド鍵K∈{0,1}の上位W{(R+1)・c+r}+1ビット目からW{(R+1)・c+r+1}ビット目までのビット列BISn,r,cとして出力する第2排他的論理和演算部と、
0以上R以下のすべての整数rについてラウンド鍵Kの各ビット列BISn,r,cが得られるまで、前記選択部、前記右シフト部、前記第1排他的論理和演算部、及び前記第2排他的論理和演算部の各処理を繰返し実行させる制御部と、
を有する暗号演算装置。
A cryptographic operation device that performs a cryptographic operation using a round key,
A round key K of L = W · (C + 1) · (R + 1) bits in the (n−1) th round when R, C and W are constants of integers of 1 or more and n is a variable of integers of 1 or more. n-1 ∈ {0, 1} storage unit for storing L ;
A selection unit for selecting an integer r of 0 or more and R or less,
Let c be an integer variable between 0 and C, and a bit string of W bits consisting of the upper W {(R + 1) · c + r} +1 bit to W {(R + 1) · c + r + 1} bit of the round key K n−1 BIS n-1, r, c , BIS n-1, r (0) = BIS n-1, r, 0 | BIS n-1, r, 1 | ... | BIS n-1, r, C Right shift unit for generating a bit string BIS n-1, r (i + 1) obtained by shifting the bit string BIS n-1, r (i) to the lower order by W bits when i is an integer of 0 to C-1. When,
A first exclusive OR operation unit for obtaining a bit string XORBIS n−1, r (C) that is an exclusive OR of each bit string BIS n−1, r (j) corresponding to each j of 0 or more and C or less; ,
Suppose that k is an integer constant between −R and R, and a bit string of W bits uniquely determined with respect to the bit string BIS n−1, (r + k) mod (R + 1), C stored in the storage unit is CBIS n− 1, r, C, and XORBIS n-1, r (C) = XORBIS n-1, r, 0 | XORBIS n-1, r, 1 | ... | W satisfying XORBIS n-1, r, C XORBIS n-1 each bit string, r, in the case of a c, CBIS n-1, r , C and XORBIS n-1, r, the exclusive OR of the c was calculated for each c, the c The bit string BIS from the upper W {(R + 1) · c + r} +1 bit to the W {(R + 1) · c + r + 1} bit of the n-th round key K n ε {0,1} L output as n, r, c 2 exclusive OR operation part;
Until each bit string BIS n, r, c of round key K n is obtained for all integers r between 0 and R, the selection unit, the right shift unit, the first exclusive OR operation unit, and the first 2 a control unit that repeatedly executes each process of the exclusive OR operation unit;
A cryptographic operation device.
請求項1の暗号演算装置であって、
前記選択部は、0以上R以下のランダムな整数rを選択する、
ことを特徴とする暗号演算装置。
The cryptographic operation device according to claim 1,
The selection unit selects a random integer r of 0 or more and R or less,
A cryptographic operation device characterized by that.
請求項2の暗号演算装置であって、
前記制御部は、前記選択部で選択された整数rに対するビット列BISn,r,cが既に得られている場合には、当該整数rに対応する前記右シフト部、前記第1排他的論理和演算部、及び前記第2排他的論理和演算部の各処理を繰返し実行させることなく、前記選択部に新たなランダムな整数rを選択させる、
ことを特徴とする暗号演算装置。
The cryptographic operation device according to claim 2,
When the bit string BIS n, r, c for the integer r selected by the selection unit has already been obtained, the control unit, the right shift unit corresponding to the integer r, the first exclusive OR Without causing the selection unit to select a new random integer r without repeatedly executing each process of the calculation unit and the second exclusive OR calculation unit,
A cryptographic operation device characterized by that.
請求項2の暗号演算装置であって、
前記制御部は、前記選択部で選択された整数rに対するビット列BISn,r,cが既に得られているか否かにかかわらず、当該整数rに対応する前記右シフト部、前記第1排他的論理和演算部、及び前記第2排他的論理和演算部の各処理を実行させる、
ことを特徴とする暗号演算装置。
The cryptographic operation device according to claim 2,
Regardless of whether or not the bit string BIS n, r, c for the integer r selected by the selection unit has already been obtained, the control unit performs the right shift unit corresponding to the integer r, the first exclusive Causing each process of the logical sum operation unit and the second exclusive OR operation unit to be executed;
A cryptographic operation device characterized by that.
請求項1の暗号演算装置であって、
前記記憶部に格納されたビット列BISn−1,(r+k)mod(R+1),Cから所定の規則に従ってビット列CBISn−1,r,Cを生成する置換部をさらに有し、
前記制御部は、前記選択部の処理、前記置換部の処理、前記右シフト部の処理、前記第1排他的論理和演算部の処理、前記第2排他的論理和演算部の処理の順序で各処理を繰り返し実行させ、
前記第2排他的論理和演算部から出力されたビット列BISn,r,cは、前記記憶部のビット列BISn−1,r,cが格納されていた領域に上書きされ、
kは1又は−1であり、
前記選択部、前記置換部、前記右シフト部、前記第1排他的論理和演算部、及び前記第2排他的論理和演算部の各処理が繰り返されるたびに、前記選択部は(r+k)mod(R+1)を新たな整数rとして選択する、
ことを特徴とする暗号演算装置。
The cryptographic operation device according to claim 1,
A replacement unit for generating the bit string CBIS n-1, r, C from the bit string BIS n-1, (r + k) mod (R + 1), C stored in the storage unit according to a predetermined rule;
The control unit performs processing in the order of processing of the selection unit, processing of the replacement unit, processing of the right shift unit, processing of the first exclusive OR operation unit, and processing of the second exclusive OR operation unit. Repeat each process,
The bit string BIS n, r, c output from the second exclusive OR operation unit is overwritten on the area where the bit string BIS n-1, r, c of the storage unit is stored,
k is 1 or -1,
Each time the selection unit, the replacement unit, the right shift unit, the first exclusive OR operation unit, and the second exclusive OR operation unit are repeated, the selection unit is (r + k) mod. Select (R + 1) as the new integer r,
A cryptographic operation device characterized by that.
請求項1から5の何れかの暗号演算装置であって、
R及びCは3であり、Wは8であり、Lは128であり、kは1であり、CBISn−1,r,3は、前記記憶部に格納されたビット列BISn−1,(r+1)mod4,3を所定の置換規則に従って置換した8ビットのビット列であり、ビット列CBISn−1,r,3とビット列BISn−1,(r+1)mod4,3とは一対一で対応する、
ことを特徴とする暗号演算装置。
The cryptographic operation device according to any one of claims 1 to 5,
R and C are 3, W is 8, L is 128, k is 1, and CBIS n-1, r, 3 is a bit string BIS n-1, ( r + 1) mod 4 , 3 is an 8-bit bit string that is replaced according to a predetermined replacement rule, and bit string CBIS n-1, r, 3 and bit string BIS n-1, (r + 1) mod 4,3 have a one-to-one correspondence.
A cryptographic operation device characterized by that.
ラウンド鍵を用いて暗号演算を行う暗号演算方法であって、
(a)R,C及びWを1以上の整数の定数とし、nを1以上の整数の変数とした場合における、n−1ラウンド目のL=W・(C+1)・(R+1)ビット長のラウンド鍵Kn−1∈{0,1}を記憶部に格納するステップと、
(b)選択部が、0以上R以下の整数rを選択するステップと、
(c)右シフト部が、cを0以上C以下の整数の変数とし、ラウンド鍵Kn−1の上位W{(R+1)・c+r}+1ビット目からW{(R+1)・c+r+1}ビット目までからなるWビットのビット列をBISn−1,r,cとし、BISn−1,r(0)=BISn−1,r,0|BISn−1,r,1|…|BISn−1,r,Cとし、iを0以上C−1以下の整数とした場合における、ビット列BISn−1,r(i)を下位にWビットシフトさせたビット列BISn−1,r(i+1)を生成するステップと、
(d)第1排他的論理和演算部が、XORBISn−1,r(0)=BISn−1,r(0)とした場合における、XORBISn−1,r(i)とビット列BISn−1,r(i+1)との排他的論理和値XORBISn−1,r(i+1)を計算するステップと、
(e)第2排他的論理和演算部が、kを−R以上R以下の整数の定数とし、前記記憶部に格納されたビット列BISn−1,(r+k)mod(R+1),Cに対して一義的に定まるWビットのビット列をCBISn−1,r,Cとし、前記ステップ(c)(d)を0以上C−1以下の各整数iについて実行して得られた排他的論理和値XORBISn−1,r(C)に対してXORBISn−1,r(C)=XORBISn−1,r,0|XORBISn−1,r,1|...|XORBISn−1,r,Cを満たすWビットの各ビット列をXORBISn−1,r,cとした場合における、CBISn−1,r,CとXORBISn−1,r,cとの排他的論理和を各cについて計算し、各cに対応する各演算結果をnラウンド目のラウンド鍵K∈{0,1}の上位W{(R+1)・c+r}+1ビット目からW{(R+1)・c+r+1}ビット目までのビット列BISn,r,cとして出力するステップと、を有し、
前記ステップ(b)から(e)は、0以上R以下のすべての整数rについてラウンド鍵Kの各ビット列BISn,r,cが得られるまで繰返し実行されるステップである、
ことを特徴とする暗号演算方法。
A cryptographic operation method for performing a cryptographic operation using a round key,
(a) When R, C, and W are integer constants of 1 or more and n is an integer variable of 1 or more, the length of L = W · (C + 1) · (R + 1) bits in the (n−1) th round Storing the round key K n-1 ε {0, 1} L in the storage unit;
(b) the selection unit selecting an integer r not less than 0 and not more than R;
(c) The right shift unit uses c as an integer variable not less than 0 and not more than C, and the upper W {(R + 1) · c + r} +1 bit to W {(R + 1) · c + r + 1} bit of the round key K n−1 a bit string of W bits consisting of up to a BIS n-1, r, c , BIS n-1, r (0) = BIS n-1, r, 0 | BIS n-1, r, 1 | ... | BIS n −1, r, C , where i is an integer between 0 and C−1, the bit string BIS n−1, r (i + 1) obtained by shifting the bit string BIS n−1, r (i) downward by W bits )
(d) XORBIS n-1, r (i) and bit string BIS n when the first exclusive OR operation unit sets XORBIS n-1, r (0) = BIS n-1, r (0) Calculating an exclusive OR value XORBIS n−1, r (i + 1) with −1, r (i + 1);
(e) The second exclusive OR operation unit sets k to an integer constant not less than −R and not more than R, for the bit string BIS n−1, (r + k) mod (R + 1), C stored in the storage unit. An exclusive OR obtained by executing the steps (c) and (d) for each integer i not less than 0 and not more than C−1 , where CBIS n−1, r, C is a uniquely determined W bit string. For the value XORBIS n-1, r (C), XORBIS n-1, r (C) = XORBIS n-1, r, 0 | XORBIS n-1, r, 1 | ... | XORBIS n-1, r, XORBIS n-1 each bit string of W bits satisfying C, r, in the case of a c, CBIS n-1, r , C and XORBIS n-1, r, each of the exclusive OR of the c c And the operation result corresponding to each c is the nth round key n{0,1} L Top W {(R + 1) · c + r} W +1 bit {(R + 1) · c + r + 1} bit string BIS n to bit of, a r, and outputting as c, and ,
Wherein the step (b) (e) is a step which is repeatedly executed for all integers r of 0 or more R less until each bit string BIS n round key K n, r, c are obtained,
A cryptographic operation method characterized by the above.
請求項7の暗号演算方法であって、
前記ステップ(b)は、0以上R以下のランダムな整数rを選択するステップである、
ことを特徴とする暗号演算方法。
The cryptographic operation method according to claim 7,
The step (b) is a step of selecting a random integer r not less than 0 and not more than R.
A cryptographic operation method characterized by the above.
請求項7の暗号演算方法であって、
(f)置換部が、前記記憶部に格納されたビット列BISn−1,(r+k)mod(R+1),Cから所定の規則に従ってビット列CBISn−1,r,Cを生成するステップをさらに有し、
前記ステップ(b)から(f)は、ステップ(b)、ステップ(f)、ステップ(c)、ステップ(d)、ステップ(e)の順序で繰返し実行されるステップであり、
ステップ(e)で生成されたビット列BISn,r,cは、前記記憶部のビット列BISn−1,r,cが格納されていた領域に上書きされ、
kは1又は−1であり、
前記ステップ(b)から(f)の処理が繰り返されるたびに、前記ステップ(b)において(r+k)mod(R+1)が新たな整数rとして選択される、
ことを特徴とする暗号演算方法。
The cryptographic operation method according to claim 7,
(f) The replacing unit further includes a step of generating a bit string CBIS n−1, r, C from the bit string BIS n−1, (r + k) mod (R + 1), C stored in the storage unit according to a predetermined rule. And
Steps (b) to (f) are steps that are repeatedly executed in the order of step (b), step (f), step (c), step (d), step (e),
The bit string BIS n, r, c generated in step (e) is overwritten on the area where the bit string BIS n-1, r, c of the storage unit is stored,
k is 1 or -1,
Each time the process from step (b) to (f) is repeated, (r + k) mod (R + 1) is selected as a new integer r in step (b).
A cryptographic operation method characterized by the above.
請求項8の暗号演算方法であって、
前記ステップ(b)で選択された整数rに対するビット列BISn,r,cが既に得られているか否かにかかわらず、当該整数rに対応する前記ステップ(c),(d),(e)の各処理を実行する、
ことを特徴とする暗号演算方法。
The cryptographic operation method according to claim 8, comprising:
Regardless of whether or not the bit string BIS n, r, c for the integer r selected in step (b) has already been obtained, the steps (c), (d), (e) corresponding to the integer r Execute each process of
A cryptographic operation method characterized by the above.
請求項7から10の何れかの暗号演算方法であって、
R及びCは3であり、Wは8であり、Lは128であり、kは1であり、CBISn−1,r,3は、前記記憶部に格納されたビット列BISn−1,(r+1)mod4,3を所定の置換規則に従って置換した8ビットのビット列であり、ビット列CBISn−1,r,3とビット列BISn−1,(r+1)mod4,3とは一対一で対応する、
ことを特徴とする暗号演算方法。
A cryptographic calculation method according to any one of claims 7 to 10,
R and C are 3, W is 8, L is 128, k is 1, and CBIS n-1, r, 3 is a bit string BIS n-1, ( r + 1) mod 4 , 3 is an 8-bit bit string that is replaced according to a predetermined replacement rule, and bit string CBIS n-1, r, 3 and bit string BIS n-1, (r + 1) mod 4,3 have a one-to-one correspondence.
A cryptographic operation method characterized by the above.
請求項1から6の何れかの暗号演算装置としてコンピュータを機能させるためのプログラム。   A program for causing a computer to function as the cryptographic operation device according to any one of claims 1 to 6.
JP2008156803A 2008-06-16 2008-06-16 Cryptographic operation apparatus, method thereof, and program Expired - Fee Related JP4990843B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008156803A JP4990843B2 (en) 2008-06-16 2008-06-16 Cryptographic operation apparatus, method thereof, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008156803A JP4990843B2 (en) 2008-06-16 2008-06-16 Cryptographic operation apparatus, method thereof, and program

Publications (2)

Publication Number Publication Date
JP2009303032A true JP2009303032A (en) 2009-12-24
JP4990843B2 JP4990843B2 (en) 2012-08-01

Family

ID=41549443

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008156803A Expired - Fee Related JP4990843B2 (en) 2008-06-16 2008-06-16 Cryptographic operation apparatus, method thereof, and program

Country Status (1)

Country Link
JP (1) JP4990843B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010057066A (en) * 2008-08-29 2010-03-11 Toshiba Corp Apparatus, method and program for scheduling key to be used for encryption

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005503069A (en) * 2001-09-04 2005-01-27 エステーミクロエレクトロニクス ソシエテ アノニム How to protect the amount of secrets
JP2005531023A (en) * 2002-06-25 2005-10-13 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Round key generation for AES (Rijndael) block ciphers
JP2005278535A (en) * 2004-03-30 2005-10-13 Haiponekkusu Japan:Kk Crop growing designing device for dripping type fertilizer application and water irritation cultivation, program, and designing method for crop growing
JP2005340892A (en) * 2004-05-24 2005-12-08 Matsushita Electric Ind Co Ltd Encryption circuit
JP2007174024A (en) * 2005-12-20 2007-07-05 Sony Corp Encryption processing apparatus
JP2007325219A (en) * 2006-06-05 2007-12-13 Sony Corp Encryption processing system and encryption processing apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005503069A (en) * 2001-09-04 2005-01-27 エステーミクロエレクトロニクス ソシエテ アノニム How to protect the amount of secrets
JP2005531023A (en) * 2002-06-25 2005-10-13 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Round key generation for AES (Rijndael) block ciphers
JP2005278535A (en) * 2004-03-30 2005-10-13 Haiponekkusu Japan:Kk Crop growing designing device for dripping type fertilizer application and water irritation cultivation, program, and designing method for crop growing
JP2005340892A (en) * 2004-05-24 2005-12-08 Matsushita Electric Ind Co Ltd Encryption circuit
JP2007174024A (en) * 2005-12-20 2007-07-05 Sony Corp Encryption processing apparatus
JP2007325219A (en) * 2006-06-05 2007-12-13 Sony Corp Encryption processing system and encryption processing apparatus

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CHEN C.-N. AND YEN S.-M.: "Differential Fault Analysis on AES Key Schedule and Some Countermeasures", LECTUE NOTES IN COMPUTER SCIENCE, vol. 2727, JPN6012019753, 2003, pages 118 - 129, XP055728531, ISSN: 0002203850, DOI: 10.1007/3-540-45067-X_11 *
高橋順子,福永利徳: "AESの鍵スケジュール部に対するフォールト攻撃", 2008年暗号と情報セキュリティシンポジウム講演論文集, JPN6012019752, 22 December 2008 (2008-12-22), ISSN: 0002203849 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010057066A (en) * 2008-08-29 2010-03-11 Toshiba Corp Apparatus, method and program for scheduling key to be used for encryption

Also Published As

Publication number Publication date
JP4990843B2 (en) 2012-08-01

Similar Documents

Publication Publication Date Title
JP4905000B2 (en) Cryptographic processing apparatus, cryptographic processing method, and computer program
JP5055993B2 (en) Cryptographic processing apparatus, cryptographic processing method, and computer program
JP4774509B2 (en) Pseudo random number generation system
Li et al. Differential fault analysis on the ARIA algorithm
CN102611549B (en) Data encryption equipment and storage card
JP5198526B2 (en) Encryption device and decryption device
TWI552121B (en) A cryptographic processing device, a cryptographic processing method and a program
CN103166751A (en) Method and device for protecting block cipher from being attacked by template
RU2603550C2 (en) Data processing device, data processing method, and program
JP2005215688A (en) Hardware encryption/decryption apparatus using s-box operation, and method for the same
TW201044334A (en) Encryption device, encryption method, and computer program
JP2005107078A (en) Encryption processing system, encryption processing method, and computer program
CN111008407A (en) Encryption circuit for performing virtual encryption operations
JP2012215814A (en) Encryption processing device, encryption processing method, and program
Luo et al. Differential fault analysis of SHA-3 under relaxed fault models
KR100922728B1 (en) AES encryption and decryption apparatus and method
JP2011123356A (en) Prime number generating device, prime number generating method, and prime number generating program
JP2005134478A (en) Encryption processing device, encryption processing method, and computer program
JP2010181789A (en) Information processing device, information processing method, and program
JP4990843B2 (en) Cryptographic operation apparatus, method thereof, and program
CN110071927B (en) Information encryption method, system and related components
JP2011119985A (en) Encryption and decryption method
JP5207153B2 (en) Pseudo random number generation system
JP2006054568A (en) Encryption apparatus, decryption apparatus and method, and computer program
RU2188513C2 (en) Method for cryptographic conversion of l-bit digital-data input blocks into l-bit output blocks

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100726

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20110810

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120412

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120424

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120502

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150511

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees