JP2010232709A - Encryption arithmetic circuit device - Google Patents

Encryption arithmetic circuit device Download PDF

Info

Publication number
JP2010232709A
JP2010232709A JP2009074812A JP2009074812A JP2010232709A JP 2010232709 A JP2010232709 A JP 2010232709A JP 2009074812 A JP2009074812 A JP 2009074812A JP 2009074812 A JP2009074812 A JP 2009074812A JP 2010232709 A JP2010232709 A JP 2010232709A
Authority
JP
Japan
Prior art keywords
random number
data
unit
circuit device
processing
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.)
Withdrawn
Application number
JP2009074812A
Other languages
Japanese (ja)
Inventor
Koyo Yamakoshi
公洋 山越
Akihiro Yamagishi
明洋 山岸
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 JP2009074812A priority Critical patent/JP2010232709A/en
Publication of JP2010232709A publication Critical patent/JP2010232709A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To solve a problem that the addition of a complicated circuit for masking is needed conventionally, a gate scale and an arithmetic amount are increased, and the power consumption of a circuit is increased. <P>SOLUTION: An encryption arithmetic circuit device has a function processing unit which performs a predetermined function processing on input data to generate output data, and outputs, to the outside as encryption data, the output data obtained by repeating, with predetermined number of times, a series of processing wherein the function processing is performed on the external input data in first processing and then the function processing is performed on the generated output data, as input data for next time, in subsequent processing. The encryption arithmetic circuit device is provided with: a random number generating unit which generates random number data with a bit width being equal to that of the output data of the function processing unit; two data holding units which temporarily store the output data of the function processing unit or the random number data; and a controlling unit which controls the processing timing of the random number generating unit, function processing unit, and data holding units. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、暗号アルゴリズムの処理を行う暗号演算回路装置に関する。特に暗号演算回路での演算中間値の物理的変化量を解析して暗号を解読する暗号解析攻撃を回避する技術に関する。   The present invention relates to a cryptographic operation circuit device that performs cryptographic algorithm processing. In particular, the present invention relates to a technique for avoiding a cryptographic analysis attack that decrypts a cipher by analyzing a physical change amount of a calculation intermediate value in a cryptographic operation circuit.

近年、セキュリティ機能を備えたICカードや携帯端末が広く利用されている。このようなセキュリティを要する装置は何らかの暗号アルゴリズムが用いられており、第三者に情報が漏洩しないような仕組みになっている。ところが最近では、このようなICカードや携帯端末などに実装された暗号アルゴリズムに対するサイドチャネル攻撃が大きな脅威となっている。サイドチャネル攻撃とは、本来、第三者が取得することを想定しない暗号演算回路が動作する際の消費電力や漏洩電磁波或いは演算時間などの漏洩情報を手掛りにして、秘密情報を不正に入手しようとする攻撃のことである。このようなサイドチャネル攻撃の中でも、暗号演算中に得られる消費電力の変化量を統計処理して秘密情報を解読する手法は、差分電力解析(DPA:Differential Power Analysis)攻撃と呼ばれ大きな脅威となっている。   In recent years, IC cards and portable terminals having a security function have been widely used. Such a device requiring security uses some kind of cryptographic algorithm, and has a mechanism that prevents information from leaking to a third party. Recently, however, side-channel attacks against cryptographic algorithms implemented in such IC cards and portable terminals have become a major threat. A side channel attack is an attempt to obtain fraudulent information by using leakage information such as power consumption, leakage electromagnetic waves, or calculation time when a cryptographic operation circuit that is not supposed to be acquired by a third party is operating. Is an attack. Among such side channel attacks, a technique for statistically processing the amount of change in power consumption obtained during cryptographic operations and decrypting secret information is called a differential power analysis (DPA) attack and is a major threat. It has become.

このようなセキュリティ装置への暗号アルゴリズムの実装方法には、CPU(中央演算ユニット)によるソフトウェア実装とワイヤードロジックなどによるハードウェア実装の2つの方法がある。ICカードや簡易な携帯端末などへの暗号アルゴリズムの実装は、処理速度の問題や低消費電力の要求などからハードウェア実装が採用される場合が多い。   There are two methods for implementing cryptographic algorithms in such a security device: software implementation by a CPU (central processing unit) and hardware implementation by wired logic. In many cases, hardware implementation is adopted for implementation of cryptographic algorithms on an IC card or a simple portable terminal due to a problem of processing speed or a demand for low power consumption.

ここで、AES(Advanced Encryption Standard)に代表されるブロック暗号アルゴリズムをハードウェア実装する場合の例について説明する。図6はラウンド関数を演算する暗号演算回路装置900の構成を示した図で、攪拌部901と鍵スケジューリング部902とに分けて描いてある。   Here, an example in which a block cipher algorithm represented by AES (Advanced Encryption Standard) is implemented in hardware will be described. FIG. 6 is a diagram showing a configuration of a cryptographic operation circuit device 900 that calculates a round function, and is divided into a stirring unit 901 and a key scheduling unit 902.

図6において、攪拌部901は、外部から入力する平文(または暗号文)とラウンド処理後のデータとを選択するセレクタ903と、所定の処理関数でラウンド処理を行う組合せ回路904と、組合せ回路904の出力データを一時的に保持するレジスタ905と、レジスタ905の出力データまたはAll=0(全て0のデータ)を選択して外部に出力するセレクタ906とで構成される。攪拌部901は、平文(または暗号文)を処理対象データとして入力し、鍵スケジューリング部902が秘密鍵から作成する副鍵(ラウンド鍵)を用いて所定回数のラウンド処理を行って暗号化し、暗号文(または平文)を処理済データとして出力する。   In FIG. 6, the agitation unit 901 includes a selector 903 that selects plaintext (or ciphertext) input from the outside and data after round processing, a combinational circuit 904 that performs round processing with a predetermined processing function, and a combinational circuit 904. The register 905 temporarily holds the output data of the register 905 and the selector 906 that selects the output data of the register 905 or All = 0 (all 0 data) and outputs the selected data to the outside. The agitation unit 901 inputs plaintext (or ciphertext) as processing target data, performs encryption a predetermined number of times using a subkey (round key) created from the secret key by the key scheduling unit 902, Output the sentence (or plaintext) as processed data.

攪拌部901において、1ラウンド処理は1クロックで行われ、セレクタ903,組合せ回路904およびレジスタ905の一巡するラウンド処理をクロックに同期して所定回数繰り返す。つまり、組合せ回路904のラウンド処理を基本とする攪拌部901では、鍵スケジューリング部902が出力する副鍵の値と1クロック前のラウンド処理の中間値とを用いて新たなラウンド処理を行い、その演算結果を新たな中間値としてレジスタに格納する処理を繰り返す。そして、クロック毎にラウンド処理関数の演算結果が中間値としてレジスタ905に保持され、必要なラウンド回数分だけクロックが進んだ後、レジスタ905に現れた値が最終演算結果となり、この値を暗号文(暗号化の場合)または平文(復号化の場合)として暗号演算回路装置900の外部に出力する。このように、途中のラウンド処理の演算中間値など不必要な情報を外部に出力することを回避するため、全ラウンド処理を終了した最終結果のみが出力されるようになっている。   In the agitation unit 901, one round process is performed in one clock, and the round process of one cycle of the selector 903, the combinational circuit 904, and the register 905 is repeated a predetermined number of times in synchronization with the clock. That is, the agitation unit 901 based on the round process of the combinational circuit 904 performs a new round process using the value of the sub key output from the key scheduling unit 902 and the intermediate value of the round process one clock before, The process of storing the operation result in the register as a new intermediate value is repeated. Then, the operation result of the round processing function is held in the register 905 as an intermediate value for each clock, and after the clock has advanced by the required number of rounds, the value appearing in the register 905 becomes the final operation result. The data is output to the outside of the cryptographic operation circuit device 900 as (in the case of encryption) or plain text (in the case of decryption). As described above, in order to avoid outputting unnecessary information such as an intermediate value of an intermediate round process to the outside, only the final result after all round processes are output.

一方、鍵スケジューリング部902は、外部から入力する秘密鍵と鍵スケジューリング処理後のデータとを選択するセレクタ907と、セレクタ907の出力データを一時的に保持するレジスタ908と、所定の処理関数で鍵スケジューリング処理を行う組合せ回路909とで構成される。鍵スケジューリング部902は、暗号演算回路装置900の外部から与えられる秘密鍵から各ラウンド処理に必要な副鍵を生成する。   On the other hand, the key scheduling unit 902 includes a selector 907 that selects a secret key input from the outside and data after key scheduling processing, a register 908 that temporarily stores output data of the selector 907, and a key with a predetermined processing function. And a combinational circuit 909 that performs scheduling processing. The key scheduling unit 902 generates a subkey necessary for each round process from a secret key given from the outside of the cryptographic operation circuit device 900.

また、制御部950は、セレクタ903,レジスタ905,セレクタ906,セレクタ907およびレジスタ908にクロック,制御信号a,制御信号bおよび制御信号cを出力して各部の処理タイミングを制御する。   The control unit 950 outputs a clock, a control signal a, a control signal b, and a control signal c to the selector 903, the register 905, the selector 906, the selector 907, and the register 908 to control the processing timing of each unit.

ここで、秘密鍵の値は第三者に知られないように安全に管理する必要があるが、何らかの方法により各ラウンド処理で使用する副鍵の値が暴かれると、鍵スケジューリング部902の処理を逆算することにより秘密鍵の値が第三者に知られてしまうという問題がある。従って、暗号演算回路の設計においては、差分電力解析攻撃などにより副鍵を推定されないように考慮する必要がある。   Here, it is necessary to securely manage the secret key value so that it is not known to a third party. However, if the value of the subkey used in each round process is revealed by some method, the process of the key scheduling unit 902 is performed. There is a problem that the value of the secret key is known to a third party by calculating back. Therefore, in the design of the cryptographic operation circuit, it is necessary to consider so that the subkey is not estimated by a differential power analysis attack or the like.

差分電力解析攻撃の中でも、非特許文献1に示すCPA(Correlation Power Analysis)攻撃は、演算中間値を保持するレジスタ値の変化に着目した攻撃法であり、特にハードウェア実装されたブロック暗号アルゴリズムに対して非常に有効な攻撃法として知られている。以下、AESアルゴリズムに対するCPA攻撃の概要について述べる(非特許文献1参照)。   Among the differential power analysis attacks, the CPA (Correlation Power Analysis) attack shown in Non-Patent Document 1 is an attack method that focuses on the change of the register value that holds the operation intermediate value. It is known as a very effective attack method. The outline of the CPA attack against the AES algorithm will be described below (see Non-Patent Document 1).

先に説明した図6のブロック暗号アルゴリズムのハードウェア構成を示す暗号演算回路装置900の攪拌部901において、1クロック後のレジスタ905の値の変化量(ハミング距離)が大きければ、その時点での消費電力量も大きい筈であると考えることができる。また、レジスタ905の値が変化すれば、それに応じてラウンド処理を行う組合せ回路904を構成する論理ゲートの入力値も変化するので論理ゲートの状態遷移が行われる。この結果、レジスタ905のハミング距離とその時点での消費電力量には相関が見られる筈である。ここで、ラウンド処理の途中でレジスタ905の中間値が外部に出力されないように制御されている場合、レジスタ905のハミング距離を計算できる可能性があるのは、外部からの入力を伴う初期ラウンドと外部への出力を伴う最終ラウンドの2箇所である。ここでは、最終ラウンドが攻撃ポイントとなるケースについて説明する(非特許文献1参照)。   In the agitation unit 901 of the cryptographic operation circuit device 900 showing the hardware configuration of the block cipher algorithm in FIG. 6 described above, if the amount of change (Hamming distance) in the register 905 after one clock is large, the current time It can be considered that power consumption should be large. Further, when the value of the register 905 changes, the input value of the logic gate constituting the combinational circuit 904 that performs the round process also changes accordingly, so that the state transition of the logic gate is performed. As a result, there should be a correlation between the Hamming distance of the register 905 and the power consumption at that time. Here, when the intermediate value of the register 905 is controlled so as not to be output to the outside during the round process, the possibility of calculating the Hamming distance of the register 905 is the initial round with input from the outside. Two places in the final round with output to the outside. Here, a case where the last round becomes an attack point will be described (see Non-Patent Document 1).

最終ラウンドの1クロック前のレジスタ値は最終ラウンドへの副鍵値を仮定すれば、AESの最終ラウンド処理を逆に辿って計算することが可能である。例えば図7に示すように、最終ラウンド処理はSubBytes−>ShiftRow−>AddKeyの処理で、1byte単位の処理に閉じているので、副鍵の推定対象としてbyte値を0x00から0xffの256通りの値のいずれか1つに決めれば、1クロック前の処理byte値を計算できる。図7において、1クロック前のレジスタ値をsi,j、暗号文出力をci,j、副鍵をki,jとした場合(尚、i,jは整数で4×4の16byteの座標位置を示す)、例えば図7に示すように、1クロック前の処理byte値s2,0は、s2,0=c2,2(+)k2,2のように計算できる(ここで(+)はEXOR演算を示す)。従って、座標(2,0)位置の1byteの成分に関する最終ラウンドの1クロック前後のハミング距離はs2,0(+)c2,0となり、逆算するとc2,0(+)c2,2(+)k2,2のように計算できる。ここで、先に説明したように、k2,2は0x00から0xffのいずれかの値を取り得るが、256通りの値のいずれか1つに決めるだけで、1クロック前の処理byte値を計算できる。尚、残りの座標位置の15byteの成分についても同様である。 The register value one clock before the last round can be calculated by tracing the last round process of AES in reverse, assuming a subkey value for the last round. For example, as shown in FIG. 7, the final round process is a process of SubBytes->ShiftRow-> AddKey, and is closed to a process of 1 byte unit. Therefore, 256 values of byte values from 0x00 to 0xff are set as subkey estimation targets. If any one of them is determined, the processing byte value one clock before can be calculated. In FIG. 7, the register value one clock before is s i, j , the ciphertext output is c i, j , and the subkey is k i, j (where i and j are integers of 4 × 4 16 bytes) For example, as shown in FIG. 7, the processing byte value s 2,0 one clock before can be calculated as s 2,0 = c 2,2 (+) k 2,2 (here (+) Indicates an EXOR operation). Therefore, the hamming distance before and after one clock of the last round for the 1-byte component at the coordinate (2,0) position is s 2,0 (+) c 2,0 , and when calculated backward, c 2,0 (+) c 2,2 (+) K 2 and 2 can be calculated. Here, as described above, k 2,2 can take any value from 0x00 to 0xff, but the processing byte value one clock before can be obtained by only determining one of 256 values. Can be calculated. The same applies to the remaining 15-byte component of the coordinate position.

ここで、1≦i≦N(Nは自然数)なる異なるN個の平文(c)について演算を行い、副鍵kの値から定まるハミング距離をh(k)とし、消費電力との相関をピアソンの相関係数として求める。また、cに対する消費電力をp(t)とすると、
(k)とp(t)のピアソン相関係数Corr(h(k),p(t))は、
Here, an operation is performed on N plaintexts (c i ) of 1 ≦ i ≦ N (N is a natural number), and the Hamming distance determined from the value of the subkey k is set to h i (k), and the correlation with the power consumption. As the Pearson correlation coefficient. Also, if the power consumption for c i is p i (t),
Pearson correlation coefficient Corr of h i (k) and p i (t) (h i (k), p i (t)) is,

Figure 2010232709
Figure 2010232709

Figure 2010232709
Figure 2010232709

このような相関係数を副鍵が取り得る0x00から0xffの全ての値について計算する。   Such a correlation coefficient is calculated for all values from 0x00 to 0xff that the subkey can take.

上記で説明したように、ハミング距離と消費電力は正の相関を持つので、相関係数が最大となる副鍵の値が真の副鍵となる。このようにして16byte全ての副鍵の値を推定すれば、鍵スケジューリング処理部902の処理を逆算することにより秘密鍵の値を不正に取得することができる。   As described above, since the Hamming distance and the power consumption have a positive correlation, the value of the sub key that maximizes the correlation coefficient is the true sub key. If the values of all the 16-byte subkeys are estimated in this way, the secret key value can be obtained illegally by calculating back the key scheduling processing unit 902.

このようなCPA攻撃に代表される差分電力解析攻撃に対する従来の対策は、乱数を用いて演算の中間値をマスク化する方法が知られている(例えば非特許文献2参照)。同文献では、AESアルゴリズムのキー関数であるSubBytes関数のマスク化について述べられているが、MixColumn関数などの他関数についてもマスク化を施し、ラウンド処理途中のレジスタに格納される中間値を含めて、演算最終結果である暗号文を除く全ての中間値が乱数によってマスク化できるので、本来のラウンド処理結果をマスク化した値がレジスタに格納される。   As a conventional countermeasure against the differential power analysis attack represented by such a CPA attack, a method of masking an intermediate value of an operation using a random number is known (for example, see Non-Patent Document 2). In this document, masking of the SubBytes function, which is a key function of the AES algorithm, is described, but other functions such as the MixColumn function are also masked and include intermediate values stored in a register in the middle of round processing. Since all intermediate values except the ciphertext that is the final operation result can be masked with random numbers, the value obtained by masking the original round processing result is stored in the register.

図8は、AESのラウンド処理関数(SubBytes−>ShiftRows−>MixColumns−>AddRoundKey)を乱数によりマスク処理する場合の構成を示す(例えば非特許文献2参照)。図8において、fは同型写像、gは同型写像の逆写像とAESアフィン変換の線形変換部との合成写像をそれぞれ示す。SubBytesの中のガロア体逆元算x−1は、非特許文献2のFig.8に記載の回路を示し、r,rtmp1,rtmp2,rはそれぞれM,Z,W,Fに対応するマスク用乱数である。ここで、ShiftRowsは単なるByteシフト演算であり、またAddRoundKeyはEXOR演算であるため、一般的な関数をそのまま用いることができる。また、MixColumnは線形関数であり、MixColumn(1)で処理結果に対してMixColumn関数処理した値とMixColumn(2)で乱数に対して同様のMixColumn関数処理した値とのEXOR演算を行うことによってMixColumn(1)の入力の乱数成分をキャンセルできる。ここで、図6で説明したようなマスク処理を行わない通常のラウンド処理関数と比較すると、乱数とのEXOR演算の他に乱数値の変換のためのf,gの関数やMixColumn関数などが追加されている。この結果、通常のラウンド処理の演算結果の値と乱数値とがEXOR演算された値がレジスタに格納されるので、乱数のマスク効果によってラウンド処理前後の値の差分量からハミング距離を計算することができない。このため、差分量と正しい副鍵値との相関が小さくなって相関係数のピークが出現しなくなり、CPA攻撃に代表される差分電力解析攻撃を防御することができる。 FIG. 8 shows a configuration when a round processing function of AES (SubBytes->ShiftRows->MixColumns-> AddRoundKey) is masked with random numbers (for example, see Non-Patent Document 2). In FIG. 8, f is the isomorphism map, and g is the composite map of the inverse map of the isomorphism map and the linear transformation part of the AES affine transformation. The Galois field inverse element x −1 in SubBytes is shown in FIG. 8 shows a circuit according a r a, r tmp1, r tmp2 , r b , respectively M, Z, W, random number mask corresponding to the F. Here, since ShiftRows is a simple Byte shift operation and AddRoundKey is an EXOR operation, a general function can be used as it is. Further, MixColumn is a linear function, and by performing an EXOR operation on a value obtained by processing the MixColumn function on the processing result by MixColumn (1) and a value obtained by processing the same MixColumn function on a random number by MixColumn (2), MixColumn is performed. The random component of the input of (1) can be canceled. Here, in comparison with the normal round processing function that does not perform the mask processing as described in FIG. 6, in addition to the EXOR operation with the random number, functions of f and g, a MixColumn function, and the like for converting the random number value are added. Has been. As a result, the value obtained by EXORing the value of the normal round processing result and the random number value is stored in the register, so that the Hamming distance is calculated from the difference between the values before and after the round processing by the mask effect of the random number. I can't. For this reason, the correlation between the difference amount and the correct subkey value becomes small, and the peak of the correlation coefficient does not appear, so that the differential power analysis attack represented by the CPA attack can be protected.

このようにして、従来技術では、図8に示すような複雑な暗号演算回路によって差分電力解析攻撃を防御することが行われていた。   In this way, in the prior art, the differential power analysis attack is protected by a complicated cryptographic operation circuit as shown in FIG.

菅原,本間,青木,佐藤,“サイドチャネル攻撃標準評価FPGAボードを用いた暗号ハードウェアに対する電力解析実験,”マルチメディア,分散,協調とモバイル(DICOMO2007)シンポジウム,7D−5,2007.Sugawara, Honma, Aoki, Sato, “Power channel analysis experiment on cryptographic hardware using side channel attack standard evaluation FPGA board,” Multimedia, Distributed, Collaboration and Mobile (DICOMO2007) Symposium, 7D-5, 2007. E.Trichina,“Small Size,Low Power Side Channel−Immune AES Co−processor Design and Synthesis Results”,AES2004.E. Trichina, “Small Size, Low Power Side Channel-Immune AES Co-processor Design and Synthesis Results”, AES 2004.

先に説明したように、従来技術によるCPA攻撃の防御対策は、暗号演算回路の構成が複雑で処理量が多く、回路規模やコスト的な問題があった。例えば、非特許文献2に示された防御対策は、SubBytes部のガロア体逆元演算途中の中間値をすべてマスク化するCPA攻撃対策を行っている。このため、SubBytes部だけでなく、MixColumn部,AddKey部などラウンド処理全体の組合せ回路をマスク化する必要があるので、マスク化に必要な乱数をラウンド処理関数を構成する論理ゲート毎に用意しなければならない。この結果、マスク化に伴うEXOR回路や予備回路の追加などが必要となり、ラウンド処理関数の回路が複雑化してゲート規模が増大し、さらに演算量も増加するため回路の消費電力が増大するという問題が生じる。   As described above, the CPA attack protection measures according to the prior art have a complicated configuration of the cryptographic operation circuit, a large amount of processing, and problems with circuit scale and cost. For example, the defense countermeasure shown in Non-Patent Document 2 is a countermeasure against CPA attack that masks all intermediate values in the middle of Galois field inverse element calculation of the SubBytes part. For this reason, since it is necessary to mask not only the SubBytes part but also the combination circuit of the whole round process such as the MixColumn part and the AddKey part, random numbers necessary for masking must be prepared for each logic gate constituting the round processing function. I must. As a result, it is necessary to add an EXOR circuit and a spare circuit accompanying masking, and the circuit of the round processing function is complicated, the gate scale is increased, and the amount of calculation is further increased, so that the power consumption of the circuit increases. Occurs.

上記課題に鑑み、本発明の目的は、マスク化を施さない暗号化処理関数のブロックをそのまま流用して、EXORゲートや予備回路の新規実装を行わずにゲート回路規模の増大や消費電力の増加を抑えながらCPA攻撃を回避することが可能な暗号演算回路装置を提供することである。   In view of the above problems, an object of the present invention is to divert an encryption processing function block that is not masked as it is, and to increase the gate circuit scale and power consumption without newly installing an EXOR gate or a spare circuit. It is an object of the present invention to provide a cryptographic operation circuit device capable of avoiding a CPA attack while suppressing the above.

本発明の請求項1に係る暗号演算回路装置は、入力データに所定の関数処理を施して出力データを生成する関数処理部を有し、初回の処理では外部からの入力データに前記関数処理を実行し、以降の処理では生成された出力データを次回の入力データとして前記関数処理行う一連の処理を所定回数繰り返して得られた出力データを暗号データとして外部に出力する暗号演算回路装置において、前記関数処理部の出力データに等しいビット幅の乱数データを生成する乱数生成部と、前記関数処理部の出力データまたは前記乱数データを一時的に格納する2つのデータ保持部と、前記乱数生成部と前記関数処理部と前記データ保持部の処理タイミングを制御する制御部とを設けたことを特徴とする。   A cryptographic operation circuit device according to claim 1 of the present invention includes a function processing unit that generates output data by performing predetermined function processing on input data. In the first processing, the function processing is performed on input data from the outside. In the cryptographic operation circuit device that outputs the output data obtained by repeating a predetermined number of times a series of processing for performing the function processing as the next input data, the output data generated in the subsequent processing, as encrypted data, A random number generation unit that generates random data having a bit width equal to the output data of the function processing unit, two data holding units that temporarily store the output data of the function processing unit or the random number data, and the random number generation unit; The function processing unit and a control unit for controlling processing timing of the data holding unit are provided.

請求項1では、例えば処理タイミング(制御部)の1クロック毎に暗号演算の処理を繰り返し実行する組合せ回路からなる処理関数(関数処理部)の演算結果を演算中間値として2つのレジスタ(2つのデータ保持部)のいずれか一方に格納してクロック信号の進行により所定回数分の処理演算を繰り返し実行する暗号演算回路装置で、処理単位であるデータサイズに等しいビット幅の乱数データを処理対象データ毎に新規に生成する(乱数生成部)。乱数データを生成することにより、消費電力量と演算結果との相関がなくなり、暗号演算中に得られる消費電力の変化量を統計処理して秘密情報を解読するCPA攻撃から防御することができる。   In the first aspect, for example, two registers (two of the processing results (function processing unit) including the combination function that repeatedly executes the cryptographic calculation processing every clock of the processing timing (control unit) are used as the calculation intermediate value. A cryptographic operation circuit device that repeatedly stores a predetermined number of processing operations by the progress of a clock signal and stores random number data having a bit width equal to the data size as a processing unit. Newly generated every time (random number generator). By generating random number data, there is no correlation between the amount of power consumption and the calculation result, and the amount of change in power consumption obtained during cryptographic calculation can be statistically processed to protect against CPA attacks that decrypt secret information.

また、本発明の請求項2に係る暗号演算回路装置は、請求項1に記載の暗号演算回路装置において、前記制御部は、前記関数処理部が初回の処理を行う1回前の処理で前記乱数生成部が生成した乱数データを前記2つのデータ保持部のいずれかに格納し、前記乱数データが格納された同一の前記データ保持部に前記関数処理部が初回の処理で生成した出力データを格納するように制御することを特徴とする。   The cryptographic operation circuit device according to claim 2 of the present invention is the cryptographic operation circuit device according to claim 1, wherein the control unit performs the process one time before the function processing unit performs an initial process. The random number data generated by the random number generation unit is stored in one of the two data holding units, and the output data generated by the function processing unit in the first process is stored in the same data holding unit in which the random number data is stored. It is characterized by controlling to store.

請求項2では、例えば一番最初のタイミングで関数処理部が生成する出力データを演算中間値としてレジスタ1またはレジスタ2の2つのレジスタ(2つのデータ保持部)のいずれかに格納するクロックタイミングの1クロック前のタイミングにおいて、レジスタ1またはレジスタ2のいずれかに乱数生成部により生成した乱数を格納するので、CPA攻撃を受けやすい初期ラウンドでの防御が可能になる。   In the second aspect, for example, the output timing generated by the function processing unit at the first timing is stored as an operation intermediate value in one of the two registers (two data holding units) of the register 1 or the register 2. Since the random number generated by the random number generation unit is stored in either the register 1 or the register 2 at the timing one clock before, it is possible to protect in the initial round that is susceptible to the CPA attack.

また、本発明の請求項3に係る暗号演算回路装置は、請求項1に記載の暗号演算回路装置において、前記制御部は、前記関数処理部が最終回の処理を行う1回前の処理で前記乱数生成部が生成した乱数データを前記2つのデータ保持部のいずれかに格納し、前記乱数データが格納された同一の前記データ保持部に前記関数処理部が最終回の処理で生成した出力データを格納するように制御することを特徴とする。   The cryptographic operation circuit device according to claim 3 of the present invention is the cryptographic operation circuit device according to claim 1, wherein the control unit performs processing one time before the function processing unit performs the last processing. The random number data generated by the random number generation unit is stored in one of the two data holding units, and the output generated by the function processing unit in the last processing is the same data holding unit in which the random number data is stored Control is performed to store data.

請求項3では、例えば一番最後のタイミングで関数処理部が生成する出力データを演算中間値としてレジスタ1またはレジスタ2の2つのレジスタ(2つのデータ保持部)のいずれかに格納するクロックタイミングの1クロック前のタイミングにおいて、レジスタ1またはレジスタ2のいずれかに乱数生成部により生成した乱数を格納するので、CPA攻撃を受けやすい最終ラウンドでの防御が可能になる。   In the third aspect of the invention, for example, the output timing generated by the function processing unit at the last timing is stored as an operation intermediate value in one of the two registers (two data holding units) of the register 1 or the register 2. Since the random number generated by the random number generation unit is stored in either the register 1 or the register 2 at the timing one clock before, it becomes possible to defend in the final round that is susceptible to the CPA attack.

また、本発明の請求項4に係る暗号演算回路装置は、請求項1に記載の暗号演算回路装置において、前記制御部は、前記関数処理部が初回および最終回のそれぞれの処理を行う1回前の処理で前記乱数生成部が生成した乱数データを前記2つのデータ保持部のいずれかに格納し、前記乱数データが格納された同一の前記データ保持部に前記関数処理部が初回および最終回の処理で生成した出力データを格納するように制御することを特徴とする。   The cryptographic operation circuit device according to claim 4 of the present invention is the cryptographic operation circuit device according to claim 1, wherein the control unit is configured such that the function processing unit performs the first process and the final process once. The random number data generated by the random number generation unit in the previous process is stored in one of the two data holding units, and the function processing unit is set to the same data holding unit in which the random number data is stored. Control is performed so as to store the output data generated by the above process.

請求項4では、一番最初と一番最後のタイミングで処理が行われる関数の結果を演算中間値としてレジスタ1またはレジスタ2の2つのレジスタ(2つのデータ保持部)のいずれかに格納するクロックタイミングの1クロック前のタイミングにおいて、レジスタ1またはレジスタ2のいずれかに乱数生成部により生成した乱数を格納するので、CPA攻撃を受けやすい初期ラウンドと最終ラウンドでの防御が可能になる。   According to a fourth aspect of the present invention, there is provided a clock for storing a result of a function processed at the very first timing and the last timing as an operation intermediate value in either one of the two registers (two data holding units) of the register 1 or the register 2 Since the random number generated by the random number generation unit is stored in either the register 1 or the register 2 at a timing one clock before the timing, it is possible to protect in the initial round and the final round that are susceptible to the CPA attack.

また、本発明の請求項5に係る暗号演算回路装置は、請求項1から4のいずれか一項に記載の暗号演算回路装置において、前記制御部は、前記関数処理部の関数処理毎に前記2つのデータ保持部の少なくとも一方に前記乱数データを格納するように制御することを特徴とする。   Moreover, the cryptographic operation circuit device according to claim 5 of the present invention is the cryptographic operation circuit device according to any one of claims 1 to 4, wherein the control unit performs the function processing for each function processing of the function processing unit. The random number data is controlled to be stored in at least one of the two data holding units.

請求項5では、クロック毎に処理される関数の結果を演算中間値としてレジスタ1またはレジスタ2にクロックに同期して格納する際に、演算中間値を格納するレジスタとは異なる他方のレジスタに乱数生成部により生成した乱数を格納する。この結果、初期ラウンドと最終ラウンドだけでなく、全てのラウンドで消費電力量と演算結果との相関がなくなり、CPA攻撃から防御することができる。   In claim 5, when the result of the function processed for each clock is stored as an operation intermediate value in register 1 or register 2 in synchronization with the clock, a random number is stored in the other register different from the register storing the operation intermediate value. Stores the random number generated by the generator. As a result, there is no correlation between the power consumption amount and the calculation result in all rounds, not only in the initial round and the final round, and it is possible to protect against the CPA attack.

また、本発明の請求項6に係る暗号演算回路装置は、請求項1から4のいずれか一項に記載の暗号演算回路装置において、前記制御部は、前記関数処理部の関数処理毎に、前記関数処理部の出力データまたは前記乱数データを前記2つのデータ保持部に交互に格納するように制御することを特徴とする。   Moreover, the cryptographic operation circuit device according to claim 6 of the present invention is the cryptographic operation circuit device according to any one of claims 1 to 4, wherein the control unit is configured for each function processing of the function processing unit. Control is performed so that the output data of the function processing unit or the random number data is alternately stored in the two data holding units.

請求項6では、クロック毎に処理される関数の結果を演算中間値としてレジスタ1またはレジスタ2にクロックに同期して交互に格納する。そして、当該クロックタイミングにおいて演算中間値を格納するレジスタとは異なる他方のレジスタに乱数生成部により生成した乱数を格納する。この結果、初期ラウンドと最終ラウンドだけでなく、全てのラウンドで消費電力量と演算結果との相関がなくなり、CPA攻撃から防御することができる。   According to the sixth aspect, the result of the function processed for each clock is alternately stored in the register 1 or the register 2 in synchronism with the clock as an operation intermediate value. Then, the random number generated by the random number generation unit is stored in the other register different from the register storing the operation intermediate value at the clock timing. As a result, there is no correlation between the power consumption amount and the calculation result in all rounds, not only in the initial round and the final round, and it is possible to protect against the CPA attack.

また、本発明の請求項7に係る暗号演算回路装置は、請求項1から6のいずれか一項に記載の暗号演算回路装置において、前記関数処理部が行う関数処理はブロック暗号アルゴリズムにおける暗号化または復号化のラウンド演算の基本処理であることを特徴とする。この結果、AESなどブロック暗号アルゴリズムを用いる暗号演算回路装置にも適用することができる。   A cryptographic operation circuit device according to claim 7 of the present invention is the cryptographic operation circuit device according to any one of claims 1 to 6, wherein the function processing performed by the function processing unit is encryption in a block encryption algorithm. Alternatively, it is a basic process of decoding round operation. As a result, the present invention can also be applied to a cryptographic operation circuit device using a block cipher algorithm such as AES.

また、本発明の請求項8に係る暗号演算回路装置は、請求項1から6のいずれか一項に記載の暗号演算回路装置において、前記関数処理部が行う関数処理は公開鍵暗号アルゴリズムで利用されるべき乗剰余演算または楕円スカラー倍演算を実行するための繰り返し演算の基本処理であることを特徴とする。この結果、冪乗剰余演算や楕円スカラー倍演算などの公開鍵暗号アルゴリズムを用いる暗号演算回路装置にも適用することができる。   The cryptographic operation circuit device according to claim 8 of the present invention is the cryptographic operation circuit device according to any one of claims 1 to 6, wherein the function processing performed by the function processing unit is used in a public key cryptographic algorithm. It is a basic process of an iterative operation for executing a modular exponentiation operation or an elliptic scalar multiplication operation to be performed. As a result, the present invention can also be applied to a cryptographic operation circuit device using a public key cryptographic algorithm such as a power-residue calculation or elliptic scalar multiplication.

本発明に係る暗号演算回路装置は、関数処理部の出力データに等しいビット幅の乱数データを生成して、関数処理部の出力データまたは乱数データを2つのデータ保持部に格納することにより、消費電力量と演算結果との相関がなくなり、暗号演算中に得られる消費電力の変化量を統計処理して秘密情報を解読するCPA攻撃から防御することができる。特に、マスク化を施さない暗号化処理関数(関数処理部)のブロックをそのまま流用して、EXORゲートや予備回路の新規実装を行わずにゲート回路規模の増大や消費電力の増加を抑えながらCPA攻撃を回避することができる。   The cryptographic operation circuit device according to the present invention generates random number data having a bit width equal to the output data of the function processing unit, and stores the output data or random number data of the function processing unit in the two data holding units. There is no correlation between the amount of power and the calculation result, and the amount of change in power consumption obtained during the cryptographic calculation can be statistically processed to protect against a CPA attack that decrypts secret information. In particular, a block of an encryption processing function (function processing unit) that is not masked is used as it is, and CPA while suppressing an increase in gate circuit scale and an increase in power consumption without newly installing an EXOR gate or a spare circuit. Attacks can be avoided.

第1の実施形態に係る暗号演算回路装置100の構成例を示す説明図である。It is explanatory drawing which shows the structural example of the cryptographic operation circuit apparatus 100 which concerns on 1st Embodiment. 第1の実施形態に係る暗号演算回路装置100のタイミングチャートである。3 is a timing chart of the cryptographic operation circuit device 100 according to the first embodiment. 第2の実施形態に係る暗号演算回路装置200の構成例を示す説明図である。It is explanatory drawing which shows the structural example of the cryptographic operation circuit apparatus 200 which concerns on 2nd Embodiment. 第2の実施形態に係る暗号演算回路装置200のタイミングチャートである。It is a timing chart of the cryptographic operation circuit device 200 according to the second embodiment. 第3の実施形態に係る暗号演算回路装置300の構成例を示す説明図である。It is explanatory drawing which shows the structural example of the cryptographic operation circuit apparatus 300 which concerns on 3rd Embodiment. 従来のブロック暗号アルゴリズムを処理する暗号演算回路装置900の構成例を示す説明図である。It is explanatory drawing which shows the structural example of the cryptographic operation circuit apparatus 900 which processes the conventional block cipher algorithm. 一般的なAESラウンド処理関数の最終ラウンド処理の説明図である。It is explanatory drawing of the last round process of a general AES round process function. 従来のマスク化対策を行ったAESラウンド処理の例を示す説明図である。It is explanatory drawing which shows the example of the AES round process which performed the conventional masking countermeasure.

以下、図面を参照して本発明に係る暗号演算回路装置の各実施形態について詳しく説明する。   Hereinafter, embodiments of a cryptographic operation circuit device according to the present invention will be described in detail with reference to the drawings.

(第1の実施形態)
図1は本実施形態に係る暗号演算回路装置100の構成例を示している。図1に示した暗号演算回路装置100は、従来技術で説明した図6の暗号演算回路装置900に対応し、AESに代表されるブロック暗号アルゴリズムについて、1クロックで1ラウンド処理を行う構成になっている。尚、図1の暗号演算回路装置100は、図6の鍵スケジューリング部902に相当する部分を含めずに攪拌部101と制御部150とで構成され、副鍵は外部から入力する構成になっているが、鍵スケジューリング部902と同じブロックを含めて暗号演算回路装置100としても構わない。
(First embodiment)
FIG. 1 shows a configuration example of a cryptographic operation circuit device 100 according to the present embodiment. The cryptographic operation circuit device 100 shown in FIG. 1 corresponds to the cryptographic operation circuit device 900 of FIG. 6 described in the prior art, and is configured to perform one round processing with one clock for a block encryption algorithm typified by AES. ing. 1 includes the agitation unit 101 and the control unit 150 without including a portion corresponding to the key scheduling unit 902 in FIG. 6, and the sub key is input from the outside. However, the same block as the key scheduling unit 902 may be included as the cryptographic operation circuit device 100.

図1において、攪拌部101は、外部から入力する平文(または暗号文)またはラウンド処理後のデータとを選択するセレクタ103と、所定の処理関数でラウンド処理を行う組合せ回路104と、乱数生成部105と、組合せ回路104の出力データまたは乱数生成部105が生成する乱数データとを選択するセレクタ106と、セレクタ106の出力データを一時的に保持するレジスタ107と、組合せ回路104の出力データまたは乱数生成部105が生成する乱数データとを選択するセレクタ108と、セレクタ108の出力データを一時的に保持するレジスタ109と、レジスタ109の出力データまたはAll=0(全て0のデータ)を選択して外部に出力するセレクタ110とで構成される。   In FIG. 1, a stirring unit 101 includes a selector 103 that selects plaintext (or ciphertext) input from the outside or data after round processing, a combinational circuit 104 that performs round processing with a predetermined processing function, and a random number generation unit. 105, a selector 106 that selects output data of the combinational circuit 104 or random number data generated by the random number generation unit 105, a register 107 that temporarily holds output data of the selector 106, and output data or random numbers of the combinational circuit 104 Select the selector 108 that selects the random number data generated by the generation unit 105, the register 109 that temporarily holds the output data of the selector 108, and the output data of the register 109 or All = 0 (all 0 data). It comprises a selector 110 that outputs to the outside.

また、制御部150は、乱数生成部105,レジスタ107およびレジスタ109にクロックを供給し、セレクタ103に制御信号1,セレクタ106に制御信号2,セレクタ108に制御信号3,セレクタ110に制御信号4をそれぞれ出力して攪拌部101の処理タイミングを制御する。尚、制御部150は、暗号演算回路装置100全体の動作を制御し、図6の鍵スケジューリング部902を含む場合は、図6の制御部905と同様に鍵スケジューリング部902に対してもクロックや制御信号を出力する。この場合、制御部150は鍵スケジューリング部902のセレクタ907に制御信号cを出力し、レジスタ908にクロックを供給する。   Further, the control unit 150 supplies a clock to the random number generation unit 105, the register 107, and the register 109, the control signal 1 to the selector 103, the control signal 2 to the selector 106, the control signal 3 to the selector 108, and the control signal 4 to the selector 110. Are respectively output to control the processing timing of the stirring unit 101. Note that the control unit 150 controls the overall operation of the cryptographic operation circuit device 100. When the key scheduling unit 902 of FIG. 6 is included, the control unit 150 also provides a clock and clock to the key scheduling unit 902 as in the control unit 905 of FIG. Output a control signal. In this case, the control unit 150 outputs a control signal c to the selector 907 of the key scheduling unit 902 and supplies a clock to the register 908.

図1の攪拌部101は、従来技術の図6の攪拌部901と同様に、平文(または暗号文)を処理対象データとして入力し、鍵スケジューリング部902などで秘密鍵から作成する副鍵(ラウンド鍵)を用いて所定回数のラウンド処理を行って暗号化し、暗号文(または平文)を処理済データとして出力する。   Similar to the agitation unit 901 of FIG. 6 of the prior art, the agitation unit 101 in FIG. 1 inputs plaintext (or ciphertext) as processing target data, and creates a subkey (round) created from the secret key by the key scheduling unit 902 or the like. The key is used for encryption by performing a predetermined number of round processes, and ciphertext (or plaintext) is output as processed data.

攪拌部101において、1ラウンド処理は1クロックで行われ、セレクタ103,組合せ回路104,セレクタ106およびレジスタ107を一巡する一連のラウンド処理をクロックに同期して所定回数だけ繰り返す。つまり、組合せ回路104のラウンド処理を基本とする攪拌部101では、鍵スケジューリング部102が出力する副鍵の値と1クロック前のラウンド処理の中間値とを用いて新たなラウンド処理を行い、その演算結果を新たな中間値としてレジスタ107に格納する処理を繰り返す。そして、クロック毎にラウンド処理関数の演算結果が中間値としてレジスタ107に保持され、必要なラウンド回数分だけクロックが進んだ後、最終ラウンドで組合せ回路104が出力するデータが最終演算結果となり、この値を暗号文(暗号化の場合)または平文(復号化の場合)としてセレクタ108を介してレジスタ109に保持され、セレクタ110を介して暗号演算回路装置100の外部に出力する。   In the agitation unit 101, one round process is performed in one clock, and a series of round processes that go around the selector 103, the combinational circuit 104, the selector 106, and the register 107 are repeated a predetermined number of times in synchronization with the clock. That is, the agitation unit 101 based on the round process of the combinational circuit 104 performs a new round process using the value of the sub key output from the key scheduling unit 102 and the intermediate value of the round process one clock before, The process of storing the operation result in the register 107 as a new intermediate value is repeated. Then, the calculation result of the round processing function is held as an intermediate value in the register 107 for each clock, and after the clock has advanced by the required number of rounds, the data output from the combinational circuit 104 in the final round becomes the final calculation result. The value is held in the register 109 via the selector 108 as ciphertext (in the case of encryption) or plaintext (in the case of decryption), and is output to the outside of the cryptographic operation circuit device 100 via the selector 110.

このように、途中のラウンド処理の演算中間値などはレジスタ107に格納され、最終ラウンドの最終結果のみレジスタ109に格納されて外部に出力される。   In this way, the intermediate value of the intermediate round process is stored in the register 107, and only the final result of the final round is stored in the register 109 and output to the outside.

ここで、図1において、外部からの入力データ(平文or暗号文)またはラウンド処理関数の中間値を保持したレジスタ107の出力データを選択するセレクタ103の制御信号1と、レジスタ109に保持された出力データまたは固定値(本実施例ではall=0)をセレクタ110の制御信号4とは、図6の攪拌部901のセレクタ903の制御信号aおよびセレクタ906の制御信号bにそれぞれ対応する。   Here, in FIG. 1, the control signal 1 of the selector 103 for selecting the input data from the outside (plaintext or ciphertext) or the output data of the register 107 holding the intermediate value of the round processing function, and the register 109 The output data or the fixed value (all = 0 in this embodiment) and the control signal 4 of the selector 110 correspond to the control signal a of the selector 903 and the control signal b of the selector 906 of the stirring unit 901 in FIG.

尚、本実施形態では、ラウンド処理の演算結果(出力データ)または乱数生成部105が生成する乱数値(乱数データ)を保持するためのレジスタとして、ラウンド処理の中間値を保持するレジスタ107および演算最終結果の最終値を保持するレジスタ109の2系統のレジスタを備えている。ここで、制御信号2はラウンド処理関数の演算結果と乱数生成部105で生成された乱数値のどちらをレジスタ107に格納するかを選択する制御信号であり、制御信号3はラウンド処理関数の演算結果と乱数生成部105で生成された乱数値のどちらをレジスタ109に格納するか選択する制御信号である。   In the present embodiment, the register 107 that holds the intermediate value of the round process and the calculation as a register for holding the calculation result (output data) of the round process or the random value (random number data) generated by the random number generation unit 105 Two systems of registers 109 are provided for holding the final value of the final result. Here, the control signal 2 is a control signal for selecting whether to store the round processing function calculation result or the random value generated by the random number generation unit 105 in the register 107, and the control signal 3 is the round processing function calculation. This is a control signal for selecting which of the result and the random number value generated by the random number generation unit 105 is stored in the register 109.

次に、図1の暗号演算回路装置100の動作について図2のタイミングチャートを用いて詳しく説明する。図2は、制御部150が出力するクロックと、制御信号1と、制御信号2と、制御信号3と、制御信号4と、レジスタ107と、レジスタ109との処理タイミングの関係を描いたタイミングチャートである。尚、図2において、初期ラウンドから最終ラウンドまでの(n+1)回の全ラウンドを1ブロック演算とし、1ブロック演算毎に処理結果の暗号文(or平文)が外部に出力される。また、図1の組合せ回路104によるラウンド処理関数は1クロック周期毎に実行され、レジスタ107およびレジスタ109は1クロック周期で各レジスタへの入力データを保持する。   Next, the operation of the cryptographic operation circuit device 100 of FIG. 1 will be described in detail with reference to the timing chart of FIG. FIG. 2 is a timing chart illustrating a relationship among processing timings of the clock output from the control unit 150, the control signal 1, the control signal 2, the control signal 3, the control signal 4, the register 107, and the register 109. It is. In FIG. 2, all (n + 1) rounds from the initial round to the final round are defined as one block calculation, and a ciphertext (or plaintext) as a processing result is output to the outside for each block calculation. Further, the round processing function by the combinational circuit 104 in FIG. 1 is executed every clock cycle, and the register 107 and the register 109 hold the input data to each register in one clock cycle.

図2において、タイミングtからtn+2はクロック周期毎のタイミングを示し、dからdは組合せ回路104によるラウンド処理関数の各ラウンド毎の出力データを示している。例えばdは初期ラウンド処理関数の結果の値、dは第1ラウンド処理関数の結果の値、dは最終ラウンド処理関数の結果の値をそれぞれ示している。また、rおよびr’は乱数生成部105が1ブロック演算周期毎の更新頻度で生成する乱数を示しており、乱数rと乱数r’は異なる乱数値である。尚、図1において、乱数発生部105にも制御部150からクロックが入力されているが、図2のフローチャートでは、乱数発生部105は最終ラウンド毎に新たな乱数を発生するものとして説明する。この場合は、乱数発生部105の内部に1ブロック分のクロックをカウントするカウンタを設けることで実現できる。或いは、乱数発生部105の消費電力は少し大きくなるが、単純にクロック周期毎に乱数を発生するようにしても構わない。この場合は、各ラウンド毎に乱数発生部105が発生する乱数rの値が異なるだけで、本実施形態の効果は変わらない。 In FIG. 2, t n + 2 from the timing t 0 represents the timing of each clock period, d n from d 0 represents the output data for each round of the round processing function by the combination circuit 104. For example d 0 indicates the results of the values of the initial round processing function, d 1 the value of the result of the first round processing function, d n is the resulting value of the final round processing functions, respectively. Further, r and r ′ represent random numbers generated by the random number generation unit 105 at an update frequency for each block calculation cycle, and the random number r and the random number r ′ are different random values. In FIG. 1, the clock is also input from the control unit 150 to the random number generation unit 105. However, in the flowchart of FIG. 2, the random number generation unit 105 will be described as generating a new random number every final round. This case can be realized by providing a counter that counts one block of clocks inside the random number generator 105. Alternatively, although the power consumption of the random number generation unit 105 is slightly increased, a random number may be simply generated every clock cycle. In this case, only the value of the random number r generated by the random number generator 105 is different for each round, and the effect of this embodiment is not changed.

図2において、先ずタイミングtで1ブロック周期の暗号演算に先立って制御信号2がHighに制御され、乱数生成部105で生成された例えば128ビットの乱数rがレジスタ107に格納される。この間、制御信号1はLowに制御され、タイミングtで制御信号2がLowに制御され、外部から入力された平文(or暗号文)が初期ラウンド処理されてレジスタ107に格納される。タイミングtから最終ラウンドを処理するタイミングtn+1まで制御信号1はHighに制御され、各ラウンド処理毎に組合せ回路104の出力データが更新されてレジスタ107に保持される。この間、第(n−1)ラウンドを処理するタイミングtまでの間、制御信号3はHighに制御されて128ビットの乱数がレジスタ109に格納される。最終ラウンドを処理するタイミングtn+1では、制御信号2がHighに制御されて128ビットの乱数がレジスタ107に格納される。これと同時に、制御信号3がLowに制御されて最終ラウンドの処理結果がレジスタ109に格納される。制御信号4は最終ラウンド処理の確定時のみLowに制御されて演算結果がセレクタ110を介して外部に出力される。制御信号4は、最終ラウンド処理の確定時以外のタイミングではHighに制御されて固定値(例えばall=0)がセレクタ110を介して外部に出力される。タイミングtn+2では制御信号1が再びLowに制御され、先のタイミングtと同様に、次に外部から入力されるブロックの平文(or暗号文)に対して初期ラウンドの処理から最終ラウンドの処理までの1ブロックの暗号化演算が繰り返される。 In FIG. 2, first, at timing t 0 , the control signal 2 is controlled to be High prior to the cryptographic operation for one block period, and for example, a 128-bit random number r generated by the random number generation unit 105 is stored in the register 107. During this time, the control signal 1 is controlled to Low, the control signal 2 is controlled to Low at timing t 1 , and plain text (or cipher text) input from the outside is subjected to initial round processing and stored in the register 107. The control signal 1 is controlled to High from timing t 2 to timing t n + 1 for processing the final round, and the output data of the combinational circuit 104 is updated and held in the register 107 for each round processing. During this time, the control signal 3 is controlled to High until the timing t n at which the (n−1) -th round is processed, and a 128-bit random number is stored in the register 109. At timing t n + 1 for processing the final round, the control signal 2 is controlled to be High, and a 128-bit random number is stored in the register 107. At the same time, the control signal 3 is controlled to be Low, and the processing result of the last round is stored in the register 109. The control signal 4 is controlled to Low only when the final round process is confirmed, and the calculation result is output to the outside via the selector 110. The control signal 4 is controlled to High at a timing other than when the final round process is finalized, and a fixed value (for example, all = 0) is output to the outside via the selector 110. Timing t n + 2 in the control signal 1 is controlled again Low, similarly to the previous time t 1, then the processing from the processing of the initial round of the final round the plaintext block which is input from outside (or ciphertext) The one block encryption operation up to is repeated.

ここで、本実施形態に係る暗号演算回路装置100において、CPA攻撃のターゲットとなる初期ラウンドおよび最終ラウンドの処理に着目する。先ず、タイミングtの初期ラウンド処理においては、レジスタ107の値が乱数rからラウンド処理関数の出力データdに変化する。この時、乱数rの値はブロック演算毎に異なるので、レジスタ107の値の変化量(ハミング距離)を推定することはできない。次に、タイミングtn+1の最終ラウンドにおいては、レジスタ107の値が出力データdn−1から乱数r’に変化し、同時にレジスタ109の値が乱数rから出力データdに変化する。ここで、r’は更新された乱数値である。最終ラウンドにおいても、乱数rの影響によりレジスタ109の値の変化量(ハミング距離)を推定することができない。 Here, in the cryptographic operation circuit device 100 according to the present embodiment, attention is paid to the processing of the initial round and the final round that are targets of the CPA attack. First, in the initial round process at timing t 1 , the value of the register 107 changes from the random number r to the output data d 0 of the round process function. At this time, since the value of the random number r is different for each block operation, the amount of change (hamming distance) in the value of the register 107 cannot be estimated. Then, in the final round of the timing t n + 1, the value of the register 107 is changed to the random number r 'from the output data d n-1, the value of the register 109 are simultaneously changed to the output data d n from a random number r. Here, r ′ is an updated random number value. Even in the final round, the amount of change (hamming distance) in the register 109 cannot be estimated due to the influence of the random number r.

このように、本実施形態に係る暗号演算回路装置100は、副鍵を仮定して各レジスタにおけるハミング距離を逆算することができなくなり、副鍵と消費電力との相関を無くすことができる。この結果、マスク化処理などを施していない従来のラウンド処理関数をそのまま利用することができ、従来技術のようにラウンド処理関数全体を乱数によってマスク化するためのEXOR回路や予備回路の追加が不要となる。特に図1に示した本実施形態に係る暗号演算回路装置100の場合は、乱数生成部(従来のマスク化にも必要)に加え、1つのレジスタおよび2つのセレクタを追加するだけでハミング距離の計算を困難にすることができ、ゲート規模の増大と消費電力の増大を回避しつつCPA攻撃を防御することが可能となる。   As described above, the cryptographic operation circuit device 100 according to the present embodiment cannot calculate the Hamming distance in each register by assuming the subkey, and can eliminate the correlation between the subkey and the power consumption. As a result, a conventional round processing function that is not subjected to masking processing can be used as it is, and there is no need to add an EXOR circuit or a spare circuit for masking the entire round processing function with random numbers as in the prior art. It becomes. In particular, in the case of the cryptographic operation circuit device 100 according to the present embodiment shown in FIG. 1, in addition to the random number generator (also necessary for conventional masking), the Hamming distance can be reduced by adding only one register and two selectors. Calculations can be made difficult, and it is possible to prevent CPA attacks while avoiding an increase in gate size and power consumption.

(第2の実施形態)
次に、第2の実施形態に係る暗号演算回路装置200について説明する。図3は暗号演算回路装置200の構成例を示している。図3に示した暗号演算回路装置200は、従来技術で説明した暗号演算回路装置900および第1の実施形態に係る暗号演算回路装置100と同様にAESに代表されるブロック暗号アルゴリズムに対応し、1クロックで1ラウンド処理を行う構成になっている。尚、図3の暗号演算回路装置200は、図6の鍵スケジューリング部902に相当する部分を含めずに攪拌部201と制御部250とで構成され、副鍵は外部から入力する構成になっているが、鍵スケジューリング部902と同じブロックを含めて暗号演算回路装置200としても構わない。
(Second Embodiment)
Next, a cryptographic operation circuit device 200 according to the second embodiment will be described. FIG. 3 shows a configuration example of the cryptographic operation circuit device 200. The cryptographic operation circuit device 200 shown in FIG. 3 corresponds to a block encryption algorithm typified by AES, similar to the cryptographic operation circuit device 900 described in the prior art and the cryptographic operation circuit device 100 according to the first embodiment, It is configured to perform one round process with one clock. 3 includes the agitation unit 201 and the control unit 250 without including the portion corresponding to the key scheduling unit 902 in FIG. 6, and the sub key is input from the outside. However, the same block as the key scheduling unit 902 may be included in the cryptographic operation circuit device 200.

第1の実施形態では乱数によるレジスタ値の変化量(ハミング距離)の算出を回避する対策を初期ラウンドと最終ラウンドに限定して行うようにしたが、第2の実施形態では初期ラウンドと最終ラウンドだけでなく中間ラウンドを含む全てのラウンドにおいてレジスタ値の変化量(ハミング距離)の算出を回避することを目的としている。   In the first embodiment, the countermeasure for avoiding the calculation of the change amount (hamming distance) of the register value due to the random number is limited to the initial round and the final round. In the second embodiment, the initial round and the final round are performed. It is intended to avoid calculation of register value change amount (Humming distance) in all rounds including not only the intermediate round.

以下、図3を用いて第2の実施形態に係る暗号演算回路装置200について詳しく説明する。図3において、攪拌部201は、外部から入力する平文(または暗号文)またはラウンド処理後のデータとを選択するセレクタ203と、所定の処理関数でラウンド処理を行う組合せ回路204と、乱数生成部205と、組合せ回路204の出力データまたは乱数生成部205が生成する乱数データとを選択するセレクタ206と、セレクタ206の出力データを一時的に保持するレジスタ207と、組合せ回路204の出力データまたは乱数生成部205が生成する乱数データとを選択するセレクタ208と、セレクタ208の出力データを一時的に保持するレジスタ209と、レジスタ207の出力データまたはレジスタ209の出力データを選択するセレクタ211と、セレクタ211の出力データまたはAll=0(全て0のデータ)を選択して外部に出力するセレクタ210とで構成される。ここで、第1の実施形態の図1の攪拌部101は組合せ回路104および乱数生成部105以外に2つのレジスタと4つのセレクタで構成されていたのに対して、第2の実施形態の図3の攪拌部201は組合せ回路204および乱数生成部205以外に2つのレジスタと5つのセレクタで構成される点が異なる。特にレジスタ207とレジスタ209の出力データを交互に選択するセレクタ211を設けた点に特徴がある。   Hereinafter, the cryptographic operation circuit device 200 according to the second embodiment will be described in detail with reference to FIG. In FIG. 3, the agitation unit 201 includes a selector 203 that selects plaintext (or ciphertext) input from the outside or data after round processing, a combinational circuit 204 that performs round processing with a predetermined processing function, and a random number generation unit. 205, a selector 206 that selects output data of the combination circuit 204 or random number data generated by the random number generation unit 205, a register 207 that temporarily holds output data of the selector 206, and output data or random numbers of the combination circuit 204 A selector 208 that selects random number data generated by the generation unit 205, a register 209 that temporarily holds output data of the selector 208, a selector 211 that selects output data of the register 207 or output data of the register 209, and a selector 211 output data or All = 0 (all 0 data Composed of a selector 210 to be output to the outside select. Here, the agitation unit 101 of FIG. 1 of the first embodiment is configured by two registers and four selectors in addition to the combinational circuit 104 and the random number generation unit 105, whereas the diagram of the second embodiment. The third stirring unit 201 is different from the combination circuit 204 and the random number generation unit 205 in that it includes two registers and five selectors. In particular, there is a feature in that a selector 211 that alternately selects output data of the register 207 and the register 209 is provided.

また、制御部250は、第1の実施形態の制御部150と同様に、乱数生成部205,レジスタ207およびレジスタ209にクロックを供給し、セレクタ203に制御信号21,セレクタ206に制御信号22,セレクタ208に制御信号23,セレクタ210に制御信号24,セレクタ210に制御信号25をそれぞれ出力して攪拌部201の処理タイミングを制御する。ここで、図1の制御信号1と図2の制御信号21および図1の制御信号4と図2の制御信号24はそれぞれ同じ処理タイミングで動作するが、その他の制御信号の処理タイミングは異なる。尚、各処理タイミングについては後で詳しく説明する。さらに、制御部250は、暗号演算回路装置200全体の動作を制御し、図6の鍵スケジューリング部902を含む場合は、図6の制御部905と同様に鍵スケジューリング部902に対してもクロックや制御信号を出力する。この場合、制御部250は鍵スケジューリング部902のセレクタ907に制御信号cを出力し、レジスタ908にクロックを供給する。   Further, the control unit 250 supplies a clock to the random number generation unit 205, the register 207, and the register 209 as in the control unit 150 of the first embodiment, the control signal 21 to the selector 203, the control signal 22 to the selector 206, The control signal 23 is output to the selector 208, the control signal 24 is output to the selector 210, and the control signal 25 is output to the selector 210 to control the processing timing of the stirring unit 201. Here, the control signal 1 in FIG. 1 and the control signal 21 in FIG. 2 and the control signal 4 in FIG. 1 and the control signal 24 in FIG. 2 operate at the same processing timing, but the processing timings of the other control signals are different. Each processing timing will be described in detail later. Furthermore, the control unit 250 controls the overall operation of the cryptographic operation circuit device 200. When the control unit 250 includes the key scheduling unit 902 in FIG. Output a control signal. In this case, the control unit 250 outputs a control signal c to the selector 907 of the key scheduling unit 902 and supplies a clock to the register 908.

図3の攪拌部201は、従来技術の図6の攪拌部901と同様に、平文(または暗号文)を処理対象データとして入力し、鍵スケジューリング部902などで秘密鍵から作成する副鍵(ラウンド鍵)を用いて所定回数のラウンド処理を行って暗号化し、暗号文(または平文)を処理済データとして出力する。   Similar to the agitation unit 901 of FIG. 6 of the prior art, the agitation unit 201 in FIG. 3 inputs plaintext (or ciphertext) as processing target data, and creates a subkey (round) created from the secret key by the key scheduling unit 902 or the like. The key is used for encryption by performing a predetermined number of round processes, and ciphertext (or plaintext) is output as processed data.

攪拌部201において、1ラウンド処理は1クロックで行われ、セレクタ203から組合せ回路204,セレクタ206またはセレクタ208,レジスタ207またはレジスタ209,セレクタ211までを一巡する一連のラウンド処理をクロックに同期して所定回数だけ繰り返す。つまり、組合せ回路204のラウンド処理を基本とする攪拌部201では、鍵スケジューリング部902などから入力する副鍵の値と1クロック前のラウンド処理の中間値とを用いて新たなラウンド処理を行い、その演算結果を新たな中間値としてレジスタ207またはレジスタ209に格納する処理を繰り返す。そして、必要なラウンド回数分だけクロックが進んだ後、最終ラウンドで組合せ回路204が出力するデータを格納するレジスタ207またはレジスタ209の値がセレクタ211で最終演算結果として選択され、この値を暗号文(暗号化の場合)または平文(復号化の場合)としてセレクタ210を介して暗号演算回路装置200の外部に出力される。   In the agitation unit 201, one round process is performed in one clock, and a series of round processes from the selector 203 to the combinational circuit 204, the selector 206 or the selector 208, the register 207 or the register 209, and the selector 211 are synchronized with the clock. Repeat a predetermined number of times. That is, the agitation unit 201 based on the round process of the combinational circuit 204 performs a new round process using the value of the sub key input from the key scheduling unit 902 or the like and the intermediate value of the round process one clock before, The process of storing the calculation result as a new intermediate value in the register 207 or the register 209 is repeated. Then, after the clock has advanced by the required number of rounds, the value of the register 207 or the register 209 storing the data output from the combinational circuit 204 in the final round is selected by the selector 211 as the final calculation result, and this value is encrypted. The data is output to the outside of the cryptographic operation circuit device 200 via the selector 210 as (encryption) or plaintext (decryption).

ここで、本実施形態では、ラウンド処理の演算結果(出力データ)または乱数生成部205が生成する乱数値(乱数データ)を保持するためのレジスタとして、ラウンド処理の中間値を保持するレジスタ207およびレジスタ209の2系統のレジスタを備えている。制御信号22および制御信号23はラウンド処理関数の演算結果と乱数生成部205で生成された乱数値のいずれかを交互にレジスタ207またはレジスタ209に格納するための制御信号であり、制御信号25はレジスタ207またはレジスタ209のいずれかに格納されたラウンド処理関数の演算結果を選択する制御信号である。   Here, in the present embodiment, as a register for holding a calculation result (output data) of the round process or a random value (random number data) generated by the random number generation unit 205, a register 207 that holds an intermediate value of the round process and Two systems of registers 209 are provided. The control signal 22 and the control signal 23 are control signals for alternately storing either the calculation result of the round processing function or the random value generated by the random number generation unit 205 in the register 207 or the register 209. The control signal 25 is This is a control signal for selecting the calculation result of the round processing function stored in either the register 207 or the register 209.

次に、図3の暗号演算回路装置200の動作について図4のタイミングチャートを用いて詳しく説明する。図3は、制御部250が出力するクロックと、制御信号21と、制御信号22と、制御信号23と、制御信号24と、制御信号25と、レジスタ207と、レジスタ209との処理タイミングの関係を描いたタイミングチャートである。尚、図4において、初期ラウンドから最終ラウンドまでの(n+1)回の全ラウンドを1ブロック演算とし、1ブロック演算毎に処理結果の暗号文(or平文)が外部に出力される。また、図3の組合せ回路204によるラウンド処理関数は1クロック周期毎に実行され、レジスタ207およびレジスタ209は1クロック周期で各レジスタへの入力データを保持する。   Next, the operation of the cryptographic operation circuit device 200 of FIG. 3 will be described in detail with reference to the timing chart of FIG. FIG. 3 shows the relationship between the clock output from the control unit 250, the control signal 21, the control signal 22, the control signal 23, the control signal 24, the control signal 25, the register 207, and the register 209. It is a timing chart which drew. In FIG. 4, (n + 1) rounds from the initial round to the final round are defined as one block calculation, and the ciphertext (or plaintext) as a processing result is output to the outside for each block calculation. Further, the round processing function by the combinational circuit 204 in FIG. 3 is executed every clock cycle, and the register 207 and the register 209 hold the input data to each register in one clock cycle.

図4において、第1の実施形態の図2と同様に、タイミングtからtn+2はクロック周期毎のタイミングを示し、dからdは組合せ回路204によるラウンド処理関数の各ラウンド毎の出力データを示している。例えばdは初期ラウンド処理関数の結果の値、dは第1ラウンド処理関数の結果の値、dは最終ラウンド処理関数の結果の値をそれぞれ示している。また、rおよびr’は乱数生成部105が1ブロック演算周期毎の更新頻度で生成する乱数を示しており、乱数rと乱数r’は異なる乱数値である。尚、図3の乱数発生部205は、第1の実施形態の図1の乱数発生部105と同様に、制御部250からクロックが入力されているが、図4のフローチャートでは乱数発生部205は最終ラウンドの処理タイミング毎に新たな乱数を発生するものとして説明する。但し、乱数発生部105で説明したように、乱数発生部205は単純にクロック周期毎に乱数を発生するようにしても構わない。この場合は、各ラウンド毎にレジスタ207またはレジスタ209に格納される乱数rの値が異なるだけで、本実施形態の効果は変わらない。 4, similarly to FIG. 2 of the first embodiment, t n + 2 from the timing t 0 represents the timing of each clock period, d 0 from d n is the output of each round of the round processing function by the combination circuit 204 Data are shown. For example d 0 indicates the results of the values of the initial round processing function, d 1 the value of the result of the first round processing function, d n is the resulting value of the final round processing functions, respectively. Further, r and r ′ represent random numbers generated by the random number generation unit 105 at an update frequency for each block calculation cycle, and the random number r and the random number r ′ are different random values. The random number generation unit 205 in FIG. 3 receives a clock from the control unit 250 in the same manner as the random number generation unit 105 in FIG. 1 of the first embodiment, but in the flowchart in FIG. A description will be given assuming that a new random number is generated at each processing timing of the final round. However, as described in the random number generation unit 105, the random number generation unit 205 may simply generate a random number every clock cycle. In this case, only the value of the random number r stored in the register 207 or the register 209 is different for each round, and the effect of this embodiment is not changed.

図4において、先ずタイミングtで1ブロック周期の暗号演算に先立って制御信号22がHighに制御され、乱数生成部205で生成された例えば128ビットの乱数rがレジスタ207に格納される。この間、制御信号21はLowに制御され、タイミングtで制御信号2がLowに制御され、外部から入力された平文(or暗号文)が初期ラウンド処理されてレジスタ207に格納される。 In FIG. 4, at timing t 0 , the control signal 22 is controlled to be High prior to the cryptographic operation for one block period, and a 128-bit random number r generated by the random number generation unit 205 is stored in the register 207. During this time, the control signal 21 is controlled to Low, the control signal 2 is controlled to Low at timing t 1 , and the plaintext (or ciphertext) input from the outside is subjected to initial round processing and stored in the register 207.

一方、タイミングtで制御信号23はHighに制御され128ビットの乱数rがレジスタ209に格納される。制御信号25は、タイミングtまでLowに制御され、レジスタ207に格納された初期ラウンドの演算結果dが第1ラウンドの入力データとしてラウンド処理関数(組合せ回路204)に入力される。 On the other hand, at timing t 1 , the control signal 23 is controlled to be High, and a 128-bit random number r is stored in the register 209. The control signal 25 is controlled to Low until timing t 2 , and the initial round operation result d 0 stored in the register 207 is input to the round processing function (combination circuit 204) as first round input data.

次のタイミングtでは制御信号22がHigh,制御信号23がLowにそれぞれ制御され、レジスタ207には128ビット乱数rが、またレジスタ209には第1ラウンドの演算結果dが格納され、タイミングtでは制御信号25がHighに制御され、レジスタ209に格納されたラウンド処理関数の演算結果dが第2ラウンドの入力データとしてラウンド処理関数に入力される。 Next timing t 2 the control signal 22 is High, the control signal 23 is controlled to Low, 128-bit random number r in the register 207, also calculation result d 1 of the first round is stored in the register 209, the timing At t 3 , the control signal 25 is controlled to High, and the operation result d 1 of the round processing function stored in the register 209 is input to the round processing function as second round input data.

タイミングtでは、制御信号22および制御信号23が1つ前のクロック周期(3クロック目)とはそれぞれ逆相に制御され、レジスタ207には第1ラウンドの演算結果dが、またレジスタ209には128ビット乱数rが格納される。タイミングtでは、制御信号25がLowに制御されレジスタ207に格納されたラウンド処理関数の演算結果dが第3ラウンドの入力データとしてラウンド処理関数に入力される。同様の動作を最終ラウンドまで繰り返す。 At timing t 4 , the control signal 22 and the control signal 23 are controlled to have opposite phases to the previous clock cycle (third clock), the first round operation result d 2 is stored in the register 207, and the register 209 is also registered. Stores a 128-bit random number r. At timing t 4 , the control signal 25 is controlled to be Low, and the operation result d 2 of the round processing function stored in the register 207 is input to the round processing function as third round input data. The same operation is repeated until the final round.

最終ラウンドでは、ラウンド処理の総数に応じてレジスタ207またはレジスタ209のいずれかにラウンド処理関数の最終演算結果(暗号文または平文)が格納されており、制御信号24をLowに制御することにより最終演算結果の値が暗号演算回路装置200の外部に出力される。   In the final round, the final calculation result (ciphertext or plaintext) of the round processing function is stored in either the register 207 or the register 209 according to the total number of round processing, and the final round is obtained by controlling the control signal 24 to Low. The value of the operation result is output to the outside of the cryptographic operation circuit device 200.

そして、次のブロック演算では、前のブロックの最終演算結果が格納されたレジスタ207またはレジスタ209のいずれかのレジスタとは異なる他方のレジスタへ初期ラウンドの演算結果が格納される。図4の場合はレジスタ209に次のブロック演算の初期ラウンドの演算結果d’が格納され、レジスタ207には乱数発生部205が制御信号24のタイミングで新たに発生した乱数r’が格納される。 In the next block operation, the operation result of the initial round is stored in the other register different from the register 207 or the register 209 in which the final operation result of the previous block is stored. In the case of FIG. 4, the operation result d 0 ′ of the initial round of the next block operation is stored in the register 209, and the random number r ′ newly generated by the random number generation unit 205 at the timing of the control signal 24 is stored in the register 207. The

このように1クロック毎に制御信号22および制御信号23を交互に反転することにより、またレジスタ207またはレジスタ209に交互に格納されるラウンド処理関数の演算結果を制御信号25によって交互に選択することにより、レジスタ207またはレジスタ209にはラウンド処理関数の演算結果d(iは整数)と乱数発生部205が発生する乱数rとが交互に格納される。 In this way, the control signal 22 and the control signal 23 are alternately inverted every clock, and the operation result of the round processing function alternately stored in the register 207 or the register 209 is alternately selected by the control signal 25. Thus, the operation result d i (i is an integer) of the round processing function and the random number r generated by the random number generation unit 205 are alternately stored in the register 207 or the register 209.

ここで、レジスタ207またはレジスタ209において、各々のレジスタに格納される値が乱数−>ラウンド処理関数の演算結果−>乱数−>ラウンド処理関数の演算結果−>乱数−>・・・というように、乱数が必ず隔クロック毎に格納されるので、どのクロックタイミングにおいても各レジスタの値の変化量(ハミング距離)をランダム化することができる。この結果、全てのクロック(全てのラウンド処理)において、クロック前後のレジスタ207およびレジスタ209に格納される値のハミング距離がr(+)dとなる(ここで(+)はEXOR演算を示す)ので、副鍵を仮定して各レジスタに格納される値のハミング距離を逆算することができなくなる。さらに、乱数は暗号化対象であるデータ単位を処理するブロック演算周期で新しい値に更新されるため、副鍵と消費電力との相関を無くすことができる。尚、先に説明したように、乱数をクロック周期または複数のクロック単位で発生させても構わないが、少なくともブロック演算周期毎に乱数を更新する必要がある。 Here, in the register 207 or the register 209, the value stored in each register is a random number → the operation result of the round processing function → the random number → the operation result of the round processing function → the random number →. Since the random number is always stored every other clock, the amount of change (Hamming distance) of the value of each register can be randomized at any clock timing. As a result, in all clocks (all round processes), the Hamming distances of the values stored in the registers 207 and 209 before and after the clock are r (+) d i (where (+) indicates an EXOR operation). Therefore, it is impossible to reversely calculate the Hamming distance of the value stored in each register assuming the sub key. Furthermore, since the random number is updated to a new value in the block calculation cycle for processing the data unit to be encrypted, the correlation between the sub key and the power consumption can be eliminated. As described above, the random number may be generated in a clock cycle or a plurality of clock units, but it is necessary to update the random number at least every block calculation cycle.

このように、本実施形態に係る暗号演算回路装置200は、マスク化処理などを施していない従来のラウンド処理関数をそのまま利用することができ、従来技術のようにラウンド処理関数全体を乱数によってマスク化するためのEXOR回路や予備回路の追加が不要となる。特に図3に示した本実施形態に係る暗号演算回路装置200の場合は、乱数生成部(従来のマスク化にも必要)に加え、1つのレジスタおよび3つのセレクタを追加するだけでハミング距離の計算を困難にすることができ、ゲート規模の増大と消費電力の増大を回避しつつCPA攻撃を防御することが可能となる。   As described above, the cryptographic operation circuit device 200 according to the present embodiment can use a conventional round processing function that is not subjected to masking processing as it is, and masks the entire round processing function with a random number as in the conventional technique. Therefore, it is not necessary to add an EXOR circuit or a spare circuit. In particular, in the case of the cryptographic operation circuit device 200 according to the present embodiment shown in FIG. 3, in addition to the random number generator (also necessary for conventional masking), the Hamming distance can be reduced by adding only one register and three selectors. Calculations can be made difficult, and it is possible to prevent CPA attacks while avoiding an increase in gate size and power consumption.

(第3の実施形態)
次に、第3の実施形態に係る暗号演算回路装置300について説明する。第1の実施形態に係る暗号演算回路装置100および第2の実施形態に係る暗号演算回路装置200では、AESに代表されるブロック暗号アルゴリズムに適用した場合の例を示したが、公開鍵暗号アルゴリズムにおいて冪乗剰余演算や楕円スカラー倍演算を実行する暗号モジュールに対しても、レジスタがパイプライン構成を取るハードウェア実装を行う場合には、先に示したブロック暗号アルゴリズムの場合と同様に本発明を適用することができる。以下、本実施形態では、このような公開鍵暗号アルゴリズムの演算で利用される冪乗剰余演算や楕円スカラー倍演算に本発明を適用した場合の例を示す。
(Third embodiment)
Next, a cryptographic operation circuit device 300 according to the third embodiment will be described. In the cryptographic operation circuit device 100 according to the first embodiment and the cryptographic operation circuit device 200 according to the second embodiment, an example in the case of application to a block encryption algorithm typified by AES has been shown. In the case of implementing a hardware implementation in which a register has a pipeline configuration for a cryptographic module that performs a power-residue operation and an elliptic scalar multiplication operation in FIG. Can be applied. Hereinafter, in the present embodiment, an example in which the present invention is applied to the power-residue calculation and the elliptic scalar multiplication used in the calculation of such a public key encryption algorithm will be described.

図5は、第3の実施形態に係る暗号演算回路装置300の構成図である。図5において、暗号演算回路装置300は、攪拌部301と、制御部350とで構成される。尚、図5の暗号演算回路装置300の攪拌部301の基本構成は、組合せ回路304を除いて、第2の実施形態で示した図3の攪拌部201と同じである。図3の攪拌部201では、組合せ回路204は鍵スケジューリング部902が生成する副鍵に基づいてブロック暗号アルゴリズムのラウンド処理関数を実行する回路であったが、本実施形態の図5の組合せ回路304は指数展開部302の出力値に基づいて冪乗剰余演算または楕円スカラー倍演算を行う回路で構成される。尚、冪乗剰余演算または楕円スカラー倍演算については周知の演算であるので詳細な説明は省略する。また、攪拌部301の処理タイミングについても第2の実施形態で説明した図4のタイミングチャートと全く同じなので重複する説明は省略する。   FIG. 5 is a configuration diagram of the cryptographic operation circuit device 300 according to the third embodiment. In FIG. 5, the cryptographic operation circuit device 300 includes a stirring unit 301 and a control unit 350. The basic configuration of the agitation unit 301 of the cryptographic operation circuit device 300 of FIG. 5 is the same as that of the agitation unit 201 of FIG. 3 shown in the second embodiment except for the combinational circuit 304. In the agitation unit 201 in FIG. 3, the combinational circuit 204 is a circuit that executes the round processing function of the block cipher algorithm based on the subkey generated by the key scheduling unit 902. However, the combinational circuit 304 in FIG. Is constituted by a circuit that performs a power residue calculation or an elliptic scalar multiplication operation based on the output value of the exponent expansion unit 302. The power-residue calculation or the elliptic scalar multiplication is a well-known calculation, and a detailed description thereof will be omitted. Further, the processing timing of the agitation unit 301 is also exactly the same as the timing chart of FIG. 4 described in the second embodiment, and a duplicate description is omitted.

図5において、指数展開部302では、秘密鍵である指数の値を例えばバイナリ値に展開し、展開したバイナリ値の上位ビットまたは下位ビットから順に、冪乗剰余演算の場合は乗算または自乗算を、楕円スカラー倍演算の場合は楕円加算または楕円2倍算を実行する。そして、図3の攪拌部201と同様に、組合せ回路304での処理関数の演算結果は中間値としてレジスタ207またはレジスタ209に交互に格納される。この時、演算結果が格納されない他方のレジスタには乱数発生部205が生成する乱数が格納される。   In FIG. 5, the exponent expansion unit 302 expands the value of the exponent that is a secret key into, for example, a binary value, and performs multiplication or self-multiplication in the case of a power-residue operation in order from the upper or lower bits of the expanded binary value. In the case of elliptic scalar multiplication, ellipse addition or elliptic doubling is executed. Similar to the stirring unit 201 of FIG. 3, the calculation result of the processing function in the combinational circuit 304 is alternately stored in the register 207 or the register 209 as an intermediate value. At this time, the random number generated by the random number generation unit 205 is stored in the other register in which the operation result is not stored.

図5の第3の実施形態に係る暗号演算回路装置300のタイミングチャートは図4で説明した第2の実施形態の場合と同様であるが、例えば左バイナリ法の場合、図4において第1ラウンド,第2ラウンド,・・・,初期ラウンドの各処理は、バイナリ展開した指数の最上位ビット,(最上位−1)ビット,・・・,最下位ビットの各処理にそれぞれ対応する。また、乱数生成部205が生成する乱数は、冪乗剰余演算または楕円スカラ一倍演算のトリガーがかかる度に新しい値に更新される。   The timing chart of the cryptographic operation circuit device 300 according to the third embodiment of FIG. 5 is the same as that of the second embodiment described with reference to FIG. 4, but for example, in the case of the left binary method, the first round in FIG. , The second round,..., And the initial round correspond to the most significant bit, the (most significant −1) bit,. In addition, the random number generated by the random number generation unit 205 is updated to a new value every time a power-residue calculation or elliptic scalar single calculation is triggered.

ここで、冪乗剰余演算や楕円スカラー倍演算に対するCPA攻撃は、最上位ビットから最下位ビットに至る各処理において、順番にビット単位で解析を行う攻撃法が用いられるため、本実施形態のようにビット単位で交互にレジスタ207またはレジスタ209に乱数を格納する方法は、ハミング距離の計算を回避する上で非常に有効である。   Here, the CPA attack for the power-residue operation and the elliptic scalar multiplication operation uses an attack method in which analysis is performed in units of bits in order in each process from the most significant bit to the least significant bit. The method of storing random numbers in the register 207 or the register 209 alternately in bit units is very effective in avoiding the calculation of the Hamming distance.

このように、本実施形態に係る暗号演算回路装置300は、公開鍵暗号アルゴリズムにおいて冪乗剰余演算や楕円スカラー倍演算を実行する暗号モジュールに対しても適用することができ、ビット単位で解析を行うCPA攻撃を防御することが可能となる。   As described above, the cryptographic operation circuit device 300 according to the present embodiment can also be applied to a cryptographic module that performs a power-residue operation or an elliptic scalar multiplication operation in a public key encryption algorithm, and performs analysis in bit units. It becomes possible to defend the CPA attack to be performed.

以上、第1の実施形態に係る暗号演算回路装置100および第2の実施形態に係る暗号演算回路装置200ではAESに代表されるブロック暗号アルゴリズムに適用した場合の例を示し、第3の実施形態に係る暗号演算回路装置300では公開鍵暗号アルゴリズムに適用した場合の例を示した。これらの実施形態以外にも、例えばストリーム暗号を用いる場合においても同様のパイプライン方式のレジスタ構成を取るハードウェア実装で暗号演算回路を実現する場合には本発明を適用することが可能である。   As described above, in the cryptographic operation circuit device 100 according to the first embodiment and the cryptographic operation circuit device 200 according to the second embodiment, an example in the case of application to a block encryption algorithm typified by AES is shown, and the third embodiment In the cryptographic operation circuit device 300 according to the example shown in FIG. In addition to these embodiments, for example, when stream cipher is used, the present invention can be applied to a case where a cryptographic operation circuit is realized by hardware implementation having a similar pipelined register configuration.

このように、暗号化処理関数の演算結果を格納するレジスタを2系統設けることにより、レジスタ値の変化量からハミング距離を計算するCPA攻撃を防御することができる。特に、マスク化を施していない従来の暗号化処理関数をそのまま流用できるので、EXORゲートや予備回路を新規に実装する必要がなく、ゲート回路規模の増大と消費電力の増加を抑えながら、効果的にCPA攻撃を回避することができる。   In this way, by providing two systems for storing the calculation result of the encryption processing function, it is possible to prevent a CPA attack that calculates the Hamming distance from the amount of change in the register value. In particular, since the conventional encryption processing function without masking can be used as it is, there is no need to newly install an EXOR gate or a spare circuit, and it is effective while suppressing an increase in the gate circuit scale and an increase in power consumption. CPA attacks can be avoided.

以上、本発明に係る暗号演算回路装置の各実施形態について説明してきたが、その精神またはその主要な特徴から逸脱することなく他の多様な形で実施することができる。そのため、上述した実施形態はあらゆる点で単なる例示に過ぎず、限定的に解釈してはならない。本発明は、特許請求の範囲によって示されるものであって、本発明は明細書本文にはなんら拘束されない。さらに、特許請求の範囲の均など範囲に属する変形や変更は、全て本発明の範囲内である。   Although the embodiments of the cryptographic operation circuit device according to the present invention have been described above, the present invention can be implemented in various other forms without departing from the spirit or main features thereof. Therefore, the above-described embodiment is merely an example in all respects and should not be interpreted in a limited manner. The present invention is shown by the scope of claims, and the present invention is not limited to the text of the specification. Furthermore, all modifications and changes belonging to the scope of the claims are within the scope of the present invention.

1,2,3,4,21,22,23,24,25,a,b,c・・・制御信号
100,200,300,900・・・暗号演算回路装置
101,201,301,901・・・攪拌部
103,106,108,110,203,206,208,210,211,903,906,907・・・セレクタ
104,204,304,904,909・・・組合せ回路
105,205・・・乱数生成部
107,109,207,209,905,908・・・レジスタ
150,250,350,950・・・制御部
201・・・攪拌部
250・・・制御部
302・・・指数展開部
902・・・鍵スケジューリング部
1, 2, 3, 4, 21, 22, 23, 24, 25, a, b, c... Control signals 100, 200, 300, 900... Cryptographic operation circuit devices 101, 201, 301, 901,. .. Stirring units 103, 106, 108, 110, 203, 206, 208, 210, 211, 903, 906, 907... Selectors 104, 204, 304, 904, 909.・ Random number generators 107, 109, 207, 209, 905, 908... Registers 150, 250, 350, 950... Control unit 201... Stirring unit 250. 902: Key scheduling unit

Claims (8)

入力データに所定の関数処理を施して出力データを生成する関数処理部を有し、初回の処理では外部からの入力データに前記関数処理を実行し、以降の処理では生成された出力データを次回の入力データとして前記関数処理行う一連の処理を所定回数繰り返して得られた出力データを暗号データとして外部に出力する暗号演算回路装置において、
前記関数処理部の出力データに等しいビット幅の乱数データを生成する乱数生成部と、
前記関数処理部の出力データまたは前記乱数データを一時的に格納する2つのデータ保持部と、
前記乱数生成部と前記関数処理部と前記データ保持部の処理タイミングを制御する制御部と
を設けたことを特徴とする暗号演算回路装置。
It has a function processing unit that performs predetermined function processing on input data to generate output data. In the first processing, the function processing is performed on input data from the outside, and in the subsequent processing, the generated output data is In the cryptographic operation circuit device for outputting the output data obtained by repeating a series of processing for performing the function processing as input data to the outside as encryption data,
A random number generator for generating random data having a bit width equal to the output data of the function processor;
Two data holding units for temporarily storing the output data of the function processing unit or the random number data;
A cryptographic operation circuit device comprising: the random number generation unit, the function processing unit, and a control unit that controls processing timing of the data holding unit.
請求項1に記載の暗号演算回路装置において、
前記制御部は、前記関数処理部が初回の処理を行う1回前の処理で前記乱数生成部が生成した乱数データを前記2つのデータ保持部のいずれかに格納し、前記乱数データが格納された同一の前記データ保持部に前記関数処理部が初回の処理で生成した出力データを格納するように制御することを特徴とする暗号演算回路装置。
The cryptographic operation circuit device according to claim 1,
The control unit stores the random number data generated by the random number generation unit in one of the previous processes in which the function processing unit performs an initial process in one of the two data holding units, and the random number data is stored. A cryptographic operation circuit device that controls to store the output data generated by the function processing unit in the first process in the same data holding unit.
請求項1に記載の暗号演算回路装置において、
前記制御部は、前記関数処理部が最終回の処理を行う1回前の処理で前記乱数生成部が生成した乱数データを前記2つのデータ保持部のいずれかに格納し、前記乱数データが格納された同一の前記データ保持部に前記関数処理部が最終回の処理で生成した出力データを格納するように制御することを特徴とする暗号演算回路装置。
The cryptographic operation circuit device according to claim 1,
The control unit stores the random number data generated by the random number generation unit in one of the previous processes in which the function processing unit performs the final process, and stores the random number data. The cryptographic operation circuit device is controlled to store the output data generated by the function processing unit in the last processing in the same data holding unit.
請求項1に記載の暗号演算回路装置において、
前記制御部は、前記関数処理部が初回および最終回のそれぞれの処理を行う1回前の処理で前記乱数生成部が生成した乱数データを前記2つのデータ保持部のいずれかに格納し、前記乱数データが格納された同一の前記データ保持部に前記関数処理部が初回および最終回の処理で生成した出力データを格納するように制御することを特徴とする暗号演算回路装置。
The cryptographic operation circuit device according to claim 1,
The control unit stores the random number data generated by the random number generation unit in one of the previous processes in which the function processing unit performs each of the initial and final processes in one of the two data holding units, A cryptographic operation circuit device, wherein the function processing unit is controlled to store output data generated by the first and last processing in the same data holding unit in which random number data is stored.
請求項1から4のいずれか一項に記載の暗号演算回路装置において、
前記制御部は、前記関数処理部の関数処理毎に前記2つのデータ保持部の少なくとも一方に前記乱数データを格納するように制御することを特徴とする暗号演算回路装置。
In the cryptographic operation circuit device according to any one of claims 1 to 4,
The control unit controls to store the random number data in at least one of the two data holding units for each function processing of the function processing unit.
請求項1から4のいずれか一項に記載の暗号演算回路装置において、
前記制御部は、前記関数処理部の関数処理毎に、前記関数処理部の出力データまたは前記乱数データを前記2つのデータ保持部に交互に格納するように制御することを特徴とする暗号演算回路装置。
In the cryptographic operation circuit device according to any one of claims 1 to 4,
The control unit controls the output data of the function processing unit or the random number data to be alternately stored in the two data holding units for each function processing of the function processing unit. apparatus.
請求項1から6のいずれか一項に記載の暗号演算回路装置において、
前記関数処理部が行う関数処理はブロック暗号アルゴリズムにおける暗号化または復号化のラウンド演算の基本処理であることを特徴とする暗号演算回路装置。
In the cryptographic operation circuit device according to any one of claims 1 to 6,
The function processing performed by the function processing unit is basic processing of encryption or decryption round operation in a block cipher algorithm.
請求項1から6のいずれか一項に記載の暗号演算回路装置において、
前記関数処理部が行う関数処理は公開鍵暗号アルゴリズムで利用されるべき乗剰余演算または楕円スカラー倍演算を実行するための繰り返し演算の基本処理であることを特徴とする暗号演算回路装置。
In the cryptographic operation circuit device according to any one of claims 1 to 6,
The cryptographic processing circuit apparatus, wherein the functional processing performed by the function processing unit is a basic processing of repetitive calculation for executing a modular multiplication or elliptic scalar multiplication operation to be used in a public key cryptographic algorithm.
JP2009074812A 2009-03-25 2009-03-25 Encryption arithmetic circuit device Withdrawn JP2010232709A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009074812A JP2010232709A (en) 2009-03-25 2009-03-25 Encryption arithmetic circuit device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009074812A JP2010232709A (en) 2009-03-25 2009-03-25 Encryption arithmetic circuit device

Publications (1)

Publication Number Publication Date
JP2010232709A true JP2010232709A (en) 2010-10-14

Family

ID=43048163

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009074812A Withdrawn JP2010232709A (en) 2009-03-25 2009-03-25 Encryption arithmetic circuit device

Country Status (1)

Country Link
JP (1) JP2010232709A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013080976A1 (en) * 2011-11-28 2013-06-06 日本電気株式会社 Encryption process circuit, decryption process circuit, methods thereof, and programs thereof
JP5364840B2 (en) * 2010-02-22 2013-12-11 株式会社東芝 Encryption device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5364840B2 (en) * 2010-02-22 2013-12-11 株式会社東芝 Encryption device
US9288040B2 (en) 2010-02-22 2016-03-15 Kabushiki Kaisha Toshiba Encryption device
WO2013080976A1 (en) * 2011-11-28 2013-06-06 日本電気株式会社 Encryption process circuit, decryption process circuit, methods thereof, and programs thereof
JP5327493B1 (en) * 2011-11-28 2013-10-30 日本電気株式会社 Encryption processing circuit and decryption processing circuit, method and program thereof
US8842824B2 (en) 2011-11-28 2014-09-23 Nec Corporation Encryption processing circuit and decryption processing circuit, methods thereof, and programs thereof

Similar Documents

Publication Publication Date Title
Bilgin et al. Trade-offs for threshold implementations illustrated on AES
US8724804B2 (en) Encryption processing apparatus
US8817975B2 (en) Cryptographic processing apparatus and operation method
SG173111A1 (en) Cryptography circuit protected against observation attacks, in particular of a high order
JPWO2008146482A1 (en) ENCRYPTION DEVICE, DECRYPTION DEVICE, ENCRYPTION METHOD, AND INTEGRATED CIRCUIT
WO2013069392A1 (en) Nonlinear processor, encryption device for stream cipher, decryption device for stream cipher, mask processing method, encryption method for stream cipher, decryption method for stream cipher, and program
GB2453367A (en) Cryptographic processing using isomorphic mappings of Galois fields
JPWO2009122464A1 (en) Encryption device and built-in device equipped with a common key encryption function
Hemme et al. Differential fault analysis on the SHA1 compression function
JP2005215688A (en) Hardware encryption/decryption apparatus using s-box operation, and method for the same
EP3143720A1 (en) Differential power analysis countermeasures
Nara et al. A scan-based attack based on discriminators for AES cryptosystems
KR100834096B1 (en) Aria encryption method for countermeasuring higher order dpa
Wang et al. Higher-order masking in practice: A vector implementation of masked AES for ARM NEON
JP7155173B2 (en) Protecting Modular Inversion Operations from External Observation Attacks
KR101506499B1 (en) Method for encrypting with SEED applying mask
JP5327493B1 (en) Encryption processing circuit and decryption processing circuit, method and program thereof
Arora et al. A double-width algorithmic balancing to prevent power analysis side channel attacks in aes
JP2010245753A (en) Encryption operation circuit device
JP2010232709A (en) Encryption arithmetic circuit device
Vadnala et al. Algorithms for switching between boolean and arithmetic masking of second order
Yli-Mäyry et al. Chosen-input side-channel analysis on unrolled light-weight cryptographic hardware
KR20100059571A (en) Apparatus and method for operating inversion of aes with masking method, and aes cipher system and method using thereof
JP2006054568A (en) Encryption apparatus, decryption apparatus and method, and computer program
Bucci et al. Testing power-analysis attack susceptibility in register-transfer level designs

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20120605