JP2013077034A - Encryption device loaded with common key encryption function and integration device - Google Patents

Encryption device loaded with common key encryption function and integration device Download PDF

Info

Publication number
JP2013077034A
JP2013077034A JP2013013329A JP2013013329A JP2013077034A JP 2013077034 A JP2013077034 A JP 2013077034A JP 2013013329 A JP2013013329 A JP 2013013329A JP 2013013329 A JP2013013329 A JP 2013013329A JP 2013077034 A JP2013077034 A JP 2013077034A
Authority
JP
Japan
Prior art keywords
bit
value
circuit
multiplication
data
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
JP2013013329A
Other languages
Japanese (ja)
Other versions
JP5500277B2 (en
Inventor
Koichi Ito
孝一 伊藤
Soichi Okada
壮一 岡田
Masahiko Takenaka
正彦 武仲
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2013013329A priority Critical patent/JP5500277B2/en
Publication of JP2013077034A publication Critical patent/JP2013077034A/en
Application granted granted Critical
Publication of JP5500277B2 publication Critical patent/JP5500277B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To increase the safety of an integration apparatus such as a smart card by making it difficult to decrypt a secret key of encryption processing such as an Advanced Encryption Standards (AES) as a representative common key algorithm.SOLUTION: A common key block encryption device for operating non-linear conversion by multiplication processing in a binary body or a composite body includes: an arithmetic unit for executing any arithmetic processing other than the non-linear conversion on the basis of fixed value masked input data obtained by executing an XOR operation to a fixed value mask; an XOR operation circuit for converting all the input data into fixed value masked input data by executing the XOR operation to the fixed value mask, and for further converting the fixed value masked input data into random value masked input data by executing the XOR operation to a random value mask in multiplication processing; a multiplier for executing multiplication processing on the basis of the random value masked input data output by the XOR operation circuit; and a random value mask/fixed value mask conversion circuit for reconverting the random value masked output data to be output from the multiplier into the fixed value masked output data for output.

Description

本発明は、暗号の分野に属するもので、電力解析攻撃と呼ばれる解読法を防ぐための対策技術に関する。   The present invention belongs to the field of cryptography and relates to a countermeasure technique for preventing a cryptanalysis called a power analysis attack.

暗号方式は、公開鍵暗号方式と共通鍵暗号方式に大別される。公開鍵暗号方式とは、暗号化と復号で異なる鍵を用いる方式であり、暗号化を行うための鍵(公開鍵)を一般に公開する代わりに、暗号文を復号するための鍵(秘密鍵)を受信者のみの秘密情報とすることで安全性を保つ方式である。これに対し、共通鍵暗号方式と呼ばれるものは、暗号化と復号で同一の鍵(秘密鍵)を用いる方式であり、この秘密鍵を送信者と受信者以外の第三者にわからない情報とすることで安全性を保つ方式である。   Encryption methods are roughly classified into public key encryption methods and common key encryption methods. Public key cryptography is a scheme that uses different keys for encryption and decryption, and instead of publicly disclosing the key for encryption (public key), the key for decrypting the ciphertext (secret key) Is a method of maintaining security by making secret information only for the receiver. On the other hand, what is called a common key encryption method is a method that uses the same key (secret key) for encryption and decryption, and makes this secret key information unknown to a third party other than the sender and receiver. This is a method to keep safety.

暗号の分野における技術の一つに、解読技術とよばれるものがある。解読技術とは秘密鍵等の秘密情報を暗号文等、入手可能な情報から推定する技術のことであり、様々な手法が存在する。その中で最近注目されている技術に、電力解析攻撃(Power Analysis, 以下PA)と呼ばれる手法がある。PAとは、1998年にPaul Kocherによって考案された手法で、スマートカード等の組み込み機器に搭載された暗号プロセッサに様々な入力データを与えた時の電力消費データを収集・解析することで、暗号プロセッサ内部の鍵情報を推定する手法である。PAを用いることで、公開鍵暗号、秘密鍵暗号共に暗号プロセッサから秘密鍵を推定できることが知られている。   One technology in the field of cryptography is called decryption technology. The decryption technique is a technique for estimating secret information such as a secret key from available information such as ciphertext, and there are various methods. Among them, a technique that has recently attracted attention is a method called power analysis attack (PA). PA is a technique devised by Paul Kocher in 1998, which collects and analyzes power consumption data when various input data are given to cryptographic processors mounted on embedded devices such as smart cards. This is a technique for estimating the key information inside the processor. It is known that by using PA, a secret key can be estimated from a cryptographic processor for both public key encryption and secret key encryption.

PAには、単純電力解析(Single Power Analysis, 以下SPA), 電力差分攻撃(Differential Power Analysis, 以下DPA)の2種類が存在する。SPAは暗号プロセッサにおける単一の電力消費データの特徴から秘密鍵の推定を行う方式、DPAは多数の電力消費データの差分を解析することで秘密鍵の推定を行う方式で、一般にDPAの方が強力であるといわれている。SPA、DPAを用いた解読技術としては代表的なものとして次のような論文が発表されている。RSAなどの公開鍵暗号に対するDPAを用いた解読法については、下記非特許文献1などの文献にて述べられている。また、共通鍵暗号方式において、現在標準として利用されているDES(Data Encryption Standards)に対するSPA, DPAを用いた解読法については、下記非特許文献2で述べられている。DESの他に、次世代で標準として利用されると思われる共通鍵暗号方式であるRijndaelについても、下記非特許文献3などの文献でDPAを用いた解読の可能性が指摘されている。   There are two types of PAs: simple power analysis (SPA) and differential power analysis (DPA). SPA is a method for estimating a secret key from the characteristics of a single power consumption data in a cryptographic processor, and DPA is a method for estimating a secret key by analyzing the difference of a large number of power consumption data. It is said to be powerful. The following papers have been published as typical decoding techniques using SPA and DPA. The decryption method using DPA for public key cryptography such as RSA is described in documents such as Non-Patent Document 1 below. Non-Patent Document 2 below describes a decryption method using SPA and DPA for DES (Data Encryption Standards) currently used as a standard in the common key cryptosystem. In addition to DES, the possibility of decryption using DPA has been pointed out in documents such as the following non-patent document 3 for Rijndael, which is a common key cryptosystem that is expected to be used as a standard in the next generation.

PAを用いた解読技術は特に有効な方法として注目されており、様々な解読法が研究されている。また、解読技術のみならずPAによる解読を防ぐための対策技術も発展しており、解読技術と同様に重要な技術として注目されている。   Decoding technology using PA is attracting attention as a particularly effective method, and various decoding methods have been studied. In addition, not only decoding technology but also countermeasure technology for preventing decoding by PA has been developed, and it is attracting attention as an important technology as well as decoding technology.

共通鍵暗号処理の一般的な構成を図1に示す。一般的に、共通鍵暗号処理はラウンド処理と拡大鍵生成の2つの処理から構成される。拡大鍵生成は、入力された秘密鍵から複数の拡大鍵と呼ばれるデータを複数(以下拡大鍵0, 拡大鍵1,…, 拡大鍵Nと表記)生成し、ラウンド処理に対して出力する。これらの拡大鍵及び平文をラウンド処理に入力することで、暗号化のための変換を行い、暗号文を出力する。   A general configuration of the common key encryption process is shown in FIG. Generally, the common key encryption process is composed of two processes, a round process and an extended key generation. In the extended key generation, a plurality of data called extended keys (hereinafter referred to as extended key 0, extended key 1,..., Extended key N) are generated from the input secret key and output to the round process. By inputting these expanded key and plaintext to the round process, conversion for encryption is performed and ciphertext is output.

代表的な共通鍵暗号のアルゴリズムとして、AES(Advanced Encryption Standards)が知られており、下記非特許文献4として公開されている。   AES (Advanced Encryption Standards) is known as a typical common key encryption algorithm, and is disclosed as Non-Patent Document 4 below.

AESの構成を図2に示す。
AESは128-bitを暗号化単位とするアルゴリズムである。すなわち128-bitの平文から128-bitの暗号文を生成する。秘密鍵は128,192,256-bitの3種類から選択することができる。拡大鍵処理を実行することで、秘密鍵からN+1個の128-bit拡大鍵を生成する。AESのラウンド処理は, RoundKey, Subbyte, ShiftRow, MixColumnの4種類から構成され、これらのうちRoundKeyにおいて拡大鍵が使用される。ラウンド処理に平文を入力することで、RoundKey, Subbyte, ShiftRow, MixColumnの順番の処理をN-1回繰り返す。次に、RoundKey, Subbyte, ShiftRow, RoundKeyの処理を実行し暗号文を出力する。この繰り返し回数Nは秘密鍵のビット長によって異なり、128-bitの場合N=10, 192-bitの場合N=12, 256-bitの場合N=14である。RoundKeyの処理を図3に、Subbyteの処理を図4に、MixColumnの処理を図5に、ShiftRowの処理を図6に示す。
The configuration of AES is shown in FIG.
AES is an algorithm using 128-bit as an encryption unit. That is, a 128-bit ciphertext is generated from a 128-bit plaintext. The secret key can be selected from three types: 128, 192, and 256-bit. By executing the extended key process, N + 1 128-bit extended keys are generated from the secret key. AES round processing is composed of four types, RoundKey, Subbyte, ShiftRow, and MixColumn. Of these, an expanded key is used in RoundKey. By inputting plain text to the round process, the process of RoundKey, Subbyte, ShiftRow, MixColumn is repeated N-1 times. Next, processing of RoundKey, Subbyte, ShiftRow, and RoundKey is executed and ciphertext is output. The number of repetitions N varies depending on the bit length of the secret key. N = 10 in the case of 128-bit, N = 12 in the case of 192-bit, and N = 14 in the case of 256-bit. FIG. 3 shows the RoundKey processing, FIG. 4 shows the Subbyte processing, FIG. 5 shows the MixColumn processing, and FIG. 6 shows the ShiftRow processing.

<DPAによる秘密鍵解読手法>
以下では、DPAによる秘密鍵解読手法について説明を行う。DPAは、図1のラウンド処理に関する消費電力を測定することで、秘密鍵を解読する手法である。以下では、DPAを用いて解読を行うことができる共通鍵暗号の処理構成について、AESに限定せずに説明を行う。一般的な共通鍵暗号では、拡大鍵XOR処理(図7)、線形変換処理(図8)、非線形変換処理(図3)の3つを組み合わせてラウンド処理を構成し、ラウンド処理を複数回繰り返すことで構成される。図7に示す通り、拡大鍵XOR処理は入力データXに対して、拡大鍵Kの排他的論理和(XOR)の演算結果Zを出力する処理である。図8は線形変換処理であり、入力データXに対して、Z=L(X)を満たすZを出力する処理である。このとき、Lは任意のX,Yに関して、

Figure 2013077034
が成立する。具体的には、図6のShiftRowのようなビット置換処理や、図5のMixColumnのような行列演算などがこれに該当する。図9は非線形変換処理であり、入力データXに対してZ=W(X)を満たすZを出力する。このとき、Wは任意のX,Yに関して、W(X○Y) =W(X)○W(Y)が成立しない(非線形)。具体的には、Sboxと呼ばれる非線型変換テーブル索引で実現する場合が多く、入力XをX=x0x1…xu-1とu個に分割し、Sbox wjを用いてzj=wj(xj)で表されるzjを計算、再びZ=z0z1...zu-1と結合してZを出力する。 <Deciphering secret key with DPA>
In the following, the secret key decryption method using DPA is described. DPA is a technique for decrypting a secret key by measuring power consumption related to the round processing of FIG. Hereinafter, the processing configuration of the common key encryption that can be decrypted using DPA will be described without being limited to AES. In general common key cryptography, round processing is configured by combining three of expanded key XOR processing (FIG. 7), linear transformation processing (FIG. 8), and nonlinear transformation processing (FIG. 3), and the round processing is repeated a plurality of times. Consists of. As shown in FIG. 7, the expanded key XOR process is a process of outputting the operation result Z of the exclusive OR (XOR) of the expanded key K with respect to the input data X. FIG. 8 shows a linear conversion process in which Z that satisfies Z = L (X) is output for input data X. At this time, L is arbitrary X and Y,
Figure 2013077034
Is established. Specifically, this corresponds to bit replacement processing such as ShiftRow in FIG. 6 and matrix operation such as MixColumn in FIG. FIG. 9 shows non-linear conversion processing, in which Z that satisfies Z = W (X) is output for input data X. At this time, W does not hold W (X ○ Y) = W (X) ○ W (Y) for any X and Y (nonlinear). Specifically, often implemented in a non-linear conversion table indexes called Sbox, divides the input X X = x 0 x 1 ... x u-1 and the u-number, z j using Sbox w j = z j represented by w j (x j ) is calculated and combined with Z = z 0 z 1 ... z u−1 again to output Z.

次に、上記処理を組み合わせた共通鍵暗号に対する、DPAを用いた解読法を示す。
最も簡単な例として、図7と図9を組み合わせた図10の処理に対してDPAを用いることで、拡大鍵Kを解読できることを示す。なお、図10は、AESにおけるRoundKey(図3)とSubbyte(図4)をあわせた構造と等価である。
Next, a cryptanalysis method using DPA for the common key encryption combined with the above processing will be shown.
As the simplest example, it is shown that the extended key K can be decrypted by using DPA for the process of FIG. 10 that combines FIG. 7 and FIG. Note that FIG. 10 is equivalent to a structure combining RoundKey (FIG. 3) and Subbyte (FIG. 4) in AES.

図10の構成においてwjの入出力に関係するビットのみを取り出した構成を図11に示す。図11において、mjは平文などの既知の値、kjは未知の値、wjは既知のSboxテーブルであると仮定する。この仮定の下で、DPAにより拡大鍵kjを推定できることを示す。 FIG. 11 shows a configuration in which only bits related to w j input / output are extracted in the configuration of FIG. In FIG. 11, it is assumed that m j is a known value such as plain text, k j is an unknown value, and w j is a known Sbox table. It is shown that the extended key k j can be estimated by DPA under this assumption.

DPAは、電力消費データの測定と、電力差分データを用いた拡大鍵の解析という2段階から構成される。電力消費データの測定において、ある平文を与えたときに暗号プロセッサが消費する電力消費データは、オシロスコープ等を用いれば、図12に示すような電力消費曲線として測定される。平文の値を様々に変えながらこのような測定を繰り返し、十分な回数の測定データが得られた時点で測定を終了する。この一連の測定で得られた電力消費曲線の集合をGとする。   The DPA is composed of two stages: measurement of power consumption data and analysis of an extended key using power difference data. In the measurement of power consumption data, the power consumption data consumed by the cryptographic processor when given a plaintext is measured as a power consumption curve as shown in FIG. 12 using an oscilloscope or the like. Such measurement is repeated while changing the plaintext value, and the measurement is terminated when a sufficient number of measurement data is obtained. Let G be the set of power consumption curves obtained by this series of measurements.

次に、電力消費曲線を用いた拡大鍵の解析について説明を行う。暗号処理内部で用いられている拡大鍵kjについて、kj=k’jであるという仮定を立てる。mj, wjが既知のため、このk’jの仮定に基づき、集合Gは以下のG0(k’j), G1(k’j)に示す2種類の集合に分類できる。 Next, expansion key analysis using a power consumption curve will be described. An assumption is made that k j = k ′ j for the extended key k j used inside the cryptographic process. Since m j and w j are known, based on this k ′ j assumption, the set G can be classified into the following two types of sets shown as G 0 (k ′ j ) and G 1 (k ′ j ).

G0(k’j) = { G| zj = wj(mj○k’j)のe番目のビット値=0 } (1)
G1(k’j) = { G| zj = wj(mj○k’j)のe番目のビット値=1 } (2)
そして、以下に示す電力差分曲線DG(k’j)を作成する。
DG(k’i) = (集合G1に属する電力消費曲線の平均)
- (集合G0に属する電力消費曲線の平均) (3)
G 0 (k ' j ) = {G | z j = w j (m j ○ k' j ) e-th bit value = 0} (1)
G 1 (k ' j ) = {G | z j = w j (m j ○ k' j ) e-th bit value = 1} (2)
Then, a power difference curve DG (k ′ j ) shown below is created.
DG (k ' i ) = (average power consumption curve belonging to set G 1 )
-(Average power consumption curve belonging to set G 0 ) (3)

もしこの仮定が正しい、すなわちk’j=kjである場合、図13Aに示すようなスパイクが現われる。もしこの仮定が誤り、すなわちk’j 1kjである場合、図13Bに示すようにスパイクが現れない平坦な曲線となる。よって、仮定したk’jから図13Aのような電力差分曲線が得られれば、拡大鍵kjを解読できたことになる。このようなkjの解読を各jについて行えば、最終的に図10における拡大鍵Kを解読することができる。この解読を、拡大鍵0,拡大鍵1,…, 拡大鍵Nについて繰り返すことで、秘密鍵を解読することができる。なおAESの場合、アルゴリズムの性質上、拡大鍵の先頭の値がそのまま秘密鍵の値であるため、秘密鍵が128-bitならば拡大鍵0を、秘密鍵が192-bitもしくは256-bitならば拡大鍵0と拡大鍵1を解読すれば、秘密鍵全体を解読することができる。 If this assumption is correct, that is, k ′ j = k j , a spike as shown in FIG. 13A appears. If this assumption is incorrect, that is, k ′ j 1 k j , a flat curve with no spike appears as shown in FIG. 13B. Therefore, if the power difference curve as shown in FIG. 13A is obtained from the assumed k ′ j , the expanded key k j can be decrypted. If such decryption of k j is performed for each j, the extended key K in FIG. 10 can be finally decrypted. By repeating this decryption for the expanded key 0, expanded key 1,..., Expanded key N, the secret key can be decrypted. In the case of AES, because of the nature of the algorithm, the first value of the expanded key is the secret key value as it is, so if the secret key is 128-bit, the expanded key is 0, and if the secret key is 192-bit or 256-bit, For example, if the extended key 0 and the extended key 1 are decrypted, the entire secret key can be decrypted.

次に、k’j=kjである場合、電力差分曲線DG(k’j)にスパイクが現れる理由について説明する。k’j=kjの場合、(1)式及び(2)式に従いG0(k’j), G1(k’j)の分類を行うことで、zjに関して(4)式が成立する。 Next, the reason why a spike appears in the power difference curve DG (k ′ j ) when k ′ j = k j is described. When k ' j = k j , Eq. (4) is established for z j by classifying G 0 (k' j ) and G 1 (k ' j ) according to Eqs . (1) and (2). To do.

(G1に属するzjの平均ハミングウェイト)
- (G0に属するzjの平均ハミングウェイト) = 1 (4)
(Average hamming weight of z j belonging to G 1 )
-(Average hamming weight of z j belonging to G 0 ) = 1 (4)

一方、k’j 1kjの場合(4)式は成立せず、ランダムな分類を行うことになるので(5)式が成立する。 On the other hand, in the case of k ′ j 1 k j , equation (4) is not satisfied, and random classification is performed, so equation (5) is satisfied.

(G1に属するzjの平均ハミングウェイト)
- (G0に属するzjの平均ハミングウェイト) = 0 (5)
(Average hamming weight of z j belonging to G 1 )
-(Average hamming weight of z j belonging to G 0 ) = 0 (5)

ただし、ハミングウェイトとは、ある値をビット値で表現したときにビット値=’1’となる個数のことであり、例えばビット値(1101)2のハミングウェイトは3である。 However, the Hamming weight is the number of bit values = '1' when a certain value is expressed as a bit value. For example, the Hamming weight of the bit value (1101) 2 is 3.

よって、(4)式が成立する場合はG1(k’j)とG0(k’j)の間でのロード値zjの平均ハミングウェイトに差が生じるが、(5)式が成立する場合はG1(k’j)とG0(k’j)の間でのロード値zjの平均ハミングウェイトに差が生じない。 Therefore, if equation (4) holds, there will be a difference in the average hamming weight of load value z j between G 1 (k ' j ) and G 0 (k' j ), but equation (5) holds. In this case, there is no difference in the average hamming weight of the load value z j between G 1 (k ′ j ) and G 0 (k ′ j ).

一般的に、消費電力はデータ値のハミングウェイトに比例すると考えられており、このことが正しいことを示した実験結果が下記非特許文献5などの文献にて示されている。   In general, power consumption is considered to be proportional to the Hamming weight of a data value, and experimental results showing that this is correct are shown in documents such as Non-Patent Document 5 below.

従って、k’j=kjである場合、(4)式が満たされることで消費電力の差が電力差分曲線上のスパイクという形になって現れるが、(5)式の場合はスパイクが現れず、平坦な曲線となる。 Therefore, when k ' j = k j , the difference in power consumption appears as a spike on the power difference curve when Equation (4) is satisfied, but in the case of Equation (5), a spike appears. Instead, it becomes a flat curve.

以上では、最も簡単な図10の構造に対するDPAに関して述べたが、このような手法は、間に図9の線形変換を挿入しても成立することが判明している。   Although the DPA for the simplest structure of FIG. 10 has been described above, it has been found that such a method can be established even if the linear transformation of FIG. 9 is inserted between them.

図14は、図10を一般化した構造であり、鍵XOR処理の前後に2つの線形変換処理L1, L2を入れた処理構造である。例えば、L1は入力をそのまま出力する関数、L2をビット転置置換関数、wjをSC2000のB関数と呼ばれるSboxにすることで、図14はSC2000と等価な構造を表す。なお、SC2000の仕様については、下記非特許文献6を参照のこと。L2はビット置換関数であるので、図14の処理について、wjの入出力に関係するビットのみを取りだした構造を考えることで、図11と同一の処理に変換でき、前述と同様のDPAを用いることで、拡大鍵Kを解読することができる。 FIG. 14 is a generalized structure of FIG. 10, and is a processing structure in which two linear transformation processes L 1 and L 2 are inserted before and after the key XOR process. For example, FIG. 14 shows a structure equivalent to SC2000, where L 1 is a function that outputs the input as it is, L 2 is a bit transposition function, and w j is an Sbox called the B function of SC2000. For the specifications of SC2000, see Non-Patent Document 6 below. Since L 2 is a bit permutation function, the process of FIG. 14 can be converted to the same process as in FIG. 11 by considering a structure in which only the bits related to w j input / output are taken out. Can be used to decrypt the extended key K.

以上の手法では、非線形処理中のSbox出力に注目してDPAを適用しているが、そのほかにも、入力mjと鍵kjとのXOR直後の値(鍵XOR処理の出力値)やSboxへの入力値xjの値に注目してDPAを適用する手法が知られている(下記非特許文献7)。 In the above method, DPA is applied focusing on Sbox output during nonlinear processing, but in addition, the value immediately after XOR of input m j and key k j (output value of key XOR processing) or Sbox A method of applying DPA by paying attention to the value of the input value x j is known (non-patent document 7 below).

上記を整理すると、次の条件を満たす場合にDPAにより秘密鍵Kが推定される。(これらのDPA攻撃条件については、下記特許文献1にも記載されている。)   To summarize the above, the secret key K is estimated by DPA when the following conditions are satisfied. (These DPA attack conditions are also described in Patent Document 1 below.)

DPA-1. 入力Mが既知かつ制御可能、鍵Kは未知で固定、Sbox wjの変換が既知の場合、図15のAの部分(Sbox wjの出力)の電力消費曲線を測定することでDPA可能。 DPA-1. If the input M is known and controllable, the key K is unknown and fixed, and the conversion of Sbox w j is known, measure the power consumption curve of part A (output of Sbox w j ) in FIG. DPA is possible.

DPA-2. 入力Mが既知かつ制御可能、鍵Kは未知で固定の場合、図15のBの部分(鍵XOR処理の出力の書き出し)の電力消費曲線を測定することでDPA可能。 DPA-2. If the input M is known and controllable, and the key K is unknown and fixed, DPA is possible by measuring the power consumption curve of the part B in Fig. 15 (writing the output of the key XOR process).

DPA-3. 入力Mが既知かつ制御可能、鍵Kは未知で固定の場合、図15のCの部分(Sbox wjを索引するための入力値のロード)の電力消費曲線を測定することでDPA可能。 DPA-3. When the input M is known and controllable, and the key K is unknown and fixed, by measuring the power consumption curve of the part C in FIG. 15 (loading the input value to index Sbox w j ) DPA is possible.

<SPAによる秘密鍵解読手法>
以下では、SPAによる秘密鍵解読手法について説明を行う。この攻撃は、

Figure 2013077034
といった乗算処理の消費電力を観察する。ただし、◎は乗算をあらわす記号であり、AES処理では、後に説明する合成体の計算(図23)において、a,b,cがGF(28)やGF(((22)2)2)の元である場合の乗算処理が行われる。入力データであるaもしくはbに’0’が入力された場合、0との乗算、つまり0=0◎bもしくは0=a◎0の演算が行われる(以下、ゼロ乗算と呼ぶ)。ゼロ乗算の消費電力波形と、a,b共に非ゼロの場合の乗算(以下、非ゼロ乗算と呼ぶ)の電力波形と比較した場合、前者は非常に特殊な波形となることが知られている。つまり、乗算処理におけるゼロ乗算と非ゼロ乗算の区別は、SPAにより観察できる。この性質を利用することで、秘密鍵を解読することができる。この攻撃をゼロ乗算SPAと呼ぶ。ゼロ乗算SPAは、その性質上乗算処理を用いる暗号処理装置に対してのみ実施可能な攻撃法である。AESの場合、後に述べる合成体の計算(図23)を用いたSubbyte処理を用いる暗号処理装置に対してのみこの攻撃法が可能であり、そうでない暗号処理装置に対してはこの攻撃は不可能である。 <Secret key decryption using SPA>
In the following, a secret key decryption method using SPA will be described. This attack
Figure 2013077034
Observe the power consumption of the multiplication process. However, ◎ is a symbol representing multiplication. In AES processing, a, b, and c are GF (2 8 ) and GF (((2 2 ) 2 ) 2 in the calculation of a composite field (FIG. 23) described later. ) Is multiplied. When '0' is input to the input data a or b, multiplication with 0, that is, 0 = 0 演算 b or 0 = a ◎ 0 is performed (hereinafter referred to as zero multiplication). It is known that the former is a very special waveform when compared to the power consumption waveform of zero multiplication and the power waveform of multiplication when both a and b are non-zero (hereinafter referred to as non-zero multiplication). . That is, the distinction between zero multiplication and non-zero multiplication in the multiplication process can be observed by SPA. By using this property, the secret key can be decrypted. This attack is called zero multiplication SPA. Zero multiplication SPA is an attack method that can be implemented only for cryptographic processing devices that use multiplication processing due to its nature. In the case of AES, this attack method is possible only for cryptographic processing devices that use Subbyte processing using the calculation of composite fields described later (FIG. 23), and this attack is not possible for cryptographic processing devices that are not. It is.

図16は、ゼロ乗算SPAによる攻撃可能な暗号処理の回路構成を表している。
図16において、Mは平文など攻撃者にKnownな値、Kは鍵などの攻撃者にUnknownな値である。X=M○KのXOR演算を行った後、データYとの乗算処理Z=X◎Yを行う。Yの値は攻撃者にUnknowな値である。攻撃者はこの処理に対してSPAによる観察を行い、Mの値を変化させながらX◎Yの演算におけるゼロ乗算の発生の有無を観察する。もし、ゼロ乗算が観察された場合、X=0である。つまり、M○K=0であることが分かるので、K=MつまりUnknownなKがMと一致することが分かり、Kの解読に成功する。この攻撃を成功させるためには、Yの値は0以外なら何でも良い任意の値である。
FIG. 16 shows a circuit configuration of cryptographic processing that can be attacked by zero multiplication SPA.
In FIG. 16, M is a value known to the attacker such as plaintext, and K is a value unknown to the attacker such as a key. After performing an XOR operation of X = M 乗 算 K, a multiplication process Z = X ◎ Y with data Y is performed. The value of Y is a value that is unknown to the attacker. The attacker observes this process with SPA, and observes the occurrence of zero multiplication in the calculation of X ◎ Y while changing the value of M. If zero multiplication is observed, X = 0. In other words, since M ○ K = 0, it can be seen that K = M, that is, Unknown K matches M, and K is successfully decoded. For this attack to succeed, the value of Y is any value other than 0.

ゼロ乗算SPAは図17の回路構成に対しても可能である。
図17において、Mは平文など攻撃者にKnownな値、Kは鍵などの攻撃者にUnknownな値である。αは任意の変換関数であり、攻撃者がゼロに関する逆変換α-1(0)を(つまり、α(z)=0を満たすzを)演算可能であれば、線型・非線型いずれの変換でも良い。V=M○KのXOR演算、X=α(V)の演算を行った後、データYとの乗算処理Z=X◎Yを行う。Yの値は攻撃者にUnknowな値である。攻撃者はこの処理に対してSPAによる観察を行い、Mの値を変化させながらX◎Yの演算におけるゼロ乗算の発生の有無を観察する。もし、ゼロ乗算が観察された場合、X=0である。つまり、α(M○K)=0であるので、M○K=zであることが分かる。つまりK=M○zが分かるので、Kの解読に成功する。
Zero multiplication SPA is also possible for the circuit configuration of FIG.
In FIG. 17, M is a value known to the attacker such as plaintext, and K is a value unknown to the attacker such as a key. α is an arbitrary transformation function. If the attacker can calculate the inverse transformation α -1 (0) for zero (that is, z satisfying α (z) = 0), either linear or non-linear transformation is possible. But it ’s okay. After performing an XOR operation of V = M ○ K and an operation of X = α (V), a multiplication process Z = X ◎ Y with data Y is performed. The value of Y is a value that is unknown to the attacker. The attacker observes this process with SPA, and observes the occurrence of zero multiplication in the calculation of X ◎ Y while changing the value of M. If zero multiplication is observed, X = 0. That is, since α (MMK) = 0, it can be seen that M ○ K = z. In other words, because K = M ○ z is known, K can be successfully decoded.

<従来技術>
従来のDPA対策法としては、暗号処理に対策を施し消費電力をランダム化する手法が存在する。この手法を用いた対策法として、以下の2つの従来例が知られており、下記に従来例1、従来例2として示す。また、DPA対策なしのAES回路に対して、Subbyte回路の縮小を実現する方法を、以下の従来例3に示す。従来例1,2は、Subbyteの回路を乗算処理ではなくテーブル演算で実行するため、ゼロ乗算SPAに対して安全であるので、DPA対策を行うことでそのままPA対策となることに注意されたい。
<Conventional technology>
As a conventional DPA countermeasure method, there is a method of taking a countermeasure against cryptographic processing and randomizing power consumption. The following two conventional examples are known as countermeasures using this technique, and are shown as Conventional Example 1 and Conventional Example 2 below. A method for realizing reduction of the Subbyte circuit with respect to an AES circuit without DPA countermeasures is shown in the following conventional example 3. It should be noted that Conventional Examples 1 and 2 are safe against zero multiplication SPA because the Subbyte circuit is executed not by multiplication but by table operation, and therefore it becomes a PA countermeasure by taking a DPA countermeasure.

従来例1
消費電力をランダム化する手法の代表的なものとして、masking method と呼ばれている手法が知られている(下記非特許文献8、以下「従来例1」と呼ぶ)。DPA対策なしの暗号処理において計算されるデータをMとすると、従来例1に記載されているDPA対策は、データMを計算する代わりに、M’=M○Rで表されるデータM’,Rを計算することで暗号処理を行う方法である。ただしRは乱数であり、暗号処理を実行する度に発生させる値である。この方法により、暗号処理のデータをランダムな値でマスクされる。よって、データがランダム化されることで消費電力もランダム化されるため、PAに安全な処理を実現することができる。以下の説明では、RのようにPA対策なしのデータに対してXORされる値をマスク値と呼ぶ。
Conventional Example 1
As a representative method for randomizing power consumption, a method called a masking method is known (Non-patent Document 8 below, hereinafter referred to as “Conventional Example 1”). Assuming that the data calculated in the encryption process without DPA countermeasures is M, the DPA countermeasure described in the conventional example 1 is the data M ′, represented by M ′ = M ○ R, instead of calculating the data M. This is a method of performing cryptographic processing by calculating R. However, R is a random number, and is a value generated every time encryption processing is executed. By this method, the data for encryption processing is masked with a random value. Therefore, since the power is randomized by randomizing the data, it is possible to realize a safe process for the PA. In the following description, a value XORed with respect to data without PA countermeasures such as R is called a mask value.

図18のDPA対策を行っていないAES回路に対して、従来例1によるDPA対策を適用したAES回路を図19に示す。この回路においては、図18で計算しているデータMiの代わりに、乱数Riに対してMi’ = Mi○ Riを満たすMi’とRiの2つのランダムなデータを計算する。暗号化処理ごとに計算されるデータ値がランダムであるため、DPAに対して安全な処理を実現することができる。ただし、データをMi’とRiの両方について計算しなくてはならないため、回路規模が増大する。(図18のおよそ2倍)。図18ではAESのSubbyte処理を、固定データによる静的な変換テーブルS[x] を用いたテーブル参照処理(0£x£255)によって行う。Subbyte処理で用いられる変換テーブルS[x]は、Sboxと呼ばれる。これに対して、図19で用いられるSboxのテーブルデータS’[x]は、乱数Rin, Routに応じてS’[x] = S[x○Rin]○Routに従ったS’[x]を、x=0,1,...,255それぞれに対して動的に更新する必要がある。この更新処理は256 cycleを必要するため、図19の回路を図18と比較すると、処理速度が遅いという欠点を有する。 FIG. 19 shows an AES circuit in which the DPA countermeasure according to Conventional Example 1 is applied to the AES circuit not taking the DPA countermeasure of FIG. In this circuit, instead of the data M i are calculated in FIG. 18, calculates the two random data with R i 'M i satisfying = M i ○ R i' M i against random number R i To do. Since the data value calculated for each encryption process is random, a process that is safe against DPA can be realized. However, since the data must be calculated for both M i ′ and R i , the circuit scale increases. (Approximately twice that of FIG. 18). In FIG. 18, AES Subbyte processing is performed by table reference processing (0 £ x 255) using a static conversion table S [x] with fixed data. The conversion table S [x] used in the Subbyte process is called Sbox. On the other hand, the Sbox table data S ′ [x] used in FIG. 19 is S ′ [x] according to S ′ [x] = S [xRin] ○ Rout according to the random numbers Rin and Rout. Need to be dynamically updated for x = 0,1, ..., 255 respectively. Since this update process requires 256 cycles, the circuit of FIG. 19 has a disadvantage that the processing speed is low when compared with FIG.

従来例1の課題
課題1.DPA対策無しの回路と比較して、回路規模が大きい。
課題2.DPA対策無しの回路と比較して、処理速度が遅い。
従来例2
従来例1の課題2を解消するための方法が下記特許文献1に公開されている(以下本書では「従来例2」と記す)。従来例1ではマスクする値をランダムに生成していたのに対し、従来例2は事前計算された複数の固定値の中から一つを乱数によって選択した値によりマスクする。この選択されたマスク値をRiと表記する。従来例2では、従来例1と同様に、M’i=Mi○Riを満たすデータM’i,Riを計算するが、Riは事前計算された値であるため、M’i,Riの両方を計算する必要はなく、M’iのみを計算すれば良い。乱数が事前計算された値であるため、従来例1と異なりSboxのテーブルデータを動的に更新する必要はなく、事前計算された静的なデータを複数用意すれば良いので、従来例1より高速な処理を実現することができる。従来例2のDPA対策方法を用いることで、図18に示したDPA対策無しのAES暗号処理は、以下の図20に示すような暗号処理に置き換えられる。
Problems of Conventional Example 1 The circuit scale is larger than the circuit without DPA countermeasures.
Problem 2 The processing speed is slower than the circuit without DPA countermeasures.
Conventional example 2
A method for solving the problem 2 of the conventional example 1 is disclosed in the following Patent Document 1 (hereinafter referred to as “conventional example 2”). In the conventional example 1, the value to be masked is randomly generated, while in the conventional example 2, one of a plurality of pre-calculated fixed values is masked with a value selected by a random number. The selected mask value is expressed as R i. In the conventional example 2, similarly to the conventional example 1, i 'data M satisfy i = M i ○ R i' to M, but to calculate the R i, for R i is pre-computed value, M 'i , R i need not be calculated, only M ′ i need be calculated. Since the random number is a pre-calculated value, unlike the conventional example 1, there is no need to dynamically update the Sbox table data, and it is only necessary to prepare a plurality of pre-calculated static data. High-speed processing can be realized. By using the DPA countermeasure method of Conventional Example 2, the AES encryption process without the DPA countermeasure shown in FIG. 18 is replaced with the encryption process as shown in FIG.

図20について説明する。q-1 MUXはセレクタを表し、q個の入力データの中から一つを乱数によって選択する。q-1 DEMUXはデマルチプレクサを表し、入力されたデータをq個の出力先の中から一つを乱数によって選択する。   FIG. 20 will be described. q-1 MUX represents a selector and selects one of q input data by random numbers. q-1 DEMUX represents a demultiplexer, and selects one of the input data from q output destinations by a random number.

入力データM’iに対して、拡大鍵KiによるXOR処理、及びSboxを用いたSubbyte処理、ShiftRow, MixColumn処理が実行され、データM’i+1が出力される。これらの一連の処理においては、乱数r(0£r£q-1)によって、q数の固定値のうち一つが選択され、この値によるマスク処理が行われる。例えば、q個の固定値をch(h=0,1,..,q-1)と表記した場合、乱数rによって選択される固定値をcrと表記する。DPA対策無しの処理における入力データをMiと表記すると、M’iは乱数rによって選択された固定値frに対して、M’i=Mi○frを満たす。つまり、Mi’はfrでXORされているので、Miのマスク値はfrである。 The input data M ′ i is subjected to XOR processing using the expanded key K i , Subbyte processing using Sbox, ShiftRow, MixColumn processing, and data M ′ i + 1 is output. In a series of these processes, one of q fixed values is selected by a random number r (0 £ rq-1), and a mask process using this value is performed. For example, when q fixed values are expressed as c h (h = 0,1, .., q−1), a fixed value selected by the random number r is expressed as cr. When the input data in the process without DPA countermeasures is denoted as M i, M 'i for a fixed value f r selected by the random number r, M' satisfy i = M i ○ f r. That is, since M i ′ is XORed with f r , the mask value of M i is f r .

拡大鍵Kiに対しては、乱数rにより選択された固定値erによりマスクされた後、M’iに対してXORされる。Mi’のマスク値はfr, 拡大鍵Kiのマスク値はerなので、Sboxに入力されるデータのマスク値は、これらのマスク値同士のXORで表されるので、fr○erとなる。ここで任意のh=0,1,…,q-1に対してch=fh○ehと表記すると、Sboxに入力されるデータのマスク値はcrとなる。 For expanded key Ki, after being masked by a fixed value e r selected by the random number r, is XOR against M 'i. Mask value M i 'is f r, the mask value of the extended key K i is because e r, since the mask values of the data input to the Sbox is represented by XOR between these mask values, f r ○ e r . Wherein any h = 0,1, ..., when expressed as c h = f h ○ e h against q-1, the mask value of the data input to Sbox becomes c r.

次に、Sbox回路による非線形変換処理が行われる。この処理は、乱数によりq個のSboxから一つを乱数によって選択することで行う。このSboxは、入力データがcrによりマスクされ、出力データがdrによりマスクされるような処理を行う。この処理を実現するための、マスクつきSbox をS’h[x]と表し、対策無しのSboxをS[x]と表した場合、S’h[x]=S[x○ch]○dhの関係が満たされるようにS’h[x]は設計される (h=0,1,…,q-1)。Sbox回路の入力にq-1 DEMUXが、出力にq-1 MUX回路があるため、q個のSboxのうち拡大鍵XOR演算の信号が伝達するのは1つだけである。q個のSboxの電力特性はそれぞれ異なるため、乱数によりこれらのうちの一つを選択することで、消費電力がランダム化され、PAに安全な処理を実現することができる。従来例1と異なり、Sboxテーブルは事前計算データを用いることができるため、従来例1より高速な処理を実現できる。しかし、図20の構成は、図16に示した対策無しのq倍のSbox回路を必要とする。AESにおける一般的にSboxの回路は非常に大きいため、このq個のSboxの回路規模がAES全体の回路規模を増大させるという欠点がある。よって、従来例2は、従来例1と同様、以下の問題がある。 Next, non-linear conversion processing by the Sbox circuit is performed. This process is performed by selecting one of q Sboxes using a random number. The Sbox input data is masked by c r, output data performs processing such as masked by d r. In order to realize this process, if Sbox with mask is represented as S ' h [x] and Sbox without countermeasure is represented as S [x], S' h [x] = S [x ○ c h ] ○ S ' h [x] is designed so that the relation of d h is satisfied (h = 0,1, ..., q-1). Since there is a q-1 DEMUX at the input of the Sbox circuit and a q-1 MUX circuit at the output, only one signal of the expanded key XOR operation is transmitted out of the q Sboxes. Since the power characteristics of q Sboxes are different from each other, by selecting one of these by a random number, power consumption is randomized, and PA-safe processing can be realized. Unlike the conventional example 1, since the Sbox table can use pre-calculated data, it can realize a higher speed process than the conventional example 1. However, the configuration of FIG. 20 requires a q-times Sbox circuit without countermeasures shown in FIG. Since the circuit of Sbox is generally very large in AES, the circuit scale of these q Sboxes has a drawback of increasing the circuit scale of AES as a whole. Therefore, the conventional example 2 has the following problems as in the conventional example 1.

従来例2の課題
課題1.DPA対策無しの回路と比較して、回路規模が大きい。
従来例3
AESのSboxの回路規模を小さくする方法として、合成体(Composite Field)を用いた方法が知られている。(下記非特許文献9、以下「従来例3」と呼ぶ)この方法は、SPA,DPA対策を用いないAES回路に適用できる方法として知られている。
Problems of Conventional Example 2 The circuit scale is larger than the circuit without DPA countermeasures.
Conventional example 3
As a method for reducing the circuit scale of the AES Sbox, a method using a composite field is known. This method is known as a method that can be applied to an AES circuit that does not use SPA and DPA countermeasures.

この方法を説明する前提として、AESのSbox回路の一般的な構成について説明する。図21は、下記非特許文献4の"5.1.1 SubBytes() Transformation"に記されているAESのSbox回路の構成を示している。Sbox回路は暗号化・復号それぞれに示しており、GF(28)の多項式x8+x4+x3+x+1の剰余値に関する逆元関数I(x)、Affine変換A(x)、及びAffine変換の逆関数であるAffine逆変換A-1(x)から構成される。ただし、GF()はガロア体(Galois Field)を現す記号である。特に、整数値βを用いてGF(2β)と表されるガロア体は、2進体 (binary field)と呼ばれ、γ個の整数値β1,…, βγを用いてGF( (…((2β1)β2) …)βγ )と表されるガロア体は合成体(composite field)と呼ばれる。ガロア体とはデータ表現形式の一種であり、このデータ表現形式で表されるデータを元(element)と呼ぶ。2進体の元はβ-bitの任意のデータであり、合成体の元は(β1×… ×βγ)-bitの任意のデータである。GF(2β)の元はβ-bitのデータ形式のみであるが、GF( (…((2β1)β2) …)βγ )の元は、β1-bit、β1×β2-bit、…、(β1×… ×βγ)-bitのようにγ種類のビット長のデータ形式に対応しており、ビット長が小さいデータ形式ほど小さな回路規模による演算処理が可能である。2進体、合成体それぞれの元に関して、乗算◎、XOR演算○、及び多項式f(x)による剰余演算mod (f(x))が定義されている。 As a premise for explaining this method, a general configuration of an AES Sbox circuit will be described. FIG. 21 shows the configuration of an AES Sbox circuit described in “5.1.1 SubBytes () Transformation” of Non-Patent Document 4 below. The Sbox circuit is shown for encryption and decryption, respectively. Inverse function I (x) and Affine transformation A (x) for the remainder of polynomial x 8 + x 4 + x 3 + x + 1 of GF (2 8 ) , And Affine inverse transformation A −1 (x) which is an inverse function of Affine transformation. However, GF () is a symbol representing a Galois Field. In particular, a Galois field represented as GF (2 β ) using an integer value β is called a binary field, and GF ((... ( The Galois field represented as (2 β1 ) β2 )…) βγ ) is called a composite field. A Galois field is a type of data representation format, and data represented in this data representation format is called an element. The element of the binary field is arbitrary data of β-bit, and the element of the composite field is arbitrary data of (β1 ×... × βγ) -bit. The element of GF (2 β ) is only β-bit data format, but the element of GF ((… ((2 β1 ) β2 )…) βγ ) is β1-bit, β1 × β2-bit, It corresponds to a data format of γ types of bit lengths such as (β1 ×... × βγ) -bit, and a data format with a smaller bit length allows arithmetic processing with a smaller circuit scale. For each element of the binary field and the composite field, multiplication 、, XOR operation ◯, and remainder operation mod (f (x)) using a polynomial f (x) are defined.

逆元(inverse element)とは、任意の8-bit値xに対してI(x)=x-1mod (x8+x4+x3+x+1)を満たす8-bit値yのことであり、x◎y=1 mod (x8+x4+x3+x+1)を満たす。Affine変換と逆元については、下記非特許文献4の"5.1.1 SubBytes() Transformation"も参照されたい。 An inverse element is an 8-bit value y that satisfies I (x) = x -1 mod (x 8 + x 4 + x 3 + x + 1) for any 8-bit value x That is, x ◎ y = 1 mod (x 8 + x 4 + x 3 + x + 1) is satisfied. For the Affine transformation and the inverse element, see also “5.1.1 SubBytes () Transformation” in Non-Patent Document 4 below.

A(x)は暗号化のときのみ、A-1(x)は復号のときのみ用いられ、I(x)は暗号化と復号の両方で用いられる共通の回路である。A(x),A-1(x)は簡単な論理演算による8-bit入出力演算を行う回路であり、回路規模が小さいことが知られている。これに対し、I(x)はテーブルを用いた8-bit入出力演算を行う回路であり、回路規模が大きいことで知られている。つまり、図21の構成は、暗号化と復号の両方で用いられる共通の回路であるI(x)の回路規模が大きいため、I(x)の回路規模削減が課題となる。このI(x)の回路規模を削減するための方法として、合成体(Composite Field)を用いた逆元の計算法が、下記非特許文献10に提案されている。テーブルを用いた一般的な逆元計算回路を図22に、合成体を用いた逆元計算回路を図23に示す。 A (x) is used only for encryption, A −1 (x) is used only for decryption, and I (x) is a common circuit used for both encryption and decryption. A (x) and A -1 (x) are circuits that perform 8-bit input / output operations by simple logic operations, and are known to have a small circuit scale. In contrast, I (x) is a circuit that performs 8-bit input / output operations using a table, and is known for its large circuit scale. That is, since the circuit scale of I (x), which is a common circuit used for both encryption and decryption, is large in the configuration of FIG. 21, reduction of the circuit scale of I (x) becomes a problem. As a method for reducing the circuit scale of I (x), an inverse element calculation method using a composite field is proposed in Non-Patent Document 10 below. A general inverse element calculation circuit using a table is shown in FIG. 22, and an inverse element calculation circuit using a composite is shown in FIG.

図22に示す通り、一般的な逆元計算回路は、テーブルを用いることで8-bit入力データを8-bit出力データに変換する処理を行うが、この処理を回路実装した場合、8-bit入出力であるため非常に回路規模が大きい。テーブル演算を行う回路において、m-bit入力データをn-bit出力データに変換する場合、その回路規模はm´n´2mに比例することが知られており(図22)、回路規模を小さくするためには入出力のビット長であるm,nの両方を小さくすることが重要な課題となる。この課題を解決したのが、図23に示す合成体を用いた逆元演算回路であり、この回路ではm=4, n=4のテーブルを用いる。図22に示すm=n=8のテーブルと、図23に示すm=n=4のテーブルの大きさを比較すると、(4´4´24)/(8´8´28)=(28)/(214)=1/64であり、つまり図23のテーブルは図22のテーブルの1/64の大きさとなるため、回路規模を削減可能である。 As shown in FIG. 22, a general inverse element calculation circuit performs a process of converting 8-bit input data into 8-bit output data by using a table. Since it is an input / output, the circuit scale is very large. When converting m-bit input data to n-bit output data in a circuit that performs table operations, it is known that the circuit scale is proportional to m′n′2 m (FIG. 22). In order to reduce the size, it is an important issue to reduce both the input and output bit lengths m and n. This problem is solved by an inverse element arithmetic circuit using the composite shown in FIG. 23, which uses a table of m = 4 and n = 4. Comparing the size of the table with m = n = 8 shown in FIG. 22 and the table with m = n = 4 shown in FIG. 23, (4′4′2 4 ) / (8′8′2 8 ) = ( Since 2 8 ) / (2 14 ) = 1/64, that is, the table of FIG. 23 is 1/64 the size of the table of FIG. 22, the circuit scale can be reduced.

図23の処理内容について説明する。図23は、GF(28)の元Tに対して、その逆元T-1を計算する。このT-1を4-bit入出力テーブルで計算するために、GF(((22)2)2)の元Uを利用する。ただし、合成体GF(((22)2)2)の元Uは多項式GF((24)2)=x2+x+(1100)2, GF((22)2)=x2+x+(10)2, GF(22)=x2+x+1の剰余である。TもUも8-bitデータであり、TとUはδ変換と呼ばれる変換により、U=δ(T), U=δ-1(T)により計算される。δ,δ-1変換はisomorphism functionと呼ばれる行列演算であり、詳細は下記非特許文献11を参照されたい。最初にδ変換により、TからUを計算した後、U16とU17を計算する。なお、U17は=U16とUを乗算することで計算する。この演算の結果、8ビット値のU17のうち、最上位4-bitは’0000’となることが知られている。つまり、U17は8ビットではなく4ビットで表現される値である。また、U17の逆元であるU-17も同様に4ビットで表現される値である。つまり、U17からU-17を計算するテーブル回路は、図22の方法では8ビット入出力であるのに対し、4ビット入出力に削減することができる。このテーブルによってU-17を計算した後、U-1=U-17´U16によりU-1を計算する。最後にT-1-1(U-1)により、T-1を計算する。 The processing content of FIG. 23 is demonstrated. FIG. 23 calculates the inverse element T −1 of the element T of GF (2 8 ). In order to calculate this T −1 with a 4-bit input / output table, the element U of GF (((2 2 ) 2 ) 2 ) is used. However, the element U of the composite field GF (((2 2 ) 2 ) 2 ) is the polynomial GF ((2 4 ) 2 ) = x 2 + x + (1100) 2 , GF ((2 2 ) 2 ) = x 2 + The remainder of x + (10) 2 , GF (2 2 ) = x 2 + x + 1. Both T and U are 8-bit data, and T and U are calculated by U = δ (T) and U = δ −1 (T) by a conversion called δ conversion. The δ, δ −1 conversion is a matrix operation called an isomorphism function. For details, see Non-Patent Document 11 below. First, U is calculated from T by δ transformation, and then U 16 and U 17 are calculated. U 17 is calculated by multiplying = U 16 and U. As a result of this calculation, it is known that the most significant 4-bit of U 17 of the 8-bit value is “0000”. That is, U 17 is a value represented by 4 bits instead of 8 bits. Similarly, U- 17 , which is the inverse element of U17 , is a value represented by 4 bits. That is, the table circuit for calculating U 17 to U -17 can be reduced to 4-bit input / output compared to 8-bit input / output in the method of FIG. After calculating the U -17 This table, to calculate the U -1 by U -1 = U -17'U 16. Finally, T −1 is calculated by T −1 = δ −1 (U −1 ).

図23の回路は、テーブルのビット長を削減した代わりに、16乗回路、乗算回路が追加されているが、これらの回路規模は図22の8-bit入出力テーブルと比べて非常に小さいことが知られているため、図23に示す逆元計算回路は図22の逆元計算回路より小さい回路規模を実現することができる。ただし、従来例3はPA対策を行っていないため、以下の課題3に示す問題がある。   In the circuit of FIG. 23, a 16th power circuit and a multiplication circuit are added instead of reducing the bit length of the table, but the circuit scale is very small compared to the 8-bit input / output table of FIG. Therefore, the inverse element calculation circuit shown in FIG. 23 can realize a circuit scale smaller than the inverse element calculation circuit of FIG. However, since Conventional Example 3 does not take PA countermeasures, there is a problem shown in Problem 3 below.

従来例3の課題
課題3.SPA,DPAに対して安全な処理を実現することができない。
なお、GF(28)の元とGF(((22)2)2)の元を用いた乗算◎は以下の種類が知られている。乗算◎、及びXOR演算○に関しては(law-1), (law-2), (law-3), (law-4) に示される法則が成立する。
Problems of Conventional Example 3 Safe processing cannot be realized for SPA and DPA.
Note that the following types of multiplications ◎ using elements of GF (2 8 ) and elements of GF (((2 2 ) 2 ) 2 ) are known. The laws shown in (law-1), (law-2), (law-3), and (law-4) hold for multiplication ◎ and XOR operation ○.

・GF(28)の乗算: 以下の1種類のみ定義される。
- c=a◎bで定義される8-bit´8-bit乗算のみ定義される。a,b,cは全て8-bit値。
・ GF(((22)2)2)の乗算: 以下の3種類が定義される。
- c=a◎bで定義される8-bit´8-bit乗算。a,b,cは全て8-bit値。
- c=a◎bで定義される8-bit´4-bit乗算。a,cは8-bit値、bは4-bit値。
- c=a◎bで定義される4-bit´4-bit乗算。a,b,cは全て4-bit値。
• Multiplication of GF (2 8 ): Only one of the following types is defined.
-Only 8-bit '8-bit multiplication defined by c = a ◎ b is defined. a, b and c are all 8-bit values.
• Multiplication of GF (((2 2 ) 2 ) 2 ): The following three types are defined.
-8-bit´8-bit multiplication defined by c = a ◎ b. a, b and c are all 8-bit values.
-8-bit '4-bit multiplication defined by c = a ◎ b. a and c are 8-bit values and b is a 4-bit value.
-4-bit´4-bit multiplication defined by c = a ◎ b. a, b and c are all 4-bit values.

(law-1) a◎b = b◎a
ただし、a,bは8-bitもしくは4-bitデータであり、GF(28)もしくはGF(((22)2)2)の元。
(law-2) a◎(b○c) = a◎b○a◎c
ただし、a,b,cは8-bitもしくは4-bitデータであり、GF(28)もしくはGF(((22)2)2)の元。
(law-3) a○a=0
ただし、aは8-bitもしくは4-bitデータであり、GF(28)もしくはGF(((22)2)2)の元。
(law-4) a◎b = aH◎b || aL◎b
ただし、aは8-bitデータ、aHはaの上位4-bit, aLはaの下位4-bit、bは4-bitデータである。||はビット結合(concatenation)を表す記号であり、例えばビット値(1110)2は(1110)2=(11)2 || (10)2と表記される。また、a, aH, aLの関係はa=aH||aLと表記される。a, aH, aL, bはGF(((22)2)2)の元である。
(law-1) a ◎ b = b ◎ a
However, a and b are 8-bit or 4-bit data and are elements of GF (2 8 ) or GF (((2 2 ) 2 ) 2 ).
(law-2) a ◎ (b ○ c) = a ◎ b ○ a ◎ c
However, a, b, and c are 8-bit or 4-bit data, and are elements of GF (2 8 ) or GF (((2 2 ) 2 ) 2 ).
(law-3) a ○ a = 0
However, a is 8-bit or 4-bit data, and is an element of GF (2 8 ) or GF (((2 2 ) 2 ) 2 ).
(law-4) a ◎ b = a H ◎ b || a L ◎ b
However, a is 8-bit data, a H is upper 4-bit of a, a L is lower 4-bit of a, and b is 4-bit data. || is a symbol representing bit concatenation. For example, a bit value (1110) 2 is expressed as (1110) 2 = (11) 2 || (10) 2 . Further, a, a H, the relationship of a L is expressed as a = a H || a L. a, a H , a L , and b are elements of GF (((2 2 ) 2 ) 2 ).

(law-1)(law-2)は, 整数における乗算´、加算+について成立する交換則a´b=b´aと、結合則a´ (b+c)=a´b+a´cに対応する法則であり、GF(28), GF(((22)2)2)の両方に成立する。(law-3)はXOR演算の定義0○0=0, 1○1=0より明らかであり、GF(28), GF(((22)2)2)の両方に成立する。(law-4)はGF(((22)2)2)のみ成立する特殊な法則である。GF(((22)2)2)における8-bit´4-bit乗算の計算結果は2つの4-bit´4-bit乗算aH◎b, aL◎bの演算結果をビット結合することで得られることを意味している。 (law-1) and (law-2) are an exchange rule a′b = b′a and a combination rule a ′ (b + c) = a′b + a′c that hold for multiplication ′ and addition + in integers. Which holds for both GF (2 8 ) and GF (((2 2 ) 2 ) 2 ). (law-3) is clear from the definition of XOR operation 0 ○ 0 = 0, 1 ○ 1 = 0, and holds for both GF (2 8 ) and GF (((2 2 ) 2 ) 2 ). (law-4) is a special law that holds only for GF (((2 2 ) 2 ) 2 ). The calculation result of 8-bit'4-bit multiplication in GF (((2 2 ) 2 ) 2 ) is the bit combination of the calculation results of two 4-bit'4-bit multiplications a H ◎ b, a L ◎ b. It means that it can be obtained.

GF(28),GF(((22)2)2)以外の一般的なガロア体について、(law-1)(law-2)(law-3)は、任意の2進体GF(2β)及び任意の合成体GF( (…(2β1)…)βγ)について成立する。(law-4)は、合成体GF( (…(2β1)…)βγ)が、βγ=2を満たす場合に成立する。つまり、aが (β1×… ×βγ-1×2)-bitであり、aH, aL, bが(β1×… ×βγ-1)-bitの場合に、a◎bの結果は(law-4)に従う。 For general Galois fields other than GF (2 8 ), GF (((2 2 ) 2 ) 2 ), (law-1) (law-2) (law-3) is an arbitrary binary GF ( 2 β ) and any composite GF ((... (2 β1 )... Ββ )). (law-4) is established when the composite GF ((... (2 β1 )... ββ ) satisfies βγ = 2. In other words, when a is (β1 ×… × βγ-1 × 2) -bit and a H , a L , b are (β1 ×… × βγ-1) -bit, the result of a ◎ b is ( Follow law-4).

以上で述べた従来例1,2,3について、それぞれの特徴に関する比較を表1にまとめる。表1においては、PAに対する安全性、回路規模、及び処理速度の3点について比較を行っている。安全性に関しては「安全」である方が優れている。回路規模に関しては「小」である方が優れている。処理速度に関しては、「高速」である方が優れている。表1から、従来例1,2,3はこれら3点全てについて優れた特徴を持つ方式ではないことが分かる。   Table 1 summarizes the comparison of the features of the conventional examples 1, 2, and 3 described above. Table 1 compares three points of PA safety, circuit scale, and processing speed. In terms of safety, “safe” is better. In terms of circuit scale, “small” is better. Regarding the processing speed, “high speed” is superior. From Table 1, it can be seen that Conventional Examples 1, 2, and 3 are not systems having excellent characteristics in all three points.

<従来の課題と解決手段について>
ここでは、表1に示す3つの特徴全てについて優れた効果を発揮する本発明の手段を示す。この手段を説明するために、従来例2と従来例3の単純な組み合わせを示したうえで、本発明による解決手段を示す。最初に、従来例2と3の単純な組み合わせの一つを図24に示す。
<Conventional issues and solutions>
Here, the means of the present invention that exhibits excellent effects for all three features shown in Table 1 are shown. In order to explain this means, a simple combination of Conventional Example 2 and Conventional Example 3 is shown, and the solution means according to the present invention is shown. First, one simple combination of Conventional Examples 2 and 3 is shown in FIG.

図24は従来例2と従来例3の組み合わせによる回路を示している。従来例2の問題は、図20に示したq個のSboxの回路規模が大きいことである。よって図24は、これらのSbox回路を図23に示した合成体の回路に置き換えることで、従来例2の欠点であるSbox回路の削減を目標としており、図23の逆元計算回路のテーブル索引処理について、図20に示す、乱数に応じたテーブル選択技術を導入している。   FIG. 24 shows a circuit according to a combination of Conventional Example 2 and Conventional Example 3. The problem of Conventional Example 2 is that the circuit scale of q Sboxes shown in FIG. 20 is large. Therefore, FIG. 24 aims to reduce the Sbox circuit, which is a disadvantage of the conventional example 2, by replacing these Sbox circuits with the composite circuit shown in FIG. 23, and the table index of the inverse element calculation circuit of FIG. For processing, a table selection technique corresponding to random numbers shown in FIG. 20 is introduced.

図24の入力データは、M○K○prである。これは、平文Mと拡大鍵KをXORされた値に対して、さらに乱数rにより選択された固定値pr(0£r£q-1)によりマスクされた値である。 Input data of FIG. 24 is a M ○ K ○ p r. This is a value obtained by masking a value obtained by XORing the plaintext M and the extended key K with a fixed value p r (0 £ r £ q-1) selected by a random number r.

この値に対してδ変換を行った値はX=δ(M○K○pr)=δ(M○K)○δ(pr)である。つまり、Xはマスク値δ(pr)によりマスクされている。なお、δ,δ-1変換は線型変換であるため、任意のa,bに対しδ(a○b)=δ(a)○δ(b), δ-1(a○b)=δ-1(a) ○δ-1(b)が成立する関数である。 A value obtained by performing δ conversion on this value is X = δ (MMK ○ p r ) = δ (M ○ K) ○ δ (p r ). That is, X is masked by the mask value Δ (p r ). Since δ, δ -1 transformation is linear transformation, δ (a ○ b) = δ (a) ○ δ (b), δ -1 (a ○ b) = δ for any a, b 1 (a) ○ δ −1 (b) is a function that holds.

図24において、このXとX16の乗算を行う乗算器に対し、ゼロ乗算SPAを用いることで、256通りの鍵Kの候補をq通りに絞ることが可能である。qの値は、理論上は無限に大きくすることが可能であるが、大きくしすぎた場合回路規模が大きくなるため、現実的にはq=4程度の値が用いられる。つまり、256通りの鍵Kの値を4通りに絞り込むことができるため、図24の回路はゼロ乗算SPAに対して脆弱である。以下では、その攻撃法について説明を行う。 In Figure 24, to a multiplier for multiplying the X and X 16, by using a zero multiplication SPA, it is possible to narrow the candidates of the key K 256 to q street. The value of q can theoretically be increased indefinitely, but if it is increased too much, the circuit scale increases, so a value of about q = 4 is practically used. That is, since the 256 key K values can be narrowed down to four, the circuit in FIG. 24 is vulnerable to zero multiplication SPA. The attack method will be described below.

最初に攻撃の前提を説明する。Mは攻撃者にKnownな値、Kは攻撃者にUnknownな値、rは攻撃者にUnknownな値、q個の固定値のセットp0, p1, …, pq-1は攻撃者にKnownな値であると仮定する。この前提をもとに、図24の回路に対するゼロ乗算SPAの方法について説明する。 First, the premise of the attack is explained. M is a value known to the attacker, K is an unknown value to the attacker, r is an unknown value to the attacker, and a set of q fixed values p 0 , p 1 ,…, p q-1 is the attacker Assume a known value. Based on this assumption, a zero multiplication SPA method for the circuit of FIG. 24 will be described.

ゼロ乗算SPAにより消費電力を観察される対象の乗算器は、X=0によるゼロ乗算が発生した場合、SPAにより観察できる。このSPAはX=0を意味するので、δ(M○K)○δ(pr)=0、つまりδ(M○K)=δ(pr)であることが攻撃者に分かる。両辺にδ-1変換を行うことで、M○K=prを得る。よって、攻撃者はK=M○prであることが分かる。つまり、r=0,1,..,q-1のいずれかに対しK= M○prであることが攻撃者にわかるので、Kの値をq通りに絞り込むことができる。このようなゼロ乗算SPAは、図24におけるXとX16の乗算を行う乗算器のみならず、X16と4-bitテーブルI’r[x]の出力を乗算する乗算器に対しても同様に可能である。 The target multiplier whose power consumption is observed by the zero multiplication SPA can be observed by the SPA when the zero multiplication by X = 0 occurs. Since this SPA means X = 0, the attacker knows that δ (M ○ K) ○ δ (p r ) = 0, that is, δ (M ○ K) = δ (p r ). By performing δ −1 conversion on both sides, M 換 K = pr is obtained. Thus, it can be seen that the attacker is a K = M ○ p r. That is, since the attacker knows that K = M Mp r for any of r = 0, 1, .., q−1, the value of K can be narrowed down to q. Such a zero multiplication SPA is applied not only to the multiplier that performs the multiplication of X and X 16 in FIG. 24 but also to the multiplier that multiplies the output of X 16 and the 4-bit table I ′ r [x]. Is possible.

以上から、図24に示した回路は、マスク値prによるデータのランダム化を行っているにも関わらず、ゼロ乗算SPAに対して脆弱である。この理由は、prがq個の8-bit固定値の中から一つを乱数によってセレクトされた値(以下、固定値マスク, fixed mask valueと呼ぶ)であるためであり、その結果、256通りのKの値をq通りに絞ることができる。固定値マスクprの代わりに、つまり任意の8-bit乱数値Rをマスク値(以下、乱数値マスク, random mask valueと呼ぶ)として用いる場合、例えゼロ乗算がSPAによって観察されたとしても攻撃者はKの値の候補を絞ることができない。なぜなら、攻撃者がゼロ乗算観察によって得る情報は、K= M○prの代わりにK=M○Rであるが、このときRは任意の8-bit乱数値であり攻撃者にUnknownな値であるので、Kの値の候補の数は256通りより減ることはないからである。 From the above, the circuit shown in FIG. 24, despite performing randomization of data by the mask value p r, is vulnerable to zero multiplication SPA. The reason for this selection values one by a random number from among the p r is the q 8-bit fixed value and because it is (hereinafter, the fixed value mask, fixed mask value called a), as a result, 256 The value of street K can be narrowed down to q ways. Instead of a fixed mask value p r, i.e. mask any 8-bit random number R value (hereinafter, random value mask, random mask value hereinafter) is used as a, as a zero multiplication even were observed by SPA attacks Cannot narrow down the candidates for K values. This is because the information that the attacker obtained by the zero multiplication observation, K = but instead of M ○ p r is K = M ○ R, Unknown values in this case R is any 8-bit random number attacker Therefore, the number of K value candidates cannot be reduced from 256.

以上より、合成体計算を用いたAES処理において、乗算器に対して、固定値マスクによりマスクされたデータを入力した場合、ゼロ乗算SPAに対して脆弱であり、乱数値マスクによりマスクされたデータを入力した場合、ゼロ乗算SPAに対して安全であるとの結論が得られる。このような、乗算処理に関してゼロ乗算SPAに対して安全性であるための条件を図式化した結果を図25に示す。   As described above, in AES processing using composite field calculation, when data masked by a fixed value mask is input to a multiplier, data that is vulnerable to zero multiplication SPA and masked by a random value mask Is entered, it is concluded that it is safe for zero multiplication SPA. FIG. 25 shows the result of diagramizing such a condition for safety against the zero multiplication SPA regarding the multiplication processing.

図25において、X,Yはマスクされていないデータであり、DPA, SPA対策なしのAES処理において計算されるデータである。pr, qsは、乱数r,sによってセレクトされた固定値マスクを表す。R,Sは、乱数値マスクを表す。X○R, Y○Sのように、DPA,SPA対策無しの処理において計算されるデータX,Yに対して、R,Sのような乱数値マスクをXORする処理を乱数値マスク化(random value masking)と呼び、その結果XORされたデータX○R, Y○Sを乱数値マスク化データ(random value masked data)と呼ぶ。同様に、X○pr, Y○qsのように、DPA,SPA対策無しの処理において計算されるデータX,Yに対して、pr,qsのような固定値マスクをXORする処理を固定値マスク化(fixed value masking)と呼び、その結果XORされたデータX○pr, Y○qsを固定値マスク化データ(fixed value masked data)と呼ぶ。 In FIG. 25, X and Y are unmasked data and are data calculated in the AES process without DPA and SPA countermeasures. p r and q s represent fixed value masks selected by the random numbers r and s. R and S represent random value masks. Randomized value masking (Random value masking) (Random value mask processing such as R and S) for data X and Y calculated in processing without DPA and SPA countermeasures such as X ○ R and Y ○ S value masking), and the XORed data XR and YS as a result are called random value masked data. Similarly, XOR of fixed value masks such as p r and q s for data X and Y calculated in processing without DPA and SPA countermeasures, such as X ○ p r and Y ○ q s Is called fixed value masking, and the resulting XORed data XXpr and Y ○ q s are called fixed value masked data.

図25に示すように、ゼロ乗算SPAに対して安全な乗算処理は、c=a◎bで表される乗算処理の2つの入力a,bともに乱数値マスク化データを入力する処理である。もし、乗算に対する2つの入力a,bのうち、片方もしくは両方に乱数値マスク化データではない値が入力される場合、ゼロ乗算SPAに対して脆弱となる。例えば、c=(X○pr)◎(Y○qs)のようにa,bともに固定値マスク化データ、c=(X○pr)◎(Y○S)のようにbのみ乱数値マスク化データ、c=(X○R)◎Yのようにaのみ乱数値マスク化データの場合は、いずれの場合についてもゼロ乗算SPAに対して脆弱である。以上により、ゼロ乗算SPAに対して安全な処理を実現するための条件は、以下の(ZSPA-sec)により表される。 As shown in FIG. 25, the safe multiplication process for the zero multiplication SPA is a process of inputting random value masked data for both the two inputs a and b of the multiplication process represented by c = aab. If a value that is not random value masked data is input to one or both of the two inputs a and b for multiplication, it becomes vulnerable to zero multiplication SPA. For example, both a and b are fixed value masked data such as c = (X ○ p r ) ◎ (Y ○ q s ), and only b is disturbed such as c = (X ○ p r ) ◎ (Y ○ S). In the case of numerical value masked data, random number masked data of only a such as c = (XR) ◎ Y, each case is vulnerable to zero multiplication SPA. As described above, the condition for realizing the safe processing for the zero multiplication SPA is expressed by the following (ZSPA-sec).

(ZSPA-sec) ゼロ乗算SPAに対して安全な乗算処理は、c=a◎bで表される乗算処理の2つの入力a,bともに乱数値マスク化データを入力する演算である。 (ZSPA-sec) The multiplication process that is safe against the zero multiplication SPA is an operation in which randomized value masked data is input to both the two inputs a and b of the multiplication process represented by c = aab.

下記文献群は、この明細書にて引用する公知例である。   The following literature group is a well-known example cited in this specification.

特開2002−366029号公報JP 2002-366029 A

Thomas S.Messerges, Ezzy A.Dabbish and Robert H.Sloan ”Power Analysis Attacks of Modular Exponentitiation in Smartcards”, Cryptographic Hardware and Embedded Systems(CHES’99), Springer-Verlag, pp.144-157Thomas S. Messerges, Ezzy A. Dabbish and Robert H. Sloan “Power Analysis Attacks of Modular Exponentitiation in Smartcards”, Cryptographic Hardware and Embedded Systems (CHES’99), Springer-Verlag, pp.144-157 Paul Kocher, Joshua Jaffe, and Benjamin Jun, “Differential Power Analysis,” in proceedings of Advances in Cryptology-CRYPTO’99, Springer-Verlag, 1999, pp. 388-397Paul Kocher, Joshua Jaffe, and Benjamin Jun, “Differential Power Analysis,” in proceedings of Advances in Cryptology-CRYPTO’99, Springer-Verlag, 1999, pp. 388-397 S. Chari, C. Jutla, J.R. Rao, P. Rohatgi, “An Cautionary Note Regarding Evaluation of AES Candidates on Smart-Cards,” Second Advanced Encryption Standard Candidate Conference, March 1999S. Chari, C. Jutla, J.R.Rao, P. Rohatgi, “An Cautionary Note Regarding Evaluation of AES Candidates on Smart-Cards,” Second Advanced Encryption Standard Candidate Conference, March 1999 米NIST(National Institute of Standards and Technology), 標準FIPS197 (Federal Information Processing Standards Publication)http://csrc.nist.gov/publications/fips/fips197/fips-197.pdfNIST (National Institute of Standards and Technology), Standard FIPS197 (Federal Information Processing Standards Publication) http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf T. S. Messerge, Ezzy A. Dabbish and Robert H.Sloan ,“Investigations of Power Attacks on Smartcards”. Proceedings of USENIX Workshop on Smartcard Technology, Mar 1999.T. S. Messerge, Ezzy A. Dabbish and Robert H. Sloan, “Investigations of Power Attacks on Smartcards”. Proceedings of USENIX Workshop on Smartcard Technology, Mar 1999. Takeshi Shimoyama, Hitoshi Yanami, Kazuhiro Yokoyama, Masahiko Takenaka, Kouichi Itoh, Jun Yajima, Naoya Torii, Hidema Tanaka "The Block Cipher SC2000", Fast Software Encryption (FSE 2001), pp.312-327, LNCS vol.2355Takeshi Shimoyama, Hitoshi Yanami, Kazuhiro Yokoyama, Masahiko Takenaka, Kouichi Itoh, Jun Yajima, Naoya Torii, Hidema Tanaka "The Block Cipher SC2000", Fast Software Encryption (FSE 2001), pp.312-327, LNCS vol.2355 M.Akkar, RBevan, P.Dischamp, and D. Moyart, "Power Analysis, What Is Now Possible... ", Asiacrypt 2000)M.Akkar, RBevan, P.Dischamp, and D. Moyart, "Power Analysis, What Is Now Possible ...", Asiacrypt 2000) Thomas S. Messerges, “Securing the AES Finalists Against Power Analysis Attacks,” in proceedings of Fast Software Encryption Workshop 2000, Springer-Verlag, April 2000.Thomas S. Messerges, “Securing the AES Finalists Against Power Analysis Attacks,” in proceedings of Fast Software Encryption Workshop 2000, Springer-Verlag, April 2000. Akashi Satoh, Sumio Morioka, Kohji Takano and Seiji Munetoh: "A Compact Rijndael Hardware Architecture with S-Box Optimization", ASIACRYPT2001, LNCS Vol.2248, pp.239-254, Dec 2001.Akashi Satoh, Sumio Morioka, Kohji Takano and Seiji Munetoh: "A Compact Rijndael Hardware Architecture with S-Box Optimization", ASIACRYPT2001, LNCS Vol.2248, pp.239-254, Dec 2001. Akashi Satoh, Sumio Morioka, Kohji Takano and Seiji Munetoh: "A Compact Rijndael Hardware Architecture with S-Box Optimization", ASIACRYPT2001, LNCS Vol.2248, pp.239-254, Dec 2001.Akashi Satoh, Sumio Morioka, Kohji Takano and Seiji Munetoh: "A Compact Rijndael Hardware Architecture with S-Box Optimization", ASIACRYPT2001, LNCS Vol.2248, pp.239-254, Dec 2001. "A Compact Rijndael Hardware Architecture with S-Box Optimization""A Compact Rijndael Hardware Architecture with S-Box Optimization"

上記のように、従来例を単純に組み合わせた場合、前述した課題1、課題2、課題3を全て解決したSPA,DPA対策つきAES暗号装置を実現することができない。よって、これらの問題を全て解決することが、本発明の課題である。   As described above, when the conventional examples are simply combined, it is impossible to realize an AES encryption apparatus with SPA and DPA countermeasures that solves all of the problems 1, 2, and 3 described above. Therefore, it is an object of the present invention to solve all these problems.

本発明の第1の態様は、非線型変換を2進体又は合成体における乗算処理で演算する共通鍵ブロック暗号化装置を前提とする。   The first aspect of the present invention is premised on a common key block encryption device that performs non-linear conversion by multiplication processing in a binary or composite field.

まず、非線型変換以外の演算処理を、固定値によるマスク(以下「固定値マスク」)をエクスクルーシブオア演算(以下「XOR」)して得た固定値マスク化入力データにより実行する演算器を有する。   First, there is an arithmetic unit that performs arithmetic processing other than non-linear conversion using fixed value masked input data obtained by exclusive OR operation (hereinafter referred to as “XOR”) of a fixed value mask (hereinafter referred to as “fixed value mask”). .

次に、非線型変換における乗算処理において、全ての入力データに固定値マスクをXORして固定値マスク化入力データに変換し、更に乱数値によるマスク(以下「乱数値マスク」)をXORして乱数値マスク化入力データに変換するXOR演算回路と、そのXOR演算回路から出力された乱数値マスク化入力データに基づいて乗算処理を実行する乗算器と、その乗算器から出力される乱数値マスク化出力データを固定値マスク化出力データ再変換して出力する乱数値マスク−固定値マスク変換回路を有する。   Next, in multiplication processing in nonlinear conversion, all input data is XORed with fixed value masks to convert to fixed value masked input data, and then a random value mask (hereinafter referred to as “random number mask”) is XORed. XOR operation circuit for converting to random value masked input data, a multiplier for executing multiplication processing based on the random value masked input data output from the XOR operation circuit, and a random value mask output from the multiplier A random value mask-fixed value mask conversion circuit that reconverts the output data into fixed value masked output data and outputs the result.

上記本発明の第1の態様をベースとして、本発明の第2の態様は、以下の構成を有する。   Based on the first aspect of the present invention, the second aspect of the present invention has the following configuration.

即ち、本発明の第1の態様における乗算処理は、非線形変換における乗算処理の入力データをX,Y、乱数値マスクをR,S、固定値マスクをfr、○をXOR演算回路、◎を乗算器とし、R’=R○pr,S’=S○qrのように固定値マスクに乱数をXORした乱数値マスクをR’,S’として、
J1=(X○R’)◎(Y○S’)
J2=S’◎(X○R’)
J3=R’◎(Y○S’)
J4=R’◎S’
J0=J1○J2○J3○J4○fr
を演算して出力J0=X◎Y○frを演算する演算回路又はこれと等価な演算回路によって構成される。
That is, the multiplication process according to the first aspect of the present invention is such that the input data of the multiplication process in the non-linear transformation is X, Y, the random value mask is R, S, the fixed value mask is fr , the circle is an XOR operation circuit, and Let R ', S' be a random value mask obtained by XORing a random number to a fixed value mask such as R '= R ○ p r , S' = S ○ q r
J1 = (X ○ R ') ◎ (Y ○ S')
J2 = S '◎ (X ○ R')
J3 = R '◎ (Y ○ S')
J4 = R '◎ S'
J0 = J1 ○ J2 ○ J3 ○ J4 ○ f r
The calculates constituted by the arithmetic circuit or equivalent computing circuit for computing an output J0 = X ◎ Y ○ f r .

上記本発明の第1の態様をベースとして、本発明の第3の態様は、以下の構成を有する。   Based on the first aspect of the present invention, the third aspect of the present invention has the following configuration.

即ち、本発明の第1の態様における乗算処理は、非線形変換における乗算処理の入力データをX,Y、乱数値マスクをR、固定値マスクをfr、○をXOR演算回路、◎を乗算器とし、R’=R○prのように固定値マスクに乱数をXORした乱数値マスクをR’として、
J1=(X○R’)◎(Y○R’)
J2=R’◎((X○R’)○(Y○R’)○R’)
J0=J1○J2○fr
を演算して出力J0=X◎Y○frを演算する演算回路又はこれと等価な演算回路によって構成される。
That is, the multiplication process according to the first aspect of the present invention is such that the input data of the multiplication process in the non-linear transformation is X, Y, the random value mask is R, the fixed value mask is fr , the circle is an XOR operation circuit, and the circle is a multiplier. and then, 'the random number mask XOR random number to a fixed value mask as = R ○ p r R' R a,
J1 = (X ○ R ') ◎ (Y ○ R')
J2 = R '◎ ((X ○ R') ○ (Y ○ R ') ○ R')
J0 = J1 ○ J2 ○ f r
The calculates constituted by the arithmetic circuit or equivalent computing circuit for computing an output J0 = X ◎ Y ○ f r .

上記本発明の第1の態様をベースとして、本発明の第4の態様は、以下の構成を有する。   Based on the first aspect of the present invention, the fourth aspect of the present invention has the following configuration.

即ち、本発明の第1の態様における乗算処理は、βγ=2を満たす合成体GF((…(2β1)…)βγ)における演算であり、その乗算処理は、非線形変換における乗算処理の入力データをX,Y、乱数値マスクをR,S、固定値マスクをfr、○をXOR演算回路、◎を乗算器とし、R’=R○pr,S’=S○qrのように固定値マスクに乱数をXORした乱数値マスクをR’,S’とし、R’H及びR’LをそれぞれR’を上位及び下位に半分ずつ分割した場合のビット値とし、J2||(0000)2をJ2の下位側にそれと同じビット数のゼロビット列を結合する演算として、
J1=(X○R’)◎(Y○R’L)
J2=(Y○R’H)◎R’H○R’H 2
J3=((X○R’)○(Y○R’L)○R’L)◎R’L
J0=J1○(J2||(0000)2)○J3○fr
を演算して出力J0=X◎Y○frを演算する演算回路又はこれと等価な演算回路によって構成される。
That is, the multiplication process in the first aspect of the present invention is an operation in the composite GF ((... (2 β1 )... Βγ ) satisfying βγ = 2, and the multiplication process is an input of the multiplication process in the nonlinear transformation. Data is X, Y, random value mask is R, S, fixed value mask is f r , ○ is an XOR operation circuit, ◎ is a multiplier, and R '= R ○ p r , S' = S ○ q r A random value mask obtained by XORing random numbers into a fixed value mask is R ′, S ′, and R ′ H and R ′ L are bit values when R ′ is divided into upper and lower half, J2 || ( 0000) 2 is an operation that joins a zero bit string of the same number of bits to the lower side of J2,
J1 = (X ○ R ') ◎ (Y ○ R'L )
J2 = (Y ○ R ' H ) ◎ R' H ○ R ' H 2
J3 = ((X ○ R ') ○ (Y ○ R' L ) ○ R ' L ) ◎ R' L
J0 = J1 ○ (J2 || (0000) 2 ) ○ J3 ○ fr
The calculates constituted by the arithmetic circuit or equivalent computing circuit for computing an output J0 = X ◎ Y ○ f r .

上記本発明の第1の態様をベースとして、本発明の第5の態様は、以下の構成を有する。   Based on the first aspect of the present invention, the fifth aspect of the present invention has the following configuration.

即ち、本発明の第1の態様における乗算処理は、βγ=2を満たす合成体GF((…(2β1)…)βγ)における演算であり、その乗算処理は、非線形変換における乗算処理の入力データをX,Y、乱数値マスクをR,S、固定値マスクをfr、○をXOR演算回路、◎を乗算器とし、R’=R○pr,S’=S○qrのように固定値マスクに乱数をXORした乱数値マスクをR’,S’とし、R’H及びR’LをそれぞれR’を上位及び下位に半分ずつ分割した場合のビット値とし、X’H及びX’LをそれぞれX’を上位及び下位に半分ずつ分割した場合のビット値として、
J1=(XH○R’L)◎(Y○R’L)
J2=((XH○R’L)○(Y○R’L)○R’L)◎R’L
J3=(XL○R’L)◎(Y○R’L)
J4=((XL○R’L)○(Y○R’L)○R’L)◎R’L
J0=((J1○J2)||(J3○J4))○fr
を演算して出力J0=X◎Y○frを演算する演算回路又はこれと等価な演算回路によって構成される。
That is, the multiplication process in the first aspect of the present invention is an operation in the composite GF ((... (2 β1 )... Βγ ) satisfying βγ = 2, and the multiplication process is an input of the multiplication process in the nonlinear transformation. Data is X, Y, random value mask is R, S, fixed value mask is f r , ○ is an XOR operation circuit, ◎ is a multiplier, and R '= R ○ p r , S' = S ○ q r R ', S' is a random value mask obtained by XORing random numbers into a fixed value mask, and R ' H and R' L are bit values when R 'is divided into upper and lower half respectively, and X' H and X ' L is a bit value when X' is divided into half of upper and lower half respectively.
J1 = (X H ○ R ' L ) ◎ (Y ○ R' L )
J2 = ((X H ○ R ' L ) ○ (Y ○ R' L ) ○ R ' L ) ◎ R' L
J3 = (X L ○ R ' L ) ◎ (Y ○ R' L )
J4 = ((X L ○ R ' L ) ○ (Y ○ R' L ) ○ R ' L ) ◎ R' L
J0 = ((J1 ○ J2) || (J3 ○ J4)) ○ f r
The calculates constituted by the arithmetic circuit or equivalent computing circuit for computing an output J0 = X ◎ Y ○ f r .

上述の本発明の第2又は第3の態様の乗算処理の演算回路を用いて、2進体もしくは合成体におけるU16◎Uの乗算を実行するように構成することができる。 Using the arithmetic circuit for multiplication processing according to the second or third aspect of the present invention described above, it is possible to perform a multiplication of U 16 ◎ U in a binary field or a composite field.

また、上述の本発明の第2、第4又は第5の態様の乗算処理の演算回路を用いて、2進体もしくは合成体におけるU-17◎U16の乗算を実行するように構成することができる。 Further, it is configured to perform the multiplication of U -17 ◎ U 16 in a binary field or a composite field by using the arithmetic circuit of the multiplication process according to the second, fourth, or fifth aspect of the present invention described above. Can do.

本発明の第6の態様は、4ビットのcr,8ビットのgr,4ビットのdr,及び8ビットのfrをそれぞれ乱数rによって選択される固定値マスクとし、8ビットのR、R’を乱数値マスクとして、8ビットの入力データU○grから8ビットの出力データU-1○frを、βγ=2を満たす合成体GF((…(2β1)…)βγ)において演算する共通鍵ブロック暗号化装置を前提として、以下の構成を有する。 A sixth aspect of the invention, a fixed mask value selected by 4-bit c r, 8-bit g r, 4 bits of d r, and 8 bits of f r each random number r, the 8-bit R as random number mask R ', the output data U -1 ○ f r of 8 bits from the input data U ○ g r of 8 bits, satisfying the [beta] [gamma] = 2 composite GF ((... (2 β1) ...) βγ Assuming the common key block encryption device operated in (1), it has the following configuration.

まず、乱数値マスクをXORさせて実行するU16◎U計算により、入力データU○grから4ビット値U17○crを計算すると共に、それぞれ8ビットのU16○R’及びR’を計算するmaskedU16◎U計算回路を有する。 First, a 4-bit value U 17 ○ c r is calculated from input data U ○ g r by U 16 ◎ U calculation executed by XORing a random value mask, and 8-bit U 16 ○ R ′ and R ′, respectively. A maskedU 16 ◎ U calculation circuit is provided.

次に、そのmaskedU16◎U計算回路から出力されるU17○crから4ビットのU-17○drを計算する、乱数rによって選択された4ビット対4ビット変換テーブル回路を有する。 Then, with its maskedU 16 ◎ U calculates the 4-bit U -17 ○ d r from U 17 ○ c r outputted from the calculation circuit, 4-bit to 4-bit conversion table circuit selected by a random number r.

そして、4ビット対4ビット変換テーブル回路から出力されるU-17○drとmaskedU16◎U計算回路から出力されるU16○R’及びR’をそれぞれ入力し、出力データU-1○frを計算するmaskedU-17◎U16計算回路を有する。 Then, 4-bit-to-4 U -17 ○ d r outputted from the bit conversion table circuit and maskedU 16 ◎ output from U calculation circuit U 16 ○ R 'and R' were respectively input, output data U -1 ○ It has a maskedU -17 ◎ U 16 calculation circuit for calculating f r .

上記本発明の第6の態様をベースとして、本発明の第7の態様は、以下の構成を有する。   Based on the sixth aspect of the present invention, the seventh aspect of the present invention has the following configuration.

即ち、maskedU16◎U計算回路は、固定値マスクgr,、入力データU○gr、及び乱数値マスクRを入力して、U○R=(U○gr)○R○gr、U16○R16=(U○R)16、及びR16の3つのデータを計算する演算回路群と、
J1=(U○R)◎(U16○R16)
J2=R16◎(U○R)
J3=R◎(U16○R16)
J4=R◎R16
J0=J1○J2○J3○J4○cr
の演算又はこれと等価な演算を実行する演算回路群とから構成され、J0をU17○crとして4ビット対4ビット変換テーブル回路へ入力させ、U16○R16及びR16をU16○R’及びR’としてmaskedU-17◎U16計算回路に入力させる。
That is, the maskedU 16 ◎ U calculation circuit inputs a fixed value mask g r , input data U ○ g r , and a random value mask R, and U ○ R = (U ○ g r ) ○ R ○ g r , An arithmetic circuit group for calculating three data of U 16 ○ R 16 = (U ○ R) 16 and R 16 ,
J1 = (U ○ R) ◎ (U 16 ○ R 16 )
J2 = R 16 ◎ (U ○ R)
J3 = R ◎ (U 16 ○ R 16 )
J4 = R ◎ R 16
J0 = J1 ○ J2 ○ J3 ○ J4 ○ cr
And an arithmetic circuit group that executes an operation equivalent to this, J0 is input as U 17cr to the 4-bit to 4-bit conversion table circuit, and U 16 ○ R 16 and R 16 are input to U 16 ○ R 'and R' are input to maskedU -17 ◎ U 16 calculation circuit.

上記本発明の第6の態様をベースとして、本発明の第8の態様は、以下の構成を有する。   Based on the sixth aspect of the present invention, the eighth aspect of the present invention has the following configuration.

即ち、maskedU16◎U計算回路は、固定値マスクgr,入力データU○gr、及び乱数値マスクRを入力して、U○R=(U○gr)○R○gr及びU16○R=(U○R)16○R○R16の2つのデータを計算する演算回路群と、
J1=(U○R)◎(U16○R)
J2=R◎((U○R)○(U16○R)○R)
J0=J1○J2○cr
の演算又はこれと等価な演算を実行する演算回路群とから構成され、J0をU17○crとして4ビット対4ビット変換テーブル回路へ入力させ、U16○R及びRをU16○R’及びR’としてmaskedU-17◎U16計算回路に入力させる。
That is, the maskedU 16 ◎ U calculation circuit inputs a fixed value mask g r , input data U ○ g r , and a random value mask R, and inputs U ○ R = (U ○ g r ) ○ R ○ g r and U 16 ○ and R = (U ○ R) 16 ○ R ○ arithmetic circuits for calculating the two data R 16,
J1 = (U ○ R) ◎ (U 16 ○ R)
J2 = R ◎ ((U ○ R) ○ (U 16 ○ R) ○ R)
J0 = J1 ○ J2 ○ cr
And an arithmetic circuit group that executes an operation equivalent to this, J0 is input as U 17 ○ c r to the 4-bit to 4-bit conversion table circuit, and U 16 ○ R and R are U 16 ○ R 'And R' are input to maskedU -17 ◎ U 16 calculation circuit.

上記本発明の第6の態様をベースとして、本発明の第9の態様は、以下の構成を有する。   Based on the sixth aspect of the present invention, the ninth aspect of the present invention has the following configuration.

即ち、maskedU-17◎U16計算回路は、4ビット対4ビット変換テーブル回路から出力されるU-17○dr、固定値マスクdrとfr、maskedU16◎U計算回路から出力されるU16○R’,R’、及び内部で発生させた乱数Sを入力して、U-17○S○dr=(U-17○dr)○S、及びS○drの2つのデータを計算する演算回路群と、
J1=(U-17○S○dr)◎(U16○R’)
J2=R’◎(U-17○S○dr)
J3=(S○dr)◎(U16○R’)
J4=(S○dr)◎R’
J0=J1○J2○J3○J4○fr
の演算又はこれと等価な演算を実行する演算回路群とから構成され、J0をU-1○frとして出力する。
That, maskedU -17 ◎ U 16 the computing circuitry, U -17 ○ d r outputted from the 4-bit to 4-bit conversion table circuit, a fixed mask value d r and f r, output from maskedU 16 ◎ U calculation circuit Input U 16 ○ R ', R' and the internally generated random number S, U -17 ○ S ○ d r = (U -17 ○ d r ) ○ S, and S ○ d r A group of arithmetic circuits for calculating data;
J1 = (U -17 ○ S ○ d r ) ◎ (U 16 ○ R ')
J2 = R '◎ (U -17 ○ S ○ d r )
J3 = (S ○ d r ) ◎ (U 16 ○ R ')
J4 = (S ○ d r ) ◎ R '
J0 = J1 ○ J2 ○ J3 ○ J4 ○ f r
It is composed of a calculation or its arithmetic circuits to perform equivalent operations, and outputs the J0 as U -1 ○ f r.

上記本発明の第6の態様をベースとして、本発明の第10の態様は、以下の構成を有する。   Based on the sixth aspect of the present invention, the tenth aspect of the present invention has the following configuration.

即ち、maskedU-17◎U16計算回路は、4ビット対4ビット変換テーブル回路から出力されるU-17○dr、固定値マスクdrとfr、maskedU16◎U計算回路から出力されるU16○R’,R’、及びR’の上位4ビットであるR’H、R’の下位4ビットであるR’Lを入力して、U16○(dr||dr)○R’,U-17○dr○R’L,dr○R’,U-17○dr○R’H,dr○R’Hの5つのデータを計算する演算回路群と、
J1=(U16○(dr||dr)○R’)◎(U-17○dr○R’H)
J2=(U-17○dr○R’H)◎(dr○R’H)○(dr○R’H2
J3=((U16○(dr||dr)○R’)○(U-17○dr○R’L)○(dr○R’L))◎(dr○R’L)
J0=J1○(J2||(0000)2)○J3○fr
の演算又はこれと等価な演算を実行する演算回路群とから構成され、J0をU-1○frとして出力する。
That, maskedU -17 ◎ U 16 the computing circuitry, U -17 ○ d r outputted from the 4-bit to 4-bit conversion table circuit, a fixed mask value d r and f r, output from maskedU 16 ◎ U calculation circuit U 16 ○ R ′ H which is the upper 4 bits of R ′, R ′ and R ′, and R ′ L which is the lower 4 bits of R ′ are input, and U 16 ○ (d r || d r ) ○ Arithmetic circuit group for calculating five data of R ', U -17dr ○ R' L , dr ○ R ', U -17dr ○ R' H , dr ○ R ' H ,
J1 = (U 16 ○ (d r || d r ) ○ R ') ◎ (U -17 ○ d r ○ R' H )
J2 = (U -17 ○ d r ○ R ' H ) ◎ (d r ○ R' H ) ○ (d r ○ R ' H ) 2
J3 = ((U 16 ○ (d r || d r ) ○ R ') ○ (U -17 ○ d r ○ R' L ) ○ (d r ○ R ' L )) ◎ (d r ○ R' L )
J0 = J1 ○ (J2 || (0000) 2 ) ○ J3 ○ fr
It is composed of a calculation or its arithmetic circuits to perform equivalent operations, and outputs the J0 as U -1 ○ f r.

上記本発明の第6の態様をベースとして、本発明の第11の態様は、以下の構成を有する。   Based on the sixth aspect of the present invention, the eleventh aspect of the present invention has the following configuration.

即ち、maskedU-17◎U16計算回路は、4ビット対4ビット変換テーブル回路から出力されるU-17○dr、固定値マスクdrとfr、maskedU16◎U計算回路から出力されるU16○R’,R’、及びR’の上位4ビットであるR’H,、R’の下位4ビットであるR’L、を入力して、U16 HとU16 Lをそれぞれ8ビット値U16の上位4ビットと下位4ビットとして、U16 H○R’L=(U16○R’の上位4ビット)○R’L○R’H、U-17○R’L=(U-17○dr)○R’L○dr、U16 L○R’L=(U16○R’の下位4ビット)の3つのデータを計算する演算回路群と、
J1=(U16 H○R’L)◎(U-17○R’L)
J2=((U16 H○R’L)○(U-17○R’L)○R’L)◎R’L
J3=(U16 L○R’L)◎(U-17○R’L)
J4=((U16 L○R’L)○(U-17○R’L)○R’L)◎R’L
J0=((J1○J2)||(J3○J4))○fr
の演算又はこれと等価な演算を実行する演算回路群とから構成され、J0をU-1○frとして出力する。
That, maskedU -17 ◎ U 16 the computing circuitry, U -17 ○ d r outputted from the 4-bit to 4-bit conversion table circuit, a fixed mask value d r and f r, output from maskedU 16 ◎ U calculation circuit U 16 ○ R ′ H , which is the upper 4 bits of R ′, R ′, and R ′, and R ′ L, which is the lower 4 bits of R ′ , are input, and U 16 H and U 16 L are each 8 as the upper 4 bits and lower 4 bits of the bit value U 16, U 16 H ○ R 'L = (U 16 ○ R' upper 4 bits of) ○ R 'L ○ R' H, U -17 ○ R 'L = (U -17 ○ d r ) ○ R ' L ○ d r , U 16 L ○ R' L = (lower 4 bits of U 16 ○ R ')
J1 = (U 16 H ○ R ' L ) ◎ (U -17 ○ R' L )
J2 = ((U 16 H ○ R ' L ) ○ (U -17 ○ R' L ) ○ R ' L ) ◎ R' L
J3 = (U 16 L ○ R ' L ) ◎ (U -17 ○ R' L )
J4 = ((U 16 L ○ R ' L ) ○ (U -17 ○ R' L ) ○ R ' L ) ◎ R' L
J0 = ((J1 ○ J2) || (J3 ○ J4)) ○ f r
It is composed of a calculation or its arithmetic circuits to perform equivalent operations, and outputs the J0 as U -1 ○ f r.

上述の本発明の第1、第2、第3、第6、又は第7、8の何れかの態様において、非線型変換における乗算処理は、GF(28)で表される2進体において実行されるように構成することができる。このとき、2進体GF(28)は、例えば多項式x8+x4+x3+x+1の剰余で表される。 In any one of the first, second, third, sixth, seventh, and eighth aspects of the present invention described above, the multiplication process in the nonlinear conversion is performed in a binary field represented by GF (2 8 ). It can be configured to be executed. At this time, the binary field GF (2 8 ) is represented by, for example, a remainder of a polynomial x 8 + x 4 + x 3 + x + 1.

また、上述の第1〜第11の何れかの態様において、非線型変換における乗算処理は、GF(((22)2)2)で表される合成体において実行されるように構成することができる。このとき、合成体GF(((22)2)2)は、例えば多項式GF((24)2)=x2+x+(1100)2,GF((22)2)=x2+x+(10)2,GF(22)=x2+x+1の剰余で表される。 In any one of the first to eleventh aspects, the multiplication process in the nonlinear conversion is configured to be executed in the composite represented by GF (((2 2 ) 2 ) 2 ). Can do. At this time, the composite field GF (((2 2 ) 2 ) 2 ) is, for example, a polynomial GF ((2 4 ) 2 ) = x 2 + x + (1100) 2 , GF ((2 2 ) 2 ) = x 2 + It is represented by the remainder of x + (10) 2 and GF (2 2 ) = x 2 + x + 1.

本発明は、上述の第1乃至第11の何れかの態様による暗号化装置を組み込んだ組込装置として実施することもできる。   The present invention can also be implemented as an embedded device incorporating the encryption device according to any one of the first to eleventh aspects described above.

本発明は、共通鍵暗号を行う暗号プロセッサにするPA対策を行うための実装技術である。本技術を用いることで、代表的な共通鍵アルゴリズムであるAESをはじめとした暗号処理の秘密鍵の解読を困難にし、スマートカード等の組み込み機器の安全性を高めることができる。   The present invention is an implementation technique for implementing PA countermeasures for a cryptographic processor that performs common key cryptography. By using this technology, it becomes difficult to decrypt private keys for cryptographic processing including AES, which is a typical common key algorithm, and the security of embedded devices such as smart cards can be improved.

共通鍵暗号処理の一般的な構成を表す図である。It is a figure showing the general structure of a common key encryption process. 一般的に知られているAES暗号アルゴリズムの構成である。This is a configuration of a generally known AES encryption algorithm. 一般的に知られているAESにおけるRoundKey処理である。This is RoundKey processing in AES that is generally known. 一般的に知られているAESにおけるSubbyte処理である。Subbyte processing in AES that is generally known. 一般的に知られている AESにおけるMixColumn処理である。It is a generally known MixColumn process in AES. 一般的に知られている AESにおけるShiftRow処理である。It is a commonly known ShiftRow process in AES. DPA対策無しの一般的な共通鍵暗号における拡大鍵XOR処理である。This is extended key XOR processing in general common key cryptography without DPA countermeasures. DPA対策無しの一般的な共通鍵暗号における線形変換処理である。This is a linear conversion process in a common symmetric key encryption without DPA countermeasures. DPA対策無しの一般的な共通鍵暗号における非線形変換処理である。This is a non-linear transformation process in general common key cryptography without DPA countermeasures. 図7と図9を組み合わせた処理である。This process is a combination of FIG. 7 and FIG. 図10の処理についてwjの入出力に関係するビットを取り出した図である。It is the figure which took out the bit relevant to the input / output of wj about the process of FIG. スマートカードの消費電力の例である。It is an example of the power consumption of a smart card. 電力差分曲線を作成し、スパイクが出現した例である。In this example, a power difference curve is created and spikes appear. 電力差分曲線を作成し、スパイクが出現しなかった例である。This is an example in which a power difference curve was created and spikes did not appear. 図7と図8と図9と組み合わせた構成である。This is a combination of FIG. 7, FIG. 8, and FIG. DPAにより秘密鍵解読を行うための、消費電力測定箇所に関する条件である。This is a condition related to the power consumption measurement location for decrypting the secret key by DPA. ゼロ乗算SPAによる攻撃可能な暗号回路の第一の構成を表す図である。It is a figure showing the 1st structure of the encryption circuit which can be attacked by zero multiplication SPA. ゼロ乗算SPAによる攻撃可能な暗号回路の第二の構成を表す図である。It is a figure showing the 2nd structure of the encryption circuit which can be attacked by zero multiplication SPA. 一般的なDPA対策なしのAES回路を表す図である。It is a figure showing the AES circuit without a general DPA countermeasure. 図18のDPA対策なしAES回路に対し、従来例1のDPA対策を適用した回路である。This is a circuit in which the DPA countermeasure of Conventional Example 1 is applied to the AES circuit without DPA countermeasure of FIG. 図18のDPA対策なしAES回路に対し、従来例2のDPA対策を適用した回路である。This is a circuit in which the DPA countermeasure of Conventional Example 2 is applied to the AES circuit without the DPA countermeasure of FIG. 一般的なAESのSbox回路の構成を表す図である。It is a figure showing the structure of a general AES Sbox circuit. テーブルを用いた一般的な逆元計算回路を表す図である。It is a figure showing the general inverse element calculation circuit using a table. 従来例3に記されている、合成体を用いた逆元計算回路である。This is an inverse element calculation circuit using a composite field described in Conventional Example 3. 従来例2と従来例3の単純な組み合わせによる逆元計算回路である。This is an inverse element calculation circuit based on a simple combination of Conventional Example 2 and Conventional Example 3. ゼロ乗算SPAに安全な処理を実現するための、乗算器に対する入力データの条件であり、本発明の基本アイデアを導出するための着眼点を表した図である。FIG. 5 is a diagram showing the focus of points for deriving a basic idea of the present invention, which is a condition of input data to a multiplier for realizing safe processing for zero multiplication SPA. 本発明の基本アイデアによる乗算回路を表す図である。It is a figure showing the multiplication circuit by the basic idea of this invention. 本発明による乗算回路の第一の構成図である。(基本原理-1)1 is a first configuration diagram of a multiplication circuit according to the present invention. (Basic principle-1) 本発明による乗算回路の第二の構成図である。(基本原理-2)It is a 2nd block diagram of the multiplication circuit by this invention. (Basic principle-2) 本発明による乗算回路の第三の構成図である。(基本原理-3)It is a 3rd block diagram of the multiplication circuit by this invention. (Basic principle-3) 本発明による乗算回路の第四の構成図である。(基本原理-4)FIG. 6 is a fourth block diagram of a multiplication circuit according to the present invention. (Basic principle-4) 本発明の技術を用いた逆元計算処理のフレームワークを表す図である。It is a figure showing the framework of the inverse element calculation process using the technique of this invention. masked U16×U計算に基本原理-1を用いる場合の第1の実施形態である。This is the first embodiment when the basic principle-1 is used for the masked U 16 × U calculation. masked U16×U計算に基本原理-2を用いる場合の実施形態第2の実施形態である。This is a second embodiment in which basic principle-2 is used for masked U 16 × U calculation. masked U-17×U16計算に基本原理-1を用いる場合の第3の実施形態である。This is a third embodiment in which the basic principle-1 is used for masked U -17 × U 16 calculation. masked U-17×U16計算に基本原理-3を用いる場合の第4の実施形態である。This is a fourth embodiment in which the basic principle-3 is used for masked U -17 × U 16 calculation. 図36は、masked U-17×U16計算に基本原理-4を用いる場合の第5の実施形態である。FIG. 36 shows a fifth embodiment when the basic principle-4 is used for the masked U -17 × U 16 calculation.

以下、図面を参照しながら、本発明を実施するための最良の形態を詳細に説明する。   The best mode for carrying out the present invention will be described below in detail with reference to the drawings.

本発明の基本原理
本発明は、「背景技術」において指摘した課題1,2,3を全て解決したAES暗号処理装置を実現する。そのために、以下の(条件-1), (条件-2), (条件-3), (条件-4)を満たした処理を行う。
Basic Principle of the Present Invention The present invention realizes an AES encryption processing apparatus that solves all of the problems 1, 2, and 3 pointed out in “Background Art”. Therefore, processing that satisfies the following (Condition-1), (Condition-2), (Condition-3), and (Condition-4) is performed.

(条件-1) AESのSubbyte処理以外について、従来例2による処理を行う。
(条件-2) AESのSubbyte処理は、合成体による逆元演算をSPA,DPAに安全な方法で実行。
(条件-3) (条件-2)の合成体演算におけるテーブル処理は、従来例2による処理を行う。
(条件-4) (条件-2)の合成体演算における乗算には、常に乱数値マスク化データを入力。
(Condition-1) Processing other than AES Subbyte processing is performed according to Conventional Example 2.
(Condition-2) In AES Subbyte processing, inverse element calculation by composite field is executed in a safe manner for SPA and DPA.
(Condition-3) The table processing in the composite field computation of (Condition-2) is performed according to Conventional Example 2.
(Condition-4) Random value masked data is always input for multiplication in composite field operation of (Condition-2).

(条件-1)を導入することで、AESのSubbyte処理以外について、課題1、課題2、課題3を同時に解決する。なぜなら、従来例2の唯一の問題であった課題1は、Subbyte回路に関してのみの課題であるため、Subbyte処理に従来例2を用いなければこれらの課題は全て解決される。後は、AESのSubbyte処理に関して課題1,2,3を解決できるならば、AES処理全体として全ての課題を解決できる。   By introducing (Condition-1), Problem 1, Problem 2, and Problem 3 are solved at the same time, except for AES Subbyte processing. This is because the problem 1 which was the only problem in the conventional example 2 is a problem related only to the Subbyte circuit. Therefore, if the conventional example 2 is not used for the Subbyte processing, all these problems are solved. After that, if problems 1, 2, and 3 can be solved with respect to the AES subbyte processing, all the problems can be solved as a whole AES processing.

(条件-2)を導入することで、AESのSubbyte処理に関して、課題1を解決する。Subbyte処理において回路規模が大きい逆元演算を、図23に示すような従来例3の合成体による処理に置き換えることで、回路規模の削減を実現する。ただし、従来例3の合成体の演算をそのまま用いた場合、SPA, DPAに対して安全ではないため、課題3が未解決である。また、SPA,DPA対策を行う場合についても、課題2をクリアする必要がある。   By introducing (Condition-2), Problem 1 is solved for Subbyte processing of AES. By substituting the inverse operation with a large circuit scale in the Subbyte process with the process using the composite of Conventional Example 3 as shown in FIG. However, when the calculation of the composite of Conventional Example 3 is used as it is, it is not safe for SPA and DPA, so Problem 3 is unsolved. Moreover, it is necessary to clear the problem 2 also when taking measures against SPA and DPA.

(条件-3)は、図23に示す合成体を用いた逆元演算のうち、テーブル演算については、従来例2によるテーブル演算を行う。つまり、q個の事前計算テーブルを準備し、そのうちの一つを乱数により選択する方法を用いる。q個の事前計算テーブルを必要とするため、課題1に示される問題の発生が危惧されるが、8ビット入出力テーブルによる逆元演算ではなく、合成体による4ビット入出力テーブル演算であるので、個々のテーブルの回路規模を8ビット入出力テーブルの1/64に抑えることができるため、課題1の問題は発生しない。よって、 図23におけるテーブル演算に関しては課題1,2,3全てを解決できる。もし、このテーブル演算処理を従来例1の方法で実行する場合、乱数に応じてテーブルを更新する必要がある。4ビットテーブルの更新は16cycleを必要とする。一般的にテーブル演算は1cycleで実行されるため、このテーブル更新によるペナルティは処理速度を大きく低下させ、課題2に示される問題が発生する。   (Condition-3) is a table operation according to Conventional Example 2 for the table operation among the inverse element operations using the composite shown in FIG. That is, a method is used in which q pre-calculation tables are prepared and one of them is selected by a random number. Since q pre-computation tables are required, the problem shown in Task 1 may occur. However, since it is not an inverse operation using an 8-bit input / output table but a 4-bit input / output table operation using a composite field, Since the circuit scale of each table can be reduced to 1/64 of the 8-bit input / output table, the problem of problem 1 does not occur. Therefore, all the problems 1, 2 and 3 can be solved for the table calculation in FIG. If this table calculation process is executed by the method of Conventional Example 1, it is necessary to update the table according to the random number. Updating a 4-bit table requires 16 cycles. Since table operations are generally executed in one cycle, this table update penalty greatly reduces the processing speed, and the problem shown in Problem 2 occurs.

(条件-4)は、図23に示す合成体を用いた逆元演算のうち、乗算に関するSPA,DPA対策法の方針である。前述の(ZSPA-sec)で述べたように、乗算処理に入力するデータは、全て乱数値マスク化データとすることで、ゼロ乗算SPA対策となる。また乱数値マスク化データを用いることで、乗算に関するDPA対策法も同時に実行できる。よって、課題3を解決する。また乱この乗算処理は1cycleで実行することができ、乱数に応じてテーブルを更新する処理のような処理速度に関するペナルティを発生しないため、課題2を解決する。   (Condition-4) is a SPA / DPA countermeasure policy regarding multiplication of inverse operations using the composite shown in FIG. As described in the above (ZSPA-sec), the data input to the multiplication process is all random-value masked data, thereby serving as a zero multiplication SPA countermeasure. By using random value masked data, DPA countermeasures for multiplication can be executed simultaneously. Therefore, Problem 3 is solved. In addition, this multiplication process can be executed in one cycle, and a penalty related to the processing speed, such as a process of updating a table according to a random number, does not occur.

本発明は、以上の(条件-1)〜(条件-4)を全て満たしたAES処理を実行する。これらの条件を全て満たすための基本方針は、合成体の逆元演算における乗算処理のみに対して、乱数値マスクを用いたマスク処理を実行し、それ以外の処理については固定値マスクを用いたマスク処理を実行することである。これを実現するための基本アイデアを以下で述べる。   The present invention executes an AES process that satisfies all of the above (condition-1) to (condition-4). The basic policy for satisfying all of these conditions is to perform mask processing using a random value mask only for multiplication processing in the inverse operation of a composite field, and use a fixed value mask for other processing. The mask process is executed. The basic idea for realizing this is described below.

<課題を解決するための基本アイデア>
乗算処理のみ乱数値マスク化データによる処理を行い、それ以外を固定値マスク化データによる処理を行うための、本発明の基本アイデアを図26に示す。
<Basic ideas for solving problems>
FIG. 26 shows a basic idea of the present invention in which only multiplication processing is performed using random value masked data, and other processing is performed using fixed value masked data.

従来例の場合、図26の上段に示すように、乗算器の片方、もしくは両方の入力が固定値マスク化データである。これに対し、本発明では、図26下段に示すように、固定値マスク化データに対して、乱数値マスクをXORすることで、固定値マスク化データを乱数値マスク化データに変換する。つまり、固定値マスクprによりマスク化されたデータX○pr は固定値マスク化データであるが、このデータに対してさらに乱数RをXORするとX○R○prとなる。Rが任意の8-bit値をとり得る乱数値ならば、R’=R○prで表されるR’も同様に任意の8-bit値をとり得る乱数値であるので、X○R○pr =X○R’は乱数値マスク化データとなる。 In the case of the conventional example, as shown in the upper part of FIG. 26, one or both inputs of the multiplier are fixed value masked data. On the other hand, in the present invention, as shown in the lower part of FIG. 26, the fixed value masked data is converted to random value masked data by XORing the random value mask with respect to the fixed value masked data. That is, masked data X ○ p r with a fixed mask value p r is a fixed value masked data, the further random number R for this data and XOR result X ○ R ○ p r. If R is a random value that can take an arbitrary 8-bit value, R ′ represented by R ′ = R ○ p r is also a random value that can take an arbitrary 8-bit value. ○ p r = X ○ R 'is the random value masked data.

固定値マスクqrによりマスク化されたデータY○qrに対しても同様に乱数SをXORすることで、 Y○S○qr =Y○S’は乱数値マスク化データとなる。これらの乱数値マスク化データに対して、(X○R’)◎(Y○S’)の乗算を行う、つまり乗算器の2つの入力ともに乱数値マスク化データであるので、本発明の方式はSPA,DPAに対して安全な処理を実現する。ただし、この乗算の結果出力されるデータも乱数値マスク化データである。(条件-1)に示すように、本発明はSubbyte処理以外は従来例2による処理、つまり固定値マスク値化データによる処理を行う必要がある。よって、乱数値マスク化データ同士を乗算した結果、出力される乱数値マスク化データを固定値マスク化データに変換する必要がある。この処理は、図26の乱数値マスク-固定値マスク変換処理回路によって実行される。 By XOR similarly random S even for masked data Y ○ q r by the fixed mask value q r, Y ○ S ○ q r = Y ○ S ' is a random number value masked data. Since these random number value masked data are multiplied by (X ○ R ′) ◎ (Y ○ S ′), that is, the two inputs of the multiplier are both random value masked data, the method of the present invention Realizes safe processing for SPA and DPA. However, the data output as a result of this multiplication is also random value masked data. As shown in (Condition-1), in the present invention, it is necessary to perform processing according to Conventional Example 2, that is, processing based on fixed value mask value data, except for Subbyte processing. Therefore, it is necessary to convert the random value masked data output as a result of multiplying the random value masked data into fixed value masked data. This processing is executed by the random value mask-fixed value mask conversion processing circuit of FIG.

図26は本発明における乗算処理のアイデアを抽象的に表現したものであり、具体的な演算方法は様々な方法が考えられる。合成体を用いた逆元演算処理においては、U17=U16◎UとU-1=U-17◎U16の2種類が実行されるが、本発明の乗算処理がこれらの2種類のいずれかを実行するかによって、R,Sの与え方、及び乱数値マスク-固定値マスク変換処理の計算方法が異なる。これら2種類の両方、もしくはいずれかの乗算処理に適用可能な本発明の乗算方式、以下の(基本原理-1)、(基本原理-2)、(基本原理-3)、(基本原理-4)に示す。(基本原理-1)、(基本原理-2)、(基本原理-3)、(基本原理-4)の技術が適用可能な乗算の種類(U17=U16◎U及びU-1=U-17◎U16)の対応表を表2に示す。 FIG. 26 is an abstract representation of the idea of multiplication processing in the present invention, and various specific calculation methods can be considered. In the inverse element processing using the composite field, two types of U 17 = U 16 ◎ U and U −1 = U -17 ◎ U 16 are executed, and the multiplication processing of the present invention is performed in these two types. The method of giving R and S and the calculation method of the random value mask-fixed value mask conversion process differ depending on which one is executed. The multiplication method of the present invention applicable to both of these two types or any one of the multiplication processes, (Basic Principle-1), (Basic Principle-2), (Basic Principle-3), (Basic Principle-4) ). Types of multiplication to which the techniques of (Basic Principle-1), (Basic Principle-2), (Basic Principle-3), and (Basic Principle-4) can be applied (U 17 = U 16 ◎ U and U -1 = U -17 ◎ U 16 ) correspondence table is shown in Table 2.

以下の(基本原理-1)〜(基本原理-4)の説明においては、PA対策無しの通常のAES処理で計算されるデータをX,Y、乱数値マスクをR,S、固定値マスクをfrと記述する。R’=R○pr,S’=S○qrのように、固定値マスクに乱数をXORした乱数値マスクをR’,S’と表記している。 In the following explanations of (Basic Principle-1) to (Basic Principle-4), X and Y are the data calculated by normal AES processing without PA countermeasures, R and S are random value masks, and fixed value masks are Write f r . R '= R ○ p r, S' = as in S ○ q r, the random number mask XOR random number to the fixed mask value R ', S' is indicated as.

[基本原理-1]
U17=U16◎UとU-1=U-17◎U16の両方の乗算に適用可能な方法である。(図27)
J1 = (X○R’)◎(Y○S’)
J2 = S’ ◎(X○R’)
J3 = R’ ◎(Y○S’)
J4 = R’ ◎S’
ただし、U17=U16◎UならX,Y,R’,S’は8-bit、U-1=U-17◎U16ならX,R’は8-bit, Y,S’は4-bitである。
[Basic Principle-1]
This is a method applicable to the multiplication of both U 17 = U 16 ◎ U and U −1 = U -17 ◎ U 16 . (Fig. 27)
J1 = (X ○ R ') ◎ (Y ○ S')
J2 = S '◎ (X ○ R')
J3 = R '◎ (Y ○ S')
J4 = R '◎ S'
However, U 17 = U 16 ◎ If U, X, Y, R ', S' is 8-bit, U -1 = U -17 ◎ If U 16, X, R 'is 8-bit, Y, S' is 4 -bit.

J1,J2,J3,J4を計算し、J0 = J1○J2○J3○J4○frによりJ0=X◎Y○frを得る。基本原理-1によりX◎Y○frを計算する回路を、記号としてMaskedMul_1(X○R’, Y○S’,R’,S’,fr)により表現する。また、(law-1)〜(law-3)を考慮すると、
J1 = X◎Y○ X◎S’ ○ Y◎R’○ R’◎S’
J2 = S’ ◎X○ S’ ◎ R’
J3 = R’ ◎Y○ R’ ◎S’
J4 = R’ ◎S’
であるので、J0 = J1○J2○J3○J4○fr= X◎Y○frを確認できる。
J1, J2, calculates the J3, J4, obtain J0 = X ◎ Y ○ f r by J0 = J1 ○ J2 ○ J3 ○ J4 ○ f r. A circuit for calculating the X ◎ Y ○ f r by basic principle -1, MaskedMul_1 as a symbol (X ○ R ', Y ○ S', R ', S', f r) is represented by. Also, considering (law-1) to (law-3),
J1 = X ◎ Y ○ X ◎ S '○ Y ◎ R' ○ R '◎ S'
J2 = S '◎ X ○ S' ◎ R '
J3 = R '◎ Y ○ R' ◎ S '
J4 = R '◎ S'
Since it is, it can confirm the J0 = J1 ○ J2 ○ J3 ○ J4 ○ f r = X ◎ Y ○ f r.

J1〜J4の乗算処理への入力データは全て乱数値マスク化データであるため、SPA,DPAに対して安全な処理を実現できる。この処理に必要となる乗算の回数は以下の通り。 Since all the input data to the multiplication processing of J1 to J4 is random value masked data, it is possible to realize safe processing for SPA and DPA. The number of multiplications required for this processing is as follows.

-U17=U16◎Uの場合:8-bit´8-bit乗算4回、
-U-1=U-17◎U16の場合:8-bit´4-bit乗算4回(もしくは4-bit´4-bit乗算8回)。
-U 17 = U 16 ◎ In case of U: 8-bit´8-bit multiplication 4 times,
-U -1 = U -17 ◎ For U 16 : 4 times 8-bit´4-bit multiplication (or 8 times 4-bit´4-bit multiplication).

基本原理-1は(law-1)〜(law-3)に基づいているため、任意の2進体と合成体の演算に適用可能である。 Since the basic principle-1 is based on (law-1) to (law-3), it can be applied to operations of arbitrary binary fields and composite fields.

[基本原理-2]
基本原理-1によるPA対策を用いた場合、PA対策なしにおける1回の乗算が4回の乗算に置き換えられる。この乗算回数の増加は、PA対策に伴うオーバヘッドとなる。よって、この置き換え後の乗算回数を減らすことが、PA対策に伴うオーバヘッドを減少させることになる。このオーバヘッドの減少を行うために、基本原理-1におけるS’に関して、S’=R’による特殊化を行ったものが(基本原理-2)である。この特殊化を行うことで、演算処理が簡略化されるため、PA対策なしにおける1回の乗算が2回の乗算に置き換えられる。
[Basic Principle-2]
When PA countermeasures based on Basic Principle-1 are used, one multiplication without PA countermeasures is replaced with four multiplications. This increase in the number of multiplications is an overhead associated with PA countermeasures. Therefore, reducing the number of multiplications after the replacement reduces the overhead associated with PA countermeasures. In order to reduce this overhead, S 'in the basic principle-1 is specialized by S' = R '(basic principle-2). By performing this specialization, the arithmetic processing is simplified, so that one multiplication without PA countermeasure is replaced with two multiplications.

ただし、S’=R’による特殊化は、S’とR’のデータビット長が等しい場合のみ可能である。よって、PA対策なしにおける乗算の2つの入力データのビット長が等しい場合のみ(基本原理-2)を適用できる。つまり、U17=U16◎Uに示される8-bit´8-bit乗算のみに対して適用可能な方法であり(図28)、U-1=U-17◎U16に示される8-bit´4-bit乗算には適用できない。 However, specialization by S ′ = R ′ is possible only when the data bit lengths of S ′ and R ′ are equal. Therefore, only when the bit lengths of two input data of multiplication without PA countermeasure are equal (basic principle-2) can be applied. In other words, U 17 = U 16 ◎ This is a method applicable only to 8-bit′8-bit multiplication shown in U (FIG. 28), U −1 = U -17 ◎ 8 shown in U 16 Not applicable to bit´4-bit multiplication.

J1 = (X○R’)◎(Y○R’)
J2 = R’ ◎( (X○R’) ○(Y○R’) ○R’)
ただし、X,Y,R’は8-bitである。J1,J2を計算し、J0 = J1○J2○frによりJ0=X◎Y○frを得る。基本原理-2によりX◎Y○frを計算する回路を、記号としてMaskedMul_2(X○R’,Y○R’,R’,fr)により表現する。また (law-1)〜(law-3)を考慮すると、
J1 = X◎Y ○ X◎R’ ○ Y◎R’ ○ R’2
J2 = X ◎R’ ○ Y’ ◎ R’ ○R’2
であるので、J0 = J1○J2○fr= X◎Y○frを確認できる。
J1 = (X ○ R ') ◎ (Y ○ R')
J2 = R '◎ ((X ○ R') ○ (Y ○ R ') ○ R')
However, X, Y, and R ′ are 8-bit. J1, J2 is calculated, and obtain J0 = X ◎ Y ○ f r by J0 = J1 ○ J2 ○ f r . A circuit for calculating the X ◎ Y ○ f r by basic principle -2, MaskedMul_2 as a symbol (X ○ R ', Y ○ R', R ', f r) is represented by. Also considering (law-1) to (law-3)
J1 = X ◎ Y ○ X ◎ R '○ Y ◎ R' ○ R ' 2
J2 = X ◎ R '○ Y' ◎ R '○ R' 2
Since it is, it can confirm the J0 = J1 ○ J2 ○ f r = X ◎ Y ○ f r.

J1,J2の乗算処理への入力データは全て乱数値マスク化データであるため、SPA,DPAに対して安全な処理を実現できる。この処理に必要となる乗算の回数は以下の通り。
- U17=U16◎Uの場合:8-bit´8-bit乗算2回
基本原理-2は(law-1)〜(law-3)に基づいているため、任意の2進体と合成体の演算に適用可能である。
Since all input data to the multiplication processing of J1 and J2 is random value masked data, safe processing can be realized for SPA and DPA. The number of multiplications required for this processing is as follows.
-U 17 = U 16 ◎ U: 8-bit '8-bit multiplication twice basic principle-2 is based on (law-1) to (law-3), so it can be combined with any binary field Applicable to field operations.

[基本原理-3]
基本原理-2を用いることで、本発明1よりPA対策に伴う乗算回数のオーバヘッドを減少させることができるが、その技術を適用可能となるのはU17=U16◎Uに示される8-bit´8-bit乗算のみであり、U-1=U-17◎U16に示される8-bit´4-bit乗算には適用できなかった。この問題を改善するために、U-1=U-17◎U16に示す8-bit´4-bit乗算には適用可能であり、かつ基本原理-1より乗算回数のオーバヘッドを低減させる方法が以下に示す基本原理-3である。
[Basic principle-3]
By using the basic principle-2, the overhead of the number of multiplications associated with the PA countermeasure can be reduced from the present invention 1, but the technology can be applied to U 17 = U 16 ◎ 8- bit'8-bit multiplication is only, not applicable to 8-bit'4-bit multiplication shown in U -1 = U -17 ◎ U 16 . In order to improve this problem, U -1 = U -17 ◎ Applicable to 8-bit'4-bit multiplication shown in U 16 and a method of reducing the number of multiplication overhead from the basic principle-1. This is the basic principle-3 shown below.

基本原理-2の基本的な考え方は、Xの乱数値マスクR’とYの乱数値マスクS’について、S’=R’による共通化を行うことで計算を簡略化することであった。この考え方はX,Yのビット長が等しい場合のみに可能であるが、ビット長が異なる場合はS’=R’とすることが不可能である。よって、ビット長が異なる場合、2つの乱数値マスクを同一とさせることは不可能であるが、部分的に一致させることは可能である。つまり、R’を8-bit, S’を4-bitとした場合、R’=R’H||R’Lのように、R’を上位4-bit値R’Hと下位4-bit値R’Lに分けた場合、S’=R’Lとすることで、乱数値マスクを部分的に一致させることができる。この考え方を用いることで、基本原理-1より乗算回数のオーバヘッドを低減し、U-1=U-17◎U16に示される8-bit´4-bit乗算に適用可能な方式を以下に示す(図29)。 The basic idea of the basic principle-2 was to simplify the calculation by sharing the random number mask R ′ of X and the random number mask S ′ of Y by S ′ = R ′. This idea is possible only when the bit lengths of X and Y are equal, but when the bit lengths are different, it is impossible to set S ′ = R ′. Therefore, when the bit lengths are different, it is impossible to make the two random value masks the same, but it is possible to make them partially match. In other words, when R 'is 8-bit and S' is 4-bit, R 'is higher 4-bit value R' H and lower 4-bit, as R '= R' H || R ' L When the values are divided into the values R ′ L , the random value masks can be partially matched by setting S ′ = R ′ L. By using this concept, the overhead of the number of multiplications is reduced from the basic principle-1, and the following method can be applied to 8-bit'4-bit multiplication indicated by U -1 = U -17 ◎ U 16 (FIG. 29).

J1 = (X○R’)◎(Y○R’L )
J2 = (Y○R’H) ◎R’H ○ R’H 2
J3 = ((X○R’ ) ○ (Y○R’L) ○R’L) ◎ R’L
ただし、X,R’は8-bit, Y, R’H, R’Lは4-bitであり、R’=R’H||R’Lである。J1,J2,J3を計算し、J0 = J1○(J2 || (0000)2 )○J3○frによりJ0=X◎Y○frを得る。基本原理-3によりX◎Y○frを計算する回路を、記号としてMaskedMul_3(X○R’,Y○R’H,Y○R’L,R’H,R’L,fr)により表現する。また、(law-1)〜(law-4)を考慮すると、
J1 = (X ○ R ') ◎ (Y ○ R' L )
J2 = (Y ○ R ' H ) ◎ R' H ○ R ' H 2
J3 = ((X ○ R ') ○ (Y ○ R' L ) ○ R ' L ) ◎ R' L
However, X and R ′ are 8-bit, Y, R ′ H and R ′ L are 4-bit, and R ′ = R ′ H || R ′ L. J1, J2, calculates the J3, obtain J0 = X ◎ Y ○ f r by J0 = J1 ○ (J2 || ( 0000) 2) ○ J3 ○ f r. A circuit for calculating the X ◎ Y ○ f r by the basic principle -3, MaskedMul_3 as a symbol (X ○ R ', Y ○ R' H, Y ○ R 'L, R' H, R 'L, f r) by Express. Also, considering (law-1) to (law-4),

J1= (XH ○ R’H) ◎ (Y○R’L) || (XL○R’L) ◎ (Y○R’L)
= (XH ◎ Y ○ XH◎R’L ○ Y◎R’H ○ R’ H◎R’L) || (XL ◎ Y ○ XL◎R’L○ Y◎R’L○ R’ H◎R’L 2)
J2 || (0000)2 = (Y ◎R’H) || (0000)2
J3= (XH ○ R’H) ◎R’L || (XL○R’L○Y○R’L○ R’L) ◎R’L
= (XH◎R’L ○ R’ H◎R’L) || (XL◎ R’L○ YL◎R’L ○ R’L 2)
である。ただし、XH, XLはX=XH||XLを満たす4-bit値である。よって、J0 = J1○(J2 || (0000)2 )○J3○fr = ( (XH◎Y) || (XL◎Y) ) ○ frであるが、(law-4)より、X◎Y= ( (XH◎Y) || (XL ◎ Y) )を考慮すると、J0 = J1○(J2 || (0000)2 )○J3○fr =X◎Y○frを導出できる。
J1 = (X H ○ R ' H ) ◎ (Y ○ R' L ) || (X L ○ R ' L ) ◎ (Y ○ R' L )
= (X H ◎ Y ○ X H ◎ R ' L ○ Y ◎ R' H ○ R ' H ◎ R' L ) || (X L ◎ Y ○ X L ◎ R ' L ○ Y ◎ R' L ○ R ' H ◎ R' L 2 )
J2 || (0000) 2 = (Y ◎ R ' H ) || (0000) 2
J3 = (X H ○ R ' H ) ◎ R' L || (X L ○ R ' L ○ Y ○ R' L ○ R ' L ) ◎ R' L
= (X H ◎ R ' L ○ R' H ◎ R ' L ) || (X L ◎ R' L ○ Y L ◎ R ' L ○ R' L 2 )
It is. However, X H and X L are 4-bit values that satisfy X = X H || X L. Therefore, J0 = J1 ○ (J2 || (0000) 2 ) ○ J3 ○ f r = ((X H ◎ Y) || (X L ◎ Y)) ○ f r , but from (law-4) , X ◎ Y = ((X H ◎ Y) || (X L ◎ Y)), J0 = J1 ○ (J2 || (0000) 2 ) ○ J3 ○ f r = X ◎ Y ○ f r Can be derived.

J1,J2,J3の乗算処理への入力データは全て乱数値マスク化データであるため、SPA,DPAに対して安全な処理を実現できる。この処理に必要となる乗算の回数は以下の通りである。
-U17=U16◎Uの場合:8-bit´4-bit乗算2回、4-bit´4-bit乗算1回、4-bit´4-bit自乗算1回。
Since all input data to the multiplication processing of J1, J2, and J3 is random value masked data, safe processing can be realized for SPA and DPA. The number of multiplications required for this processing is as follows.
-U 17 = U 16 ◎ U: Two 8-bit '4-bit multiplications, one 4-bit' 4-bit multiplication, one 4-bit '4-bit self multiplication.

さらに、8-bit´4-bit乗算1回は4-bit´4-bit乗算2回に相当すること、4-bit´4-bit自乗算1回は4-bit´4-bit乗算1回よりコストが安い演算(つまり、4-bit´4-bit乗算では1回未満のコスト)ことを考慮すると、基本原理-3に必要な乗算回数は以下のようにも表現できる。
-U17=U16◎Uの場合:8-bit´4-bit乗算φ回 (2.5<φ<3)
基本原理-3は(law-1)〜(law-4)に基づいているため、βγ=2を満たす合成体GF((…(2β1)…)βγ)の演算に対して適用可能である。
Furthermore, one 8-bit´4-bit multiplication is equivalent to two 4-bit´4-bit multiplications. One 4-bit´4-bit multiplication is one 4-bit´4-bit multiplication. Considering the operation at a lower cost (that is, the cost of less than once for 4-bit'4-bit multiplication), the number of multiplications necessary for the basic principle-3 can be expressed as follows.
-U 17 = U 16 ◎ U: 8-bit´4-bit multiplication φ times (2.5 <φ <3)
Since Basic Principle-3 is based on (law-1) to (law-4), it is applicable to the computation of the composite GF ((… (2 β1 )…) βγ ) satisfying βγ = 2 .

[基本原理-4]
U-1=U-17◎U16に示される8-bit´4-bit乗算に関して、基本原理-1の場合4回の8-bit´4-bit乗算を必要とするのに対して、基本原理-3を用いることでφ回の8-bit´4-bit乗算(2.5<φ<3)まで減少させることに成功した。8-bit´4-bit乗算の性質を利用することで、この乗算回数をさらに減少させることができる方法が基本原理-4である。(law-4)より、8-bit´4-bit乗算は2つの4-bit´4-bit乗算に分解できる。基本原理-4では、これら個々の4-bit´4-bit乗算に入力される2つのデータに対し、(基本原理-2)と同様に、同一の乱数値のXORを行う(図30)。
[Basic Principle-4]
U -1 = U -17 ◎ Regarding the 8-bit '4-bit multiplication shown in U 16 , the basic principle-1 requires four 8-bit' 4-bit multiplications, while the basic By using Principle-3, we succeeded in reducing it to φ 8-bit'4-bit multiplication (2.5 <φ <3). The basic principle-4 is a method that can further reduce the number of multiplications by utilizing the property of 8-bit′4-bit multiplication. From (law-4), 8-bit '4-bit multiplication can be decomposed into two 4-bit' 4-bit multiplications. In the basic principle-4, XOR of the same random number value is performed on the two pieces of data input to each of these 4-bit'4-bit multiplications as in (Basic principle-2) (FIG. 30).

J1 = (XH○ R’L) ◎(Y○R’L)
J2 = ( (XH○R’L)○ (Y○R’L) ○ R’L) ◎R’L
J3= (XL○ R’L) ◎(Y○R’L)
J4= ( (XL○R’L) ○ (Y○R’L) ○ R’L) ◎ R’L
ただし、Xは8-bit、XH, XL, Y, R’Lは4-bitであり、X=XH||XLである。J1,J2,J3,J4を計算し、J0 = ( (J1○J2) || (J3○J4) ) ○frによりJ0=X◎Y○frを得る。 (law-1)〜(law-4)を考慮すると、
J1 = (X H ○ R ' L ) ◎ (Y ○ R' L )
J2 = ((X H ○ R ' L ) ○ (Y ○ R' L ) ○ R ' L ) ◎ R' L
J3 = (X L ○ R ' L ) ◎ (Y ○ R' L )
J4 = ((X L ○ R ' L ) ○ (Y ○ R' L ) ○ R ' L ) ◎ R' L
However, X is 8-bit, X H , X L , Y, R ′ L is 4-bit, and X = X H || X L. J1, J2, J3, and calculates the J4, obtain J0 = ((J1 ○ J2) || (J3 ○ J4)) ○ f r by J0 = X ◎ Y ○ f r . Considering (law-1) to (law-4),

J1○J2=(XH ○ R’L) ◎ (Y○R’L) ○(XH○R’L○Y○R’L○ R’L) ◎R’L
= XH◎Y ○ XH◎R’L ○ Y◎R’L ○ R’L 2○ XH◎R’L ○ Y◎R’L ○ R’L 2 = XH◎Y
J3○J4=(XL ○ R’L) ◎ (Y○R’L) ○(XL○R’L○Y○R’L○ R’L) ◎R’L
= XL◎Y ○ XL◎R’L ○ Y◎R’L ○ R’L 2○ XL◎R’L ○ Y◎R’L ○ R’L 2 = XL◎Y
である。基本原理-4によりX◎Y○frを計算する回路を、記号としてMaskedMul_4(XH○R’L,XL○R’L,Y○R’L, R’L,fr)により表現する。(law-4)から、X◎Y= ( (XH◎Y) || (XL ◎ Y) )であるので、J0 = ( (J1○J2) || (J3○J4) ) ○fr =X◎Y ○ frを確認できる。
J1 ○ J2 = (X H ○ R ' L ) ◎ (Y ○ R' L ) ○ (X H ○ R ' L ○ Y ○ R' L ○ R ' L ) ◎ R' L
= X H ◎ Y ○ X H ◎ R ' L ○ Y ◎ R' L ○ R ' L 2 ○ X H ◎ R' L ○ Y ◎ R ' L ○ R' L 2 = X H ◎ Y
J3 ○ J4 = (X L ○ R ' L ) ◎ (Y ○ R' L ) ○ (X L ○ R ' L ○ Y ○ R' L ○ R ' L ) ◎ R' L
= X L ◎ Y ○ X L ◎ R ' L ○ Y ◎ R' L ○ R ' L 2 ○ X L ◎ R' L ○ Y ◎ R ' L ○ R' L 2 = X L ◎ Y
It is. A circuit that calculates X ◎ Y ○ f r based on the basic principle-4 is expressed as a symbol MaskedMul_4 (X H ○ R ' L , X L ○ R' L , Y ○ R ' L , R' L , f r ) To do. From (law-4), X ◎ Y = ((X H ◎ Y) || (X L ◎ Y)), so J0 = ((J1 ○ J2) || (J3 ○ J4)) ○ f r = X ◎ Y ○ f r can be confirmed.

J1,J2,J3,J4の乗算処理への入力データは全て乱数値マスク化データであるため、SPA,DPAに対して安全な処理を実現できる。この処理に必要となる乗算の回数は以下の通りである。
-U17=U16◎Uの場合: 4-bit´4-bit乗算4回(8-bit´4-bit乗算2回と等価)。
基本原理-4は(law-1)〜(law-4)に基づいているため、βγ=2を満たす合成体GF((…(2β1)…)βγ)の演算に対して適用可能である。
Since all input data to the multiplication processing of J1, J2, J3, and J4 is random value masked data, it is possible to realize safe processing for SPA and DPA. The number of multiplications required for this processing is as follows.
-U 17 = U 16 ◎ U: 4 times 4-bit´4-bit multiplication (equivalent to 2 times 8-bit´4-bit multiplication).
Since Basic Principle-4 is based on (law-1) to (law-4), it is applicable to the calculation of the composite GF ((… (2 β1 )…) βγ ) satisfying βγ = 2 .

本発明の各実施形態の構成
基本原理-1, 基本原理-2, 基本原理-3, 基本原理-4に記した本発明の技術を、図23に示した従来例3に示した逆元演算に適用した実施形態を以下に示す。以下の実施形態の説明では、図31に示すように、逆元演算の処理のコア部分、つまり合成体の計算部分に対して本発明を用いた場合の実施形態を示す。本発明の実施形態において説明する逆元演算では、共通して以下のI〜IVのステップを実行する。
The basic principle-1, basic principle-2, basic principle-3, basic principle-3, basic principle-4 of each embodiment of the present invention are applied to the inverse element operation shown in the conventional example 3 shown in FIG. The embodiment applied to is shown below. In the following description of the embodiment, as shown in FIG. 31, an embodiment in which the present invention is used for the core part of the inverse element processing, that is, the calculation part of the composite field is shown. In the inverse operation described in the embodiment of the present invention, the following steps I to IV are executed in common.

i.逆元演算回路はGF(28)の元T○prを入力することで、GF(28)の元T-1○qrを計算し出力する回路である。ただし、pr,qrは乱数rによって選択される固定値マスクを表す。 i. Inverse operation circuit by inputting the original T ○ p r of GF (2 8), is a circuit that calculates and outputs the original T -1 ○ q r of GF (2 8). Here, p r and q r represent fixed value masks selected by the random number r.

ii.入力されたGF(28)の元T○grにδ変換を行い、δ(T○pr)=δ(T)○δ(pr)=U○grを計算する。ただし、grは乱数rによって選択される固定値マスクであり、gr=δ(pr)を満たす。 ii. Perform [delta] converted back T ○ g r of the input GF (2 8), δ ( T ○ p r) = δ (T) ○ δ to calculate the (p r) = U ○ g r. However, g r is a fixed value mask selected by the random number r and satisfies g r = δ (p r ).

iii.U○grに対して、乗算とテーブル演算を組み合わせた演算を行うことで、U○grから、U-1○frを計算する。ただし、frは乱数rによって選択される固定値マスクを表す。 iii. Against U ○ g r, by performing a calculation combining multiplies the table calculation, the U ○ g r, calculates the U -1 ○ f r. Here, f r represents a fixed value mask selected by the random number r.

iv.U-1○frに対して、δ-1変換を行うことでδ-1(U-1○fr)=δ-1(U-1)○δ-1(fr)=T-1○qrを計算する。ただし、qrとfrの間には、δ-1(fr)= qrの関係式が成立する。 iv. U -1 ○ against f r, δ -1 δ by performing conversion -1 (U -1 ○ f r) = δ -1 (U -1) ○ δ -1 (f r) = T -1 ○ q r is calculated. However, a relational expression of δ −1 (f r ) = q r is established between q r and f r .

以下では、上記のi〜ivステップのうち、iiiに記した逆元演算のステップに関して、基本原理-1, 基本原理-2, 基本原理-3, 基本原理-4に記した本発明の技術を適用することで、SPA,DPA対策を実現する実施形態について説明する。   In the following, among the above i to iv steps, the technique of the present invention described in Basic Principle-1, Basic Principle-2, Basic Principle-3, Basic Principle-4 is applied to the step of inverse element operation described in iii. An embodiment for realizing SPA and DPA countermeasures by application will be described.

iiiの計算を実行するためのフレームワークを図31に示す。
図31の計算は、「masked U16◎U計算」、「masked U-17◎U16計算」2つの乗算処理から構成される。これらは、データのマスク処理を実行しながら乗算処理を行う回路であり、それぞれ以下の機能を有する。
A framework for performing the iii calculation is shown in FIG.
The calculation in FIG. 31 includes two multiplication processes “masked U 16 ◎ U calculation” and “masked U -17 ◎ U 16 calculation”. These are circuits that perform multiplication processing while performing data mask processing, and each have the following functions.

masked U 16 ◎U計算
この回路の基本機能は、U○grを入力することで、U17○crを計算し出力することである。ただし、cr,grは乱数rによって選択される固定値マスクであり、crは4-bit, grは8-bitである。この固定値マスクcr, grはこの回路に対する入力として与える。この回路内部で乱数値マスク化されたデータによる乗算を実行するために、乱数Rを入力として与える。また、U16○R’, R’で表される2つのデータを出力し、masked U-17◎U16計算への入力として与える。R’として出力される値は、この回路の実施形態によって異なり、基本原理-1の乗算回路を用いた[第1の実施形態]の場合R’=R16であり、基本原理-2の乗算回路を用いた[第2の実施形態]の場合R’=Rである。[第1の実施形態][第2の実施形態]の詳細については、後に述べる。
· Masked U 16 U calculating basic function of this circuit, by inputting a U ○ g r, is that calculates and outputs a U 17 ○ c r. However, c r, g r is a fixed value mask is selected by a random number r, c r is a 4-bit, g r is 8-bit. The fixed value masks c r and g r are given as inputs to this circuit. A random number R is given as an input in order to execute multiplication with the random value masked data inside the circuit. Also, U 16 ○ R ', R ' outputs two data represented by, giving as input to masked U -17 ◎ U 16 calculation. The value output as R ′ differs depending on the embodiment of this circuit. In the case of the first embodiment using the multiplication circuit of the basic principle-1, R ′ = R 16 and the multiplication of the basic principle-2. In the case of [Second Embodiment] using a circuit, R ′ = R. Details of the first embodiment and the second embodiment will be described later.

masked U -17 ◎U 16 計算
この回路の基本機能は、U-17○dr及びU16○R’、乱数R’を入力することで、U-1○frを計算し出力することである。ただし、dr,frは乱数rによって選択される固定値マスクであり、drは4-bit, frは8-bitである。この固定値マスクdr, frはこの回路に対する入力として与える。
Masked U -17 ◎ U 16 calculation The basic function of this circuit is to calculate and output U -1 ○ f r by inputting U -17 ○ d r, U 16 ○ R 'and random number R'. It is. However, d r, f r is a fixed value mask is selected by a random number r, d r is a 4-bit, f r is 8-bit. The fixed value masks d r and f r are given as inputs to this circuit.

図31は、入力データU○grから出力データU-1○frを計算する処理である。この計算処理全体の流れを説明する。 Figure 31 is a process for calculating the output data U -1 ○ f r from the input data U ○ g r. The overall flow of this calculation process will be described.

masked U16◎U計算により、8-bit値U○grから4-bit値U17○crを計算する。このU17○crに対し、乱数rによって選択された4-bita4-bit変換テーブルI’r[x]を用いてU-17○drを計算する。GF(((22)2)2)の元における4-bita4-bit逆元変換テーブルをI[x]=x-1と表した場合、I’h[x]はh-0,1,..,q-1全てに関して、I’h[x]=I[x○ch] ○dhで与えられる変換を行うテーブルである。U17○crに対しI’r[x]による変換を行うことで、I’[U17○cr] = I[(U17○cr)○cr]○dr = I[U17]○dr = (U17)-1○dr = U-17○drを計算することができる。このデータは、masked U-17◎U16計算に対する2つの入力データの1番目の入力となる。 The masked U 16 ◎ U calculation, calculates a 4-bit value U 17 ○ c r from 8-bit value U ○ g r. For this U 17 ○ c r , U −17 ○ d r is calculated using the 4-bita4-bit conversion table I ′ r [x] selected by the random number r. When the 4-bita4-bit inverse element conversion table in the element of GF (((2 2 ) 2 ) 2 ) is expressed as I [x] = x −1 , I ′ h [x] is h-0,1, .., q-1 is a table for performing conversion given by I ′ h [x] = I [x o c h ] o d h . By converting U 17 ○ c r with I ′ r [x], I ′ [U 17 ○ c r ] = I [(U 17 ○ c r ) ○ c r ] ○ d r = I [U 17 ] ○ d r = (U 17 ) −1 ○ d r = U -17 ○ d r can be calculated. This data is a first input of the two input data to the masked U -17 ◎ U 16 calculation.

masked U-17◎U16計算に対する2番目の入力データとして、U16○R’の計算を行う。後に述べる[第1の実施形態]の場合、U16○R’は、masked U16◎U計算の過程において計算される(U○R)16=U16○R16のデータを用いるため、R’=R16となる。後に述べる[第2の実施形態]の場合、masked U16◎U計算の過程において計算されるU16○Rの値を用いるため、R’=Rとなる。 as the second input data to the masked U -17 ◎ U 16 calculation, the calculation of U 16 ○ R '. In the case of the first embodiment to be described later, U 16 R ′ is calculated in the process of masked U 16 ◎ U, and uses data of (UR) 16 = U 16 ○ R 16. '= R 16 In the case of [Second Embodiment] described later, R ′ = R because the value of U 16 ○ R calculated in the process of masked U 16 ◎ U is used.

なお、(U○R)16=U16○R16が成立する理由は、16乗演算は2乗演算を4回繰り返す演算であり、かつ1回の2乗演算の結果は(law-3)を考慮すると(U○R)2=U2○2U◎R○R2=U2○R2、つまり整数kに対してUk○Rkの形式を満たすからであり、よって、16乗の場合U16○R16となる。 Note that (U ○ R) 16 = U 16 ○ R 16 is established because the 16th power calculation is a calculation that repeats the squaring operation four times, and the result of one square operation is (law-3) (U ○ R) 2 = U 2 ○ 2U ◎ R ○ R 2 = U 2 ○ R 2 , that is, it satisfies the form of U k ○ R k for integer k. Case U 16 ○ R 16

以上により、U-17○drとU16○R’の計算を行った後、これらの値をmasked U-17◎U16計算に対する2つの入力データとして与えることで、U-1○frを得る。 Thus, after calculating U -17 ○ d r and U 16 ○ R ′, by giving these values as two input data for the masked U -17 ◎ U 16 calculation, U −1 ○ f r Get.

上記における、「masked U16◎U計算」、「masked U-17◎U16計算」に対して、基本原理-1、基本原理-2、基本原理-3、基本原理-4に記した、本発明の回路を用いることで、SPA,DPAに対して安全な処理を実現することができる。以下では、「masked U16◎U計算」、「masked U-17◎U16計算」に対して、基本原理-1、基本原理-2、基本原理-3、基本原理-4を適用した結果の実施形態を示す。 For the above “masked U 16 ◎ U calculation” and “masked U -17 ◎ U 16 calculation”, this is the book described in Basic Principle-1, Basic Principle-2, Basic Principle-3, and Basic Principle-4. By using the circuit of the invention, safe processing can be realized for SPA and DPA. In the following, "masked U 16 ◎ U computing", for the "masked U -17 ◎ U 16 calculates" basic principle -1, basic principle -2, basic principles -3, the result of applying the basic principle -4 An embodiment is shown.

図32は、基本原理-1の乗算回路を用いてmasked U16◎Uを計算する本発明の第1の実施形態の構成図である。入力データgr, U○gr, Rから、U○R= (U○gr) ○R○gr、U16○R16= (U○R)16、R16の3つのデータを計算する。その後、基本原理-1のMaskMul_1回路を用いて、U17○cr= MaskMul_1(U○R, U16○R16, R, R16, cr)によりU17○crを計算する。この計算過程で発生したU16○R16とR16を、それぞれU16○R’, R’として出力する。 FIG. 32 is a block diagram of the first embodiment of the present invention for calculating masked U 16 ◎ U using the multiplication circuit of basic principle-1. Calculates three data from input data g r , U ○ g r , R: U ○ R = (U ○ g r ) ○ R ○ g r , U 16 ○ R 16 = (U ○ R) 16 , R 16 To do. Then, using the MaskMul_1 circuit basic principles -1, U 17 ○ c r = MaskMul_1 (U ○ R, U 16 ○ R 16, R, R 16, c r) by calculating the U 17 ○ c r. U 16 ○ R 16 and R 16 generated in this calculation process are output as U 16 ○ R ′ and R ′, respectively.

図33は、基本原理-2の乗算回路を用いてmasked U16◎Uを計算する第2の実施形態の構成図である。入力データgr, U○gr, Rから、U○R= (U○gr) ○R○gr、U16○R= (U○R)16○R○R16の2つのデータを計算する。その後、基本原理-2のMaskMul_2回路を用いて、U17○cr=MaskMul_2(U○R, U16○R, R, cr)によりU17○crを計算する。この計算過程で発生したU16○RとRを、それぞれU16○R’, R’として出力する。 FIG. 33 is a block diagram of a second embodiment in which masked U 16 ◎ U is calculated using the multiplication circuit of basic principle-2. From input data g r , U ○ g r , R, two data of U ○ R = (U ○ g r ) ○ R ○ g r , U 16 ○ R = (U ○ R) 16 ○ R ○ R 16 calculate. After that, using the MaskMul_2 circuit of the basic principle-2, U 17 ○ c r is calculated by U 17 ○ c r = MaskMul_2 (U ○ R, U 16 ○ R, R, cr ). U 16 ○ R and R generated in this calculation process are output as U 16 ○ R ′ and R ′, respectively.

図34は、基本原理-1の乗算回路を用いてmasked U-17◎U16を計算する本発明の第3の実施形態の構成図である。入力データU-17○dr, dr, U16○R’, R’,fr及び内部で発生させた乱数Sから、U-17○S○dr= (U-17○dr)○S、S○drの2つのデータを計算する。その後、基本原理-1のMaskMul_1回路を用いて、U-1○fr=MaskMul_1(U-17○S○dr, U16○R, S○dr, R’, fr)によりU-1○frを計算する。 FIG. 34 is a block diagram of a third embodiment of the present invention for calculating masked U -17 ◎ U 16 using the multiplication circuit of basic principle-1. From input data U -17 ○ d r , d r , U 16 ○ R ', R', f r and internally generated random number S, U -17 ○ S ○ d r = (U -17 ○ d r ) ○ S, to calculate the two data of the S ○ d r. Then, using the MaskMul_1 circuit basic principles -1, U -1 ○ f r = MaskMul_1 (U -17 ○ S ○ d r, U 16 ○ R, S ○ d r, R ', f r) by U - 1 Calculate f r .

図35は、基本原理-3の乗算回路を用いてmasked U-17◎U16を計算する本発明の第4の実施形態の構成図である。入力データU-17○dr, dr, U16○R’ , R’、及び8-bit乱数R’の上位4-bitであるR’H, 下位4-bitであるR’Lを用いて、U16○(dr||dr) ○R’, U-17○dr○R’L, dr○RL’, U-17○dr○R’H, dr○R’Hの5つのデータを計算する。その後、基本原理-3のMaskMul_3回路を用いて、U-1○fr=MaskMul_3(U16○(dr||dr)○R’, U-17○dr○R’H, U-17○dr○R’L, dr○R’H, dr○R’L, fr)によりU-1○frを計算する。 FIG. 35 is a block diagram of a fourth embodiment of the present invention for calculating masked U -17 ◎ U 16 using the multiplication circuit of basic principle-3. Input data U -17 ○ d r , d r , U 16 ○ R ' , R ′ and the upper 4-bit R ′ H of the 8-bit random number R ′ and the lower 4-bit R ′ L , U 16 ○ (d r || d r ) ○ R ′, U -17 ○ d r ○ R ' L, d r ○ R L', U -17 ○ d r ○ R 'H, d r ○ R' to calculate the five data of H. Then, using the MaskMul_3 circuit basic principles -3, U -1 ○ f r = MaskMul_3 (U 16 ○ (d r || d r) ○ R ', U -17 ○ d r ○ R' H, U - 17dr ○ R ′ L , dr ○ R ′ H , dr ○ R ′ L , f r ), U− 1fr is calculated.

図36は、基本原理-4の乗算回路を用いてmasked U-17◎U16を計算する本発明の第5の実施形態の構成図である。入力データU-17○dr, dr, U16○R’ r, fr, R’、及び8-bit乱数R’の上位4-bitであるR’H, 下位4-bitであるR’L、を用いて、U16 H○R’L=(U16○R’の上位4-bit) ○R’L○R’H、U-17○R’L= (U-17○dr) ○R’L○dr、U16 L○R’L=(U16○R’の下位4-bit)の3つのデータを計算する。ただし、U16 HとU16 Lは、それぞれ8-bit値U16の上位4-bitと下位4-bitを表す。その後、基本原理-4のMaskMul_4回路を用いて、U-1○fr=MaskMul_4(U16 H○R’L, U16 L○R’L, U-17○R’L, R’L, fr)によりU-1○frを計算する。 FIG. 36 is a block diagram of the fifth embodiment of the present invention for calculating masked U -17 ◎ U 16 using the multiplication circuit of basic principle-4. Input data U -17 ○ d r , d r , U 16 ○ R ' r , f r , R', and R ' H which is the upper 4-bit of 8-bit random number R', R which is the lower 4-bit ' L, U 16 H ○ R' L = (Upper 4-bit of U 16 ○ R ') ○ R' L ○ R ' H , U -17 ○ R' L = (U -17 ○ d r ) ○ R ' L ○ d r , U 16 L ○ R' L = (lower 4 bits of U 16 ○ R ') is calculated. However, U 16 H and U 16 L represent the upper 4-bit and the lower 4-bit of the 8-bit value U 16 , respectively. After that, using the MaskMul_4 circuit of Basic Principle-4, U -1 ○ f r = MaskMul_4 (U 16 H ○ R ' L , U 16 L ○ R' L , U -17 ○ R ' L , R' L , U −1 ○ f r is calculated from f r ).

本発明の各実施形態の効果
本発明の技術を用いたAES暗号処理装置は、「本発明の基本原理」に記した(条件-1), (条件-2), (条件-3), (条件-4)を満たすので、従来例1,2,3が解決できなかった課題1,2,3を全て解決できる。つまり、従来例では不可能であった、小さな回路規模(課題1の解決)、高速な処理速度(課題2の解決)、SPA,DPAに安全な処理(課題3の解決)の3点を全て満たしたAES暗号処理装置を実現することができる。従来例1,2,3と本発明の比較を表3に示す。
Advantages of each embodiment of the present invention The AES encryption processing device using the technology of the present invention is described in (Condition-1), (Condition-2), (Condition-3), (Condition-3), Since Condition-4) is satisfied, all the problems 1, 2, and 3 that cannot be solved by the conventional examples 1, 2, and 3 can be solved. In other words, all three points that were impossible with the conventional example: small circuit scale (solution for issue 1), high processing speed (solution for issue 2), and safe processing for SPA and DPA (solution for issue 3). A satisfying AES encryption processor can be realized. Table 3 compares the conventional examples 1, 2, and 3 with the present invention.

また、本発明の技術を用いることで、AESのみならず、合成体を用いた乗算処理を行う共通鍵暗号全般に対して、課題1,2,3を解決した暗号処理装置を実現することができる。例えば、128-bit共通鍵ブロック暗号アルゴリズムであるCLEFIA(http://www.sony.co.jp/Products/clefia/technical/data/clefia-spec-1.0.pdf) に対しても、本発明を適用できる。   In addition, by using the technique of the present invention, it is possible to realize a cryptographic processing apparatus that solves the problems 1, 2, and 3 for all common key cryptosystems that perform multiplication processing using not only AES but also a composite field. it can. For example, the present invention is also applied to CLEFIA (http://www.sony.co.jp/Products/clefia/technical/data/clefia-spec-1.0.pdf) which is a 128-bit common key block cipher algorithm. Applicable.

本発明の技術を実現するための基本的な乗算回路は、基本原理-1、基本原理-2、基本原理-3、基本原理-4の4種類であり、それぞれの回路に必要となる8-bit´4-bit乗算の回数を表4に示す。   There are four basic multiplication circuits for realizing the technology of the present invention: basic principle-1, basic principle-2, basic principle-3, and basic principle-4. Table 4 shows the number of bit'4-bit multiplications.

本発明の乗算回路は、「masked U16◎U計算」「masked U-17◎U16計算」の2つの計算に対し、[第1の実施形態]〜[第5の実施形態]のうちのどの実施形態を適用するかに応じて、必要となる8-bit´4-bit乗算の乗算回数が変化する。この乗算回数は、実施形態のベースとなる基本原理-1〜基本原理-4それぞれに必要となる乗算回数の合計で評価される。評価結果を表5に示す。 The multiplication circuit of the present invention is one of [first embodiment] to [fifth embodiment] for two calculations of “masked U 16 ◎ U calculation” and “masked U -17 ◎ U 16 calculation”. Depending on which embodiment is applied, the necessary number of 8-bit′4-bit multiplications varies. The number of multiplications is evaluated by the total number of multiplications required for each of the basic principle-1 to basic principle-4, which are the basis of the embodiment. The evaluation results are shown in Table 5.

表5の評価においては、16乗の演算回数が含まれていないが、これは、GF(((22)2)2)の16乗演算は、非常に小さな回路規模で実現できる特殊な演算であるからである。具体的には、Xに対する16乗演算結果X16はXの上位4-bit XH, 下位4-bit XLを用いて、X16=XH|| (XL○XH)のように4-bitXOR演算のみで演算可能であり、これは乗算回路の回路規模と比較して非常に小さいため無視できる大きさである。 The evaluation in Table 5 does not include the number of operations to the 16th power. This is because the GF (((2 2 ) 2 ) 2 ) 16th operation is a special operation that can be realized with a very small circuit scale. Because. Specifically, the 16th power operation result X 16 for X is expressed as X 16 = X H || (X L ○ X H ) using the upper 4-bit X H and lower 4-bit X L of X. The calculation can be performed only by the 4-bit XOR operation, which is very small compared with the circuit scale of the multiplication circuit, and can be ignored.

Claims (2)

○をXOR演算処理、◎を乗算処理とし、
4ビットのcr,8ビットのgr,4ビットのdr,及び8ビットのfrをそれぞれ乱数rによって選択される固定値マスクとし、8ビットのR、R’を乱数値マスクとして、8ビットの入力データU○grから8ビットの出力データU-1○frを、βγ=2を満たす合成体GF((…(2β1)…)βγ)において演算する共通鍵ブロック暗号化装置であって、
乱数値マスクをXORさせて実行するU16◎U計算により、前記入力データU○grから4ビット値U17○crを計算すると共に、それぞれ8ビットのU16○R’及びR’を計算するmaskedU16◎U計算回路と、
該maskedU16◎U計算回路から出力される前記U17○crから4ビットのU-17○drを計算する、乱数rによって選択された4ビット対4ビット変換テーブル回路と、
前記4ビット対4ビット変換テーブル回路から出力されるU-17○drと前記maskedU16◎U計算回路から出力されるU16○R’及びR’をそれぞれ入力し、前記出力データU-1○frを計算するmaskedU-17◎U16計算回路と、
を含むことを特徴とする暗号化装置。
○ is XOR operation processing, ◎ is multiplication processing,
4 bits of c r, 8-bit g r, 4 bits of d r, and 8 bits of f r a fixed mask value to be selected by the respective random number r, 8-bit R, a random number mask R ', 8-bit output data U -1 ○ f r from 8-bit input data U ○ g r, satisfies the [beta] [gamma] = 2 composite GF ((... (2 β1) ...) βγ) common key block encryption for computing the A device,
U 16 ◎ Executed by XORing the random value mask, U-calculation calculates a 4-bit value U 17 ○ c r from the input data U ○ g r , and 8-bit U 16 ○ R ′ and R ′ respectively. MaskedU 16 to calculate ◎ U calculation circuit,
Wherein calculating the U 17 ○ c r from the 4-bit U -17 ○ d r outputted from the maskedU 16 ◎ U calculation circuit, and a 4-bit to 4-bit conversion table circuit selected by a random number r,
The 4-bit to 4 and bit conversion output from the table circuit U -17 ○ d r wherein maskedU 16 ◎ output from U calculation circuit U 16 ○ R 'and R' were respectively input, the output data U -1 ○ f maskedU -17 to calculate r ◎ U 16 calculation circuit,
An encryption device comprising:
○をXOR演算処理、◎を乗算処理とし、
4ビットのcr,8ビットのgr,4ビットのdr,及び8ビットのfrをそれぞれ乱数rによって選択される固定値マスクとし、8ビットのR、R’を乱数値マスクとして、8ビットの入力データU○grから8ビットの出力データU-1○frを、βγ=2を満たす合成体GF((…(2β1)…)βγ)において演算する共通鍵ブロック暗号化方法であって、
乱数値マスクをXORさせて実行するU16◎U計算により、前記入力データU○grから4ビット値U17○crを計算すると共に、それぞれ8ビットのU16○R’及びR’を計算するmaskedU16◎U計算ステップと、
該maskedU16◎U計算ステップの出力である前記U17○crから4ビットのU-17○drを計算する、乱数rによって選択された4ビット対4ビット変換テーブルステップと、
前記4ビット対4ビット変換テーブルステップの出力であるU-17○drと前記maskedU16◎U計算ステップの出力であるU16○R’及びR’をそれぞれ入力し、前記出力データU-1○frを計算するmaskedU-17◎U16計算ステップと、
を実行させることを特徴とする暗号化方法。
○ is XOR operation processing, ◎ is multiplication processing,
4 bits of c r, 8-bit g r, 4 bits of d r, and 8 bits of f r a fixed mask value to be selected by the respective random number r, 8-bit R, a random number mask R ', 8-bit output data U -1 ○ f r from 8-bit input data U ○ g r, satisfies the [beta] [gamma] = 2 composite GF ((... (2 β1) ...) βγ) common key block encryption for computing the A method,
U 16 ◎ Executed by XORing the random value mask, U-calculation calculates a 4-bit value U 17 ○ c r from the input data U ○ g r , and 8-bit U 16 ○ R ′ and R ′ respectively. MaskedU 16 to calculate ◎ U calculation step,
The maskedU 16 ◎ calculates the 4-bit from U 17 ○ c r U -17 ○ d r is the output of the U computation step, the 4-bit to 4-bit conversion table step selected by the random number r,
The 4-bit-to-four, which is the output of the bit conversion table steps and U -17 ○ d r wherein maskedU 16 ◎ which is the output of the U calculation step U 16 ○ R 'and R' were respectively input, the output data U -1 ○ maskedU -17 to calculate f r ◎ U 16 calculation step,
The encryption method characterized by performing this.
JP2013013329A 2013-01-28 2013-01-28 Encryption device and built-in device equipped with a common key encryption function Active JP5500277B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013013329A JP5500277B2 (en) 2013-01-28 2013-01-28 Encryption device and built-in device equipped with a common key encryption function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013013329A JP5500277B2 (en) 2013-01-28 2013-01-28 Encryption device and built-in device equipped with a common key encryption function

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2010505044A Division JP5229315B2 (en) 2008-03-31 2008-03-31 Encryption device and built-in device equipped with a common key encryption function

Publications (2)

Publication Number Publication Date
JP2013077034A true JP2013077034A (en) 2013-04-25
JP5500277B2 JP5500277B2 (en) 2014-05-21

Family

ID=48480480

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013013329A Active JP5500277B2 (en) 2013-01-28 2013-01-28 Encryption device and built-in device equipped with a common key encryption function

Country Status (1)

Country Link
JP (1) JP5500277B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210049279A1 (en) * 2015-04-14 2021-02-18 Capital One Services, Llc System and methods for secure firmware validation

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002366029A (en) * 2001-06-13 2002-12-20 Fujitsu Ltd Encipherment safe against dpa(differential power analysis)
JP2005266810A (en) * 2004-03-16 2005-09-29 Samsung Electronics Co Ltd Data-ciphering processing apparatus applying masking method thereto, aes-ciphering system and aes-ciphering method
JP2006003905A (en) * 2004-06-19 2006-01-05 Samsung Electronics Co Ltd Method and apparatus for multiplication in galois field for preventing information leakage attack, inverse transformation device, and apparatus for aes byte substitution operation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002366029A (en) * 2001-06-13 2002-12-20 Fujitsu Ltd Encipherment safe against dpa(differential power analysis)
JP2005266810A (en) * 2004-03-16 2005-09-29 Samsung Electronics Co Ltd Data-ciphering processing apparatus applying masking method thereto, aes-ciphering system and aes-ciphering method
JP2006003905A (en) * 2004-06-19 2006-01-05 Samsung Electronics Co Ltd Method and apparatus for multiplication in galois field for preventing information leakage attack, inverse transformation device, and apparatus for aes byte substitution operation

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JPN6012060244; Trichina, E.: 'Combinational Logic Design for AES SubByte Transformation on Masked Data' Cryptology ePrint Archive Report 2003/236, 200311, The Internet *
JPN6012060247; 川畑伸幸 他: 'AESにおける合成体Subbytes向けパワーマスキング乗算回路の設計' 電子情報通信学会技術研究報告 第107巻 第335号, 20071114 *
JPN6012060264; Rodriguez LL, et al.: 'Full-length genome analysis of natural isolates of vesicular stomatitis virus (Indiana 1 serotype) f' Journal of General Virology Vol. 83, No. 10, 200210, p. 2475-2483 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210049279A1 (en) * 2015-04-14 2021-02-18 Capital One Services, Llc System and methods for secure firmware validation
US11640467B2 (en) * 2015-04-14 2023-05-02 Capital One Services, Llc System and methods for secure firmware validation

Also Published As

Publication number Publication date
JP5500277B2 (en) 2014-05-21

Similar Documents

Publication Publication Date Title
JP5229315B2 (en) Encryption device and built-in device equipped with a common key encryption function
CN106788974B (en) Mask S box, grouping key calculation unit, device and corresponding construction method
JP4596686B2 (en) Secure encryption against DPA
JP4909018B2 (en) Encryption device for common key encryption
KR101026439B1 (en) The Masking Method for Protecting Power Analysis Attacks in SEED
JP2008058830A (en) Data converting device, data conversion method, and computer program
JP5364840B2 (en) Encryption device
TW201044334A (en) Encryption device, encryption method, and computer program
US20170366339A1 (en) Method of encryption with dynamic diffusion and confusion layers
KR20050078271A (en) Hardware cryptographic engine and method improving power consumption and operation speed
Ara et al. Dynamic key dependent S-Box for symmetric encryption for IoT devices
KR101506499B1 (en) Method for encrypting with SEED applying mask
JP5680016B2 (en) Decoding processing apparatus, information processing apparatus, decoding processing method, and computer program
KR100991713B1 (en) Apparatus and method for operating inversion of AES with masking method, and AES cipher system and method using thereof
Noura et al. Tresc: Towards redesigning existing symmetric ciphers
JP5500277B2 (en) Encryption device and built-in device equipped with a common key encryption function
Yang et al. A new cryptosystem based on chaotic map and operations algebraic
Yang et al. A new block cipher based on chaotic map and group theory
Yli-Mäyry et al. Chosen-input side-channel analysis on unrolled light-weight cryptographic hardware
Silva-Garcia et al. The triple-DES-96 cryptographic system
JP5772934B2 (en) Data conversion apparatus, data conversion method, and computer program
Siddavaatam et al. An adaptive security framework with extensible computational complexity for cipher systems
Bai et al. Securing SMS4 cipher against differential power analysis and its VLSI implementation
Cook et al. Elastic aes
Aveem et al. Construction of S-boxes from cyclic group of residue class of noncommutative quaternion integers

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130128

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131224

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140123

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: 20140212

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140225

R150 Certificate of patent or registration of utility model

Ref document number: 5500277

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150