JP2007316491A - Exponentiation arithmetic unit, decoding apparatus, and signature creating apparatus - Google Patents

Exponentiation arithmetic unit, decoding apparatus, and signature creating apparatus Download PDF

Info

Publication number
JP2007316491A
JP2007316491A JP2006148059A JP2006148059A JP2007316491A JP 2007316491 A JP2007316491 A JP 2007316491A JP 2006148059 A JP2006148059 A JP 2006148059A JP 2006148059 A JP2006148059 A JP 2006148059A JP 2007316491 A JP2007316491 A JP 2007316491A
Authority
JP
Japan
Prior art keywords
multiplier
unit
secret information
multiplication
storing
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.)
Pending
Application number
JP2006148059A
Other languages
Japanese (ja)
Inventor
Yuichi Fuda
裕一 布田
Natsume Matsuzaki
なつめ 松崎
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2006148059A priority Critical patent/JP2007316491A/en
Publication of JP2007316491A publication Critical patent/JP2007316491A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/002Countermeasures against attacks on cryptographic mechanisms
    • H04L9/003Countermeasures against attacks on cryptographic mechanisms for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3006Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters
    • H04L9/302Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters involving the integer factorization problem, e.g. RSA or quadratic sieve [QS] schemes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/08Randomization, e.g. dummy operations or using noise

Abstract

<P>PROBLEM TO BE SOLVED: To solve the following problem: the conventional method for blocking the attack of simple power analysis by adding dummy multiplication to eliminate the differences in existence of multiplication by the bit of a power value of a private key (d) cannot block an attack (a BigMac attack) wherein the multipliers in a dummy multiplication and in a non-dummy multiplication are analyzed. <P>SOLUTION: An exponentiation arithmetic unit comprises an input/output section, a private key storing section, a counter storing section, a counter initializing section, a counter updating section, a first counter judging section, a second counter judging section, a bit judging section, a multiplication section, a squaring section, an intermediate value storing section, a multiplier storing section, a random number storing section, a multiplier initializing section, a multiplier updating section, a randomness removing section, and a random number updating section. By updating the multiplier while raising it, distinction between a dummy multiplication and a non-dummy multiplication is made difficult. Thus, a BigMac attack can be blocked. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、暗号処理を実行する際の電力消費量を計測することで、暗号モジュールに埋め込まれている暗号鍵を解析する攻撃方法に対して安全な暗号装置に関する。   The present invention relates to a cryptographic device that is safe against an attack method that analyzes a cryptographic key embedded in a cryptographic module by measuring power consumption when performing cryptographic processing.

近年、ハードウェアあるいはソフトウェアで実装された暗号モジュールが、暗号処理を行う際の副情報を手がかりにして、暗号鍵の解析を行う解読法が各種考案されている。例えば、タイミング攻撃と呼ばれる解析方法では、暗号モジュールが暗号処理に要する時間が、暗号処理に用いている暗号鍵の値により、わずかではあるが異なることを利用して、暗号鍵の解析を行う。即ち、タイミング攻撃においては、暗号処理を行う際の処理時間という副情報を利用して、暗号鍵の解読を行っている。そのような解読法の中でも、暗号処理を行う際の電力消費量を副情報として、解読を行う解読方法は、Simple Power Analysis(単純電力解析攻撃)、やDifferential Power Analysis(差分電力解析攻撃)といった各種の方法が考案されている。これらの解読法は、近年、高性能な計測機器が安価で手に入るようになった背景もあって、ICカードのような暗号が実装された実際の製品に対しても解析が可能であることが報告されている。以下の記述では、上記のような暗号処理時における暗号モジュールの電力消費量の変化、すなわち、電力波形を手がかりにして、暗号鍵を解析する解読方法を総称して、「電力解析攻撃」と呼ぶ。タイミング攻撃については、非特許文献1、電力解析攻撃については、非特許文献2が詳しい。   2. Description of the Related Art In recent years, various cryptanalysis methods have been devised in which a cryptographic module implemented by hardware or software analyzes a cryptographic key by using sub-information when performing cryptographic processing as a clue. For example, in an analysis method called a timing attack, an encryption key is analyzed by taking advantage of the fact that the time required for encryption processing by the encryption module varies slightly depending on the value of the encryption key used for encryption processing. That is, in the timing attack, the encryption key is decrypted by using the sub-information called the processing time when performing the encryption process. Among such cryptanalysis methods, cryptanalysis methods that perform cryptanalysis using the power consumption at the time of cryptographic processing as sub-information are Simple Power Analysis (Simple Power Analysis Attack) and Differential Power Analysis (Differential Power Analysis Attack). Various methods have been devised. These cryptanalysis methods can be analyzed even for actual products in which cryptography such as an IC card is mounted, due to the background that high-performance measuring instruments are available at low cost in recent years. It has been reported. In the following description, the power consumption of the cryptographic module during the cryptographic processing as described above, that is, the decryption method for analyzing the cryptographic key using the power waveform as a clue is collectively referred to as “power analysis attack”. . Non-Patent Document 1 is detailed for timing attacks, and Non-Patent Document 2 is detailed for power analysis attacks.

以下で、RSA暗号への単純電力解析攻撃について説明する。RSA暗号については、非特許文献3が詳しい。   Hereinafter, a simple power analysis attack on the RSA encryption will be described. Regarding the RSA encryption, Non-Patent Document 3 is detailed.

〔RSA暗号の単純電力解析攻撃〕
RSA暗号の復号化処理において、素数p、qの積n、n未満の正整数である暗号文cと、正整数である秘密鍵dに対し、c^d mod nの計算を行う。この計算方法として例えば、非特許文献4の9ページにおけるバイナリ法が知られている。以下では、バイナリ法について説明する。d=d0+d1×2+d2×2^2+...+d^(len−1)×2^(len−1)、i=0、1、...、len−1に対しdi=0または1とする。ここで、lenはdのビット数、“×”は整数の乗算、x^yはxのy乗を示している。
[Simple power analysis attack of RSA encryption]
In the decryption process of the RSA cipher, c ^ d mod n is calculated for a product n of prime numbers p and q, a ciphertext c that is a positive integer less than n, and a secret key d that is a positive integer. As this calculation method, for example, the binary method on page 9 of Non-Patent Document 4 is known. Hereinafter, the binary method will be described. d = d0 + d1 × 2 + d2 × 2 ^ 2 +. . . + D ^ (len-1) × 2 ^ (len-1), i = 0, 1,. . . , Len-1 with di = 0 or 1. Here, len indicates the number of bits of d, “×” indicates multiplication of an integer, and x ^ y indicates x to the power of y.

(バイナリ法)
ステップS801:i←len−2, z←c
ステップS802:z←z^2 mod n
ステップS803:diが1であるかチェック。di=1である場合は、z←z×c mod n。
(Binary method)
Step S801: i ← len-2, z ← c
Step S802: z ← z ^ 2 mod n
Step S803: Check whether di is 1. When di = 1, z ← z × c mod n.

ステップS804:i←i−1。iが負であるかチェック。負である場合は、zを出力。それ以外は、ステップS802へ。   Step S804: i ← i-1. Check if i is negative. Output z if negative. Otherwise, go to step S802.

上記方法では、ステップS802、S803、S804をループとして繰り返し計算している。このループ内で、di(i=1,2,...,len−1)に対して、di=1の場合は、zの2乗算とcによる乗算を行い、di=0の場合は、zの2乗算のみを実行する。nは大きな数、例えば、1024ビットの整数である。通常は、2乗算は乗算より、計算の処理の効率化が図ることが可能なため、高速に処理可能になる。その場合、2乗算と乗算は処理が異なるため、電力波形が異なる。   In the above method, steps S802, S803, and S804 are repeatedly calculated as a loop. In this loop, for di (i = 1, 2,..., Len−1), when di = 1, z is multiplied by 2 and c, and when di = 0, Only perform z multiplication. n is a large number, for example, an integer of 1024 bits. Usually, the multiplication by 2 can be performed more quickly than the multiplication, so that the processing efficiency can be improved. In that case, the processing is different between 2 multiplication and multiplication, so the power waveforms are different.

したがって、電力波形を計測することにより、2乗算、乗算の演算の順序を解析することが可能になる。さらに、diによりループ内の処理が異なることを利用して、その順序からdiの値を求められる。まとめると、以下のステップにより、単純電力解析攻撃が可能になる。   Therefore, by measuring the power waveform, it is possible to analyze the order of operations of double multiplication and multiplication. Further, the value of di can be obtained from the order using the fact that the processing in the loop differs depending on di. In summary, the following steps enable a simple power analysis attack.

(バイナリ法の単純電力解析攻撃)
ステップS901:暗号文cを復号化し、その処理における電力波形を計測。
(Binary method simple power analysis attack)
Step S901: The ciphertext c is decrypted and the power waveform in the process is measured.

ステップS902:上記電力波形より、2乗算、乗算の演算の順序を求める。   Step S902: The order of the multiplication and multiplication operations is obtained from the power waveform.

ステップS903:上記順序より、ビットdi(i=1,2,...,len−1)を求める。   Step S903: The bit di (i = 1, 2,..., Len−1) is obtained from the above order.

〔従来のRSA暗号の単純電力解析攻撃対策〕
上記の単純電力解析攻撃では、バイナリ法のステップS803で、di=1のときのみ乗算を行うことを利用している。そこで、di=0のときに、1をzに乗じる乗算をすることで、結果は変化しないが、di=0のときにも乗算を行うことで、2乗算、乗算の演算順序がdの値に依存しなくなる、単純電力解析攻撃の対策方法も考案されている(非特許文献1参照)。
Paul Kocher. Timing attacks on implementations of Diffie−Hellman, RSA, DSS, and other systems. In Neal Koblitz, editor, CRYPTO’96, LNCS 1109, Springer−Verlag, 1996, pp.104−113. P. Kocher, J. Ja_e, and B. Jun, “Di_erential Power Analysis,” Advances in Cryptology −CRYPTO ’99, LNCS, 1666 , Springer−Verlag, 1999, pp.388−397. 岡本龍明、山本博資、「現代暗号」、産業図書(1997年) H.Cohen,”A Course in Computational Algebraic Number Theory”,GTM 138,Springer−Verlag,1996,p9 C.D.Walter,”Sliding windows succumbs to Big Mac Attack”, CHES2001, LNCS2162, Springer−Verlag, 2001, pp.286−299. 神永, 渡邊, 遠藤, 大河内, “RSA暗号の電力解析法による攻撃とその対策”, IEICE, Vol. J88−A, No.5, pp.606−615, 2005
[Simple power analysis attack countermeasures for conventional RSA encryption]
The above simple power analysis attack utilizes the fact that multiplication is performed only when di = 1 in step S803 of the binary method. Therefore, when di = 0, multiplication by multiplying 1 by z does not change the result. However, by performing multiplication even when di = 0, two multiplications and the operation order of multiplication are values of d. A countermeasure method for a simple power analysis attack that does not depend on the system has been devised (see Non-Patent Document 1).
Paul Kocher. Timing attacks on implementations of Diffie-Hellman, RSA, DSS, and other systems. In Neal Koblitz, editor, CRYPTO '96, LNCS 1109, Springer-Verlag, 1996, pp. 104-113. P. Kocher, J. et al. Ja_e, and B.B. Jun, “Di_eriental Power Analysis,” Advances in Cryptology—CRYPTO '99, LNCS, 1666, Springer-Verlag, 1999, pp. 388-397. Tatsuaki Okamoto, Hiroshi Yamamoto, "Contemporary Cryptography", Industrial Books (1997) H. Cohen, “A Course in Computational Algebraic Number Theory”, GTM 138, Springer-Verlag, 1996, p9. C. D. Walter, “Sliding windows succums to Big Mac Attack”, CHES2001, LNCS2162, Springer-Verlag, 2001, pp. 13-28. 286-299. Kaninaga, Watanabe, Endo, Okouchi, “Attack by RSA encryption power analysis method and countermeasures”, IEICE, Vol. J88-A, no. 5, pp. 606-615, 2005

上述したRSA暗号の単純電力解析攻撃対策では、di=1のときにc、di=0のときに1を乗じる乗算を行い、乗数が異なる。このことを利用してdiが0であるか1であるかを解析する攻撃(BigMac攻撃と呼ばれる)が考案されている(非特許文献5参照)。この攻撃を使用すると、上述した単純電力解析攻撃対策をしても、dの値が解析されてしまうという課題がある。   In the RSA encryption simple power analysis attack countermeasure described above, multiplication is performed by multiplying c when di = 1 and 1 when di = 0. An attack (referred to as BigMac attack) for analyzing whether di is 0 or 1 by using this fact has been devised (see Non-Patent Document 5). When this attack is used, there is a problem that the value of d is analyzed even if the above-described simple power analysis attack countermeasure is taken.

本発明は、BigMac攻撃により安全性を低下しないようRSA暗号の復号化を行う復号装置を提供することを目的とする。   An object of the present invention is to provide a decryption device that decrypts an RSA cipher so as not to reduce security due to a BigMac attack.

上記目的を達成するために、請求項1における発明は、対象データを入力し、秘密の数である秘密情報をべき値とした前記対象データのべき乗演算結果を出力するべき乗演算装置であって、前記対象データの入力を受け付け、前記対象データのべき乗演算結果を出力する入出力部と、前記秘密情報を格納する秘密情報格納部と、中間値を格納する中間値格納部と、前記秘密情報に対し、判定する秘密情報判定部と、複数個の乗数を格納する乗数格納部と、前記中間値と前記乗数との乗算を実行する乗算部と、前記中間値の2乗算を実行する2乗算部と、前記乗数を更新する乗数更新部とを備え、前記乗算部で使用する前記乗数は、前記秘密情報判定部の判定結果に基づき、前記乗数格納部に格納されている複数個の前記乗数から選択することを特徴とする。   In order to achieve the above object, the invention according to claim 1 is a power calculation device that inputs target data and outputs a power calculation result of the target data with secret information that is a secret number as a power value, An input / output unit that receives an input of the target data and outputs a power operation result of the target data, a secret information storage unit that stores the secret information, an intermediate value storage unit that stores an intermediate value, and the secret information On the other hand, a secret information determination unit for determination, a multiplier storage unit for storing a plurality of multipliers, a multiplication unit for performing multiplication of the intermediate value and the multiplier, and a two multiplication unit for performing double multiplication of the intermediate value And a multiplier update unit that updates the multiplier, and the multiplier used in the multiplier is based on a determination result of the secret information determination unit from a plurality of the multipliers stored in the multiplier storage unit To choose And features.

請求項2における発明は、前記べき乗演算装置は、さらに、カウンタを格納するカウンタ格納部と、カウンタの値を更新するカウンタ更新部と、カウンタの値を判定するカウンタ判定部とを備え、前記秘密情報判定部は、前記カウンタの値に基づき判定し、前記乗数更新部は、前記カウンタ判定部の判定結果に基づき、前記乗数を更新することを特徴とする。   The power operation device may further include a counter storage unit that stores a counter, a counter update unit that updates a counter value, and a counter determination unit that determines a counter value. The information determination unit makes a determination based on a value of the counter, and the multiplier update unit updates the multiplier based on a determination result of the counter determination unit.

請求項3における発明は、前記べき乗演算装置は、さらに、乱数を格納する乱数格納部と、前記中間値から前記乱数の影響を取り去る乱数性除去部とを備え、前記乗数は、少なくとも前記乱数に基づくことを特徴する。   The power operation device may further include a random number storage unit that stores a random number, and a randomness removal unit that removes the influence of the random number from the intermediate value, and the multiplier includes at least the random number. Characterized based on.

請求項4における発明は、前記乱数は、予め計算し、前記乱数格納部に格納しており、前記乱数性除去部は、前記中間値に予め計算した乱数性除去数を乗算することを特徴とする。   The invention according to claim 4 is characterized in that the random number is calculated in advance and stored in the random number storage unit, and the random number removal unit multiplies the intermediate value by a random number removed in advance. To do.

請求項5における発明は、前記べき乗演算装置は、さらに、前記乱数を更新する乱数更新部を備えることを特徴とする。   The invention according to claim 5 is characterized in that the power arithmetic apparatus further comprises a random number updating unit for updating the random number.

請求項6における発明は、前記乗数格納部は、2個の前記乗数X_0、X_1を格納し、前記乗数更新部は、前記乗数X_0、X_1に対し、前記乗数X_0を2乗した結果を前記乗数X_0に対する更新乗数X_0’とし、前記対象データと前記更新乗数X_0を掛けた結果を前記乗数X_1に対する更新乗数X_1’とし、それぞれの前記更新乗数X_0’、X_1’を前記乗数格納部に格納することを特徴とする。   In the invention according to claim 6, the multiplier storage unit stores the two multipliers X_0 and X_1, and the multiplier update unit calculates a result of squaring the multiplier X_0 with respect to the multipliers X_0 and X_1. An update multiplier X_0 ′ for X_0 is set, and a result of multiplying the target data and the update multiplier X_0 is set as an update multiplier X_1 ′ for the multiplier X_1, and the respective update multipliers X_0 ′ and X_1 ′ are stored in the multiplier storage unit. It is characterized by.

請求項7における発明は、暗号文を入力し、秘密の数である秘密情報をべき値とした前記暗号文のべき乗演算結果を復号文として出力する復号化装置であって、前記暗号文の入力を受け付け、前記復号文を出力する入出力部と、前記秘密情報を格納する秘密情報格納部と、中間値を格納する中間値格納部と、前記秘密情報に対し、判定する秘密情報判定部と、複数個の乗数を格納する乗数格納部と、前記中間値と前記乗数との乗算を実行する乗算部と、前記中間値の2乗算を実行する2乗算部と、前記乗数を更新する乗数更新部とを備え、前記乗算部で使用する前記乗数は、前記秘密情報判定部の判定結果に基づき、前記乗数格納部に格納されている複数個の前記乗数から選択することを特徴とする。   The invention according to claim 7 is a decryption device that inputs a ciphertext and outputs a result of a power operation of the ciphertext having a secret value that is a secret number as a power value as a decrypted text, wherein the ciphertext input An input / output unit that outputs the decrypted text, a secret information storage unit that stores the secret information, an intermediate value storage unit that stores an intermediate value, and a secret information determination unit that determines the secret information A multiplier storage for storing a plurality of multipliers, a multiplier for performing multiplication of the intermediate value and the multiplier, a multiplier for executing multiplication of the intermediate value, and a multiplier update for updating the multiplier And the multiplier used in the multiplier is selected from a plurality of multipliers stored in the multiplier storage based on a determination result of the secret information determination unit.

請求項8における発明は、署名対象データを入力し、秘密の数である秘密情報をべき値とした前記署名対象データのべき乗演算結果を署名データとして出力する署名生成装置であって、前記署名対象データの入力を受け付け、前記署名データを出力する入出力部と、前記秘密情報を格納する秘密情報格納部と、中間値を格納する中間値格納部と、前記秘密情報に対し、判定する秘密情報判定部と、複数個の乗数を格納する乗数格納部と、前記中間値と前記乗数との乗算を実行する乗算部と、前記中間値の2乗算を実行する2乗算部と、前記乗数を更新する乗数更新部とを備え、前記乗算部で使用する前記乗数は、前記秘密情報判定部の判定結果に基づき、前記乗数格納部に格納されている複数個の前記乗数から選択することを特徴とする。   The invention according to claim 8 is a signature generation apparatus for inputting signature target data and outputting a power operation result of the signature target data with the secret information being a secret number as a power value as signature data, wherein the signature target An input / output unit that receives data input and outputs the signature data; a secret information storage unit that stores the secret information; an intermediate value storage unit that stores an intermediate value; and secret information that is determined for the secret information A determination unit; a multiplier storage unit that stores a plurality of multipliers; a multiplication unit that performs multiplication of the intermediate value and the multiplier; a double multiplication unit that performs multiplication of the intermediate value; and the multiplier is updated. A multiplier updating unit that selects the multiplier used by the multiplication unit from a plurality of multipliers stored in the multiplier storage unit based on a determination result of the secret information determination unit. To do.

請求項9における発明は、対象データを入力し、秘密の数である秘密情報をべき値とした前記対象データのべき乗演算結果を出力するべき乗演算方法であって、前記対象データの入力を受け付け、前記対象データのべき乗演算結果を出力する入出力ステップと、前記秘密情報を格納する秘密情報格納ステップと、中間値を格納する中間値格納ステップと、前記秘密情報に対し、判定する秘密情報判定ステップと、複数個の乗数を格納する乗数格納ステップと、前記中間値と前記乗数との乗算を実行する乗算ステップと、前記中間値の2乗算を実行する2乗算ステップと、前記乗数を更新する乗数更新ステップとを含み、前記乗算部で使用する前記乗数は、前記秘密情報判定ステップの判定結果に基づき、前記乗数格納ステップに格納されている複数個の前記乗数から選択することを特徴とする。   The invention according to claim 9 is a power calculation method for inputting the target data and outputting a power calculation result of the target data with the secret information that is a secret number as a power value, and receiving the input of the target data, An input / output step for outputting a power operation result of the target data, a secret information storage step for storing the secret information, an intermediate value storage step for storing an intermediate value, and a secret information determination step for determining the secret information A multiplier storage step for storing a plurality of multipliers, a multiplication step for executing multiplication of the intermediate value and the multiplier, a double multiplication step for executing double multiplication of the intermediate value, and a multiplier for updating the multiplier The multiplier used in the multiplier is stored in the multiplier storage step based on the determination result of the secret information determination step. And selecting from a plurality of said multiplier.

請求項10における発明は、対象データを入力し、秘密の数である秘密情報をべき値とした前記対象データのべき乗演算結果を出力するべき乗演算装置に実行させるプログラムであって、前記対象データの入力を受け付け、前記対象データのべき乗演算結果を出力する入出力ステップと、前記秘密情報を格納する秘密情報格納ステップと、中間値を格納する中間値格納ステップと、前記秘密情報に対し、判定する秘密情報判定ステップと、複数個の乗数を格納する乗数格納ステップと、前記中間値と前記乗数との乗算を実行する乗算ステップと、前記中間値の2乗算を実行する2乗算ステップと、前記乗数を更新する乗数更新ステップとを含み、前記乗算部で使用する前記乗数は、前記秘密情報判定ステップの判定結果に基づき、前記乗数格納ステップに格納されている複数個の前記乗数から選択することを特徴とする。   The invention according to claim 10 is a program to be executed by a power arithmetic device that inputs target data and outputs a power calculation result of the target data with secret information that is a secret number as a power value. An input / output step for receiving an input and outputting a power operation result of the target data; a secret information storing step for storing the secret information; an intermediate value storing step for storing an intermediate value; and determining the secret information A secret information determination step, a multiplier storage step for storing a plurality of multipliers, a multiplication step for executing multiplication of the intermediate value and the multiplier, a double multiplication step for executing double multiplication of the intermediate value, and the multiplier A multiplier update step for updating the multiplier, and the multiplier used in the multiplier is based on a determination result of the secret information determination step. And selecting from a plurality of said multiplier is stored in step.

請求項11における発明は、請求項10に記載のプログラムを記録した媒体である。   The invention according to claim 11 is a medium in which the program according to claim 10 is recorded.

請求項12における発明は、対象データを入力し、秘密の数である秘密情報をべき値とした前記対象データのべき乗演算結果を出力するべき乗演算装置の集積回路であって、前記対象データの入力を受け付け、前記対象データのべき乗演算結果を出力する入出力部と、前記秘密情報を格納する秘密情報格納部と、中間値を格納する中間値格納部と、前記秘密情報に対し、判定する秘密情報判定部と、複数個の乗数を格納する乗数格納部と、前記中間値と前記乗数との乗算を実行する乗算部と、前記中間値の2乗算を実行する2乗算部と、前記乗数を更新する乗数更新部とを備え、前記乗算部で使用する前記乗数は、前記秘密情報判定部の判定結果に基づき、前記乗数格納部に格納されている複数個の前記乗数から選択することを特徴とする。   The invention according to claim 12 is an integrated circuit of a power operation device that inputs target data and outputs a power operation result of the target data with secret information that is a secret number as a power value. An input / output unit that outputs a power operation result of the target data, a secret information storage unit that stores the secret information, an intermediate value storage unit that stores an intermediate value, and a secret that is determined for the secret information An information determination unit; a multiplier storage unit that stores a plurality of multipliers; a multiplication unit that performs multiplication of the intermediate value and the multiplier; a double multiplication unit that performs multiplication of the intermediate value; and the multiplier A multiplier updating unit for updating, and the multiplier used in the multiplication unit is selected from the plurality of multipliers stored in the multiplier storage unit based on a determination result of the secret information determination unit. And

これらの構成によると、BigMac攻撃により安全性を低下することを防ぐことができ、その価値は大きい。   According to these configurations, it is possible to prevent the safety from being lowered by the BigMac attack, and the value thereof is great.

(実施の形態1)
図1は、本発明にかかる実施の形態1としてのべき乗演算装置1000の構成を示す図である。本装置は、べき乗を行う対象データである対象データXを入力し、対象データのべき乗結果を出力する入出力部1010と、秘密鍵dを格納する秘密鍵格納部1020と、カウンタcountを格納するカウンタ格納部1030と、カウンタcountを初期化するカウンタ初期化部1040と、カウンタcountの値を更新するカウンタ更新部1050と、カウンタcountの値を判定する第1のカウンタ判定部1060と、第1のカウンタ判定部1060と異なるカウンタcountの値の判定を行う第2のカウンタ判定部1070と、dのビット値を判定するビット判定部1080と、乗算を実行する乗算部1090と、2乗算を実行する2乗算部1100と、乗算部1090や2乗算部1100の結果を格納する中間値格納部1110と、乗算部1090で使用する乗数を格納した乗数格納部1120と、後述する乱数と乱数性除去数を格納する乱数格納部1130と、乗数格納部1120に格納している乗数を初期化する乗数初期化部1140と、乗数格納部1120に格納している乗数を更新する乗数更新部1150と、乱数格納部1130に格納されている乱数性除去数を用いて乱数の影響を取り去る乱数性除去部1160と、乱数と乱数性除去数を更新する乱数更新部1170とを備える。本べき乗演算装置1000は、対象データとして入力し、対象データの秘密鍵dをべき値としたべき乗演算結果を出力する。
(Embodiment 1)
FIG. 1 is a diagram showing a configuration of a power arithmetic apparatus 1000 according to the first embodiment of the present invention. This apparatus inputs target data X, which is target data to be exponentiated, and outputs an input / output unit 1010 that outputs a power result of the target data, a secret key storage unit 1020 that stores a secret key d, and a counter count. A counter storage unit 1030; a counter initialization unit 1040 that initializes the counter count; a counter update unit 1050 that updates the value of the counter count; a first counter determination unit 1060 that determines the value of the counter count; A second counter determination unit 1070 that determines a counter count value different from the counter determination unit 1060 of FIG. 1, a bit determination unit 1080 that determines a bit value of d, a multiplication unit 1090 that performs multiplication, and a double multiplication 2 multiplication unit 1100 that performs the calculation, and intermediate value storage unit 1 that stores the results of the multiplication unit 1090 and the 2 multiplication unit 1100 10, a multiplier storage unit 1120 that stores a multiplier used in the multiplication unit 1090, a random number storage unit 1130 that stores a random number and a randomness elimination number described later, and a multiplier stored in the multiplier storage unit 1120. Multiplier initialization unit 1140, multiplier update unit 1150 that updates the multiplier stored in multiplier storage unit 1120, and randomness removal that removes the effects of random numbers using the random number removal number stored in random number storage unit 1130 Unit 1160 and a random number update unit 1170 that updates the random number and the random number removal number. The power arithmetic apparatus 1000 is input as target data, and outputs a power calculation result with the secret key d of the target data as a power value.

<べき乗演算装置1000の使用する場面について>
本装置は、例えば、RSA暗号方式の復号化やRSA署名方式の署名作成において、使用する。以下で、RSA暗号方式及びRSA署名方式について説明する。
<About scenes used by the power arithmetic unit 1000>
This apparatus is used, for example, in the decryption of the RSA encryption method and the signature creation of the RSA signature method. Hereinafter, the RSA encryption method and the RSA signature method will be described.

●RSA暗号方式
(1)鍵の生成
次に示すようにして公開鍵及び秘密鍵を計算する。
RSA encryption method (1) Key generation The public key and secret key are calculated as follows.

・ランダムに大きい素数p,qを選択し、その積n=p×qを計算する。   • Select large prime numbers p and q at random and calculate the product n = p × q.

・(p−1)及び(q−1)の最小公倍数L=LCM(p−1,q−1)を計算する。   Calculate the least common multiple L = LCM (p−1, q−1) of (p−1) and (q−1).

・Lと互いに素でLより小さい自然数eをランダムに選ぶ。   A random natural number e that is relatively prime to L and smaller than L is selected at random.

1≦e≦L−1、GCD(e,L)=1
ここで、GCD(e,L)は、eとLの最大公約数を示している。
1 ≦ e ≦ L−1, GCD (e, L) = 1
Here, GCD (e, L) indicates the greatest common divisor of e and L.

・e×d=1 mod Lを満たすdを計算する。GCD(e,L)=1より、このようなdは必ず存在する。このようにして、得られた整数e及び整数nが、公開鍵である。また、整数dが、秘密鍵である。ここで、x mod yは、xをyで割った余りを示す。   Calculate d satisfying e × d = 1 mod L. Since GCD (e, L) = 1, such d always exists. Thus, the obtained integer e and integer n are public keys. The integer d is a secret key. Here, x mod y indicates a remainder obtained by dividing x by y.

(2)暗号文の生成
公開鍵である整数e及び整数nを用いて、平文mに暗号演算を施して暗号文cを計算する。
(2) Generation of Ciphertext Using the integer e and the integer n that are public keys, the ciphertext c is calculated by performing a cryptographic operation on the plaintext m.

c=m^e mod n
なお、この明細書において、演算子^は、べき乗を示す。例えば、A^xは、x>0のときはAをx回乗じたものを示す。
c = m ^ e mod n
In this specification, the operator ^ indicates a power. For example, A ^ x indicates that x is multiplied by x when x> 0.

(3)復号文の生成
秘密鍵である整数dを用いて、暗号文cに復号演算を施して復号文m’を計算する。
(3) Generation of decrypted text The decrypted text m ′ is calculated by performing a decryption operation on the cipher text c using the integer d which is a secret key.

m’=c^d mod n
なお、
m’=c^d mod n
=(m^e )^d mod n
=m^(e×d mod L) mod n
=m^1 mod n
=m mod n
であるので、復号文m’は、平文mと一致する。
m ′ = c ^ d mod n
In addition,
m ′ = c ^ d mod n
= (M ^ e) ^ d mod n
= M ^ (e * d mod L) mod n
= M ^ 1 mod n
= M mod n
Therefore, the decrypted text m ′ matches the plain text m.

べき乗演算装置1000は、この復号文の生成における上記のcからm’を計算する箇所で使用する。このとき、べき乗演算装置1000において対象データをcとして、秘密鍵dを使用して、m’=c^d mod nを計算する。   The power arithmetic apparatus 1000 is used at the place where c ′ to m ′ are calculated in the generation of the decrypted text. At this time, m '= c ^ d mod n is calculated in the exponentiation operation apparatus 1000 using c as the target data and the secret key d.

なお、RSA暗号については、非特許文献3の110〜113ページに詳しく説明されている。   The RSA encryption is described in detail on pages 110 to 113 of Non-Patent Document 3.

●RSA署名方式
(1)鍵の生成
鍵の生成方法については、RSA暗号方式と同様である。
RSA signature method (1) Key generation The key generation method is the same as the RSA encryption method.

(2)署名生成
メッセージデータDに対して、以下のように署名データSを計算する。
(2) Signature generation For the message data D, the signature data S is calculated as follows.

まず、ハッシュ関数Hashを用いて、メッセージデータDのハッシュ値h=Hash(D)を計算する。   First, the hash value h = Hash (D) of the message data D is calculated using the hash function Hash.

次に、秘密鍵である整数dを用いて、ハッシュ値hをd乗して、署名データSを計算する。   Next, the signature data S is calculated by multiplying the hash value h to the d power by using the integer d which is a secret key.

S=h^d mod n
(3)署名検証
署名データSがメッセージデータDの正しい署名であるかを、以下のように検証する。
S = h ^ d mod n
(3) Signature verification Whether the signature data S is the correct signature of the message data D is verified as follows.

Hash(D)とS^e mod nが等しいか否かを確認する。等しい場合は、署名データSが正しい署名であるとして、受理する。等しくない場合は、署名データSが正しくない署名であるとして、拒否する。   Check whether Hash (D) and S ^ e mod n are equal. If they are equal, the signature data S is accepted as a correct signature. If they are not equal, the signature data S is rejected as an incorrect signature.

べき乗演算装置1000は、上記の署名生成におけるhからSを計算する箇所で使用する。このとき、べき乗演算装置1000において対象データをhとして、秘密鍵dを使用して、S=h^d mod nを計算する。   The power arithmetic apparatus 1000 is used at a place where S is calculated from h in the signature generation described above. At this time, S = h ^ d mod n is calculated using the secret key d in the power arithmetic apparatus 1000 with the target data as h.

なお、RSA署名については、非特許文献3の175〜176ページに詳しく説明されている。   The RSA signature is described in detail on pages 175 to 176 of Non-Patent Document 3.

<べき乗演算装置1000の各部について>
入出力部1010は、対象データXの入力を受付、対象データを中間値Zとして、中間値格納部1110へ格納する。入出力部1010はさらに、対象データXのべき乗演算結果を出力する。
<About each part of the exponentiation arithmetic unit 1000>
The input / output unit 1010 receives input of the target data X, and stores the target data in the intermediate value storage unit 1110 as the intermediate value Z. The input / output unit 1010 further outputs a power operation result of the target data X.

秘密鍵格納部1020は、秘密鍵であるdを格納する。dは例えば、512ビットの整数である。   The secret key storage unit 1020 stores d, which is a secret key. For example, d is a 512-bit integer.

カウンタ格納部1030は、カウンタcountを格納する。   The counter storage unit 1030 stores a counter count.

カウンタ初期化部1040は、カウンタcountをlend−1に設定する。ここで、lendは秘密鍵dのビットサイズである。例えば、lend=512である。   The counter initialization unit 1040 sets the counter count to lnd-1. Here, lend is the bit size of the secret key d. For example, lend = 512.

カウンタ更新部1050は、カウンタ格納部1030に格納されているカウンタcountをデクリメント(1を減算)する。   The counter update unit 1050 decrements the counter count stored in the counter storage unit 1030 (subtracts 1).

第1のカウンタ判定部1060は、カウンタ格納部1030に格納されているカウンタcountの値が0であるかを判定する。   The first counter determination unit 1060 determines whether the value of the counter count stored in the counter storage unit 1030 is zero.

第2のカウンタ判定部1070は、カウンタ格納部1030に格納されているカウンタcountの値が8で割り切れるか否か、すなわち、8の倍数であるか否かを判定する。   The second counter determination unit 1070 determines whether the value of the counter count stored in the counter storage unit 1030 is divisible by 8, that is, whether it is a multiple of 8.

ビット判定部1080は、カウンタ格納部1030に格納されているカウンタcountに対し、秘密鍵格納部1020に格納されている秘密鍵dのcountビット目の値が0か1のどちらであるかを判定する。ここで、秘密鍵dのcountビット目とは、下位のビットから順番に数えたときの順番を示している。ただし、最下位ビットを0ビット目としている。   The bit determination unit 1080 determines whether the value of the count bit of the secret key d stored in the secret key storage unit 1020 is 0 or 1 with respect to the counter count stored in the counter storage unit 1030 To do. Here, the count bit of the secret key d indicates the order when counting in order from the lower bits. However, the least significant bit is the 0th bit.

乗算部1090は、中間値格納部1110に格納されている中間値Zと、乗数格納部1120に格納されている乗数値X_0または、乗数値X_1を乗算し、その乗算結果を中間値格納部1110に格納する。具体的には、中間値Zと乗数値X_0を乗算する場合、Z←Z×X_0 mod nを実行する。ここで、nはRSA暗号における大きな素数p、qの積であり、←は右の計算結果を左の変数へ代入することを意味する。   The multiplication unit 1090 multiplies the intermediate value Z stored in the intermediate value storage unit 1110 by the multiplier value X_0 or the multiplier value X_1 stored in the multiplier storage unit 1120, and the multiplication result is the intermediate value storage unit 1110. To store. Specifically, when multiplying the intermediate value Z and the multiplier value X_0, Z ← Z × X_0 mod n is executed. Here, n is a product of large prime numbers p and q in the RSA encryption, and ← means that the calculation result on the right is substituted into the left variable.

2乗算部1100は、中間値格納部1110に格納されている中間値Zを2乗し、2乗した結果を中間値格納部1110に格納する。具体的には、Z←Z^2 mod nを実行する。   The 2 multiplication unit 1100 squares the intermediate value Z stored in the intermediate value storage unit 1110 and stores the squared result in the intermediate value storage unit 1110. Specifically, Z ← Z ^ 2 mod n is executed.

中間値格納部1110は、べき乗演算の中間値Zを格納する。   The intermediate value storage unit 1110 stores the intermediate value Z of the power operation.

乗数格納部1120は、乗算部1090で使用する乗数X_0及びX_1を格納する。   The multiplier storage unit 1120 stores the multipliers X_0 and X_1 used by the multiplication unit 1090.

乱数格納部1130は、乱数Rと乱数性除去数Uを格納する。乱数R及び乱数性除去数Uは、予め与えられているものとする。   The random number storage unit 1130 stores a random number R and a randomness removal number U. It is assumed that the random number R and the randomness removal number U are given in advance.

乗数初期化部1140は、乗数格納部1120に格納されている乗数X_0及びX_1を初期化する。具体的には、対象データXに対し、乱数格納部1130に格納されている乱数Rを用いて、X_0←R mod n、X_1←X×X_0 mod nとする。ここで、←は右の結果を左の変数に代入することを意味する。   Multiplier initialization unit 1140 initializes multipliers X_0 and X_1 stored in multiplier storage unit 1120. Specifically, for the target data X, X_0 ← R mod n and X_1 ← X × X_0 mod n are set using the random number R stored in the random number storage unit 1130. Here, ← means that the right result is assigned to the left variable.

乗数更新部1150は、乗数格納部1120に格納されている乗数X_0及びX_1を更新する。具体的には、X_0←X_0^2 mod n、X_1←X×X_0 mod nとする。   The multiplier update unit 1150 updates the multipliers X_0 and X_1 stored in the multiplier storage unit 1120. Specifically, X_0 ← X_0 ^ 2 mod n, X_1 ← X × X_0 mod n.

乱数性除去部1160は、乗数X_0及びX_1に乗じた乱数Rの影響を取り除くために、乱数性除去数Uを中間値格納部1110に格納されている中間値Zに乗じて、その結果を中間値格納部1110へ格納する。すなわち、Z←Z×U mod nを実行する。ここで、U=R^u mod nであり、u=(1+2+2^2+2^3+2^4+2^5+2^6+2^7)×(2^504+2×2^496+2^2×2^488+・・・+2^63)である。ただし、このuは秘密鍵dが512ビットの整数であり、8ビットごとに乗数を更新する場合の値であり、秘密鍵dの大きさが大きくなったり、乗数を更新するタイミングが変わったりすれば、uの値も変化する。   The random number removal unit 1160 multiplies the intermediate value Z stored in the intermediate value storage unit 1110 by the random number removal number U in order to remove the influence of the random number R multiplied by the multipliers X_0 and X_1, and outputs the intermediate result. Store in the value storage unit 1110. That is, Z ← Z × U mod n is executed. Here, U = R ^ u mod n, and u = (1 + 2 + 2 + ^ 2 + 2 ^ 3 + 2 ^ 4 + 2 ^ 5 + 2 ^ 6 + 2 ^ 7) × (2 ^ 504 + 2 × 2 ^ 496 + 2 ^ 2 × 2 ^ 488 +... + 2 ^ 63). However, this u is a value when the secret key d is a 512-bit integer and the multiplier is updated every 8 bits, and the size of the secret key d may increase or the timing for updating the multiplier may change. For example, the value of u also changes.

乱数更新部1170は、乱数格納部1130に格納されている乱数と乱数性除去数Uを更新する。具体的には、乱数格納部1130に格納されている乱数Rに対し、R←R^2 mod n、U←U^2 mod nを実行する。   The random number update unit 1170 updates the random number and the randomness removal number U stored in the random number storage unit 1130. Specifically, R ← R ^ 2 mod n and U ← U ^ 2 mod n are executed on the random number R stored in the random number storage unit 1130.

<べき乗演算装置1000の動作>
べき乗演算装置1000は、対象データXとして入力し、対象データXの秘密鍵dをべき値としたべき乗演算結果を出力する。図2は、べき乗演算装置1000のフローチャートを示している。以下では、べき乗演算装置1000の動作を示す。
<Operation of power arithmetic apparatus 1000>
The power calculation apparatus 1000 is input as the target data X, and outputs a power calculation result with the secret key d of the target data X as a power value. FIG. 2 shows a flowchart of the power arithmetic apparatus 1000. Hereinafter, the operation of the power arithmetic apparatus 1000 will be described.

ステップS101:入出力部1010は、対象データXの入力を受け付け、中間値格納部1110に中間値Zとして格納する。   Step S101: The input / output unit 1010 receives input of the target data X and stores it as an intermediate value Z in the intermediate value storage unit 1110.

ステップS102:乗数初期化部1140は、対象データXを用いて、乗数格納部1120に格納する乗数X_0とX_1を初期化する。   Step S102: The multiplier initialization unit 1140 uses the target data X to initialize multipliers X_0 and X_1 stored in the multiplier storage unit 1120.

ステップS103:カウンタ初期化部1040は、カウンタcountを初期化する。具体的には、カウンタcountをlend−1に設定する。   Step S103: The counter initialization unit 1040 initializes the counter count. Specifically, the counter count is set to lend-1.

ステップS104:2乗算部1100は、中間値格納部1110に格納されている中間値Zを2乗し、その結果を中間値格納部1110に格納する。   Step S104: The 2 multiplication unit 1100 squares the intermediate value Z stored in the intermediate value storage unit 1110 and stores the result in the intermediate value storage unit 1110.

ステップS105:ビット判定部1080は、秘密鍵dのビットを判定する。そのビットが0である場合、次のステップS106へ、1である場合、ステップS107へ。   Step S105: The bit determination unit 1080 determines the bit of the secret key d. If the bit is 0, go to the next step S106. If it is 1, go to step S107.

ステップS106:乗算部1090は、中間値格納部1110に格納されている中間値Zと、乗数格納部1120に格納されている乗数X_0を乗算し、その結果を中間値格納部1110に格納する。ステップS108へ。   Step S106: The multiplication unit 1090 multiplies the intermediate value Z stored in the intermediate value storage unit 1110 by the multiplier X_0 stored in the multiplier storage unit 1120, and stores the result in the intermediate value storage unit 1110. Go to step S108.

ステップS107:乗算部1090は、中間値格納部1110に格納されている中間値Zと、乗数格納部1120に格納されている乗数X_1を乗算し、その結果を中間値格納部1110に格納する。   Step S107: The multiplication unit 1090 multiplies the intermediate value Z stored in the intermediate value storage unit 1110 by the multiplier X_1 stored in the multiplier storage unit 1120, and stores the result in the intermediate value storage unit 1110.

ステップS108:第1のカウンタ判定部1060は、カウンタ格納部1030に格納されているカウンタcountの判定をする。カウンタcountが0であれば、ステップS112へ。それ以外は、次のステップS109へ。   Step S108: The first counter determination unit 1060 determines the counter count stored in the counter storage unit 1030. If the counter count is 0, go to step S112. Otherwise, go to the next step S109.

ステップS109:第2のカウンタ判定部1070は、カウンタ格納部1030に格納されているカウンタcountの判定をする。判定結果が肯定(カウンタcountが8で割り切れる)の場合は、次のステップS110へ。それ以外は、ステップS111へ。   Step S109: The second counter determination unit 1070 determines the counter count stored in the counter storage unit 1030. If the determination result is affirmative (counter count is divisible by 8), go to the next step S110. Otherwise, go to step S111.

ステップS110:乗数更新部1150は、乗数格納部1120に格納されている乗数X_0とX_1を更新する。   Step S110: The multiplier update unit 1150 updates the multipliers X_0 and X_1 stored in the multiplier storage unit 1120.

ステップS111:カウンタ更新部1050は、カウンタ格納部1030に格納されているカウンタcountを更新する。ステップS104へ。   Step S111: The counter update unit 1050 updates the counter count stored in the counter storage unit 1030. Go to step S104.

ステップS112:乱数性除去部1160は、中間値格納部1110に格納されている中間値Zと乱数格納部1130に格納されている乱数性除去数Uを乗算し、その結果を中間値格納部1110に格納する。   Step S112: The randomness removal unit 1160 multiplies the intermediate value Z stored in the intermediate value storage unit 1110 by the random number removal number U stored in the random number storage unit 1130, and the result is the intermediate value storage unit 1110. To store.

ステップS113:入出力部1010は、中間値格納部1110に格納されている中間値Zを(べき乗演算結果として)出力する。   Step S113: The input / output unit 1010 outputs the intermediate value Z stored in the intermediate value storage unit 1110 (as a power calculation result).

ステップS114:乱数更新部1170は、乱数格納部1130に格納されている乱数R及び乱数性除去数Uを更新する。終了。   Step S114: The random number update unit 1170 updates the random number R and the randomness removal number U stored in the random number storage unit 1130. End.

<実施の形態1の効果>
実施の形態1では、dを8ビットのブロックごとに乗数更新部1150において、中間値Zに乗じる乗数X_0、X_1を更新している。こうすることによって、ブロックごとに乗数が異なるようになり、乗数が何であるかを解析することにより、秘密鍵dを求めるBigMac攻撃を防ぐことが可能となる。以下で、詳細に説明する。
<Effect of Embodiment 1>
In the first embodiment, multipliers X_0 and X_1 for multiplying intermediate value Z are updated in multiplier update section 1150 for each 8-bit block of d. By doing so, the multiplier is different for each block, and it is possible to prevent the BigMac attack for obtaining the secret key d by analyzing what the multiplier is. This will be described in detail below.

図3は、実施の形態1のべき乗演算装置1000の秘密鍵dに対する処理と、攻撃者による乗数の分類及びdのビット推測について示している。ブロック1では、dのビットが0の場合はX_0=X_01を中間値Zに乗じ、1の場合はX_1=X_11を乗じる。ブロック2では、X_0をX_01からX_02、X_1をX_11からX_12に更新しているため、dのビットが0の場合はX_0=X_02、1の場合はX_1=X_12を乗じる。ここで、攻撃者は、消費電力波形より、ブロック1の中に乗数が互いに異なるグループa1とb1、ブロック2の中に乗数が互いに異なるグループa2とb2に波形を分類できる。しかし、攻撃者はグループa1とb1のどちらがdのビットが0、1に対応するか、グループa2とb2のどちらがdのビットが0、1に対応するかを知らないため、それぞれのブロック内でどちらかのグループをdのビットが0(または1)に対応すると仮定して、正しいか否かを確認する必要がある。a1、b1がdのビット0、1に対応するパターンは2通りあり、a2、b2がdのビット0、1に対応するパターンは2通りあるため、それぞれの組合せは2×2=4通りある。したがって、攻撃者は4通りを試す必要がある。ここで、ブロックの個数をNBとすると、攻撃者は2^NB通りを試す必要がある。NBを大きくすると、その分、攻撃者の試す時間がかかり、BigMac攻撃に対する安全性が高まる。例えば、秘密鍵dを512ビットの整数とするとき、8ビットのブロックは512/8=64個存在するため、安全性(攻撃者の試す時間)は2^64であり高い。このように、BigMac攻撃を防ぐことができる。   FIG. 3 shows processing for the secret key d of the power arithmetic apparatus 1000 according to the first embodiment, classification of multipliers by the attacker, and bit estimation of d. In the block 1, when the bit of d is 0, X_0 = X_01 is multiplied by the intermediate value Z, and when it is 1, X_1 = X_11 is multiplied. In block 2, since X_0 is updated from X_01 to X_02 and X_1 is updated from X_11 to X_12, when the bit of d is 0, X_0 = X_02, and when X = 1, X_1 = X_12 is multiplied. Here, the attacker can classify the waveforms into groups a1 and b1 having different multipliers in block 1 and groups a2 and b2 having different multipliers in block 2 from the power consumption waveform. However, the attacker does not know which of the groups a1 and b1 corresponds to the bit d 0 or 1 and which of the groups a2 or b2 corresponds to the bit 0 0 or 1 in each block. Assuming that either group corresponds to a bit of d corresponding to 0 (or 1), it is necessary to check whether it is correct. There are two patterns for a1 and b1 corresponding to bits 0 and 1 of d, and there are two patterns for a2 and b2 corresponding to bits 0 and 1 of d, so there are 2 × 2 = 4 combinations of each. . Therefore, the attacker must try four ways. Here, if the number of blocks is NB, the attacker needs to try 2 ^ NB. When NB is increased, it takes time for the attacker to try, and the safety against the BigMac attack increases. For example, when the secret key d is a 512-bit integer, since there are 512/8 = 64 8-bit blocks, the security (time taken by the attacker) is 2 ^ 64, which is high. In this way, the BigMac attack can be prevented.

また、乱数更新部1170において、乱数Rを更新することにより、対象データXにより同じ乱数Rを使うことにより電力波形に偏りが出ることを利用して解析する差分電力解析攻撃を防ぐことが可能となる。   In addition, by updating the random number R in the random number update unit 1170, it is possible to prevent a differential power analysis attack that analyzes using the fact that the power waveform is biased by using the same random number R by the target data X. Become.

(実施の形態2)
図4は、本発明にかかる実施の形態2としてのべき乗演算装置2000の構成を示す図である。本装置は、実施の形態1と同様の入出力部1010と、秘密鍵格納部1020と、カウンタ格納部1030と、カウンタ更新部1050と、第1のカウンタ判定部1060と、第2のカウンタ判定部1070と、2乗算部1100と、中間値格納部1110と、乱数更新部1170と、実施の形態1と異なるカウンタ初期化部2040と、乗数選択部2080と、乗算部2090と、乗数格納部2120と、乱数格納部2130と、乗数初期化部2140と、乗数更新部2150と、乱数性除去部2160とを備える。本装置は、対象データとして入力し、対象データの秘密鍵dをべき値としたべき乗演算結果を出力する。
(Embodiment 2)
FIG. 4 is a diagram showing a configuration of a power arithmetic apparatus 2000 as the second embodiment according to the present invention. This apparatus includes an input / output unit 1010, a secret key storage unit 1020, a counter storage unit 1030, a counter update unit 1050, a first counter determination unit 1060, and a second counter determination similar to those in the first embodiment. Unit 1070, 2 multiplication unit 1100, intermediate value storage unit 1110, random number update unit 1170, counter initialization unit 2040 different from the first embodiment, multiplier selection unit 2080, multiplication unit 2090, and multiplier storage unit 2120, a random number storage unit 2130, a multiplier initialization unit 2140, a multiplier update unit 2150, and a randomness removal unit 2160. This apparatus inputs as target data, and outputs a power operation result with the secret key d of the target data as a power value.

本べき乗演算装置2000は、実施の形態1のべき乗演算装置1000と同様に、例えば、RSA暗号方式の復号化やRSA署名方式の署名作成において、使用する。   The power arithmetic apparatus 2000 is used in, for example, decryption of the RSA encryption scheme and signature creation of the RSA signature scheme, as with the power arithmetic apparatus 1000 of the first embodiment.

<べき乗演算装置2000の各部について>
カウンタ初期化部2040は、カウンタcountをbに設定する。ここで、bは(len/sw以上の最も小さい整数)−1、swは正整数、lenは秘密鍵dのビットサイズである。例えば、len=512である。以下では簡単のため、sw=4とする。なお、swは2、3や5以上であってもよい。
<Regarding Each Unit of Power Calculation Device 2000>
The counter initialization unit 2040 sets the counter count to b. Here, b is (the smallest integer equal to or greater than len / sw) −1, sw is a positive integer, and len is the bit size of the secret key d. For example, len = 512. In the following, for simplicity, it is assumed that sw = 4. In addition, sw may be 2, 3 or 5 or more.

乗数選択部2080は、カウンタ格納部1030に格納されているカウンタcountに対する後述する分割秘密情報d_countの値をインデックスi(i=d_count)として、乗数格納部2120に格納されている乗数X_iを選択する。   The multiplier selection unit 2080 selects a multiplier X_i stored in the multiplier storage unit 2120 using a value of divided secret information d_count (to be described later) for the counter count stored in the counter storage unit 1030 as an index i (i = d_count). .

乗算部2090は、中間値格納部1110に格納されている中間値Zと、乗数選択部2080で選択された乗数X_iを乗算し、その乗算結果を中間値格納部1110に格納する。具体的には、Z←Z×X_i mod nを実行する。ここで、nはRSA暗号における大きな素数p、qの積であり、←は右の計算結果を左の変数へ代入することを意味する。   Multiplication unit 2090 multiplies intermediate value Z stored in intermediate value storage unit 1110 by multiplier X_i selected by multiplier selection unit 2080 and stores the multiplication result in intermediate value storage unit 1110. Specifically, Z ← Z × X_i mod n is executed. Here, n is a product of large prime numbers p and q in the RSA encryption, and ← means that the calculation result on the right is substituted into the left variable.

乗数格納部2120は、乗算部2090で使用する乗数X_0、X_1、...、X_15を格納する。なお、X_0からX_15を格納するのは、sw=4であるためである。一般のswに対しては、乗数格納部2120は、乗数X_0、X_1、...、X_(2^sw−1)を格納する。   The multiplier storage unit 2120 includes multipliers X_0, X_1,. . . , X_15 are stored. Note that X_0 to X_15 are stored because sw = 4. For general sw, the multiplier storage unit 2120 has multipliers X_0, X_1,. . . , X_ (2 ^ sw-1).

乱数格納部2130は、乱数Rと乱数性除去数Uを格納する。乱数R及び乱数性除去数Uは、予め与えられているものとする。   The random number storage unit 2130 stores a random number R and a randomness removal number U. It is assumed that the random number R and the randomness removal number U are given in advance.

乗数初期化部2140は、乗数格納部2120に格納されている乗数X_0、X_1、...、X_15を初期化する。具体的には、対象データXに対し、乱数格納部2130に格納されている乱数Rを用いて、X_0←R mod n、X_1←X×X_0 mod n、X_2←X×X_1 mod n、...、X_15←X×X_14 mod n(=X^15×R mod n)とする。ここで、←は右の結果を左の変数に代入することを意味する。   The multiplier initialization unit 2140 includes multipliers X_0, X_1,. . . , X_15 is initialized. Specifically, using the random number R stored in the random number storage unit 2130, X_0 ← R mod n, X_1 ← X × X_0 mod n, X_2 ← X × X_1 mod n,. . . , X — 15 ← X × X — 14 mod n (= X ^ 15 × R mod n). Here, ← means that the right result is assigned to the left variable.

乗数更新部2150は、乗数格納部2120に格納されている乗数X_0、X_1、...、X_15を更新する。具体的には、X_0←X_0^2 mod n、X_1←X×X_0 mod n、X_2←X×X_1 mod n、...、X_15←X×X_14 mod nとする。   The multiplier update unit 2150 includes multipliers X_0, X_1,. . . , X_15 is updated. Specifically, X — 0 ← X — 0 ^ 2 mod n, X — 1 ← X × X — 0 mod n, X — 2 ← X × X — 1 mod n,. . . , X — 15 ← X × X — 14 mod n.

乱数性除去部2160は、乗数X_0、X_1、...、X_15に乗じた乱数Rの影響を取り除くために、乱数性除去数Uを中間値格納部1110に格納されている中間値Zに乗じて、その結果を中間値格納部1110へ格納する。すなわち、Z←Z×U mod nを実行する。ここで、U=R^u mod nであり、u=(1+2^4+2^8+2^12+2^16+2^20+2^24+2^28)×(2^480+2×2^448+2^2×2^416+・・・+2^15)である。ただし、このuは秘密鍵dが512ビットの整数であり、カウンタが8削減されるたびに乗数を更新する場合の値であり、秘密鍵dの大きさが大きくなったり、乗数を更新するタイミングが変わったりすれば、uの値も変化する。   The randomness removing unit 2160 is a multiplier X_0, X_1,. . . In order to remove the influence of the random number R multiplied by X_15, the random number elimination number U is multiplied by the intermediate value Z stored in the intermediate value storage unit 1110, and the result is stored in the intermediate value storage unit 1110. That is, Z ← Z × U mod n is executed. Here, U = R ^ u mod n, and u = (1 + 2 ^ 4 + 2 ^ 8 + 2 ^ 12 + 2 ^ 16 + 2 ^ 20 + 2 ^ 24 + 2 ^ 28) × (2 ^ 480 + 2 × 2 ^ 448 + 2 ^ 2 × 416 +... + 2 ^ 15). However, this u is a value when the secret key d is a 512-bit integer and the multiplier is updated every time the counter is reduced by 8, and the timing when the size of the secret key d increases or the multiplier is updated. If u changes, the value of u also changes.

<べき乗演算装置2000の動作>
べき乗演算装置2000は、対象データXとして入力し、対象データXの秘密鍵dをべき値としたべき乗演算結果を出力する。図5は、べき乗演算装置2000のフローチャートを示している。以下では、べき乗演算装置2000の動作を示す。
<Operation of power arithmetic unit 2000>
The power calculation device 2000 is input as the target data X, and outputs a power calculation result with the secret key d of the target data X as a power value. FIG. 5 shows a flowchart of the power arithmetic apparatus 2000. In the following, the operation of the power arithmetic apparatus 2000 is shown.

ステップS201:入出力部1010は、対象データXの入力を受け付け、中間値格納部1110に中間値Zとして格納する。   Step S201: The input / output unit 1010 accepts input of the target data X and stores it as an intermediate value Z in the intermediate value storage unit 1110.

ステップS202:乗数初期化部2140は、対象データXを用いて、乗数格納部2120に格納する乗数X_0、X_1、...、X_15を初期化する。   Step S202: The multiplier initialization unit 2140 uses the target data X to store the multipliers X_0, X_1,. . . , X_15 is initialized.

ステップS203:カウンタ初期化部2040は、カウンタcountを初期化する。具体的には、カウンタcountをbに設定する。   Step S203: The counter initialization unit 2040 initializes the counter count. Specifically, the counter count is set to b.

ステップS204:2乗算部1100は、中間値格納部1110に格納されている中間値Zを2乗し、その結果を中間値格納部1110に格納する。これをさらに3回繰り返すことで、ステップ204以前の中間値Zを16乗する。   Step S204: The 2 multiplication unit 1100 squares the intermediate value Z stored in the intermediate value storage unit 1110, and stores the result in the intermediate value storage unit 1110. By repeating this three more times, the intermediate value Z before step 204 is raised to the 16th power.

ステップS205:乗数選択部2080は、乗数格納部2120に格納されている乗数X_iを選択する。   Step S205: The multiplier selection unit 2080 selects the multiplier X_i stored in the multiplier storage unit 2120.

ステップS206:乗算部2090は、中間値格納部1110に格納されている中間値Zと、乗数選択部2080で選択した乗数X_iを乗算し、その結果を中間値格納部1110に格納する。   Step S206: The multiplication unit 2090 multiplies the intermediate value Z stored in the intermediate value storage unit 1110 by the multiplier X_i selected by the multiplier selection unit 2080, and stores the result in the intermediate value storage unit 1110.

ステップS207:第1のカウンタ判定部1060は、カウンタ格納部1030に格納されているカウンタcountの判定をする。カウンタcountが0であれば、ステップS211へ。それ以外は、次のステップS208へ。   Step S207: The first counter determination unit 1060 determines the counter count stored in the counter storage unit 1030. If the counter count is 0, go to step S211. Otherwise, go to the next step S208.

ステップS208:第2のカウンタ判定部1070は、カウンタ格納部1030に格納されているカウンタcountの判定をする。判定結果が肯定(カウンタcountが8で割り切れる)の場合は、次のステップS209へ。それ以外は、ステップS210へ。   Step S208: The second counter determination unit 1070 determines the counter count stored in the counter storage unit 1030. If the determination result is affirmative (counter count is divisible by 8), the process proceeds to the next step S209. Otherwise, go to step S210.

ステップS209:乗数更新部2150は、乗数格納部2120に格納されている乗数X_0、X_1、...、X_15を更新する。   Step S209: The multiplier update unit 2150 receives the multipliers X_0, X_1,. . . , X_15 is updated.

ステップS210:カウンタ更新部1050は、カウンタ格納部1030に格納されているカウンタcountを更新する。ステップS204へ。   Step S210: The counter update unit 1050 updates the counter count stored in the counter storage unit 1030. Go to step S204.

ステップS211:乱数性除去部2160は、中間値格納部1110に格納されている中間値Zと乱数格納部2130に格納されている乱数性除去数Uを乗算し、その結果を中間値格納部1110に格納する。   Step S211: The randomness removal unit 2160 multiplies the intermediate value Z stored in the intermediate value storage unit 1110 by the random number removal number U stored in the random number storage unit 2130, and the result is the intermediate value storage unit 1110. To store.

ステップS212:入出力部1010は、中間値格納部1110に格納されている中間値Zを(べき乗演算結果として)出力する。   Step S212: The input / output unit 1010 outputs the intermediate value Z stored in the intermediate value storage unit 1110 (as a power calculation result).

ステップS213:乱数更新部1170は、乱数格納部1130に格納されている乱数R及び乱数性除去数Uを更新する。終了。   Step S213: The random number update unit 1170 updates the random number R and the randomness removal number U stored in the random number storage unit 1130. End.

<実施の形態2の効果>
実施の形態2では、dを8×4=32ビットのブロックごとに乗数更新部2150において、中間値Zに乗じる乗数X_0、X_1、...、X_15を更新している。こうすることによって、実施の形態1と同様にブロックごとに乗数が異なるようになり、乗数が何であるかを解析することにより、秘密鍵dを求めるBigMac攻撃を防ぐことが可能となる。
<Effect of Embodiment 2>
In the second embodiment, multipliers X_0, X_1,... For multiplying intermediate value Z by multiplier update unit 2150 for each block of 8 × 4 = 32 bits. . . , X_15 is updated. By doing so, the multiplier differs for each block as in the first embodiment, and it is possible to prevent the BigMac attack for obtaining the secret key d by analyzing what the multiplier is.

(変形例)
上記に説明した実施の形態は、本発明の実施の一例であり、本発明はこの実施の形態に何ら限定されるものではなく、その旨を逸脱しない範囲において種々なる態様で実施し得るものである。例えば、以下のような場合も本発明に含まれる。
(Modification)
The embodiment described above is an example of the implementation of the present invention, and the present invention is not limited to this embodiment, and can be implemented in various modes without departing from the scope of the present invention. is there. For example, the present invention includes the following cases.

(1)実施の形態1及び2における秘密鍵dのビットサイズは、512に限らない。1024や2048であってもよい。また、べき乗演算装置1000では、X^d mod nを計算するが、dp=d mod p−1,dq=d mod q−1とし、X^dp mod pとX^dq mod qを計算し、中国人の剰余定理を用いることでX^d mod nを計算するとしてもよい。ここで、X^dp mod p及びX^dq mod qを計算する際にべき乗演算装置1000を使用してもよい。この場合、例えば、X^dp mod pを計算するときは、乗算部1090などで使用しているmod nをmod pとして、べき乗演算装置1000を実施する。   (1) The bit size of the secret key d in Embodiments 1 and 2 is not limited to 512. It may be 1024 or 2048. In addition, the exponentiation unit 1000 calculates X ^ d mod n, dp = d mod p-1, dq = d mod q-1, X ^ dp mod p and X ^ dq mod q are calculated, X ^ d mod n may be calculated by using the Chinese remainder theorem. Here, the power arithmetic unit 1000 may be used when calculating X ^ dp mod p and X ^ dq mod q. In this case, for example, when calculating X ^ dp mod p, the power arithmetic apparatus 1000 is implemented with mod n used in the multiplier 1090 or the like as mod p.

(2)本発明は、べき乗を演算するのではなく、楕円曲線の点のスカラ倍点を演算するとしてもよい。その場合、べき乗演算装置1000で実施している乗算は楕円加算であり、2乗算は楕円2倍算となる。また、「べき」は「スカラ」に対応する。   (2) The present invention may calculate the scalar multiple of the points of the elliptic curve instead of calculating the power. In that case, multiplication performed by the power arithmetic apparatus 1000 is elliptic addition, and double multiplication is elliptic doubling. Also, “Sh” corresponds to “Scalar”.

(3)実施の形態1及び2における第2のカウンタ判定部1070は、カウンタが8で割り切れるか否かを判定しているが、これに限らない。例えば、4で割り切れるか否かを判定してもよい。この場合、実施の形態1では、u=(1+2+2^2+2^3)×(2^508+2×2^504+2^2×2^500+・・・+2^127)、実施の形態2では、u=(1+2^4+2^8+2^12)×(2^496+2×2^484+2^2×2^468+・・・+2^31)となる。また、複数の正整数を含めたテーブルを保持し、このテーブルに格納されている正整数であるかを判定してもよい。なお、このテーブルに含める正整数は、8の倍数など、規則性のあるものだけでなく、規則性がないものであってもよい。また、これらの場合も、その正整数の値により、uは変化する。   (3) Although the second counter determination unit 1070 in Embodiments 1 and 2 determines whether the counter is divisible by 8, the present invention is not limited to this. For example, it may be determined whether or not it is divisible by 4. In this case, in the first embodiment, u = (1 + 2 + 2 + ^ 2 + 2 ^ 3) * (2 ^ 508 + 2 * 2 ^ 504 + 2 ^ 2 * 2 ^ 500 +... + 2 ^ 127), and in the second embodiment, u = ( 1 + 2 ^ 4 + 2 ^ 8 + 2 ^ 12) * (2 ^ 496 + 2 * 2 ^ 484 + 2 ^ 2 * 2 ^ 468 +... + 2 ^ 31). Further, a table including a plurality of positive integers may be held, and it may be determined whether the table is a positive integer stored in the table. Note that the positive integers included in this table are not limited to regular ones such as multiples of 8, but may be those having no regularity. Also in these cases, u changes depending on the value of the positive integer.

(4)実施の形態1における乗数更新部1150や実施の形態2における乗数更新部2150において、乗数X_0を2乗しているが、これに限らない。例えば、3乗してもよい。この場合、実施の形態1では、u=(1+2+2^2+2^3+2^4+2^5+2^6+2^7)×(2^504+3×2^496+3^2×2^488+・・・+3^63)、実施の形態1では、u=(1+2^4+2^8+2^12+2^16+2^20+2^24+2^28)×(2^480+3×2^448+3^2×2^416+・・・+3^15)となる。ただし、この場合、第2のカウンタ判定部1070で、カウンタが8で割り切れるか否かを判定しているものとする。   (4) The multiplier X_0 is squared in the multiplier updating unit 1150 in the first embodiment and the multiplier updating unit 2150 in the second embodiment, but the present invention is not limited to this. For example, it may be cubed. In this case, in the first embodiment, u = (1 + 2 + 2 ^ 2 + 2 ^ 3 + 2 ^ 4 + 2 ^ 5 + 2 ^ 6 + 2 ^ 7) × (2 ^ 504 + 3 × 2 ^ 496 + 3 ^ 2 × 2 ^ 488 +... + 3 ^ 63), implementation In the first form, u = (1 + 2 ^ 4 + 2 ^ 8 + 2 ^ 12 + 2 ^ 16 + 2 ^ 20 + 2 ^ 24 + 2 ^ 28) × (2 ^ 480 + 3 × 2 ^ 448 + 3 ^ 2 × 2 ^ 416 +... + 3 ^ 15). However, in this case, the second counter determination unit 1070 determines whether the counter is divisible by 8.

(5)実施の形態1及び2における乱数更新部1170において、乱数Rを2乗することで更新しているが、これに限らない。例えば、3乗してもよい。また、固定の値を予め保持しておき、これを乱数Rに乗じることで乱数Rを更新してもよい。また、乱数更新部1170は、差分電力解析攻撃を防ぐためにべき乗演算装置1000に含めており、この他で差分電力解析攻撃対策を施す場合は、乱数更新部1170はなくてもよい。   (5) In the random number updating unit 1170 in the first and second embodiments, the random number R is updated by squaring, but the present invention is not limited to this. For example, it may be cubed. Alternatively, a fixed value may be stored in advance, and the random number R may be updated by multiplying the random number R by this. Further, the random number update unit 1170 is included in the power arithmetic apparatus 1000 to prevent the differential power analysis attack, and when the differential power analysis attack countermeasure is taken in addition to this, the random number update unit 1170 may be omitted.

(6)本発明は、べき乗演算装置でなく、これを利用するRSA暗号の復号化装置やRSA署名の署名生成装置であってもよい。また、秘密情報をべき値としたべき乗演算を実行する情報セキュリティ装置であってもよい。例えば、ElGamal暗号の復号化装置であったり、DSA署名の署名生成装置であったりしてもよい。   (6) The present invention may be an RSA encryption decryption apparatus or an RSA signature generation apparatus that uses the RSA encryption, instead of a power operation apparatus. Further, the information security device may execute an exponentiation operation with the secret information as a power value. For example, it may be a decryption device for ElGamal encryption or a signature generation device for a DSA signature.

(7)上記の各装置は、具体的には、マイクロプロセッサ、ROM、RAM、ハードディスクユニット、ディスプレイユニット、キーボード、マウスなどから構成されるコンピュータシステムである。前記RAMまたはハードディスクユニットには、コンピュータプログラムが記憶されている。前記マイクロプロセッサが、前記コンピュータプログラムにしたがって動作することにより、各装置は、その機能を達成する。ここでコンピュータプログラムは、所定の機能を達成するために、コンピュータに対する指令を示す命令コードが複数個組み合わされて構成されたものである。   (7) Each of the above devices is specifically a computer system including a microprocessor, ROM, RAM, a hard disk unit, a display unit, a keyboard, a mouse, and the like. A computer program is stored in the RAM or hard disk unit. Each device achieves its functions by the microprocessor operating according to the computer program. Here, the computer program is configured by combining a plurality of instruction codes indicating instructions for the computer in order to achieve a predetermined function.

(8)上記の各装置を構成する構成要素の一部または全部は、1個のシステムLSI(Large Scale Integration:大規模集積回路)から構成されているとしてもよい。システムLSIは、複数の構成部を1個のチップ上に集積して製造された超多機能LSIであり、具体的には、マイクロプロセッサ、ROM、RAMなどを含んで構成されるコンピュータシステムである。前記RAMには、コンピュータプログラムが記憶されている。前記マイクロプロセッサが、前記コンピュータプログラムにしたがって動作することにより、システムLSIは、その機能を達成する。   (8) A part or all of the components constituting each of the above devices may be configured by one system LSI (Large Scale Integration). The system LSI is a super multifunctional LSI manufactured by integrating a plurality of components on one chip, and specifically, a computer system including a microprocessor, a ROM, a RAM, and the like. . A computer program is stored in the RAM. The system LSI achieves its functions by the microprocessor operating according to the computer program.

(9)上記の各装置を構成する構成要素の一部または全部は、各装置に脱着可能なICカードまたは単体のモジュールから構成されているとしてもよい。前記ICカードまたは前記モジュールは、マイクロプロセッサ、ROM、RAMなどから構成されるコンピュータシステムである。前記ICカードまたは前記モジュールは、上記の超多機能LSIを含むとしてもよい。マイクロプロセッサが、コンピュータプログラムにしたがって動作することにより、前記ICカードまたは前記モジュールは、その機能を達成する。このICカードまたはこのモジュールは、耐タンパ性を有するとしてもよい。   (9) A part or all of the constituent elements constituting each of the above devices may be constituted by an IC card or a single module that can be attached to and detached from each device. The IC card or the module is a computer system including a microprocessor, a ROM, a RAM, and the like. The IC card or the module may include the super multifunctional LSI described above. The IC card or the module achieves its function by the microprocessor operating according to the computer program. This IC card or this module may have tamper resistance.

(10)本発明は、上記に示す方法であるとしてもよい。また、これらの方法をコンピュータにより実現するコンピュータプログラムであるとしてもよいし、前記コンピュータプログラムからなるディジタル信号であるとしてもよい。   (10) The present invention may be the method described above. Further, the present invention may be a computer program that realizes these methods by a computer, or may be a digital signal composed of the computer program.

(11)また、本発明は、前記コンピュータプログラムまたは前記ディジタル信号をコンピュータ読み取り可能な記録媒体、例えば、フレキシブルディスク、ハードディスク、CD−ROM、MO、DVD、DVD−ROM、DVD−RAM、BD(Blu−ray Disc)、半導体メモリなどに記録したものとしてもよい。また、これらの記録媒体に記録されている前記ディジタル信号であるとしてもよい。   (11) Further, the present invention provides a computer-readable recording medium such as a flexible disk, a hard disk, a CD-ROM, an MO, a DVD, a DVD-ROM, a DVD-RAM, a BD (Blu-ray). -Ray Disc), or recorded in a semiconductor memory or the like. Further, the digital signal may be recorded on these recording media.

(12)また、本発明は、前記コンピュータプログラムまたは前記ディジタル信号を、電気通信回線、無線または有線通信回線、インターネットを代表とするネットワーク、データ放送等を経由して伝送するものとしてもよい。   (12) In the present invention, the computer program or the digital signal may be transmitted via an electric communication line, a wireless or wired communication line, a network represented by the Internet, a data broadcast, or the like.

(13)また、本発明は、マイクロプロセッサとメモリを備えたコンピュータシステムであって、前記メモリは、上記コンピュータプログラムを記憶しており、前記マイクロプロセッサは、前記コンピュータプログラムにしたがって動作するとしてもよい。   (13) The present invention may be a computer system including a microprocessor and a memory, wherein the memory stores the computer program, and the microprocessor operates according to the computer program. .

(14)また、前記プログラムまたは前記ディジタル信号を前記記録媒体に記録して移送することにより、または前記プログラムまたは前記ディジタル信号を前記ネットワーク等を経由して移送することにより、独立した他のコンピュータシステムにより実施するとしてもよい。   (14) Another computer system which is independent by recording and transferring the program or the digital signal on the recording medium or by transferring the program or the digital signal via the network or the like. May be implemented.

(15)上記実施の形態及び上記変形例をそれぞれ組み合わせるとしてもよい。   (15) The above embodiment and the above modifications may be combined.

これらの構成によると、BigMac攻撃により安全性を低下することを防ぐことができる。   According to these configurations, it is possible to prevent the safety from being lowered due to the BigMac attack.

本発明に係る1個の実施の形態としてのべき乗演算装置1000の構成を示すブロック図The block diagram which shows the structure of the exponentiation calculating apparatus 1000 as one embodiment based on this invention べき乗演算装置1000の処理を示すフローチャートThe flowchart which shows the process of the exponentiation calculating apparatus 1000 べき乗演算装置1000の秘密鍵dに対する処理と、攻撃者による乗数の分類及びdのビット推測を示す図The figure which shows the process with respect to the secret key d of the power arithmetic unit 1000, the classification of the multiplier by an attacker, and the bit estimation of d 本発明に係る1個の実施の形態としてのべき乗演算装置2000の構成を示すブロック図The block diagram which shows the structure of the exponentiation calculating apparatus 2000 as one embodiment based on this invention べき乗演算装置2000の処理を示すフローチャートThe flowchart which shows the process of the exponentiation calculating apparatus 2000

符号の説明Explanation of symbols

1000,2000 べき乗演算装置
1010 入出力部
1020 秘密鍵格納部
1030 カウンタ格納部
1040,2040 カウンタ初期化部
1050 カウンタ更新部
1060 第1のカウンタ判定部
1070 第2のカウンタ判定部
1080 ビット判定部
1090,2090 乗算部
1100 2乗算部
1110 中間値格納部
1120,2120 乗数格納部
1130,2130 乱数格納部
1140,2140 乗数初期化部
1150,2150 乗数更新部
1160,2160 乱数性除去部
1170 乱数更新部
2080 乗数選択部
1000, 2000 Power arithmetic unit 1010 Input / output unit 1020 Secret key storage unit 1030 Counter storage unit 1040, 2040 Counter initialization unit 1050 Counter update unit 1060 First counter determination unit 1070 Second counter determination unit 1080 Bit determination unit 1090, 2090 Multiplying unit 1100 2 Multiplying unit 1110 Intermediate value storing unit 1120, 2120 Multiplier storing unit 1130, 2130 Random number storing unit 1140, 2140 Multiplier initialization unit 1150, 2150 Multiplier updating unit 1160, 2160 Randomness removing unit 1170 Random number updating unit 2080 Multiplier Select part

Claims (12)

対象データを入力し、秘密の数である秘密情報をべき値とした前記対象データのべき乗演算結果を出力するべき乗演算装置であって、
前記対象データの入力を受け付け、前記対象データのべき乗演算結果を出力する入出力部と、
前記秘密情報を格納する秘密情報格納部と、
中間値を格納する中間値格納部と、
前記秘密情報に対し、判定する秘密情報判定部と、
複数個の乗数を格納する乗数格納部と、
前記中間値と前記乗数との乗算を実行する乗算部と、
前記中間値の2乗算を実行する2乗算部と、
前記乗数を更新する乗数更新部とを備え、
前記乗算部で使用する前記乗数は、前記秘密情報判定部の判定結果に基づき、前記乗数格納部に格納されている複数個の前記乗数から選択すること
を特徴とするべき乗演算装置。
A power calculation device that inputs target data and outputs a power calculation result of the target data with secret information that is a secret number as a power value,
An input / output unit that accepts input of the target data and outputs a result of a power operation of the target data;
A secret information storage unit for storing the secret information;
An intermediate value storage for storing intermediate values;
A secret information determination unit for determining the secret information;
A multiplier storage for storing a plurality of multipliers;
A multiplication unit that performs multiplication of the intermediate value and the multiplier;
A two-multiplying unit that performs two multiplications of the intermediate value;
A multiplier update unit for updating the multiplier,
The multiplier used in the multiplication unit is selected from a plurality of multipliers stored in the multiplier storage unit based on a determination result of the secret information determination unit.
前記べき乗演算装置は、さらに、
カウンタを格納するカウンタ格納部と、
カウンタの値を更新するカウンタ更新部と、
カウンタの値を判定するカウンタ判定部とを備え、
前記秘密情報判定部は、前記カウンタの値に基づき判定し、
前記乗数更新部は、前記カウンタ判定部の判定結果に基づき、前記乗数を更新すること
を特徴とする請求項1記載のべき乗演算装置。
The power arithmetic device further includes:
A counter storage for storing the counter;
A counter update unit for updating the value of the counter;
A counter determination unit for determining the value of the counter,
The secret information determination unit determines based on the value of the counter,
The power calculator according to claim 1, wherein the multiplier update unit updates the multiplier based on a determination result of the counter determination unit.
前記べき乗演算装置は、さらに、
乱数を格納する乱数格納部と、
前記中間値から前記乱数の影響を取り去る乱数性除去部とを備え、
前記乗数は、少なくとも前記乱数に基づくこと
を特徴する請求項1または請求項2記載のべき乗演算装置。
The power arithmetic device further includes:
A random number storage for storing random numbers;
A random number removing unit that removes the influence of the random number from the intermediate value,
The power multiplier according to claim 1, wherein the multiplier is based on at least the random number.
前記乱数は、予め計算し、前記乱数格納部に格納しており、
前記乱数性除去部は、前記中間値に予め計算した乱数性除去数を乗算すること
を特徴とする請求項3記載のべき乗演算装置。
The random number is calculated in advance and stored in the random number storage unit,
The power arithmetic apparatus according to claim 3, wherein the randomness removing unit multiplies the intermediate value by a preliminarily calculated randomness removal number.
前記べき乗演算装置は、さらに、
前記乱数を更新する乱数更新部を備えること
を特徴とする請求項4記載のべき乗演算装置。
The power arithmetic device further includes:
The power arithmetic apparatus according to claim 4, further comprising a random number update unit that updates the random number.
前記乗数格納部は、2個の前記乗数X_0、X_1を格納し、
前記乗数更新部は、前記乗数X_0、X_1に対し、前記乗数X_0を2乗した結果を前記乗数X_0に対する更新乗数X_0’とし、前記対象データと前記更新乗数X_0を掛けた結果を前記乗数X_1に対する更新乗数X_1’とし、それぞれの前記更新乗数X_0’、X_1’を前記乗数格納部に格納すること
を特徴とする請求項1から請求項5のいずれか1項に記載のべき乗演算装置。
The multiplier storage unit stores the two multipliers X_0 and X_1,
The multiplier update unit sets a result obtained by squaring the multiplier X_0 to the multipliers X_0 and X_1 as an update multiplier X_0 ′ for the multiplier X_0, and a result obtained by multiplying the target data by the update multiplier X_0 for the multiplier X_1. The power multiplier according to any one of claims 1 to 5, wherein an update multiplier X_1 'is used, and each of the update multipliers X_0' and X_1 'is stored in the multiplier storage unit.
暗号文を入力し、秘密の数である秘密情報をべき値とした前記暗号文のべき乗演算結果を復号文として出力する復号化装置であって、
前記暗号文の入力を受け付け、前記復号文を出力する入出力部と、
前記秘密情報を格納する秘密情報格納部と、
中間値を格納する中間値格納部と、
前記秘密情報に対し、判定する秘密情報判定部と、
複数個の乗数を格納する乗数格納部と、
前記中間値と前記乗数との乗算を実行する乗算部と、
前記中間値の2乗算を実行する2乗算部と、
前記乗数を更新する乗数更新部とを備え、
前記乗算部で使用する前記乗数は、前記秘密情報判定部の判定結果に基づき、前記乗数格部に格納されている複数個の前記乗数から選択すること
を特徴とする復号化装置。
A decryption device that inputs a ciphertext and outputs a power operation result of the ciphertext with a secret value that is a secret number as a power value, as a decrypted text,
An input / output unit that receives input of the ciphertext and outputs the decrypted text;
A secret information storage unit for storing the secret information;
An intermediate value storage for storing intermediate values;
A secret information determination unit for determining the secret information;
A multiplier storage for storing a plurality of multipliers;
A multiplication unit that performs multiplication of the intermediate value and the multiplier;
A two-multiplying unit that performs two multiplications of the intermediate value;
A multiplier update unit for updating the multiplier,
The decoding device according to claim 1, wherein the multiplier used in the multiplication unit is selected from the plurality of multipliers stored in the multiplier case unit based on a determination result of the secret information determination unit.
署名対象データを入力し、秘密の数である秘密情報をべき値とした前記署名対象データのべき乗演算結果を署名データとして出力する署名生成装置であって、
前記署名対象データの入力を受け付け、前記署名データを出力する入出力部と、
前記秘密情報を格納する秘密情報格納部と、
中間値を格納する中間値格納部と、
前記秘密情報に対し、判定する秘密情報判定部と、
複数個の乗数を格納する乗数格納部と、
前記中間値と前記乗数との乗算を実行する乗算部と、
前記中間値の2乗算を実行する2乗算部と、
前記乗数を更新する乗数更新部とを備え、
前記乗算部で使用する前記乗数は、前記秘密情報判定部の判定結果に基づき、前記乗数格納部に格納されている複数個の前記乗数から選択すること
を特徴とする署名生成装置。
A signature generation device that inputs signature target data and outputs a result of exponentiation operation of the signature target data with secret information that is a secret number as a power value, as signature data,
An input / output unit that accepts input of the signature target data and outputs the signature data;
A secret information storage unit for storing the secret information;
An intermediate value storage for storing intermediate values;
A secret information determination unit for determining the secret information;
A multiplier storage for storing a plurality of multipliers;
A multiplication unit that performs multiplication of the intermediate value and the multiplier;
A two-multiplying unit that performs two multiplications of the intermediate value;
A multiplier update unit for updating the multiplier,
The multiplier used in the multiplication unit is selected from a plurality of the multipliers stored in the multiplier storage unit based on the determination result of the secret information determination unit.
対象データを入力し、秘密の数である秘密情報をべき値とした前記対象データのべき乗演算結果を出力するべき乗演算方法であって、
前記対象データの入力を受け付け、前記対象データのべき乗演算結果を出力する入出力ステップと、
前記秘密情報を格納する秘密情報格納ステップと、
中間値を格納する中間値格納ステップと、
前記の秘密情報に対し、判定する秘密情報判定ステップと、
複数個の乗数を格納する乗数格納ステップと、
前記中間値と前記乗数との乗算を実行する乗算ステップと、
前記中間値の2乗算を実行する2乗算ステップと、
前記乗数を更新する乗数更新ステップとを含み、
前記乗算部で使用する前記乗数は、前記秘密情報判定ステップの判定結果に基づき、前記乗数格納ステップに格納されている複数個の前記乗数から選択すること
を特徴とするべき乗演算方法。
A power calculation method for inputting target data and outputting a power calculation result of the target data with secret information that is a secret number as a power value,
An input / output step for receiving an input of the target data and outputting a power operation result of the target data;
A secret information storing step for storing the secret information;
An intermediate value storing step for storing the intermediate value;
A secret information determination step for determining the secret information;
A multiplier storage step for storing a plurality of multipliers;
A multiplication step for performing multiplication of the intermediate value and the multiplier;
A two-multiplication step for performing two multiplications of the intermediate values;
A multiplier update step of updating the multiplier,
The multiplier used in the multiplier is selected from the plurality of multipliers stored in the multiplier storage step based on the determination result of the secret information determination step.
対象データを入力し、秘密の数である秘密情報をべき値とした前記対象データのべき乗演算結果を出力するべき乗演算装置に実行させるプログラムであって、
前記対象データの入力を受け付け、前記対象データのべき乗演算結果を出力する入出力ステップと、
前記秘密情報を格納する秘密情報格納ステップと、
中間値を格納する中間値格納ステップと、
前記秘密情報に対し、判定する秘密情報判定ステップと、
複数個の乗数を格納する乗数格納ステップと、
前記中間値と前記乗数との乗算を実行する乗算ステップと、
前記中間値の2乗算を実行する2乗算ステップと、
前記乗数を更新する乗数更新ステップとを含み、
前記乗算部で使用する前記乗数は、前記秘密情報判定ステップの判定結果に基づき、前記乗数格納ステップに格納されている複数個の前記乗数から選択すること
を特徴とするプログラム。
A program that inputs target data and causes a power calculator to output a power calculation result of the target data with secret information that is a secret number as a power value,
An input / output step for receiving an input of the target data and outputting a power operation result of the target data;
A secret information storing step for storing the secret information;
An intermediate value storing step for storing the intermediate value;
A secret information determination step for determining the secret information;
A multiplier storage step for storing a plurality of multipliers;
A multiplication step for performing multiplication of the intermediate value and the multiplier;
A two-multiplication step for performing two multiplications of the intermediate values;
A multiplier update step of updating the multiplier,
The multiplier used in the multiplier is selected from the plurality of multipliers stored in the multiplier storage step based on the determination result of the secret information determination step.
請求項10に記載のプログラムを記録した媒体。 A medium on which the program according to claim 10 is recorded. 対象データを入力し、秘密の数である秘密情報をべき値とした前記対象データのべき乗演算結果を出力するべき乗演算装置の集積回路であって、
前記対象データの入力を受け付け、前記対象データのべき乗演算結果を出力する入出力部と、
前記秘密情報を格納する秘密情報格納部と、
中間値を格納する中間値格納部と、
前記秘密情報に対し、判定する秘密情報判定部と、
複数個の乗数を格納する乗数格納部と、
前記中間値と前記乗数との乗算を実行する乗算部と、
前記中間値の2乗算を実行する2乗算部と、
前記乗数を更新する乗数更新部とを備え、
前記乗算部で使用する前記乗数は、前記秘密情報判定部の判定結果に基づき、前記乗数格納部に格納されている複数個の前記乗数から選択すること
を特徴とする集積回路。
An integrated circuit of a power calculation device that inputs target data and outputs a power calculation result of the target data with secret information that is a secret number as a power value,
An input / output unit that accepts input of the target data and outputs a result of a power operation of the target data;
A secret information storage unit for storing the secret information;
An intermediate value storage for storing intermediate values;
A secret information determination unit for determining the secret information;
A multiplier storage for storing a plurality of multipliers;
A multiplication unit that performs multiplication of the intermediate value and the multiplier;
A two-multiplying unit that performs two multiplications of the intermediate value;
A multiplier update unit for updating the multiplier,
The integrated circuit according to claim 1, wherein the multiplier used in the multiplier is selected from a plurality of multipliers stored in the multiplier storage based on a determination result of the secret information determination unit.
JP2006148059A 2006-05-29 2006-05-29 Exponentiation arithmetic unit, decoding apparatus, and signature creating apparatus Pending JP2007316491A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006148059A JP2007316491A (en) 2006-05-29 2006-05-29 Exponentiation arithmetic unit, decoding apparatus, and signature creating apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006148059A JP2007316491A (en) 2006-05-29 2006-05-29 Exponentiation arithmetic unit, decoding apparatus, and signature creating apparatus

Publications (1)

Publication Number Publication Date
JP2007316491A true JP2007316491A (en) 2007-12-06

Family

ID=38850378

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006148059A Pending JP2007316491A (en) 2006-05-29 2006-05-29 Exponentiation arithmetic unit, decoding apparatus, and signature creating apparatus

Country Status (1)

Country Link
JP (1) JP2007316491A (en)

Similar Documents

Publication Publication Date Title
Yen et al. Power analysis by exploiting chosen message and internal collisions–vulnerability of checking mechanism for RSA-decryption
US7908641B2 (en) Modular exponentiation with randomized exponent
KR101194837B1 (en) Cryptographic apparatus and method for fast computation of blinding-exponent DPA countermeasure
US8265267B2 (en) Information security device
US20130279692A1 (en) Protecting modular exponentiation in cryptographic operations
JP2008252299A (en) Encryption processing system and encryption processing method
JP5648177B2 (en) Protection of prime generation against side channel attacks
US8280042B2 (en) Decryption processor and decryption processing method
EP2332040B1 (en) Countermeasure securing exponentiation based cryptography
JP4662802B2 (en) Calculation method, calculation apparatus, and computer program
JP5365624B2 (en) Embedded device apparatus incorporating a decoding device, a program, and a recovery device having a countermeasure function against a power analysis attack
JP4977300B2 (en) Cryptography and equipment
KR100652377B1 (en) A modular exponentiation algorithm, a record device including the algorithm and a system using the algorithm
JP2004304800A (en) Protection of side channel for prevention of attack in data processing device
JP2011510579A (en) Countermeasure method and device for asymmetric cryptosystem using signature diagram
US8804952B2 (en) System and method for securing scalar multiplication against differential power attacks
US20100208887A1 (en) Method and device for countering faul attacks
WO2015199675A1 (en) System and method for securing scalar multiplication against differential power attacks
JP2007316491A (en) Exponentiation arithmetic unit, decoding apparatus, and signature creating apparatus
Pontie et al. Design of a secure architecture for scalar multiplication on elliptic curves
KR20130054591A (en) Method for protecting information against pa and fa using crt-rsa
KR102019369B1 (en) Elliptic curve cryptography apparatus and method for blocking single trace attack
Kim et al. SPA countermeasure based on unsigned left-to-right recodings
WO2006103851A1 (en) Power value generation device
Okeya et al. Security analysis of CRT-based cryptosystems