JP5840160B2 - Cryptographic operation apparatus, cryptographic operation method, and program - Google Patents

Cryptographic operation apparatus, cryptographic operation method, and program Download PDF

Info

Publication number
JP5840160B2
JP5840160B2 JP2013037123A JP2013037123A JP5840160B2 JP 5840160 B2 JP5840160 B2 JP 5840160B2 JP 2013037123 A JP2013037123 A JP 2013037123A JP 2013037123 A JP2013037123 A JP 2013037123A JP 5840160 B2 JP5840160 B2 JP 5840160B2
Authority
JP
Japan
Prior art keywords
cache
calculation
calculation table
memory
cryptographic operation
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.)
Active
Application number
JP2013037123A
Other languages
Japanese (ja)
Other versions
JP2014165813A (en
Inventor
順子 高橋
順子 高橋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2013037123A priority Critical patent/JP5840160B2/en
Publication of JP2014165813A publication Critical patent/JP2014165813A/en
Application granted granted Critical
Publication of JP5840160B2 publication Critical patent/JP5840160B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

この発明は、情報セキュリティ技術に関し、特に、キャッシュ・タイミング攻撃への耐性を有する暗号演算技術に関する。   The present invention relates to information security technology, and more particularly, to cryptographic operation technology having resistance to cache timing attacks.

現在多くのコンピュータは中央演算処理装置(Central Processing Unit, CPU)に主記憶装置(Random Access Memory, RAM)(以下、メインメモリとも呼ぶ。)よりも高速なキャッシュメモリを搭載しており、頻繁にアクセスするデータをキャッシュメモリへ一時的に記憶することで各種演算の高速化を実現している。所定の演算を実行する際に、所望のデータがキャッシュメモリに存在し、キャッシュメモリから所望のデータを読み込む場合をキャッシュヒットと呼び、所望のデータがキャッシュメモリに存在せず、メインメモリから所望のデータを読み込む場合をキャッシュミスと呼ぶ。   Many computers today have a central processing unit (CPU) with a cache memory that is faster than the main memory (Random Access Memory, RAM) (hereinafter also referred to as main memory). The speed of various operations is realized by temporarily storing the data to be accessed in the cache memory. When a predetermined operation is performed, the desired data exists in the cache memory and the desired data is read from the cache memory is called a cache hit, and the desired data does not exist in the cache memory, and the desired data is read from the main memory. The case of reading data is called a cache miss.

キャッシュヒット時は高速なキャッシュメモリ上のデータを読み込むため演算時間は短いが、キャッシュミス時には低速なメインメモリからデータを読み込む必要があるため演算時間は長くなる。このキャッシュヒット時とキャッシュミス時の演算時間の差を利用して、暗号演算を実行するコンピュータから秘密鍵などの秘密情報を不正に取得するキャッシュ・タイミング攻撃が知られている(例えば、非特許文献1参照)。   When the cache hits, the calculation time is short because the data in the high-speed cache memory is read. However, when the cache miss occurs, the calculation time is long because the data needs to be read from the low-speed main memory. A cache timing attack is known in which secret information such as a secret key is illegally obtained from a computer that performs cryptographic computation using the difference in computation time between a cache hit and a cache miss (for example, non-patent) Reference 1).

暗号アルゴリズムの実装方法において、暗号演算速度の高速化を目的として秘密情報に関する値を参照値とした事前計算テーブルが頻繁に利用されている。キャッシュ・タイミング攻撃では、暗号演算に関するタイミング情報を測定することにより事前計算テーブルの参照位置を推測し、暗号演算に用いられた秘密鍵を導出する。上述の通り、暗号演算時にメインメモリ上の事前計算テーブルを参照するか、キャッシュメモリ上の事前計算テーブルを参照するかによりアクセス時間が異なるため、この時間差を解析することにより事前計算テーブルの参照位置を推測することができる。   In a method for implementing a cryptographic algorithm, a pre-calculation table using a value related to secret information as a reference value is frequently used for the purpose of speeding up a cryptographic operation speed. In the cache timing attack, the timing information related to the cryptographic operation is measured to estimate the reference position of the pre-calculation table, and the secret key used for the cryptographic operation is derived. As described above, the access time differs depending on whether the pre-computation table in the main memory or the pre-computation table in the cache memory is referenced at the time of cryptographic operation. Therefore, by analyzing this time difference, the reference position of the pre-computation table Can be guessed.

このようなキャッシュ・タイミング攻撃への対策として、事前計算テーブルの参照値から、それに対応する秘密情報を一意に特定することを困難にするために、できるだけ小さい要素サイズの事前計算テーブルを使用することが知られている(例えば、非特許文献2参照)。このような対策を施せば、キャッシュラインと呼ばれるキャッシュメモリを構成する最小単位(通常、複数バイトからなる)に事前計算テーブルの多くの要素を格納することができるため、キャッシュ・タイミング攻撃で推測される事前計算テーブルの要素数が多くなり秘密情報を一意に特定することが困難となる。なお、事前計算テーブルのサイズを小さくすると演算速度の低下を招くことがあるため、暗号演算全体の中でキャッシュ・タイミング攻撃の標的となりやすい一部の個所のみに要素サイズの小さい事前計算テーブルを使用する実装方法などが知られている(例えば、非特許文献2参照)。   As a countermeasure against such a cache timing attack, use a precalculation table with the smallest possible element size to make it difficult to uniquely identify the corresponding secret information from the reference value of the precalculation table. Is known (for example, see Non-Patent Document 2). If such measures are taken, many elements of the pre-calculation table can be stored in the smallest unit (usually consisting of multiple bytes) that constitutes a cache memory called a cache line. This increases the number of elements in the pre-calculation table and makes it difficult to uniquely identify secret information. Note that if the pre-computation table size is reduced, the computation speed may be reduced, so the pre-computation table with a small element size is used only in some parts of the entire cryptographic computation that are likely to be targets of cache timing attacks. A mounting method is known (for example, see Non-Patent Document 2).

E. Tromer, D. A. Osvik, and A. Shamir、“Efficient Cache Attacks on AES, and Countermeasures”、Journal of Cryptology、vol.23、no.1、pp.37-71E. Tromer, D. A. Osvik, and A. Shamir, “Efficient Cache Attacks on AES, and Countermeasures”, Journal of Cryptology, vol. 23, no. 1, pp. 37-71 E. Brickell, G. Graunke, M. Neve, J.-P. Seifert、“Software mitigations to hedge AES against cache-based software side channel vulnerabilities”、Cryptology ePrint Archive、Report 2006/052、[online]、[平成25年2月13日検索]、インターネット<URL: http://eprint.iacr.org/2006/052.pdf>E. Brickell, G. Graunke, M. Neve, J.-P. Seifert, “Software mitigations to hedge AES against cache-based software side channel vulnerabilities”, Cryptology ePrint Archive, Report 2006/052, [online], [Heisei Search February 13, 25], Internet <URL: http://eprint.iacr.org/2006/052.pdf> OpenSSL Software Foundation、“OpenSSL: The Open Source toolkit for SSL/TLS”、 [online]、[平成25年2月13日検索]、インターネット<URL: http://www.openssl.org/>OpenSSL Software Foundation, “OpenSSL: The Open Source toolkit for SSL / TLS”, [online], [Search February 13, 2013], Internet <URL: http://www.openssl.org/>

従来のキャッシュ・タイミング攻撃への対策方法は、実装に必要なコストが高いという問題点があった。例えば、インターネット上で情報を暗号化して送受信するSSL/TLS(Secure Socket Layer/Transport Layer Security)プロトコルの具体的な実装の1つであるOpenSSL(例えば、非特許文献3参照)等で一般的に用いられている高速化手法は、事前計算テーブルの要素サイズを小さくすると使用することができなくなり、演算速度が遅くなるという問題があった。また、小さい要素サイズの事前計算テーブルを使用することによる速度低下を抑えるために、1回の暗号演算内で小さい要素サイズの事前計算テーブルと高速化手法で使用する事前計算テーブルの2種類を使用することが考えられるが、暗号演算内で2種類の事前計算テーブルの使用を切り替える必要があり実装が容易ではなかった。   The conventional countermeasure method against the cache timing attack has a problem that the cost required for the implementation is high. For example, OpenSSL (see, for example, Non-Patent Document 3), which is one of the specific implementations of SSL / TLS (Secure Socket Layer / Transport Layer Security) protocol that encrypts and transmits information on the Internet, is generally used. The speed-up method used has a problem that it cannot be used if the element size of the pre-calculation table is reduced, and the calculation speed becomes slow. In addition, in order to suppress the speed drop caused by using a pre-calculation table with a small element size, two types of pre-calculation tables used in the encryption method and a small element size pre-calculation table are used in one cryptographic operation. Although it is conceivable, it is necessary to switch the use of two types of pre-calculation tables in cryptographic operations, and implementation is not easy.

この発明の目的は、事前計算テーブルの要素サイズを変更することなく、キャッシュ・タイミング攻撃に対して安全に暗号演算を行う技術を提供することである。   An object of the present invention is to provide a technique for performing a cryptographic operation safely against a cache timing attack without changing the element size of a pre-calculation table.

上記の課題を解決するために、この発明の暗号演算装置は、複数のキャッシュラインからなるキャッシュセットを複数含むキャッシュメモリと、キャッシュセットそれぞれに対応する複数のメモリブロック群を含むメインメモリと、複数の相異なる参照値と当該参照値それぞれに対して任意の変換を実行した変換結果との組み合わせを要素とする事前計算テーブルを記憶するテーブル記憶部と、Nを事前計算テーブルの容量をキャッシュセットの容量で除算した値以上の最小の整数として、N+1個以下のメモリブロック群に事前計算テーブルを格納するテーブル格納部と、事前計算テーブルの所望の要素がキャッシュメモリに存在しなければ、当該要素をメモリブロック群から読み込みメモリブロック群に対応するキャッシュセットに格納するキャッシュ制御部と、任意の値が入力されると当該値から求めた参照値により事前計算テーブルの要素を参照して変換結果を求める演算部とを有する。   In order to solve the above problems, a cryptographic operation apparatus according to the present invention includes a cache memory including a plurality of cache sets each including a plurality of cache lines, a main memory including a plurality of memory block groups corresponding to the respective cache sets, and a plurality of cache memories. A table storage unit that stores a pre-calculation table whose elements are combinations of different reference values and conversion results obtained by performing arbitrary conversion on each of the reference values, and N is the capacity of the pre-calculation table. As the smallest integer greater than or equal to the value divided by the capacity, a table storage unit that stores the pre-calculation table in a group of N + 1 or less memory blocks, and if the desired element of the pre-calculation table does not exist in the cache memory, Key to read elements from memory blocks and store them in cache set corresponding to memory blocks A cache control unit, and a calculation unit that obtains a conversion result by referring to an element of a pre-calculation table with a reference value obtained from the value when an arbitrary value is input.

この発明の暗号演算技術によれば、キャッシュ・タイミング攻撃を行うために暗号演算時間に関するタイミング情報が取得されたとしても解析を行うために必要とされる十分な情報を得られないため、キャッシュ・タイミング攻撃に対して安全に暗号演算を行うことができる。   According to the cryptographic operation technique of the present invention, even if timing information related to the cryptographic operation time is acquired in order to perform a cache timing attack, sufficient information necessary for performing analysis cannot be obtained. It is possible to perform cryptographic operations safely against timing attacks.

また、事前計算テーブルの要素サイズを変更することなく利用可能であるため、一般的な高速化手法を引き続き使用することができる。これにより暗号演算速度の低下を招くことなく、かつ容易に実装することが可能である。   In addition, since it can be used without changing the element size of the pre-calculation table, a general speed-up method can be continuously used. As a result, the cryptographic operation speed can be easily implemented without causing a decrease in the cryptographic operation speed.

暗号演算装置の機能構成を例示する図。The figure which illustrates the function structure of a cryptographic operation apparatus. キャッシュ方式を説明する図。The figure explaining a cache system. 暗号演算装置の処理フローを例示する図。The figure which illustrates the processing flow of a cryptographic operation apparatus. 事前計算テーブルの格納方法を例示する図。The figure which illustrates the storage method of a prior calculation table. 事前計算テーブルの格納方法を例示する図。The figure which illustrates the storage method of a prior calculation table. 事前計算テーブルの格納方法を例示する図。The figure which illustrates the storage method of a prior calculation table. 事前計算テーブルの格納方法を例示する図。The figure which illustrates the storage method of a prior calculation table. AES暗号方式の具体的な実装方法を例示する図。The figure which illustrates the specific implementation method of an AES encryption system. 従来技術の実験結果を示す図。The figure which shows the experimental result of a prior art. 実施形態の実験結果を示す図。The figure which shows the experimental result of embodiment.

以下、この発明の実施の形態について詳細に説明する。なお、図面中において同じ機能を有する構成部には同じ番号を付し、重複説明を省略する。   Hereinafter, embodiments of the present invention will be described in detail. In addition, the same number is attached | subjected to the component which has the same function in drawing, and duplication description is abbreviate | omitted.

[実施形態]
従来の事前計算テーブルを用いた暗号方式の実装では、事前計算テーブルを格納するためにメインメモリ上の連続する領域を確保していた。このような実装では、セットアソシアティブ方式のキャッシュ方式を採用する中央演算処理装置を備えるコンピュータにより暗号演算を行うと、多数のキャッシュセット位置に対応するメモリブロックに跨って領域が確保されることになる。その結果、事前計算テーブルの各要素は、キャッシュメモリ上では、その参照値に依存して多くのキャッシュセットに分散して格納されることになっていた。
[Embodiment]
In the conventional implementation of an encryption method using a pre-calculation table, a continuous area on the main memory is secured to store the pre-calculation table. In such an implementation, when cryptographic computation is performed by a computer having a central processing unit that employs a set associative cache method, an area is secured across memory blocks corresponding to a large number of cache set positions. . As a result, each element of the precalculation table is distributed and stored in many cache sets on the cache memory depending on the reference value.

実施形態の暗号演算装置は、セットアソシアティブ方式のキャッシュ方式を採用する中央演算処理装置を備えるコンピュータにおいて、秘密情報に関する値を参照値とした事前計算テーブルの各要素を、その参照値に依存せず、キャシュメモリ上でできるだけ同じキャッシュセット位置に格納されるように、そのキャッシュセット位置に対応するメインメモリ上に配置することを特徴とする。   The cryptographic operation device according to the embodiment is a computer including a central processing unit that employs a set-associative cache method, and does not depend on the reference value for each element of the pre-calculation table with a value related to secret information as a reference value. In the cache memory, it is arranged on the main memory corresponding to the cache set position so as to be stored in the same cache set position as much as possible.

<構成>
図1を参照して、実施形態の暗号演算装置1の機能構成の一例を説明する。暗号演算装置1は、キャッシュメモリ2、メインメモリ3、テーブル記憶部4、テーブル格納部5、入力部6、キャッシュ制御部7、演算部8、出力部9を有する。暗号演算装置1は、例えば、中央演算処理装置(Central Processing Unit、CPU)、主記憶装置(Random Access Memory、RAM)等を有する公知又は専用のコンピュータに特別なプログラムが読み込まれて構成された特別な装置である。キャッシュメモリ2は、例えば、中央演算処理装置と主記憶装置を接続するバス上に設置された高速かつ小容量の記憶装置である。メインメモリ3は、例えば、半導体素子により構成される比較的低速かつ大容量の記憶装置である。テーブル記憶部4は、例えば、ハードディスクや光ディスクもしくはフラッシュメモリ(Flash Memory)などの半導体メモリ素子により構成される補助記憶装置、またはリレーショナルデータベースやキーバリューストアなどのミドルウェアにより構成することができる。入力部6および出力部9は、例えば、ネットワークを介して処理対象のデータを送受信するネットワーク・インターフェースや、入出力デバイスを介して処理対象のデータを入出力する各種ポートなどである。
<Configuration>
With reference to FIG. 1, an example of a functional configuration of the cryptographic operation device 1 according to the embodiment will be described. The cryptographic operation device 1 includes a cache memory 2, a main memory 3, a table storage unit 4, a table storage unit 5, an input unit 6, a cache control unit 7, a calculation unit 8, and an output unit 9. The cryptographic operation device 1 is a special configuration in which a special program is read into a known or dedicated computer having a central processing unit (CPU), a main storage device (Random Access Memory, RAM), and the like. Device. The cache memory 2 is a high-speed and small-capacity storage device installed on a bus connecting the central processing unit and the main storage device, for example. The main memory 3 is a relatively low-speed and large-capacity storage device composed of semiconductor elements, for example. The table storage unit 4 can be configured by, for example, an auxiliary storage device configured by a semiconductor memory element such as a hard disk, an optical disk, or a flash memory, or middleware such as a relational database or a key-value store. The input unit 6 and the output unit 9 are, for example, a network interface that transmits / receives data to be processed via a network, and various ports that input / output data to be processed via an input / output device.

暗号演算装置1の搭載する中央演算処理装置はキャッシュ方式としてセットアソシアティブ方式を採用する。図2を参照して、セットアソシアティブ方式におけるキャッシュメモリ2およびメインメモリ3の構成例を説明する。   The central processing unit mounted on the cryptographic operation device 1 employs a set associative method as a cache method. A configuration example of the cache memory 2 and the main memory 3 in the set associative method will be described with reference to FIG.

キャッシュメモリ2はS(S≧1)個のキャシュセット200,…,20S-1から構成される。キャシュセット20k(0≦k<S)はy(y≧1)個のキャッシュライン200k,0,…,200k,y-1から構成される。キャッシュセットを構成するキャッシュラインの個数の単位をウェイと呼び、1個のキャシュセットがy個のキャッシュラインからなるセットアソシアティブ方式をyウェイセットアソシアティブ方式と呼ぶこともある。キャッシュメモリ2はキャッシュライン200を一単位としてデータの入出力を管理する。以降ではキャッシュライン200のサイズをB(B≧1)バイトとする。 The cache memory 2 is composed of S (S ≧ 1) cache sets 20 0 ,..., 20 S−1 . The cache set 20 k (0 ≦ k <S) includes y (y ≧ 1) cache lines 200 k, 0 ,..., 200 k, y−1 . A unit of the number of cache lines constituting a cache set is called a way, and a set associative method in which one cache set is composed of y cache lines is sometimes called a y-way set associative method. The cache memory 2 manages data input / output using the cache line 200 as a unit. Hereinafter, the size of the cache line 200 is assumed to be B (B ≧ 1) bytes.

メインメモリ3はS個のメモリブロック群300,…,30S-1を含む。メモリブロック群30kはw(w≧y)個のメモリブロック300k,0,…,300k,w-1を含む。メインメモリ3はメモリブロック300を一単位として読み取りおよび書き込みが行われる。メモリブロック300のサイズはキャッシュライン200のサイズと等しいことが一般的である。 The main memory 3 includes S memory block groups 30 0 ,..., 30 S−1 . The memory block group 30 k includes w (w ≧ y) memory blocks 300 k, 0 ,..., 300 k, w−1 . The main memory 3 is read and written with the memory block 300 as a unit. The size of the memory block 300 is generally equal to the size of the cache line 200.

キャシュメモリ2上のキャシュセット200,…,20S-1とメインメモリ3上のメモリブロック群300,…,30S-1とはキャッシュセット番号により対応付けられている。同じキャッシュセット番号に対応付けられたメモリブロックのデータはそのキャッシュセット番号をもつキャッシュセットに記憶される。例えば、キャッシュセット番号0に対応付けられたw個のメモリブロック3000,0,…,3000,w-1のいずれかに記憶されているデータは、キャッシュセット200に含まれるキャッシュライン2000,0,…,2000,y-1のいずれかに記憶される。 Cache set 20 0 on cache memory 2, ..., 20 S-1 and the memory block group 30 0 in the main memory 3, ... are associated with cache set numbers and 30 S-1. Data of the memory block associated with the same cache set number is stored in the cache set having the cache set number. For example, cache set numbers 0 w memory blocks associated with the 300 0,0, ..., 300 0, w-1 of the data stored in either the cache line 200 included in the cache set 20 0 Stored in any of 0,0 ,..., 200 0, y-1 .

<処理>
図3を参照して、暗号演算装置の実行する処理の一例を手続きの順に従って説明する。
<Processing>
With reference to FIG. 3, an example of processing executed by the cryptographic operation device will be described in the order of procedures.

テーブル記憶部4には事前計算テーブル40が記憶されている。事前計算テーブル40は、複数の相異なる参照値iとその参照値iに対して任意の変換fを実行した変換結果f(i)との組み合わせを要素とするテーブルである。テーブル記憶部4に記憶される事前計算テーブルの数は複数であってもよい。事前計算テーブルの数は適用する具体的な暗号アルゴリズムの実装により決定される。   A pre-calculation table 40 is stored in the table storage unit 4. The pre-calculation table 40 is a table having as an element a combination of a plurality of different reference values i and a conversion result f (i) obtained by executing an arbitrary conversion f on the reference value i. A plurality of pre-calculation tables may be stored in the table storage unit 4. The number of precalculation tables is determined by the implementation of the specific cryptographic algorithm to be applied.

変換fは、任意の暗号方式を構成するいずれかのアルゴリズムの一部として実行される、入力値を所定の規則に従って出力値に変換する演算である。入力値を出力値に変換する規則は、実行するアルゴリズムにより規定される。暗号方式としては、例えば、任意の共通鍵暗号方式や任意の公開鍵暗号方式を適用でき、これらと同等の機能を有する任意の暗号方式を適用することができる。共通鍵暗号方式は、送信者と受信者が同一の鍵を共有し、暗号化に使用する鍵と復号に使用する鍵が同一である暗号方式である。代表的な共通鍵暗号方式としては、例えば、DES(Data Encryption Standard)、AES(Advanced Encryption Standard)などがある。公開鍵暗号方式は、受信者が公開鍵と秘密鍵を生成し、送信者は公開鍵を用いて暗号文を生成し、受信者は秘密鍵を用いて暗号文を復号する暗号方式である。代表的な公開鍵暗号方式としては、例えば、RSA暗号などがある。   The conversion f is an operation for converting an input value into an output value according to a predetermined rule, which is executed as a part of any algorithm constituting an arbitrary encryption method. The rules for converting input values to output values are defined by the algorithm to be executed. As an encryption method, for example, an arbitrary common key encryption method or an arbitrary public key encryption method can be applied, and an arbitrary encryption method having functions equivalent to these can be applied. The common key encryption method is an encryption method in which a sender and a receiver share the same key, and a key used for encryption and a key used for decryption are the same. Typical common key cryptosystems include, for example, DES (Data Encryption Standard) and AES (Advanced Encryption Standard). In the public key cryptosystem, the receiver generates a public key and a secret key, the sender generates a ciphertext using the public key, and the receiver decrypts the ciphertext using the secret key. A typical public key cryptosystem is, for example, RSA cryptography.

テーブル格納部5はテーブル記憶部4に記憶されている事前計算テーブル40をメインメモリ3に格納する(ステップS5)。このとき、格納する要素の参照値に依存せず、できるだけ同じキャッシュセット20に対応づけられたメモリブロック群30に収まるように事前計算テーブル40の各要素を格納する。すなわち、Nを事前計算テーブル40の容量をキャッシュセット20の容量で除算した値以上の最小の整数として、N+1個以下のメモリブロック群300,…,30N-1に事前計算テーブル40の各要素を格納すればよい。後述する通り、事前計算テーブル40は複数の要素からなるが、事前計算テーブル40の第1要素がメモリブロックの境界に一致して配置できる場合には、N個のメモリブロック群300,…,30N-1へ格納する。事前計算テーブル40の第1要素がメモリブロックの境界に一致して配置できない場合であり、N個のメモリブロック群300,…,30N-1では格納できない場合には、N+1個のメモリブロック群300,…,30Nへ格納する。 The table storage unit 5 stores the pre-calculation table 40 stored in the table storage unit 4 in the main memory 3 (step S5). At this time, each element of the pre-calculation table 40 is stored so as to fit in the memory block group 30 associated with the same cache set 20 as much as possible without depending on the reference value of the element to be stored. That is, the capacity of the pre-calculation table 40 as a minimum integer greater than or equal divided by volume of cache set 20 N, N + 1 or fewer memory blocks 30 0, ..., precomputed table 40 to 30 N-1 It is sufficient to store each element. As will be described later, the pre-calculation table 40 is composed of a plurality of elements. However, if the first element of the pre-calculation table 40 can be arranged so as to coincide with the boundary of the memory block, N memory block groups 30 0 ,. Store in 30 N-1 . A case where the first element of the pre-calculation table 40 can not be positioned aligned with the boundaries of the memory blocks, N number of memory blocks 30 0, ..., 30 in the case where N-1 In can not be stored in, N + 1 pieces of Store in the memory block group 30 0 ,..., 30 N.

図4を参照して、事前計算テーブル40をメインメモリ3へ格納する方法を説明する。事前計算テーブル40はθ(θ≧1)個のテーブル要素t0,…,tθ-1を含んでいる。テーブル格納部5は事前計算テーブル40を所定のサイズのブロックに等分割して、同じキャッシュセット番号に対応付けられたメモリブロック群20へ格納する。事前計算テーブル40の各要素t0,…,tθ-1をメインメモリ3へ効率的に格納するために、事前計算テーブル40を等分割するための要素tの個数はキャッシュライン200のサイズを事前計算テーブル40の要素tのサイズで除算した値に合わせるとよい。キャッシュライン200のサイズをBバイト、事前計算テーブルの要素tのサイズをLバイトとすれば、事前計算テーブル40を等分割したブロックに含まれる要素tの個数δはB/Lである。図4は、δ=4とした例である。要素t0,…,t3はメモリブロック300k,0、要素t4,…,t7はメモリブロック300k,1、要素t8,…,t11はメモリブロック300k,2のように、1つのメモリブロック300へは4つの要素tを格納している。 A method for storing the pre-calculation table 40 in the main memory 3 will be described with reference to FIG. The pre-calculation table 40 includes θ (θ ≧ 1) table elements t 0 ,..., T θ-1 . The table storage unit 5 equally divides the pre-calculation table 40 into blocks of a predetermined size and stores them in the memory block group 20 associated with the same cache set number. In order to efficiently store each element t 0 ,..., T θ-1 of the precalculation table 40 in the main memory 3, the number of elements t for equally dividing the precalculation table 40 is the size of the cache line 200. It is good to match the value divided by the size of the element t in the pre-calculation table 40. If the size of the cache line 200 is B bytes and the size of the element t of the pre-calculation table is L bytes, the number δ of elements t included in the block obtained by equally dividing the pre-calculation table 40 is B / L. FIG. 4 shows an example in which δ = 4. Element t 0, ..., t 3 is the memory block 300 k, 0, element t 4, ..., t 7 is the memory block 300 k, 1, element t 8, ..., t 11, as the memory block 300 k, 2 In one memory block 300, four elements t are stored.

また、事前計算テーブル40の各要素t0,…,tθ-1をメインメモリ3へ効率的に格納するために、事前計算テーブル40の第1要素t0はメモリブロックの境界に沿って配置するとよい。このとき、どのメモリブロックの境界の位置に配置するかは問わない。以降の説明では事前計算テーブル40の第1要素t0をメモリブロックの境界に沿って配置する場合を前提とする。メインメモリ3上で分散する方法は、以下のようにすればよい。すなわち、あるメモリブロック300k,i(0≦i<y)へBバイト分の事前計算テーブル40の要素tを格納したら、{(S-1)×B}/Lバイト分を飛ばして次のメモリブロック300k,i+1へ格納し、これをキャッシュメモリ2のウェイ数yだけ繰り返す。 In addition, in order to efficiently store each element t 0 ,..., T θ-1 of the precalculation table 40 in the main memory 3, the first element t 0 of the precalculation table 40 is arranged along the boundary of the memory block. Good. At this time, it does not matter which memory block is located at the boundary position. In the following description assumes the case of disposing along the first element t 0 precomputed table 40 at the boundary of memory blocks. A method of distributing on the main memory 3 may be as follows. That is, when the element t of the pre-calculation table 40 for B bytes is stored in a certain memory block 300 k, i (0 ≦ i <y), {(S-1) × B} / L bytes are skipped and the next The data is stored in the memory block 300 k, i + 1 and this is repeated for the number of ways y of the cache memory 2.

暗号アルゴリズムの実装方式によっては複数の事前計算テーブル40を使用する場合も考えられる。図5を参照して、複数の事前計算テーブル40をメインメモリ3へ格納する方法を説明する。この例では、2つの事前計算テーブル400,401をメインメモリ3へ格納するものとする。1つ目の事前計算テーブル400は上述の手順に従ってあるキャッシュセット200に対応するメモリブロック群300に分散して格納すればよい。続いて、2つ目の事前計算テーブル401をキャッシュセット200のすぐ隣のキャッシュセット201に対応するメモリブロック群301に分散して格納する。 Depending on the implementation method of the encryption algorithm, a plurality of pre-calculation tables 40 may be used. A method for storing a plurality of pre-calculation tables 40 in the main memory 3 will be described with reference to FIG. In this example, it is assumed that two pre-calculation tables 40 0 and 40 1 are stored in the main memory 3. The first pre-calculation table 40 0 may be distributed and stored in the memory block group 30 0 corresponding to cache set 20 0 in accordance with the above procedure. Subsequently, the second pre-calculation table 40 1 dispersed in the memory block group 30 1 immediately corresponding to the cache set 20 1 next to cache set 20 0 is stored.

図4、5では、1つの事前計算テーブル40は1つのキャッシュセット20に対応するメモリブロック群30に格納される例を説明したが、事前計算テーブル40全体のサイズがキャッシュセット20のサイズよりも大きい場合には、複数のキャッシュセット20に跨って1つの事前計算テーブル40を格納しても構わない。ただし、この場合には、できるだけ少ないメモリブロック群30に格納されるようにする。具体的には、事前計算テーブル40を格納するメモリブロック群の最大数をN+1とすると、Nは事前計算テーブル40の容量をキャッシュセット20の容量で除算した値以上の最小の整数である。上述の通り、事前計算テーブルの第1要素t0をメモリブロックの境界に沿って配置することができれば、N個のメモリブロック群30に格納することができる。事前計算テーブルの第1要素t0をメモリブロックの境界に配置することができない場合であり、N個のメモリブロック群30では格納できない場合には、N+1個のメモリブロック群30に格納すればよい。 4 and 5, the example in which one pre-calculation table 40 is stored in the memory block group 30 corresponding to one cache set 20 has been described. However, the size of the pre-calculation table 40 as a whole is larger than the size of the cache set 20. If it is larger, one pre-calculation table 40 may be stored across a plurality of cache sets 20. However, in this case, the data is stored in as few memory block groups 30 as possible. Specifically, when the maximum number of memory block groups storing the pre-calculation table 40 is N + 1, N is a minimum integer equal to or greater than a value obtained by dividing the capacity of the pre-calculation table 40 by the capacity of the cache set 20. . As described above, if the first element t 0 of the pre-calculation table can be arranged along the boundary of the memory block, it can be stored in the N memory block groups 30. When the first element t 0 of the pre-calculation table cannot be arranged at the boundary of the memory block and cannot be stored in the N memory block groups 30, the first element t 0 is stored in the N + 1 memory block groups 30. That's fine.

具体的な実装方法として、効率良く事前計算テーブル40の各要素t0,…,tθ-1をメインメモリ3に格納するために、事前計算テーブル40の第1要素t0はメインメモリ3上のメモリブロック300の境界に沿って配置するとよい。事前計算テーブル40の第1要素t0を格納するメモリブロック300の位置は問わない。メモリブロック群30に対して事前計算テーブル40の要素t0,…,tθ-1を格納する方法は2通り考えられる。 As a specific implementation, each element t 0 efficiently precomputed table 40, ..., to store t theta-1 to the main memory 3, the first element t 0 precomputed table 40 main memory 3 above It may be arranged along the boundary of the memory block 300. The position of the memory block 300 for storing the first element t 0 of the pre-calculation table 40 is not limited. There are two possible methods for storing the elements t 0 ,..., T θ−1 of the pre-calculation table 40 in the memory block group 30.

図6を参照して1番目の格納方法を説明する。図6において、一点鎖線で囲った部分は、キャッシュメモリ2およびメインメモリ3である。破線で囲った部分は、k番目のキャッシュセット20kと、そのキャッシュセット20kに対応するメモリブロック群30kである。太線で囲った部分は、キャッシュセット20kに含まれるキャッシュライン200それぞれの境界と、メモリブロック群30kに含まれる各メモリブロック300それぞれの境界を表している。まず、事前計算テーブル40の要素t0,…,tθ-1をδ個ずつに分割する。ここで、δはキャッシュライン200のサイズを要素tのサイズで除算した値(δ=B/L)である。最初のδ個の要素t0,…,tδ-1をメインメモリ3上の任意のメモリブロック300k,iの先頭位置からメモリブロックの境界まで横方向(もしくは行方向)に充填する。メモリブロック群30kに対応するキャッシュメモリ2の同一のキャッシュセット位置kにテーブル要素が格納されるようにメインメモリ3上で分散させるために、次のδ個の要素tδ,…,t2δ-1を次の列のメモリブロック300k,i+1に格納する。すべての要素t0,…,tθ-1がメインメモリ3へ格納されるまでこれを繰り返す。図6に示す通り、この格納方法により、事前計算テーブル40の第1要素t0から第δ要素tδ-1までのδ個の要素を1つのメモリブロック300k,iに格納する。その後、第δ+1要素tδから第2δ要素t2δ-1までのテーブル要素を、キャッシュメモリ2の同一のキャッシュセット位置kに格納するように、メインメモリ3上でS-1個のメモリブロック300を飛ばして次の列に格納する。これをキャッシュメモリ2上の1つのキャッシュセット位置がすべて埋まるまで、すなわちウェイの数yだけ繰り返すことによって、事前計算テーブル40のすべての要素t0,…,tθ-1をメインメモリ3に格納する。事前計算テーブル40のサイズ、キャッシュメモリ2のウェイ数yやキャッシュライン200のサイズLによっては、1つのキャッシュセット番号ですべてのテーブル要素t0,…,tθ-1を格納できない場合がある。その場合は複数列を利用して事前計算テーブル40の全ての要素t0,…,tθ-1を格納する。複数列を利用する場合は、最初に1列目すべてに要素tを格納し、次に2列目すべてに要素tを格納し、これを繰り返すことで、メインメモリ3上で1列ずつ要素tを格納してもよい。また、最初に複数列の1行目すべてに要素tを格納し、次に2行目すべてに要素tを格納し、これを繰り返すことで、メインメモリ3上で1行ずつ要素tを格納してもよい。 The first storage method will be described with reference to FIG. In FIG. 6, the portions surrounded by the alternate long and short dash line are the cache memory 2 and the main memory 3. A portion surrounded by a broken line is a kth cache set 20 k and a memory block group 30 k corresponding to the cache set 20 k . A portion surrounded by a thick line represents a boundary between each cache line 200 included in the cache set 20 k and a boundary between each memory block 300 included in the memory block group 30 k . First, the elements t 0 ,..., T θ-1 of the pre-calculation table 40 are divided into δ pieces. Here, δ is a value (δ = B / L) obtained by dividing the size of the cache line 200 by the size of the element t. The first δ elements t 0 ,..., T δ-1 are filled in the horizontal direction (or row direction) from the start position of an arbitrary memory block 300 k, i on the main memory 3 to the boundary of the memory block. In order to distribute the table elements on the main memory 3 so that the table elements are stored in the same cache set position k of the cache memory 2 corresponding to the memory block group 30 k , the following δ elements t δ ,. −1 is stored in the memory block 300 k, i + 1 in the next column. This is repeated until all elements t 0 ,..., T θ-1 are stored in the main memory 3. As shown in FIG. 6, by this storage method, δ elements from the first element t 0 to the δ element t δ−1 of the pre-calculation table 40 are stored in one memory block 300 k, i . Thereafter, S-1 memories are stored on the main memory 3 so that the table elements from the δ + 1 element t δ to the second δ element t 2δ-1 are stored in the same cache set position k of the cache memory 2. Block 300 is skipped and stored in the next column. By repeating this until one cache set position on the cache memory 2 is filled, that is, by the number of ways y, all elements t 0 ,..., T θ-1 of the pre-calculation table 40 are stored in the main memory 3. To do. Depending on the size of the pre-calculation table 40, the number of ways y of the cache memory 2 and the size L of the cache line 200, it may not be possible to store all the table elements t 0 ,. In that case, all the elements t 0 ,..., T θ-1 of the pre-calculation table 40 are stored using a plurality of columns. When using multiple columns, first store the element t in all the first column, then store the element t in all the second column, and repeat this to repeat the element t one column at a time on the main memory 3 May be stored. Also, element t is first stored in all the first rows of multiple columns, then element t is stored in all the second row, and by repeating this, element t is stored in the main memory 3 line by line. May be.

図7を参照して2番目の格納方法を説明する。図7において、一点鎖線、破線、太線は図6と同様の意味で用いている。まず、事前計算テーブル40の要素t0,…,tθ-1をy個ずつに分割する。上述の通り、yはキャッシュセットのウェイ数である。最初のy個の要素t0,…,ty-1をメインメモリ3上の任意のメモリブロック300k,iの先頭位置からメモリブロック300k,i+y-1まで縦方向(もしくは列方向)に充填する。メモリブロック群30kに対応するキャッシュメモリ2の同一のキャッシュセット位置kにテーブル要素が格納されるようにメインメモリ3上で分散させるために、次のy個の要素ty,…,t2y-1をメモリブロック300k,iから300k,i+y-1までの2番目の位置に格納する。すべての要素t0,…,tθ-1がメインメモリ3へ格納されるまでこれを繰り返す。図7に示す通り、この格納方法により、事前計算テーブル40の第1要素t0から第y要素のテーブル要素ty-1を1つのメモリブロック群30kに含まれるy個のメモリブロック300k,i,…,300k,i+y-1の先頭位置に格納する。その後、同じメモリブロック群30kのメモリブロック300k,i,…,300k,i+y-1の2番目の位置に格納する。これをキャッシュメモリ2上の1つのキャッシュセット位置がすべて埋まるまで、すなわちキャッシュライン200のサイズを要素tのサイズで除算した値δだけ繰り返すことによって、事前計算テーブル40のすべての要素をメインメモリ3に格納する。1つのキャッシュセット番号ですべてのテーブル要素t0,…,tθ-1を格納できない場合の処理は、1番目の格納方法と同様である。 The second storage method will be described with reference to FIG. In FIG. 7, the alternate long and short dash line, the broken line, and the thick line are used in the same meaning as in FIG. First, the elements t 0 ,..., T θ-1 of the pre-calculation table 40 are divided into y pieces. As described above, y is the number of ways of the cache set. The first y elements t 0 ,..., T y−1 are arranged in the vertical direction (or column direction) from the start position of an arbitrary memory block 300 k, i on the main memory 3 to the memory block 300 k, i + y−1. ). In order to distribute the table elements on the main memory 3 so that the table elements are stored in the same cache set position k of the cache memory 2 corresponding to the memory block group 30 k , the following y elements t y ,..., T 2y −1 is stored in the second position from memory block 300 k, i to 300 k, i + y−1 . This is repeated until all elements t 0 ,..., T θ-1 are stored in the main memory 3. As shown in FIG. 7, with this storage method, the first element t 0 to the y-th table element t y-1 of the pre-calculation table 40 are included in one memory block group 30 k and y memory blocks 300 k. , i ,..., 300 k, i + y−1 are stored at the head position. Thereafter, the data is stored in the second position of the memory blocks 300 k, i ,..., 300 k, i + y−1 of the same memory block group 30 k . By repeating this until one cache set position on the cache memory 2 is filled, that is, by a value δ obtained by dividing the size of the cache line 200 by the size of the element t, all elements of the pre-calculation table 40 are stored in the main memory 3. To store. The processing when all the table elements t 0 ,..., T θ-1 cannot be stored with one cache set number is the same as the first storage method.

図8を参照して、事前計算テーブルを用いた暗号アルゴリズムの具体的な演算処理方法を説明する。この例では、共通鍵暗号方式の一種であるブロック暗号の代表的なアルゴリズムの一つであるAES(Advanced Encryption Standard)暗号方式に適用した場合を説明する。ブロック暗号では複数ラウンドから構成される演算処理を実行する。図8に示すキャッシュメモリ2は、キャッシュラインのサイズを64バイト(B=64)、ウェイ数を8(y=8)、キャッシュセット数を64(S=64)とする。事前計算テーブル40は、要素サイズが4バイト(L=4)、要素数が256個(θ=256)の事前計算テーブルを4種類使用する。したがって、1つのキャッシュラインに格納される事前計算テーブルの要素の数δは16となる(δ=B÷L=64÷4=16)。ここでは、非特許文献3に示したOpenSSLの実装を基本とした高速化手法を適用した実装方法を利用するものとする。   With reference to FIG. 8, a specific calculation processing method of the encryption algorithm using the pre-calculation table will be described. In this example, a case will be described in which the present invention is applied to an AES (Advanced Encryption Standard) encryption method, which is one of typical algorithms of block encryption, which is a kind of common key encryption method. In block ciphers, arithmetic processing composed of multiple rounds is executed. The cache memory 2 shown in FIG. 8 has a cache line size of 64 bytes (B = 64), a way number of 8 (y = 8), and a cache set number of 64 (S = 64). The precalculation table 40 uses four types of precalculation tables having an element size of 4 bytes (L = 4) and 256 elements (θ = 256). Therefore, the number of elements δ of the pre-calculation table stored in one cache line is 16 (δ = B ÷ L = 64 ÷ 4 = 16). Here, it is assumed that an implementation method using a speed-up method based on the implementation of OpenSSL shown in Non-Patent Document 3 is used.

4種類の事前計算テーブル400,401,402,403をメインメモリ3上に分散して格納するために、メインメモリ3上にキャッシュメモリ2と同サイズの領域を事前計算テーブル領域として確保する。この領域の容量は32,768バイト(64バイト×8ウェイ×64セット)である。この領域には、事前計算テーブルの要素tが8,192個(32,768バイト÷4バイト)格納できる。T[・]は事前計算テーブル領域の・番目の位置を表す。 In order to store the four types of pre-calculation tables 40 0 , 40 1 , 40 2 , and 40 3 in a distributed manner on the main memory 3, an area of the same size as the cache memory 2 is used as a pre-calculation table area on the main memory 3. Secure. The capacity of this area is 32,768 bytes (64 bytes x 8 ways x 64 sets). In this area, 8,192 elements (32,768 bytes ÷ 4 bytes) of the pre-calculation table can be stored. T [•] represents the • th position in the pre-calculation table area.

4種類の事前計算テーブル400〜403の格納方法を以下に示す。事前計算テーブルの要素サイズが4バイトであり、合計256個の要素があるため、1つの事前計算テーブルについて1,024バイトのキャッシュメモリ領域が必要である。キャッシュメモリ2のウェイ数が8、キャッシュラインのサイズが64バイトであるため、1つのキャッシュセットに512バイトのデータを格納することが可能である。そのため、事前計算テーブル40h(0≦h≦3)のすべての要素th,0,…,th,255を格納するためには、2つのキャッシュセット20が必要である。1つのキャッシュライン200には16個(64バイト÷4バイト)の要素が充填できるため、事前計算テーブル40hの要素32個を連続してメインメモリ3上に配置する。より具体的には、事前計算テーブル400の先頭から32個の要素(t0,0,…,t0,31)を事前計算テーブル領域の0番目から31番目(T[0]〜T[31])に配置する。同様に、事前計算テーブル401の先頭から32個の要素(t1,0,…,t1,31)を事前計算テーブル領域の32番目から63番目(T[32]〜T[63])に、事前計算テーブル402の先頭から32個の要素(t2,0,…,t2,31)を事前計算テーブル領域の64番目から95番目(T[64]〜T[95])に、事前計算テーブル403の先頭から32個の要素(t3,0,…,t3,31)を事前計算テーブル領域の96番目から127番目(T[96]〜T[127])に配置する。次に、事前計算テーブル400の32番目から63番目の32個の要素(t0,32,…,t0,63)をT[127]から3,584バイト(要素896個分)空けた位置、すなわち事前計算テーブル領域の1,024番目から1,055番目(T[1024]〜T[1055])に配置する。同様に、事前計算テーブル401〜403の32番目から63番目の32個の要素(t1,32,…,t1,63,t2,32,…,t2,63,t3,32,…,t3,63)を事前計算テーブル領域の1,056番目から1,087番目、1,088番目から1,119番目、1,120番目から1,151番目(T[1056]〜T[1087],T[1088]〜T[1119],T[1020]〜T[1151])に配置する。このように、事前計算テーブル400の要素を32個ずつT[1024×i](i=0,1,2,…,7)に配置し、事前計算テーブル400の32個の要素に続けて、事前計算テーブル401〜403それぞれの32個の要素(計96個)を配置する。これを4種類の事前計算テーブル400〜403の256個の要素(計1,024個)がすべて格納されるまで繰り返す。 4 kinds of storage methods precomputed table 40 0-40 3 below. Since the element size of the precalculation table is 4 bytes and there are a total of 256 elements, a cache memory area of 1,024 bytes is required for one precalculation table. Since the number of ways of the cache memory 2 is 8 and the size of the cache line is 64 bytes, it is possible to store 512 bytes of data in one cache set. Therefore, in order to store all the elements t h, 0 ,..., T h, 255 of the pre-calculation table 40 h (0 ≦ h ≦ 3), two cache sets 20 are necessary. Since one cache line 200 can be filled with 16 elements (64 bytes / 4 bytes), 32 elements of the pre-calculation table 40 h are continuously arranged on the main memory 3. More specifically, pre-computed tables 40 0 from the head 32 of the elements of (t 0,0, ..., t 0,31 ) 31 th from 0th precomputed table area (T [0] ~T [ 31]). Similarly, the 32 elements (t 1,0 ,..., T 1,31 ) from the top of the pre-calculation table 40 1 are replaced with the 32nd to 63rd elements (T [32] to T [63]) in the pre-calculation table area. In addition, 32 elements (t 2,0 ,..., T 2,31 ) from the top of the pre-calculation table 40 2 are changed from the 64th to the 95th (T [64] to T [95]) in the pre-calculation table area. , 32 elements (t 3,0 ,..., T 3,31 ) from the top of the precalculation table 40 3 are arranged from the 96th to 127th (T [96] to T [127]) in the precalculation table area. To do. Next, pre-calculation table 40 0 32 th to 63 th 32 elements (t 0,32, ..., t 0,63 ) spaced 3,584 bytes from T [127] (896 pieces of element) position, That is, it is arranged in the 1,024th to 1,055th (T [1024] to T [1055]) of the pre-calculation table area. Similarly, thirty-two to thirty-sixth 32 elements (t 1,32 ,..., T 1,63 , t 2,32 ,..., T 2,63 , t 3, of the precalculation tables 40 1 to 40 3 32 , ..., t 3,63 ) in the precalculation table area from 1,056 to 1,087, from 1,088 to 1,119, from 1,120 to 1,151 (T [1056] to T [1087], T [1088] to T [ 1119], T [1020] to T [1151]). Thus, precomputed table elements 40 0 by 32 T [1024 × i] (i = 0,1,2, ..., 7) arranged, following the 32 elements of the pre-calculation table 40 0 Thus, 32 elements (96 in total) of each of the pre-calculation tables 40 1 to 40 3 are arranged. This four pre-calculation table 40 0-40 3 256 elements (total 1,024) is repeated until all stored.

このようにメインメモリ3上に格納することにより、事前計算テーブル400の256個の要素t0,0,…,t0,255はキャッシュセット番号が0,1のキャッシュメモリ領域に、事前計算テーブル401の256個の要素t1,0,…,t1,255はキャッシュセット番号が2,3のキャッシュメモリ領域に、事前計算テーブル402の256個の要素t2,0,…,t2,255はキャッシュセット番号が4,5のキャッシュメモリ領域に、事前計算テーブル403の256個の要素t3,0,…,t3,255はキャッシュセット番号が6,7のキャッシュメモリ領域に格納されることとなる。このように、キャッシュメモリ2上に事前計算テーブル400〜403を格納する際に少ないキャッシュセット数を利用するようにメインメモリ3上に事前計算テーブル400〜403を分散して格納することで、キャッシュ・タイミング攻撃が困難となる。 By storing in the main memory 3 in this way, the 256 elements t 0,0 ,..., T 0,255 of the pre-calculation table 40 0 are stored in the cache memory area with the cache set number 0,1 in the pre-calculation table 40. 1 of 256 elements t 1, 0, ..., t 1,255 in the cache memory region of the cache set number is 2, 3, precomputed table 40 2 256 elements t 2,0, ..., t 2,255 cache a cache memory area of the set number is 4,5, precomputed table 40 3 256 elements t 3,0, ..., t 3,255 becomes the cache set number is stored in the cache memory area of 6,7 . Thus, distributed and stored precomputed table 40 0-40 3 on the main memory 3 to take advantage of the small number of cache set when storing precomputed table 40 0-40 3 in the cache memory 2 This makes cache timing attacks difficult.

上記の事前計算テーブル領域T[8192]を利用してAES暗号方式の暗号演算を行う場合、事前計算テーブルの入力値yは以下の通りとなる。OpenSSLでの実装のオリジナルの入力値をx、xを事前計算テーブルの要素を連続して格納する数32で割った商をx_s、xを同様に32で割った時の余りをx_aとすると、事前計算テーブル400〜403に関する入力値z0,z1,z2,z3は以下の式(1)(2)(3)(4)により求めることができる。
z0=x_s×1024+x_a …(1)
z1=x_s×1024+x_a+32 …(2)
z2=x_s×1024+x_a+64 …(3)
z3=x_s×1024+x_a+96 …(4)
When performing AES encryption cryptographic operations using the above-mentioned precalculation table area T [8192], the input value y of the precalculation table is as follows. If the original input value of the implementation in OpenSSL is x, x is the quotient divided by the number 32 that stores the elements of the precomputed table continuously, x_s, and the remainder when x is similarly divided by 32 is x_a, precomputed table 40 0-40 3 for the input value z0, z1, z2, z3 can be obtained by the following equation (1) (2) (3) (4).
z0 = x_s × 1024 + x_a (1)
z1 = x_s × 1024 + x_a + 32 (2)
z2 = x_s × 1024 + x_a + 64 (3)
z3 = x_s × 1024 + x_a + 96 (4)

ここで、式(1)〜(4)における1024はキャッシュラインのサイズ64バイト×キャッシュセットの数64を事前計算テーブルの要素サイズ4バイトで割った数である(64×64÷4=1024)。式(2)〜(4)では1つの事前計算テーブルにつき32個分(4バイト×32個)の要素をキャッシュセット方向に配置するため式(2)では32を足している。式(3)(4)も同様である。   Here, 1024 in formulas (1) to (4) is the number obtained by dividing the size of the cache line by 64 bytes x the number of cache sets of 64 by the element size of the pre-calculation table by 4 bytes (64 x 64 ÷ 4 = 1024) . In Expressions (2) to (4), 32 elements (4 bytes × 32 elements) per one pre-calculation table are arranged in the cache set direction, so 32 is added in Expression (2). The same applies to equations (3) and (4).

AES暗号方式を利用して暗号化を行う時には、暗号アルゴリズムのオリジナルの入力値xを4種類の事前計算テーブル400〜403を参照して、式(1)〜(4)によりz0〜z3のいずれかに変換し、z0〜z3のいずれかの値をT[8192]の入力値として演算を行う。 When encryption is performed using the AES encryption method, the original input value x of the encryption algorithm is referred to the four types of pre-calculation tables 40 0 to 40 3, and z 0 to z 3 according to equations (1) to (4). And any one of z0 to z3 is used as an input value for T [8192].

テーブル格納部5により事前計算テーブル40がメインメモリ3に格納された後、入力部6に演算対象の値mが入力される(ステップS6)。演算対象の値mは暗号アルゴリズムへ入力された平文値もしくは暗号アルゴリズムを実行する過程で生成される中間値である。入力値mは演算部8へ入力される。演算部8は入力値mから事前計算テーブル40の参照値jを求める。入力値mから参照値jを求める方法は、適用する暗号アルゴリズムにより規定される。そして、演算部8は、値jを参照値とする事前計算テーブル40の要素tjを求める。 After the pre-calculation table 40 is stored in the main memory 3 by the table storage unit 5, the value m to be calculated is input to the input unit 6 (step S6). The value m to be calculated is a plaintext value input to the encryption algorithm or an intermediate value generated in the process of executing the encryption algorithm. The input value m is input to the calculation unit 8. The calculation unit 8 obtains the reference value j of the pre-calculation table 40 from the input value m. A method for obtaining the reference value j from the input value m is defined by the encryption algorithm to be applied. Then, the calculation unit 8 obtains an element t j of the pre-calculation table 40 using the value j as a reference value.

キャッシュ制御部7は演算部8が参照しようとする事前計算テーブル40の要素tjがキャッシュメモリ2上に存在するか否かを確認する(ステップS71)。事前計算テーブル40の所望の要素tjがキャッシュメモリ2上に存在しない場合には、メインメモリ3のメモリブロック群30に格納された事前計算テーブル40から所望の要素tjを読み込み、その要素tjが存在したメモリブロック300に対応するキャッシュライン200へその要素tjを格納する(ステップS72)。 The cache control unit 7 checks whether or not the element t j of the pre-calculation table 40 that the calculation unit 8 is to refer to exists in the cache memory 2 (step S71). When the desired element t j of the pre-calculation table 40 does not exist in the cache memory 2, the desired element t j is read from the pre-calculation table 40 stored in the memory block group 30 of the main memory 3, and the element t j The element t j is stored in the cache line 200 corresponding to the memory block 300 in which j exists (step S72).

演算部8は、キャッシュメモリ2上に存在する事前計算テーブル40の所望の要素tjを参照し、値jに対して上述の変換fを実行した変換結果f(j)を求める(ステップS8)。求められた変換結果f(j)は出力部9を介して出力される(ステップS9)。 The computing unit 8 refers to the desired element t j of the pre-calculation table 40 existing on the cache memory 2, and obtains a conversion result f (j) obtained by executing the above-described conversion f on the value j (step S8). . The obtained conversion result f (j) is output via the output unit 9 (step S9).

<効果>
上記のように、実施形態の暗号演算装置では、秘密情報に関する値を参照値とする事前計算テーブルの各要素を、その参照値に関わらず、キャシュメモリ上でできるだけ同じキャッシュセット位置に格納されるようにメインメモリ上に配置する。このように構成することで、キャッシュ・タイミング攻撃を行うために暗号演算時間に関するタイミング情報が取得されたとしても解析を行うために必要とされる十分な情報を得られない。したがって、キャッシュ・タイミング攻撃に対して安全に暗号演算を行うことができる。
<Effect>
As described above, in the cryptographic operation device according to the embodiment, each element of the pre-calculation table that uses a value related to secret information as a reference value is stored in the cache memory as much as possible on the cache memory regardless of the reference value. Is arranged on the main memory. With this configuration, even if timing information related to the cryptographic operation time is acquired in order to perform a cache timing attack, sufficient information necessary for performing analysis cannot be obtained. Therefore, it is possible to perform cryptographic operations safely against a cache timing attack.

また、従来のキャッシュ・タイミング攻撃に対する対策のような事前計算テーブルの要素サイズに対する制約がないため、事前計算テーブルの要素サイズを変更することなく適用することが可能である。これにより、SSL/TLS等で従来から利用されている一般的な高速化手法を引き続き使用することができる。これにより暗号演算速度の低下を招くことなく、かつ容易に実装することが可能である。   In addition, since there is no restriction on the element size of the pre-calculation table like the countermeasure against the conventional cache timing attack, it can be applied without changing the element size of the pre-calculation table. As a result, it is possible to continue to use a general speed-up method that has been conventionally used for SSL / TLS. As a result, the cryptographic operation speed can be easily implemented without causing a decrease in the cryptographic operation speed.

なお、この発明の暗号演算技術に対して、既存の他のキャッシュ・タイミング攻撃への対策方法を適用することも可能である。   It is also possible to apply another existing countermeasure method against a cache timing attack to the cryptographic operation technique of the present invention.

[実験結果]
この発明の効果を確認するために、実機を用いて暗号演算に対してキャッシュ・タイミング攻撃を実行する実験を行った。実験ではキャッシュ・タイミング攻撃に対する対策が未実装である従来の暗号演算装置と、実施形態の暗号演算装置とで、AES暗号方式の暗号演算をそれぞれ実行した。実験を行った装置は中央演算処理装置として“Intel(登録商標) Core Soloプロセッサ”を搭載している装置を使用した。“Intel(登録商標) Core Soloプロセッサ”は8ウェイセットアソシアティブ方式を採用したキャッシュメモリを搭載している中央演算処理装置である。この環境においてキャッシュ・タイミング攻撃の一形態であるAccess-Driven Cache Attackを実行した結果を比較した。
[Experimental result]
In order to confirm the effect of the present invention, an experiment was performed in which a cache timing attack was performed on cryptographic operations using a real machine. In the experiment, AES cryptographic cryptographic operations were executed by a conventional cryptographic operation device that did not implement a countermeasure against a cache timing attack and the cryptographic operation device of the embodiment. The apparatus used for the experiment was an apparatus equipped with an “Intel (registered trademark) Core Solo processor” as a central processing unit. "Intel (registered trademark) Core Solo processor" is a central processing unit equipped with a cache memory that employs an 8-way set associative method. In this environment, we compared the results of executing Access-Driven Cache Attack, which is a form of cache timing attack.

この実験ではAccess-Driven Cache Attackで用いられているPrime+Probe法という計測方法を用いて時間計測を行った。Prime+Probe法では、暗号演算の実行前に、キャッシュメモリのサイズと同程度のサイズであらかじめ確保したメインメモリ上の領域の値をメモリブロックごとに読み出し、キャッシュメモリの全領域をそれらの値ですべて埋める。その後、暗号演算を実行し、再び同じメインメモリ上の領域の値を読み出し、その読み出しにかかる時間を計測する。Access-Driven Cache Attackでは、図9、10に示すように計測時間をパターン図で表現し、秘密鍵を1バイトずつ導出する。図9、10では、縦軸を暗号演算に入力した平文の先頭1バイトである平文値(Plaintext(Pt[0]))、横軸をキャッシュセット位置(Cache set、最大64セット)として、計測時間を表している。実験では様々な平文を入力として102,400回の計測を行なった。図9,10では平文値ごとに平均化した計測時間を更に正規化した値を表している。各マスの濃淡は読み込みの応答速度を表しており、図右端に示す凡例の通り、色が濃いほど応答速度が早いことを表している。従って、グラフの各マスはある平文値に対してあるキャッシュセット位置に対応するメインメモリ上の値を読み込んだ際の応答速度を表している。暗号演算の実行前に、あらかじめ確保したメインメモリ上の領域の値を読み込み、キャッシュメモリの全領域をそれらの値で埋めることを行なっているため、暗号演算により変更されなかったキャッシュセット位置に属するキャッシュライン上に格納されている値はキャッシュメモリから読み込まれるため応答速度は早くなる。Access-Driven Cache Attackではこの動作を利用して暗号演算に用いられたデータの位置を推測している。このデータ位置は事前計算テーブルの参照値に相当している。事前計算テーブルを用いたAES暗号方式の実装では、入力された平文または演算の中間値と秘密鍵から計算されるラウンド鍵との排他的論理和を取った値を参照値として事前計算テーブルを参照する。したがって、平文値と事前計算テーブルの参照値が既知であれば、それらの排他的論理和を計算することによりラウンド鍵が計算できる。これにより攻撃者は秘密鍵を推測することが可能となる。   In this experiment, the time was measured using the measurement method called Prime + Probe method used in Access-Driven Cache Attack. In the Prime + Probe method, before executing cryptographic operations, the value of the area on the main memory reserved in advance with the same size as the size of the cache memory is read for each memory block, and the entire area of the cache memory is read with those values. Fill everything. Thereafter, the cryptographic operation is executed, the value of the area on the same main memory is read again, and the time required for the reading is measured. In the Access-Driven Cache Attack, as shown in FIGS. 9 and 10, the measurement time is represented by a pattern diagram, and the secret key is derived byte by byte. 9 and 10, the vertical axis is the plaintext value (Plaintext (Pt [0])) that is the first byte of plaintext input to the cryptographic operation, and the horizontal axis is the cache set position (Cache set, maximum 64 sets). Represents time. In the experiment, we measured 102,400 times using various plaintexts as input. 9 and 10 represent values obtained by further normalizing the measurement time averaged for each plaintext value. The shade of each square represents the response speed of reading, and as the legend shown at the right end of the figure, the darker the color, the faster the response speed. Accordingly, each square of the graph represents the response speed when a value on the main memory corresponding to a certain cache set position is read with respect to a certain plaintext value. Before executing the cryptographic operation, the value of the area in the main memory reserved in advance is read and the entire area of the cache memory is filled with these values, so it belongs to the cache set position that has not been changed by the cryptographic operation. Since the value stored on the cache line is read from the cache memory, the response speed is increased. Access-Driven Cache Attack uses this operation to estimate the location of data used for cryptographic operations. This data position corresponds to a reference value in the pre-calculation table. In the implementation of the AES encryption method using the pre-calculation table, refer to the pre-calculation table using the value obtained by exclusive ORing the input plaintext or the intermediate value of the operation and the round key calculated from the secret key as a reference value. To do. Therefore, if the plaintext value and the reference value of the pre-calculation table are known, the round key can be calculated by calculating the exclusive OR of them. This allows the attacker to guess the secret key.

図9は、キャッシュ・タイミング攻撃に対する対策が未実装の暗号演算装置によりAES暗号方式の暗号演算に対してAccess-Driven Cache Attackを実行した結果である。図9ではキャッシュセット番号が33から43までの位置に応答速度が長いことを表す白い部分が見られる。攻撃者はこのタイミング情報に基づいて暗号演算に用いられた秘密情報を推測することができる。   FIG. 9 shows the result of executing an Access-Driven Cache Attack on the cryptographic operation of the AES cryptographic method by a cryptographic operation device that does not implement a countermeasure against the cache timing attack. In FIG. 9, a white portion indicating that the response speed is long can be seen at positions where the cache set numbers are 33 to 43. The attacker can guess the secret information used for the cryptographic operation based on this timing information.

図10は、実施形態の暗号演算装置によりAES暗号方式の暗号演算に対してAccess-Driven Cache Attackを実行した結果である。図10では全体の応答速度がほぼ均等になっており、際立った偏りが認められない。攻撃者はキャッシュ・タイミング攻撃に必要となる十分なタイミング情報を得ることができないため、暗号演算に用いられた秘密情報を推測することはできない。   FIG. 10 shows a result of executing an Access-Driven Cache Attack on the AES encryption method encryption operation by the encryption operation device of the embodiment. In FIG. 10, the overall response speed is almost uniform, and no noticeable bias is observed. Since the attacker cannot obtain sufficient timing information necessary for the cache timing attack, the attacker cannot guess the secret information used for the cryptographic operation.

以上の実験結果より、実施形態の暗号演算装置にはキャッシュ・タイミング攻撃に対する耐性を高める効果があることが示された。   From the above experimental results, it has been shown that the cryptographic operation device according to the embodiment has an effect of improving the resistance to the cache timing attack.

[プログラム、記録媒体]
この発明は上述の実施形態に限定されるものではなく、この発明の趣旨を逸脱しない範囲で適宜変更が可能であることはいうまでもない。上記実施形態において説明した各種の処理は、記載の順に従って時系列に実行されるのみならず、処理を実行する装置の処理能力あるいは必要に応じて並列的にあるいは個別に実行されてもよい。
[Program, recording medium]
The present invention is not limited to the above-described embodiment, and it goes without saying that modifications can be made as appropriate without departing from the spirit of the present invention. The various processes described in the above embodiment may be executed not only in time series according to the order of description, but also in parallel or individually as required by the processing capability of the apparatus that executes the processes or as necessary.

また、上記実施形態で説明した各装置における各種の処理機能をコンピュータによって実現する場合、各装置が有すべき機能の処理内容はプログラムによって記述される。そして、このプログラムをコンピュータで実行することにより、上記各装置における各種の処理機能がコンピュータ上で実現される。   When various processing functions in each device described in the above embodiment are realized by a computer, the processing contents of the functions that each device should have are described by a program. Then, by executing this program on a computer, various processing functions in each of the above devices are realized on the computer.

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

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

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

また、この形態では、コンピュータ上で所定のプログラムを実行させることにより、本装置を構成することとしたが、これらの処理内容の少なくとも一部をハードウェア的に実現することとしてもよい。   In this embodiment, the present apparatus is configured by executing a predetermined program on a computer. However, at least a part of these processing contents may be realized by hardware.

1 暗号演算装置
2 キャッシュメモリ
3 メインメモリ
4 テーブル記憶部
5 テーブル格納部
6 入力部
7 キャッシュ制御部
8 演算部
9 出力部
20 キャッシュセット
30 メモリブロック群
40 事前計算テーブル
200 キャッシュライン
300 メモリブロック
DESCRIPTION OF SYMBOLS 1 Cryptographic operation apparatus 2 Cache memory 3 Main memory 4 Table storage part 5 Table storage part 6 Input part 7 Cache control part 8 Operation part 9 Output part 20 Cache set 30 Memory block group 40 Precalculation table 200 Cache line 300 Memory block

Claims (8)

複数のキャッシュラインからなるキャッシュセットを複数含むキャッシュメモリと、
前記キャッシュセットそれぞれに対応する複数のメモリブロック群を含むメインメモリと、
複数の相異なる参照値と当該参照値それぞれに対して任意の変換を実行した変換結果との組み合わせを要素とする事前計算テーブルを記憶するテーブル記憶部と、
Nを前記事前計算テーブルの容量を前記キャッシュセットの容量で除算した値以上の最小の整数として、前記テーブル記憶部に記憶された前記事前計算テーブルを読み込みN+1個以下のメモリブロック群に格納するテーブル格納部と、
前記事前計算テーブルの所望の要素が前記キャッシュメモリに存在しなければ、当該要素を前記メモリブロック群から読み込み当該メモリブロック群に対応する前記キャッシュセットに格納するキャッシュ制御部と、
任意の値が入力されると当該値から求めた参照値により前記事前計算テーブルの要素を参照して前記変換結果を求める演算部と、
を有し、
前記事前計算テーブルの容量は前記キャッシュセットの容量よりも大きいことを特徴とする暗号演算装置。
A cache memory including a plurality of cache sets each including a plurality of cache lines; and
A main memory including a plurality of memory block groups corresponding to each of the cache sets;
A table storage unit for storing a pre-calculation table having a combination of a plurality of different reference values and a conversion result obtained by performing arbitrary conversion on each of the reference values;
N is a minimum integer greater than or equal to a value obtained by dividing the capacity of the pre-calculation table by the capacity of the cache set, and the pre-calculation table stored in the table storage unit is read and N + 1 or less memory block groups a table storage unit that store the,
If a desired element of the pre-calculation table does not exist in the cache memory, a cache control unit that reads the element from the memory block group and stores it in the cache set corresponding to the memory block group;
An arithmetic unit that obtains the conversion result by referring to an element of the pre-calculation table by a reference value obtained from the value when an arbitrary value is input;
I have a,
The cryptographic operation apparatus characterized in that a capacity of the pre-calculation table is larger than a capacity of the cache set .
請求項1に記載の暗号演算装置であって、
前記事前計算テーブルの要素のサイズが前記キャッシュセットの容量の約数である
ことを特徴とする暗号演算装置。
The cryptographic operation device according to claim 1,
The cryptographic operation device, wherein a size of an element of the pre-calculation table is a divisor of a capacity of the cache set.
請求項1または2に記載の暗号演算装置であって、
前記テーブル記憶部は、複数の前記事前計算テーブルを記憶し、
前記テーブル格納部は、複数の前記事前計算テーブルそれぞれを相異なる前記キャッシュセットに対応する前記メモリブロック群に格納する
ことを特徴とする暗号演算装置。
The cryptographic operation device according to claim 1 or 2,
The table storage unit stores a plurality of the pre-calculation tables,
The table storage unit stores each of the plurality of pre-calculation tables in the memory block group corresponding to the different cache sets.
請求項1から3のいずれかに記載の暗号演算装置であって、
前記テーブル格納部は、2個の前記キャッシュセットに対応する前記メモリブロック群に前記事前計算テーブルを格納する
ことを特徴とする暗号演算装置。
A cryptographic operation device according to any one of claims 1 to 3,
The cryptographic operation device, wherein the table storage unit stores the pre-calculation table in the memory block group corresponding to two cache sets.
請求項1から4のいずれかに記載の暗号演算装置であって、
前記変換は、任意の暗号方式を構成するいずれかのアルゴリズムで用いられる
ことを特徴とする暗号演算装置。
A cryptographic operation device according to any one of claims 1 to 4,
The conversion is used in any algorithm that constitutes an arbitrary encryption method.
請求項5に記載の暗号演算装置であって、
前記暗号方式は、AES暗号方式である
ことを特徴とする暗号演算装置。
The cryptographic operation device according to claim 5,
The cryptographic operation device is characterized in that the encryption method is an AES encryption method.
キャッシュメモリは、複数のキャッシュラインからなるキャッシュセットを複数含んでおり、
メインメモリは、前記キャッシュセットそれぞれに対応する複数のメモリブロック群を含んでおり、
テーブル記憶部に、複数の相異なる参照値と当該参照値それぞれに対して任意の変換を実行した変換結果との組み合わせを要素とする事前計算テーブルが記憶されており、
Nを前記事前計算テーブルの容量を前記キャッシュセットの容量で除算した値以上の最小の整数として、前記テーブル記憶部に記憶された前記事前計算テーブルを読み込みN+1個以下のメモリブロック群に配置するテーブル格納ステップと、
キャッシュ制御部が、前記事前計算テーブルの所望の要素が前記キャッシュメモリに存在しなければ、当該要素を前記メモリブロック群から読み込み当該メモリブロック群に対応する前記キャッシュセットに格納するキャッシュ制御ステップと、
演算部が、任意の値が入力されると当該値から求めた参照値により前記事前計算テーブルの要素を参照して前記変換結果を求める演算ステップと、
を含み、
前記事前計算テーブルの容量は前記キャッシュセットの容量よりも大きいことを特徴とする暗号演算方法。
The cache memory includes multiple cache sets consisting of multiple cache lines,
The main memory includes a plurality of memory block groups corresponding to each of the cache sets,
In the table storage unit, a pre-calculation table having a combination of a plurality of different reference values and a conversion result obtained by performing arbitrary conversion on each of the reference values as an element is stored,
N is a minimum integer greater than or equal to a value obtained by dividing the capacity of the pre-calculation table by the capacity of the cache set, and the pre-calculation table stored in the table storage unit is read and N + 1 or less memory block groups a table storing step of placement in,
A cache control step in which a cache control unit reads the element from the memory block group and stores it in the cache set corresponding to the memory block group if a desired element of the pre-calculation table does not exist in the cache memory; ,
When the arithmetic unit receives an arbitrary value, an arithmetic step of obtaining the conversion result by referring to an element of the pre-calculation table with a reference value obtained from the value;
Only including,
The cryptographic calculation method according to claim 1, wherein a capacity of the pre-calculation table is larger than a capacity of the cache set .
請求項1から6のいずれかに記載の暗号演算装置としてコンピュータを機能させるためのプログラム。   A program for causing a computer to function as the cryptographic operation device according to any one of claims 1 to 6.
JP2013037123A 2013-02-27 2013-02-27 Cryptographic operation apparatus, cryptographic operation method, and program Active JP5840160B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013037123A JP5840160B2 (en) 2013-02-27 2013-02-27 Cryptographic operation apparatus, cryptographic operation method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013037123A JP5840160B2 (en) 2013-02-27 2013-02-27 Cryptographic operation apparatus, cryptographic operation method, and program

Publications (2)

Publication Number Publication Date
JP2014165813A JP2014165813A (en) 2014-09-08
JP5840160B2 true JP5840160B2 (en) 2016-01-06

Family

ID=51616015

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013037123A Active JP5840160B2 (en) 2013-02-27 2013-02-27 Cryptographic operation apparatus, cryptographic operation method, and program

Country Status (1)

Country Link
JP (1) JP5840160B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11366766B2 (en) 2017-09-28 2022-06-21 Samsung Electronics Co., Ltd. Electronic device and control method thereof

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE112018007468T5 (en) * 2018-05-15 2021-01-21 Mitsubishi Electric Corporation Secret Search Facility and Secret Search Procedure

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11366766B2 (en) 2017-09-28 2022-06-21 Samsung Electronics Co., Ltd. Electronic device and control method thereof

Also Published As

Publication number Publication date
JP2014165813A (en) 2014-09-08

Similar Documents

Publication Publication Date Title
Pereida García et al. Make sure DSA signing exponentiations really are constant-time
CN107294698B (en) The full homomorphic cryptography method that single ciphertext homomorphism calculates
Yarom et al. Recovering OpenSSL ECDSA nonces using the FLUSH+ RELOAD cache side-channel attack
Mirzaei et al. A new image encryption method: parallel sub-image encryption with hyper chaos
Lawson Side-channel attacks on cryptographic software
US9590807B2 (en) Identity based public key cryptosystem
US10594471B2 (en) Multiplicative blinding for cryptographic operations
CA2442456C (en) Data encryption system and method
US11171773B2 (en) Client-server computer system
Ashokkumar et al. Highly efficient algorithms for AES key retrieval in cache access attacks
JP6770075B2 (en) Encrypted message search method, message sending / receiving system, terminal, program
WO2012041942A1 (en) Protecting modular exponentiation in cryptographic operations
CN108011706A (en) Data processing equipment and the method for encryption for data
CN108985102A (en) Data integrity verification method, device, system and storage medium
CN104463020B (en) The method of memory data integrity protection
JP5840160B2 (en) Cryptographic operation apparatus, cryptographic operation method, and program
Liu et al. Image Encryption Technology Based on Fractional Two‐Dimensional Triangle Function Combination Discrete Chaotic Map Coupled with Menezes‐Vanstone Elliptic Curve Cryptosystem
US20190372757A1 (en) Generating a pseudorandom number based on a portion of shares used in a cryptographic operation
JP7315030B2 (en) Electronic watermark embedding device, electronic watermark extraction device, electronic watermark embedding method, electronic watermark extraction method, and program
Banescu Cache timing attacks
CN102394747B (en) Method for rapidly embedding plaintext on one point of elliptic curve
Saraswat et al. Remote cache-timing attacks against aes
US11146397B2 (en) Encoding abelian variety-based ciphertext with metadata
Atici et al. Remote cache-timing attack without learning phase
CN112913184B (en) Computing key rotation periods for block cipher based encryption scheme systems and methods

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150114

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150826

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150915

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151016

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151110

R150 Certificate of patent or registration of utility model

Ref document number: 5840160

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150