JP3490365B2 - Replacement calculation device and its program recording medium - Google Patents

Replacement calculation device and its program recording medium

Info

Publication number
JP3490365B2
JP3490365B2 JP2000000644A JP2000000644A JP3490365B2 JP 3490365 B2 JP3490365 B2 JP 3490365B2 JP 2000000644 A JP2000000644 A JP 2000000644A JP 2000000644 A JP2000000644 A JP 2000000644A JP 3490365 B2 JP3490365 B2 JP 3490365B2
Authority
JP
Japan
Prior art keywords
permutation
matrix
data
memory
replacement data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2000000644A
Other languages
Japanese (ja)
Other versions
JP2001194994A (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 JP2000000644A priority Critical patent/JP3490365B2/en
Publication of JP2001194994A publication Critical patent/JP2001194994A/en
Application granted granted Critical
Publication of JP3490365B2 publication Critical patent/JP3490365B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】この発明は、例えば暗号技術
で用いられる置換演算置及びそのプログラム記録媒体
に関する。
TECHNICAL FIELD The present invention relates to, for example, substitution operation instrumentation 置及 Bisono program recording medium used in cryptography.

【0002】[0002]

【従来の技術】データを秘匿するためには暗号化技術が
有効である。暗号化の方法は共通鍵暗号と公開鍵暗号が
ある。共通鍵暗号では、暗号作成側と暗号復号側で同一
の鍵を用い、この鍵は秘密に管理されている。一方、公
開鍵暗号では暗号文作成の鍵と暗号文復号の鍵は異なっ
ており、暗号文作成のための鍵は公開しても、復号のた
めの鍵は現実的な時間内に求まらないと広く信じられて
いる。処理速度の観点からは共通鍵暗号の方が有利であ
る。
2. Description of the Related Art Encryption technology is effective for concealing data. There are common key cryptography and public key cryptography as the encryption method. In common key cryptography, the same key is used on the cipher creation side and the cipher decryption side, and this key is secretly managed. On the other hand, in public key cryptography, the key for ciphertext creation and the key for ciphertext decryption are different, and even if the key for ciphertext creation is open, the key for decryption can be obtained within a realistic time. It is widely believed that no. From the viewpoint of processing speed, common key cryptography is more advantageous.

【0003】高速かつ安全な共通鍵暗号を構成するため
に、暗号化対象のデータを適当な長さのブロックに分割
し、そのブロック毎に暗号化する方法をブロック暗号と
呼ぶ。このような暗号方式として代表的なDES暗号の
構成は、例えば「池野、小山:”現代暗号理論”、電子
情報通信学会、pp.41-62, 1986」に示されている。
A method of dividing data to be encrypted into blocks of an appropriate length and encrypting each block in order to construct a high-speed and secure common key encryption is called a block cipher. A typical configuration of the DES encryption as such an encryption method is shown in, for example, "Ikeno, Koyama:" Modern Cryptography ", Institute of Electronics, Information and Communication Engineers, pp.41-62, 1986".

【0004】このDES暗号を含め、多くの共通鍵暗号
は換字(substitution)と、置換(permutation)の組み合
わせから構成されている。置換を実現するために環R上
の線形変換がよく用いられる。例えば、E2暗号(例え
ば、文献「神田、"128ビットブロック暗号E2の提案,"
電子情報通信学会、情報セキュリティ研究会、ISEC98-1
2」、以下「文献E2」と略す)では行列
Many common key ciphers including this DES cipher consist of a combination of substitution and permutation. A linear transformation on the ring R is often used to realize the permutation. For example, E2 encryption (for example, "Kanda," Proposal of 128-bit block cipher E2, "
IEICE, Information Security Study Group, ISEC98-1
2 ”, abbreviated as“ Literature E2 ”below)

【0005】[0005]

【数4】 を用いて入力データ(z1,z2,...,z8)に対する出力データ
(z1',z2',...,z8')を次式
[Equation 4] Output data for input data (z 1 , z 2 , ..., z 8 ) using
(z 1 ', z 2 ', ..., z 8 ')

【0006】[0006]

【数5】 で表される行列の積で演算する。[Equation 5] It is calculated by the product of matrices.

【0007】このような{0,1}の要素からなる行列
Pで表現される置換の高速な実現方法がいくつか考えら
れている。例えば、文献「青木、植田:"E2のソフト
ウェア実装、”1999年暗号と情報セキュリティシンポジ
ウムSCIS99-F1-2.2」がある。しかし上記文献では主に
32ビットCPUの実装環境での高速な実現方法を述べ
ているだけであり、低価格ICカードで使われているよ
うな8ビットCPUの実装環境では必ずしも有効なもの
ではなかった。つまり、低価格ICカードなどで採用さ
れている8ビットの累算器型CPUでは、累算器と少数
の汎用レジスタ、少量のメモリで構成されているという
ハードウェア上の制約のため、それらを逐次的に動作さ
せて置換を実現する必要がある。
Several high-speed methods of realizing the permutation represented by the matrix P consisting of {0, 1} elements have been considered. For example, there is a document “Aoki, Ueda:“ Software implementation of E2, ”1999 Encryption and Information Security Symposium SCIS99-F1-2.2”. However, the above-mentioned document mainly describes only a high-speed implementation method in a 32-bit CPU mounting environment, and is not necessarily effective in an 8-bit CPU mounting environment used in a low-priced IC card. It was In other words, the 8-bit accumulator type CPU used in low-priced IC cards and the like has a hardware limitation that it is composed of an accumulator, a small number of general-purpose registers, and a small amount of memory. It is necessary to operate sequentially to realize the replacement.

【0008】以下では、1つの累算器と少数の汎用レジ
スタで構成されるような実装環境において、入力データ
(z1,z2,...,z8)がメモリに格納されてあり、その入力デ
ータを読み込んで、上記のような置換を計算した後、出
力データ(z1',z2',...,z8')をメモリに書き出す場合を
検討する。ここでは、従来の3つの手法による処理速度
の効率性の比較のために、加減演算回数、メモリ読み込
み回数、メモリ書き込み回数の3項目について評価す
る。具体例として、上記行列Pを用いたときの置換で説
明する。また、置換演算としては上記行列Pを用いた式
(2) の演算を実行するものとする。
In the following, in an implementation environment where one accumulator and a small number of general-purpose registers are used, input data
(z 1 , z 2 , ..., z 8 ) is stored in memory, and after reading its input data and computing the permutation as above, the output data (z 1 ', z 2 ', Consider writing ..., z 8 ') to memory. Here, in order to compare the efficiency of the processing speeds by the three conventional methods, three items, that is, the number of addition / subtraction operations, the number of memory readings, and the number of memory writings are evaluated. As a specific example, the replacement when the matrix P is used will be described. Further, as the replacement operation, an expression using the above matrix P
The operation of (2) shall be executed.

【0009】従来手法1:式(1)、(2)による置換を定義
どおりに逐次的に行うと、以下の演算を行うことにな
る。
Conventional method 1: When the replacement by the equations (1) and (2) is sequentially performed as defined, the following calculation is performed.

【0010】 z1'=z2+z3+z4+z5+z6+z7 z2'=z1+z3+z4+z6+z7+z8 z3'=z1+z2+z4+z5+z7+z8 z4'=z1+z2+z3+z5+z6+z8 z5'=z1+z2+z4+z5+z6 z6'=z1+z2+z3+z6+z7 z7'=z2+z3+z4+z7+z8 z8'=z1+z3+z4+z5+z8 (3) この演算に必要な処理は 加減算 36回 メモリ読み込み 44回 メモリ書き込み 8回 である。この手法では、メモリ読み込み回数は行列Pの
成分が1である要素の総数に等しくなる。従って、1と
なる要素数が多くなるほど処理量が増える。
Z 1 '= z 2 + z 3 + z 4 + z 5 + z 6 + z 7 z 2 ' = z 1 + z 3 + z 4 + z 6 + z 7 + z 8 z 3 '= z 1 + z 2 + z 4 + z 5 + z 7 + z 8 z 4 '= z 1 + z 2 + z 3 + z 5 + z 6 + z 8 z 5 ' = z 1 + z 2 + z 4 + z 5 + z 6 z 6 '= z 1 + z 2 + z 3 + z 6 + z 7 z 7 ' = z 2 + z 3 + z 4 + z 7 + z 8 z 8 '= z 1 + z 3 + z 4 + z 5 + z 8 (3) required for this calculation process is subtraction 36th memory read 44 times memory write 8 times. In this method, the number of memory readings is equal to the total number of elements in which the elements of the matrix P are 1. Therefore, the processing amount increases as the number of elements that becomes 1 increases.

【0011】従来手法2:上記行列Pを使った置換演算
方法として文献E2には、環RとしてGF(28)を使い、次
式の演算を行う方法が示されている。
Conventional method 2: As a permutation operation method using the above matrix P, document E2 shows a method of performing the operation of the following equation using GF (2 8 ) as a ring R.

【0012】 a5=z5+z1 b1=z1+a7 z5'=a5+b4 z1'=b1+z5' a6=z6+z2 b2=z2+a8 z6'=a6+b1 z2'=b2+z6' a7=z7+z3 b3=z3+a5 z7'=a7+b2 z3'=b3+z7' a8=z8+z4 b4=z4+a6 z8'=a8+b3 z4'=b4+z8' この方法による演算量は次の通りである。[0012] a 5 = z 5 + z 1 b 1 = z 1 + a 7 z 5 '= a 5 + b 4 z 1' = b 1 + z 5 'a 6 = z 6 + z 2 b 2 = z 2 + a 8 z 6 '= a 6 + b 1 z 2' = b 2 + z 6 'a 7 = z 7 + z 3 b 3 = z 3 + a 5 z 7' = a 7 + b 2 z 3 '= b 3 + z 7' a 8 = z 8 + z 4 b 4 = z 4 + a 6 z 8 '= a 8 + b 3 z 4' = b 4 + z 8 ' operation amount by this method is as follows.

【0013】 加減算 16回 メモリ読み込み 32回 メモリ書き込み 16回 この手法は、使用するレジスタ数が多く、かつ加算命令
が直交している(すべてのレジスタに対して加算命令が
実行可能な)場合には、手法1よりも有効である。しか
し、次の欠点を有する。
Addition / subtraction 16 times memory reading 32 times memory writing 16 times This method is used when a large number of registers are used and addition instructions are orthogonal (addition instructions can be executed for all registers). , More effective than method 1. However, it has the following drawbacks.

【0014】(a) Rの標数が2であることを本質的に用
いているので、標数が2でない場合に適用できない。
(A) Since the characteristic of R is essentially 2, it cannot be applied when the characteristic is not 2.

【0015】(b) 多数のレジスタが使用できないなどの
実装環境によっては必ずしも効率的でない。
(B) It is not always efficient depending on the mounting environment in which a large number of registers cannot be used.

【0016】(c) 処理量が行列Pの成分構成に大きく依
存する。
(C) The amount of processing largely depends on the component structure of the matrix P.

【0017】従来手法3:更に、上記行列Pのように成
分に1が多い場合には以下のような計算方法がある。
Conventional method 3: Further, when the number of components is 1 as in the above matrix P, there is the following calculation method.

【0018】 σ=z1+z2+z3+z4+z5+z6+z7+z8 z1'=σ−z1−z8 z2'=σ−z2−z5 z3'=σ−z3−z6 z4'=σ−z4−z7 z5'=σ−z3−z7−z8 z6'=σ−z4−z8−z5 z7'=σ−z1−z5−z6 z8'=σ−z2−z6−z7 この手法による演算量は次の通りである。Σ = z 1 + z 2 + z 3 + z 4 + z 5 + z 6 + z 7 + z 8 z 1 ′ = σ−z 1 −z 8 z 2 ′ = σ−z 2 −z 5 z 3 ′ = σ−z 3 −z 6 z 4 ′ = σ−z 4 −z 7 z 5 ′ = σ−z 3 −z 7 −z 8 z 6 ′ = σ−z 4 −z 8 −z 5 z 7 ′ = σ−z 1 −z 5 −z 6 z 8 '= σ −z 2 −z 6 −z 7 The amount of calculation by this method is as follows.

【0019】 加減算 27回 メモリ読み込み 36回 メモリ書き込み 9回 この手法は行列Pの成分が1である個数が全体数の約6
割以上になると、手法1よりも効率的になる。
Addition / subtraction 27 times memory reading 36 times memory writing 9 times In this method, the number of elements of matrix P being 1 is about 6 of the total number.
If it is more than 50%, it will be more efficient than the method 1.

【0020】以上の従来手法1〜3のいずれの場合であ
っても、行列Pによる置換が効率的に行えるかどうか
は、行列Pの{0,1}成分がどのように分布している
か、特に1となる成分の個数がどの程度の割合で存在し
ているかに依存して処理量が決まる。つまり、行列Pの
構成次第では、手法1が効率的であることも、逆に手法
3が効率的になることもあり得るので、これらの手法は
汎用的とはいえない。これらの手法のどちらが効率的に
なるかの分岐点は、行列Pの成分が1である個数が全体
の約6割以上になるところにある。
In any of the above-mentioned conventional methods 1 to 3, whether or not the replacement by the matrix P can be efficiently carried out depends on how the {0, 1} components of the matrix P are distributed. In particular, the processing amount is determined depending on the ratio of the number of components that become 1. That is, depending on the configuration of the matrix P, the method 1 may be efficient and the method 3 may be conversely efficient, so these methods cannot be said to be general-purpose. The branch point of which of these methods is more efficient is that the number of elements of the matrix P having 1 is about 60% or more of the whole.

【0021】暗号に使用できるような安全な置換を実現
するためには、行列Pにおける{0,1}成分の割合が
ある程度のバランスを有していた方が望ましい。例え
ば、E2暗号の置換で使用されている上記の行列Pの場
合、1となる成分の割合は約2/3 である。このような割
合による置換の場合、上述したように、その割合が効率
分岐点近くであるため、手法1〜3のいずれの場合であ
ってもメモリ読み込み回数がほとんど変わらないことに
なる。従って、一般にメモリの読み書きは加減算より数
倍低速であることを考慮すれば、これらの手法は、実質
的には処理速度の改善効果がほとんどないことを意味し
ており、上記手法のどれを実施したとしても置換演算の
実行速度は遅い。
In order to realize a secure permutation that can be used for encryption, it is desirable that the ratio of {0,1} components in the matrix P has a certain balance. For example, in the case of the matrix P used in the permutation of the E2 cipher, the ratio of components that become 1 is about 2/3. In the case of replacement by such a ratio, as described above, since the ratio is near the efficiency branch point, the number of memory readings is almost unchanged in any of the methods 1 to 3. Therefore, considering that memory reading and writing are generally several times slower than addition and subtraction, these methods have practically no effect on improving the processing speed. Even if it does, the execution speed of the replacement operation is slow.

【0022】[0022]

【発明が解決しようとする課題】この発明は、{0,
1}の要素からなる行列Pを使って表現されるようなあ
らゆる置換において、少数の汎用レジスタを含む累算器
型CPUと少量のメモリで構成されているような実装環
境に適用できるよう、メモリの読み込み回数を削減し、
その置換計算を高速化できる置換演算装置及びそのプロ
グラムを記録した記録媒体を提供することである。
The present invention is based on {0,
In every permutation represented by the matrix P consisting of 1} elements, a memory is provided so that it can be applied to an implementation environment composed of an accumulator CPU including a small number of general-purpose registers and a small amount of memory. To reduce the number of readings of
The substitution computation is to provide a recording medium which records a substituted Starring SanSo location and the program can be speeded.

【0023】[0023]

【課題を解決するための手段】この発明によれば、累算
器型CPUとレジスタを含む演算装置により入力データ
z1,z2,...,znを、予め与えられた{0,1}を要素とす
るm×n行列Pにより次式
According to the present invention, an input device is provided with an arithmetic unit including an accumulator type CPU and a register.
z 1 , z 2 , ..., z n can be expressed by the following equation by an m × n matrix P having {0,1} given as elements.

【0024】[0024]

【数式6】 で置換し、置換データ(z1',z2',...,zm')を得る置換演
装置であり、以下の演算を行う。 (a) 各置換データzj' を、すでに計算されたzi' を使っ
て次式を演算する。 zj'=zi'+Di だし、j≠i、i及びjは1以上m以下の整数であり、Di
は上記入力データz1,z2,...,znを使って上記行列Pが規
定する置換データzj'とzi'をそれぞれ表す式の差分Di=z
j ' z i 'により与えられる。 (b) 全ての上記jについてzj'を演算する。
[Formula 6] It is a permutation arithmetic unit that substitutes with to obtain permutation data (z 1 ', z 2 ', ..., z m '), and performs the following arithmetic operations. (a) For each replacement data z j ', the following equation is calculated using the already calculated z i ' . z j '= z i' + D i was however, j ≠ i, i and j are 1 or m an integer, D i
Is the difference D i = z between the expressions representing the permuted data z j 'and z i ' defined by the matrix P using the input data z 1 , z 2 , ..., z n.
j - Ru given by the 'z i'. (b) Calculate z j 'for all the above j.

【0025】[0025]

【発明の実施の形態】以下ではこの発明の実施例を説明
する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below.

【0026】式(3) による定義どおりの計算法では、各
zi' を計算するたびに、その結果を破棄し新たに加減算
を行うことによって次のzi' を求めることになる。しか
し、各zi' を計算するための定義式は他のzj'を計算す
る定義式と共通の成分を複数含んでいて、ある程度、似
通っていることがあるので、zi' の値を前回の計算値
zj'との差分Diによりzi'=zj'+Di と表すことにより前
の計算結果を利用できる。この原理を用いてメモリ読み
込み回数を削減する。
In the calculation method as defined by the equation (3), each
Each time z i 'is calculated, the result is discarded and a new z i ' is added to obtain the next z i '. However, since the definition formula for calculating each z i 'includes multiple components common to other definition formulas for calculating z j ' and may be similar to some extent, the value of z i 'is Previous calculated value
available before the calculation result by 'by the difference D i between the z i' z j representing a = z j '+ D i. This principle is used to reduce the number of memory readings.

【0027】第1実施例この第1実施例では、z'i+1=z'
i+Diと表して次式により置換演算を行う。
First Embodiment In this first embodiment, z'i + 1 = z '
It is expressed as i + D i, and the replacement operation is performed by the following equation.

【0028】 z1'=z2+z3+z4+z5+z6+z7 z2'=z1'+z1−z2−z5+z8 z3'=z2'+z2−z3+z5−z6 z4'=z3'+z3−z4+z6−z7 z5'=z4'−z3+z4−z8 z6'=z5'+z3−z4−z5+z7 z7'=z6'−z1+z4−z6+z8 z8'=z7'+z1−z2+z5−z7 (4) この方法による必要な処理量は次の通りである。Z 1 '= z 2 + z 3 + z 4 + z 5 + z 6 + z 7 z 2 ' = z 1 '+ z 1 -z 2 -z 5 + z 8 z 3 ' = z 2 '+ z 2 -z 3 + z 5 −z 6 z 4 ′ = z 3 ′ + z 3 −z 4 + z 6 −z 7 z 5 ′ = z 4 ′ −z 3 + z 4 −z 8 z 6 ′ = z 5 ′ + z 3 −z 4 −z 5 + z 7 z 7 ′ = z 6 ′ −z 1 + z 4 −z 6 + z 8 z 8 ′ = z 7 ′ + z 1 −z 2 + z 5 −z 7 (4) The required processing amount by this method is as follows. Is.

【0029】 加減算 32回 メモリ読み込み 33回 メモリ書き込み 8回 この結果は、従来技術で述べた手法1と比較し、メモリ
読み込み回数を25%削減することができる。なお、z'
i+1を計算する際にzi' の値が累算器に入っており、そ
の分のメモリ読み込みが省略できることに注意。
Addition / subtraction 32 times memory reading 33 times memory writing 8 times This result can reduce the number of times of memory reading by 25% as compared with the method 1 described in the prior art. Note that z '
Note that when calculating i + 1 , the value of z i 'is in the accumulator, and the memory reading for that amount can be omitted.

【0030】説明を簡単にするため、置換としてE2暗
号に示されている行列Pを利用してこの実施例の説明し
たが、上記の検討は上記の行列Pに限定されるものでな
く、{0,1}の要素からなる行列で表現されるすべて
の置換演算に適用できる。その際の、一般的特性は以下
の通りである。
For simplification of the description, this embodiment has been described by using the matrix P shown in the E2 cipher as a permutation, but the above examination is not limited to the above matrix P, and { It can be applied to all permutation operations expressed by a matrix consisting of 0, 1} elements. The general characteristics at that time are as follows.

【0031】まず、従来技術の手法1では、必要となる
zj(j=1,2,...,8)を読み込んでから各zi'(i=1,2,...,8)
を求めている。そのため、手法1で必要となるメモリ読
み込み総回数は、行列Pの成分が1となる個数の総数に
等しくなる。このことは、行列Pの成分が1となる個数
の総数が多くなるほど、メモリ読み込み回数が多くな
り、実行速度が遅くなることを意味する。
First, the method 1 of the prior art requires it.
Read z j (j = 1,2, ..., 8) and then each z i '(i = 1,2, ..., 8)
Are seeking. Therefore, the total number of memory readings required in the method 1 is equal to the total number of the elements of the matrix P being 1. This means that the larger the total number of elements of the matrix P being 1, the larger the number of memory readings and the slower the execution speed.

【0032】一方、第1実施例では、z'i+1とz'iの差分
となるzj(j=1,2,...,8)だけを読み込めば、z'i+1を求め
ることができる。一般に、行列Pの成分が1となる個数
の総和が多くなるほど、z'i+1とz'iの差分は少なくなる
ことが期待できる。従って、行列Pの成分が1となる個
数の総数が多くなるほど、メモリ読み込み回数が少なく
てすむことになり、実行速度が改善されることを意味す
る。
On the other hand, in the first embodiment, if only z j (j = 1,2, ..., 8), which is the difference between z ′ i + 1 and z ′ i , is read, z ′ i + 1 becomes You can ask. In general, it can be expected that the difference between z ′ i + 1 and z ′ i becomes smaller as the total number of the elements of the matrix P becomes 1 increases. Therefore, the larger the total number of the elements of the matrix P being 1, the smaller the number of memory readings, which means that the execution speed is improved.

【0033】 また、この第1実施例では、従来手法2
とは異なり、行列Pの実現方法に制限はなく、汎用性が
ある。なお、行列Pの成分が1となる個数の総数が極端
に多い場合、従来手法3と比較して、この第1実施例が
優れているかどうかは自明でない。
Further, in the first embodiment, the conventional method 2
Unlike the above, there is no limitation on the method of realizing the matrix P, and it has versatility. When the total number of elements of the matrix P is 1 is extremely large, it is not obvious whether the first embodiment is superior to the conventional method 3.

【0034】第2実施例 第2実施例では、z'i をi=1から順に計算するものとし
て説明したが、現実の実装では、z'i(i=1,2,...,8)は並
列表記であるので、i=1から順に計算する必然性はな
い。そこで、zi' との差分Diが少なくなるzj'を利用す
ることで演算処理量を削減できる。例えばz6'からz7'を
計算する場合にはz1,z4,z6,z8を読み込まなくてはなら
ないが、z4'を計算する場合にはz5,z7,z8だけを読み込
めばよく、メモリ読み込み回数を1回と、加減算回数を
1回削減できることになる。
Second Embodiment In the second embodiment, it has been described that z ′ i is calculated sequentially from i = 1, but in actual implementation, z ′ i (i = 1,2, ..., 8) ) Is a parallel notation, it is not necessary to calculate sequentially from i = 1. Therefore, the calculation processing amount can be reduced by using z j 'where the difference D i from z i ' is small. For example, if you want to calculate z 7 'from z 6 ', you have to read z 1 , z 4 , z 6 , z 8 but if you want to calculate z 4 ', z 5 , z 7 , z 8 It is only necessary to read in, and the number of memory readings can be reduced to 1 and the number of additions and subtractions to be reduced by 1.

【0035】このようにして、全体の差分の合計数、即
ち、メモリの読み込み回数が最小となるようにzi' の計
算順序を求めることによって、最適な実行が可能とな
る。E2暗号の行列Pを用いた場合の最適な演算順序は
次のようになる。
In this way, by obtaining the calculation order of z i 'so that the total number of the total differences, that is, the number of times of reading the memory is minimized, optimum execution becomes possible. The optimum calculation order when the matrix P of E2 encryption is used is as follows.

【0036】 z6'=z1+z2+z3+z6+z7 z4'=z6'+z5−z7+z8 z5'=z4'−z3+z4−z8 z3'=z5'−z6+z7+z8 z8'=z3'−z2+z3−z7 z2'=z8'−z5+z6+z7 z7'=z2'−z1+z2−z6 z1'=z7'+z5+z6−z8 (5) この方法による置換演算量は次のようになる。Z 6 ′ = z 1 + z 2 + z 3 + z 6 + z 7 z 4 ′ = z 6 ′ + z 5 −z 7 + z 8 z 5 ′ = z 4 ′ −z 3 + z 4 −z 8 z 3 ′ = z 5 '-z 6 + z 7 + z 8 z 8' = z 3 '-z 2 + z 3 -z 7 z 2' = z 8 '-z 5 + z 6 + z 7 z 7' = z 2 '-z 1 + z 2 −z 6 z 1 ′ = z 7 ′ + z 5 + z 6 −z 8 (5) The permutation calculation amount by this method is as follows.

【0037】 加減算回数 25回 メモリ読み込み回数 26回 メモリ書き込み回数 8回 従って、メモリ読み込み回数が従来手法1よりも約35
%、従来手法2よりも約25%削減されている。
Addition / subtraction number 25 times Memory reading number 26 times Memory writing number 8 times Therefore, the memory reading number is about 35 compared with the conventional method 1.
%, About 25% less than the conventional method 2.

【0038】なお、説明を簡単にするために、置換計算
としてE2暗号に示されている行列Pを利用してこの実
施例の説明を行ったが、上述の議論は、上記行列Pに限
定されるものではなく、{0,1}の要素からなる行列
で表現される全ての置換計算に適用できることは明らか
である。その際の、一般的特性は以下の通りである。
In order to simplify the explanation, this embodiment has been described using the matrix P shown in the E2 encryption as the permutation calculation, but the above discussion is limited to the above matrix P. It is obvious that the present invention can be applied to all permutation calculations expressed by a matrix of elements of {0, 1}, rather than one. The general characteristics at that time are as follows.

【0039】 まず、第2実施例は、明らかに第1実施
例の改良であるので、加減算・メモリ読み書き回数の観
点からは従来手法1より高速である。また、従来手法2
とは異なり、行列Pの実現方法に制限はなく、汎用性が
ある。
Firstly, the second embodiment, since obviously it is improvements in the first embodiment, in terms of subtraction memory read and write times faster than the conventional method 1. In addition, conventional method 2
Unlike the above, there is no limitation on the method of realizing the matrix P, and it has versatility.

【0040】一方、行列Pの成分が1となる個数の総数
が多い場合には、全体として、zi'とzj'の差分が少なく
なるような順序が与えられることが期待でき、そのほと
んどが最小メモリ読み込み回数で実現される。例えば、
この第2実施例の場合、3つのzkをメモリから読み込む
ことによってzi'からzj'が求められるような順序が存在
している。一般に、従来手法3でσからzi' を求めるた
めに必要となるメモリ読み込み回数は、この第2実施例
での最小メモリ読み込み回数と同数以上であると考えて
よい。従って、全てのzi'(i=1,2,...,8)を求めるために
必要となる総読み込み回数は、ほとんどの場合、従来手
法3よりもこの第2実施例の方が少ないと考えて差し支
えない。
On the other hand, when the total number of the elements of the matrix P being 1 is large, it can be expected that an order is given so that the difference between z i 'and z j ' is small as a whole. Is achieved with the minimum number of memory reads. For example,
In the case of this second embodiment, there is an order in which three z k's are read from memory to obtain z i 'to z j '. In general, it can be considered that the number of memory readings required to obtain z i 'from σ in Conventional Method 3 is equal to or more than the minimum number of memory readings in the second embodiment. Therefore, in most cases, the total number of readings required to obtain all z i '(i = 1,2, ..., 8) is smaller in the second embodiment than in the conventional method 3. You can think of it.

【0041】 図1は第1又は第2実施例による置換演
算を行う装置の構成を示す。置換を受ける入力データ
z1,z2,...,z8は入力データメモリ221 に保持されてい
る。プログラムメモリ227 には式(4)又は式(5)の置換演
算処理を実行するプログラムが格納されている。制御装
置220 はそのプログラムに従って、メモリ221 から順に
読み出すデータのアドレス及び、演算により得られたデ
ータを書き込むべきメモリ222 のアドレスを発生するア
ドレス生成装置226 を制御すると共に、累算器224 とレ
ジスタ225 を使った加減算(又は排他的論理和)の制御
を逐次実行する。各計算結果zi'は次のzj'の計算に使用
されるまで累算器224 又はレジスタ225 又は一時データ
メモリ223 に保持される。
[0041] Figure 1 shows a configuration of a device for by that substitution operation on the first or second embodiment. Input data to be replaced
z 1 , z 2 , ..., z 8 are held in the input data memory 221. The program memory 227 stores a program for executing the substitution calculation process of the formula (4) or the formula (5). According to the program, the control device 220 controls the address generator 226 that generates the address of the data sequentially read from the memory 221 and the address of the memory 222 to which the data obtained by the operation should be written, and at the same time, accumulator 224 and register 225. The addition / subtraction (or exclusive OR) control using is sequentially executed. Each calculation result z i 'is held in the accumulator 224 or the register 225 or the temporary data memory 223 until it is used for the next calculation of z j '.

【0042】上述の第1及び第2実施例では、行列Pと
して8×8行列を使った場合の置換演算例を示したが、
m、nを2以上の整数とすると、一般に行列Pとしてm
×n行列を使い、入力データ(z1,z2,...,zn)に対する置
換出力データ(z1',z2',...,zm')を、予め与えられた
{0,1}を要素とするm×n行列Pにより次式
In the above-mentioned first and second embodiments, an example of permutation calculation is shown when an 8 × 8 matrix is used as the matrix P.
When m and n are integers of 2 or more, m is generally used as the matrix P.
Using the × n matrix, the permuted output data (z 1 ', z 2 ', ..., z m ') for the input data (z 1 , z 2 , ..., z n ) are given in advance { An m × n matrix P whose elements are 0, 1} is given by

【0043】[0043]

【数7】 で表される置換演算にこの発明を適用できることは明ら
かである。
[Equation 7] It is obvious that the present invention can be applied to the replacement operation represented by

【0044】[0044]

【発明の効果】以上の説明のように、この実施例が最も
メモリ総読み込み回数が少ないと考えられ、一般にメモ
リ読み書きは加減算より低速であり、かつアドレス計算
などを含む分、この実施例は従来のどの方法よりも高速
となる。
As described above, this embodiment is considered to have the smallest total number of memory reads, and memory read / write is generally slower than addition / subtraction, and address calculation and the like are included. Will be faster than any of the methods.

【図面の簡単な説明】[Brief description of drawings]

【図1】この発明の実施例を示すブロック図。FIG. 1 is a block diagram showing an embodiment of the present invention.

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 山本宙,水野秀尚,藤原融,嵩忠雄, Shu Lin,“セクショントレリス ダイアグラムの詳細構造を用いた線形符 号の再帰的最ゆう復号アルゴリズムにつ いての”,電子情報通信学会技術研究報 告(SST95−130〜150),日本,社団 法人電子情報通信学会,1996年 3月19 日,Vol.95,No.595,p.31− 36 神田雅透,盛合志帆,青木和麻呂,植 田広樹,大久保美也子,高嶋洋一,太田 和夫,松本勉,“128ビットブロック暗 号E2の提案”,電子情報通信学会技術 研究報告(ISEC98−10〜19),日 本,社団法人電子情報通信学会,1998年 7月30日,Vol.98,No.227, p.13−24 (58)調査した分野(Int.Cl.7,DB名) G09C 1/00 650 G09C 1/00 610 ─────────────────────────────────────────────────── ─── Continuation of the front page (56) References Chu Yamamoto, Hidehisa Mizuno, Tsuru Fujiwara, Tadao Shige, Shu Lin, “A recursive maximum likelihood decoding algorithm for linear codes using the detailed structure of a section trellis diagram” , ”IEICE Technical Report (SST95-130 to 150), Japan, The Institute of Electronics, Information and Communication Engineers, March 19, 1996, Vol. 95, No. 595, p. 31-36 Masatoru Kanda, Shiho Moriai, Kazumaro Aoki, Hiroki Ueda, Miyako Okubo, Yoichi Takashima, Kazuo Ota, Tsutomu Matsumoto, "Proposal of 128-bit block code E2", IEICE technical research report ( IEC98-10-19), Japan, The Institute of Electronics, Information and Communication Engineers, July 30, 1998, Vol. 98, No. 227, p. 13-24 (58) Fields investigated (Int.Cl. 7 , DB name) G09C 1/00 650 G09C 1/00 610

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 少数の汎用レジスタを含む累算器型CP
Uと少量のメモリを含む演算装置により入力データz1,z
2,...,znを、予め与えられた{0,1}を要素とするm
×n行列Pにより次式 【数3】 で置換し、置換データ(z1',z2',...,zm')を得る置換演
算装置であり:上記入力データが保持されるメモリと、 前回計算された置換データzi' を格納する記憶手段と、 上記記憶手段から読み出された置換データzi' を使って
次式 zj'=zi'+Di により次の置換データzj'を計算し、その置換データ z j '
を前回計算された置換データ z i ' として上記記憶手段に
格納する演算手段と、ただし、j i、i及びjは1以上m
以下の整数であり、m、nは2以上の整数であり、Di
上記入力データz1,z2,...,znを使って上記行列Pが規定
する置換データzj'とzi'をそれぞれ表す式の差分Di=z j '
z i 'により与えられ、 上記演算手段による上記置換データzj' の演算を全ての
上記jについて繰り返す制御を行う制御手段、 とを含む置換演算装置。
1. An accumulator-type CP including a small number of general-purpose registers.
Input data z 1 , z by an arithmetic unit including U and a small amount of memory
M having 2 , ..., z n as elements of {0,1} given in advance
× n matrix P It is a permutation operation unit that obtains the permutation data (z 1 ', z 2 ', ..., z m ') by substituting with: the memory holding the above input data and the previously calculated permutation data z i ' The following replacement data z j 'is calculated using the following expression z j ' = z i '+ D i using the storage means for storing and the replacement data z i ' read out from the storage means, and the replacement data z j '
Is stored in the storage means as replacement data z i ' calculated last time , where j i , i and j are 1 or more m
The following integers, m and n are integers of 2 or more, and D i is the replacement data z j 'defined by the matrix P using the input data z 1 , z 2 , ..., z n. Difference of each expression that represents z i 'D i = z j '
- 'provided by, the replacement data z j by the computing means' z i control means for controlling repeated for all the j operations of substitution operation device including a city.
【請求項2】 請求項記載の置換演算装置において、
上記制御手段はj=i+1としてi=0,1,...,m-1の順に上記zj
'を演算する手段を含む置換演算装置。
2. The permutation operation device according to claim 1 , wherein
The control means is j = i + 1 and i = 0,1, ..., m-1 in the order of z j
A permutation arithmetic unit including means for calculating '.
【請求項3】 請求項記載の置換演算装置において、
上記制御手段は、予めm個の異なるjの全ての順番のそ
れぞれについてzj'の演算に必要な加減算の総回数をそ
れぞれ求め、最小の総回数を与えるjの順番を決め、そ
の決められた順番で上記zj'を順次計算する手段を含む
置換演算装置。
3. The permutation operation device according to claim 1 , wherein
The control means previously obtains the total number of additions and subtractions required for the calculation of z j 'for all of the m different orders of j, determines the order of j that gives the minimum total number, and the order is determined. A permutation arithmetic unit including a means for sequentially calculating the above z j '.
【請求項4】 請求項1〜3のいずれかに記載した置換
演算装置としてコンピュータを機能させるためのプログ
ラムを記録したコンピュータ読み取り可能な記録媒体。
4. A substitution according to any one of claims 1 to 3.
A program for operating a computer as a computing device
A computer-readable recording medium on which a ram is recorded.
JP2000000644A 2000-01-06 2000-01-06 Replacement calculation device and its program recording medium Expired - Lifetime JP3490365B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000000644A JP3490365B2 (en) 2000-01-06 2000-01-06 Replacement calculation device and its program recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000000644A JP3490365B2 (en) 2000-01-06 2000-01-06 Replacement calculation device and its program recording medium

Publications (2)

Publication Number Publication Date
JP2001194994A JP2001194994A (en) 2001-07-19
JP3490365B2 true JP3490365B2 (en) 2004-01-26

Family

ID=18529960

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000000644A Expired - Lifetime JP3490365B2 (en) 2000-01-06 2000-01-06 Replacement calculation device and its program recording medium

Country Status (1)

Country Link
JP (1) JP3490365B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4527960B2 (en) * 2003-10-22 2010-08-18 日本電信電話株式会社 Substitution substitution device, substitution substitution method, substitution substitution program, substitution substitution recording medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
山本宙,水野秀尚,藤原融,嵩忠雄,Shu Lin,"セクショントレリスダイアグラムの詳細構造を用いた線形符号の再帰的最ゆう復号アルゴリズムについての",電子情報通信学会技術研究報告(SST95−130〜150),日本,社団法人電子情報通信学会,1996年 3月19日,Vol.95,No.595,p.31−36
神田雅透,盛合志帆,青木和麻呂,植田広樹,大久保美也子,高嶋洋一,太田和夫,松本勉,"128ビットブロック暗号E2の提案",電子情報通信学会技術研究報告(ISEC98−10〜19),日本,社団法人電子情報通信学会,1998年 7月30日,Vol.98,No.227,p.13−24

Also Published As

Publication number Publication date
JP2001194994A (en) 2001-07-19

Similar Documents

Publication Publication Date Title
US6578061B1 (en) Method and apparatus for data permutation/division and recording medium with data permutation/division program recorded thereon
JP2003015522A (en) Ciphering circuit
JPS63287882A (en) Cryptographer
JP3709553B2 (en) Arithmetic circuit and arithmetic method
SE1350203A1 (en) Device encryption process and process for unsafe environments
Tillich et al. Accelerating AES using instruction set extensions for elliptic curve cryptography
KR20020063793A (en) Power-residue calculating unit using montgomery algorithm
JP3490365B2 (en) Replacement calculation device and its program recording medium
EP3483867B1 (en) System, device, method, and program for indexing a secret-shared array with secure multiparty computations
JP7060115B2 (en) Secret array access device, secret array access method, and program
CN116318660A (en) Message expansion and compression method and related device
Bradbury et al. Fast quantum-safe cryptography on IBM Z
JP3401207B2 (en) Substitution substitution device and program recording medium thereof
JP5354914B2 (en) Encryption processing device, decryption processing device, and program
US20150234750A1 (en) Method and apparatus for addressing a memory containing different bit-length field variables
TW561435B (en) Method and device for executing a byte substitution operation of the AES algorithm according to Rijndael
JP6973677B1 (en) Reciprocal calculation method, device, and program
JP4484002B2 (en) Arithmetic processor
JP3736731B2 (en) Replacement processing apparatus and program recording medium thereof
JP3492988B2 (en) Data conversion device and program recording medium thereof
JP3494619B2 (en) Reverse byte sequence cyclic shift device and program recording medium therefor
US7685221B1 (en) Efficient remainder calculation for even divisors
JP6876423B2 (en) Internal state initializer, method and program in stream cipher
JP4003723B2 (en) Information processing equipment, tamper resistant processing equipment
JP3110110B2 (en) Encryption / decryption device

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
R151 Written notification of patent or utility model registration

Ref document number: 3490365

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

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

Free format text: PAYMENT UNTIL: 20071107

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20081107

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20091107

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20101107

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20101107

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20111107

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20111107

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20121107

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20121107

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20131107

Year of fee payment: 10

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

EXPY Cancellation because of completion of term