JP3736731B2 - Replacement processing apparatus and program recording medium thereof - Google Patents

Replacement processing apparatus and program recording medium thereof Download PDF

Info

Publication number
JP3736731B2
JP3736731B2 JP2000044529A JP2000044529A JP3736731B2 JP 3736731 B2 JP3736731 B2 JP 3736731B2 JP 2000044529 A JP2000044529 A JP 2000044529A JP 2000044529 A JP2000044529 A JP 2000044529A JP 3736731 B2 JP3736731 B2 JP 3736731B2
Authority
JP
Japan
Prior art keywords
exclusive
result
rotation
byte
output
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
JP2000044529A
Other languages
Japanese (ja)
Other versions
JP2001236017A (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 JP2000044529A priority Critical patent/JP3736731B2/en
Publication of JP2001236017A publication Critical patent/JP2001236017A/en
Application granted granted Critical
Publication of JP3736731B2 publication Critical patent/JP3736731B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

【0001】
【発明の属する技術分野】
この発明は、主に暗号技術で用いられ、特に、秘密鍵の制御のもとでデータをブロック単位で暗号化または復号を行う共通鍵暗号方式に用いられ、第一の非線形変換S−線形変換P−第二の非線形変換Sが行われる装置または非線形変換S−線形変換Pが行われる装置に適する置換処理装置に関する。
【0002】
【従来の技術】
データを秘匿するためには暗号化技術が有効である。暗号化の方式には共通鍵暗号と公開鍵暗号があり、暗号化と復号で同一の秘密鍵を用いる方式を共通鍵暗号、暗号化と復号とで異なる鍵を用いる方式を公開鍵暗号と呼ぶ。処理速度の観点からは共通鍵暗号の方が有利である。
高速かつ安全な共通鍵暗号を構成するために、暗号化対象のデータを適当な長さのブロックに分割し、そのブロック毎に暗号化する方法をブロック暗号と呼ぶ。このような暗号方式の一方式として、S−P−S構造を利用して置換処理における安全性を高めたE2暗号(例えば、文献「神田ら:“128ビットブロック暗号E2の提案”、電子情報通信学会情報セキュリティ研究会ISEC98−12」)がある。
【0003】
図16はE2暗号で利用されている置換処理を表したものである。このなかのP関数処理は、第1のS関数処理と合わせて、行列表現z′=P・z=P・s(x)として、
【0004】
【数24】

Figure 0003736731
のように表され、
【0005】
【数25】
Figure 0003736731
【0006】
という処理が行われる。ここで、s(x)はxを入力として第1のS関数を構成するs−boxによる非線形変換された値を表している。
この第1のS関数処理と{0,1}要素からなる行列Pで表現される置換処理(P関数処理)との合成処理に対する高速な実現方法はいくつか考えられており、例えば文献「青木ら:“E2のソフトウェァ実装、”1999年暗号と情報セキュリティシンポジウムSCIS99−F1−2.2」にその実現方法が記載されている。
例えば、32ビットプロセッサー上での実装例として、以下の4個の32ビット参照テーブル
【0007】
【数26】
Figure 0003736731
を準備した時、上記のS関数処理とP関数処理の合成処理は以下のように書き直すことができる。
【0008】
【数27】
Figure 0003736731
【0009】
ここで、>>yは下yバイトの論理シフト、<<yは上yバイトの論理シフトである。上記行列中の縦線、横線は左辺の行列P・S(x)と右辺のS1(・)〜S4(・)よりなる行列との関係を分かり易くするために記入したものであって特別の意味はない。
このとき、図17に示すように、第1のS関数処理とP関数処理との合成処理では、xのあらゆる値に対して参照可能なテーブルS1(・)〜S4(・)、つまり4KBのメモリ(S1(・)〜S4(・)のテーブルは各々1KBのメモリが必要)を使用し、演算処理としてはx1〜x8によるテーブル参照8回、排他的論理和11回、シフト演算4回を必要とする。また、この文献中には特に記載されていないが、実際の実装においては、これらの演算処理の他に途中データのメモリ退避が1回必要となることに注意されたい。
別の実装例では、上記のS1(・)〜S4(・)のテーブルの他に以下の4個の32ビット参照テーブル
【0010】
【数28】
Figure 0003736731
を準備することにより、上記の置換処理は以下のように書き直すことができる。
【0011】
【数29】
Figure 0003736731
【0012】
このとき、第1のS関数処理とP関数処理との合成処理では、8KBのメモリ(S1(・)〜S8(・)のテーブルは各々1KBのメモリが必要)を使用し、演算処理としては図18に示すようにテーブル参照12回、排他的論理和11回を必要とする。
以上説明したように、E2暗号で利用されている第1のS関数処理とP関数処理との合成処理での高速実装方法は、メモリを4〜8KBも利用しているわりにはテーブル参照、排他的論理和、シフト演算などの処理量が大きく、必ずしも高速なものであるとはいえない。そのうえ、メモリ使用量に制限があるとき、さらに処理量が急増すると予想される。
【0013】
【発明が解決しようとする課題】
この発明の目的は、少なくともS−P構造を有する置換処理において、実装の多様性を持たせたP関数を実現することによって、置換処理での安全性を同じにしながら、様々な実装環境に応じた最適な実装、特に、S関数処理と、{0,1}要素からなる行列Pで表現される置換処理(P関数処理)との合成処理における高速実装を可能とするような置換処理装置を提供することを目的とする。
【0014】
【課題を解決するための手段】
この発明では、上記の目的を達成するための置換処理装置において、S関数処理(非線形変換処理)と、行列Pで表現される置換処理(P関数処理:線形変換処理)との合成処理を以下のように書き直すことが可能となるような構造にすることによって、様々な実装環境に応じた柔軟な高速実装が可能となる。
【0015】
【数30】
Figure 0003736731
【0016】
ここで、<<<yは上にyバイトのローテーション、S1(・)〜S8(・)のテーブルは参照テーブルを表す。なお、y<0のときは下に|y|バイトローテーションを表すものとする。
【0017】
【作用】
この発明によれば、S関数処理と、行列Pで表現される置換処理(P関数処理)との合成処理における高速実装方法として少なくとも、(1)8KBのメモリを使用したときにはテーブル参照8回、排他的論理和8回、ローテーション1回の演算処理、(2)4KBのメモリを使用したときにはテーブル参照8回、排他的論理和10回、ローテーション4回または5回の演算処理、(3)256Bのメモリを使用したときにはテーブル参照8回、排他的論理和25回の演算処理、の3種類を実現することができる。なお、(2)の実装方法のときには、4KBのメモリを使用したテーブル参照の代わりに、256Bのメモリを使用したテーブル参照と6回のシフト演算によっても実現可能であり、このときテーブル参照8回、シフト6回、排他的論理和10回、ローテーション4回または5回の演算処理となる。また、特に{S1(・),S2(・),S3(・),S4(・)}={S5(・),S6(・),S7(・),S8(・)}を満たすのであれば、(1)の実装方法の時にはさらに4KBのメモリ使用量を削減可能であり、使用メモリは4KBとなる(他の演算処理量は変化しない)。
【0018】
これによって、E2暗号で使われていた置換処理よりも高速で、かつ柔軟な実装が可能となる置換処理装置を提供できる。さらに、合成処理そのものは同じでありながら、(1)の実装方法はPC向き、(2)は32ビットCPUを備えたハイエンドICカード向き、(3)は8ビットCPUを備えたローエンドICカード向きというように多様な実装環境に応じて最適かつ柔軟な実装が可能となる。
【0019】
【発明の実施の形態】
実施例1
以下、この発明の実施例1を、図面を用いて説明する。
図1は、この発明の実施例1を示す置換処理装置におけるS関数処理とP関数処理との合成処理を抜き出して示したものである。この合成処理は、
【0020】
【数31】
Figure 0003736731
という処理が行なわれ、行列表現z′=P・z=P・s(x)として、
【0021】
【数32】
Figure 0003736731
のように表される。これは、
【0022】
【数33】
Figure 0003736731
とすると、
【0023】
【数34】
Figure 0003736731
であるから、
【0024】
【数35】
Figure 0003736731
【0025】
と表すことができる。
まず、4KBのテーブルを利用したときの実装法について述べる。ここで用意するテーブルは以下の32ビット参照テーブルの4個であり、各テーブルが1KBのメモリ量を使用する。
【0026】
【数36】
Figure 0003736731
上記のS関数処理とP関数処理との合成処理は以下のように書き換えることができる。
【0027】
【数37】
Figure 0003736731
【0028】
したがって、このような処理を行う処理図は図2に示すようになる。つまりx1,x2,x3,x4でそれぞれテーブルS1,S2,S3,S4を参照してS1(x1),S2(x2),S3(x3),S4(x4)を求め、これらの排他的論理和を回路11,12,13で求め、またx5,x6,x7,x8でそれぞれテーブルS2,S3,S4,S1を参照してS2(x5),S3(x6),S4(x7),S1(x8)を求め、これらの排他的論理和を回路14,15,16により求め、この排他的論理和演算結果U2と前記排他的論理和演算結果U1との排他的論理和が回路17でとられてz1′,z2′,z3′,z4′として出力され、また回路16よりの排他的論理和演算結果U2に対し、上1バイトローテーションが回路18で行われ、回路17の出力と回路19で排他的論理和演算が行われてz5′,z6′,z7′,z8′が得られる。
【0029】
この変換処理はコンピュータにより行わせることもできる。例えば、図3に示すように、CPUよりなる制御部21はプログラムメモリ22に格納されたプログラムを読出し、解読実行し、図4に示す処理を行う。つまり入力部23を通じてデータx1〜x8を取込んで記憶部24に一時記憶し(ステップ1)、その各データx1〜x8を順次取出して、テーブルメモリ25内の対応するテーブルを参照し(ステップ2)、参照結果を記憶部24に一時格納する(ステップ3)。つまりこの例では参照結果S1(x1),S2(x2),S3(x3),S4(x4),S2(x5),S3(x6),S4(x7),S1(x8)が記憶部24に格納される。
【0030】
記憶部24からS1(x1),S2(x2),S3(x3),S4(x4)を取出し、これらの排他的論理和演算を制御部21の演算部26で行い(ステップ4)、その演算結果U1を記憶部24に一時格納し、また記憶部24からS2(x5),S3(x6),S4(x7),S1(x8)を取出し、演算部26でこれらの排他的論理和演算を行い(ステップ5)、その演算結果U2と、前記演算結果U1との排他的論理和演算を演算部26で行う(ステップ6−1)と共に、制御部21のローテーション部27で演算結果U2に対し、下1バイトローテーションを行い(ステップ6−2)、このローテーションの結果とステップ6の排他的論理和演算の結果との排他的論理和演算を演算部26で行う(ステップ7)。このステップ4の演算結果U1をz1′,z2′,z3′,z4′として、またステップ8の演算結果をz5′,z6′,z7′,z8′として出力部28より出力する(ステップ8)。
【0031】
以上の置換処理ではテーブル参照8回、排他的論理和8回、ローテーション1回で構成可能であることがわかる。なお、ローテーション回路18への入力が別の排他的論理和回路17への(一方の)入力となっている場合にはそのローテーションと排他的論理和は並列処理が可能である。故に、図2中の点線部の処理は並列処理を考慮すると2演算で処理が完了する。
次に、もう1つの4KBメモリを利用したときの実装法について述べる。ここで用意するテーブルは以下の32ビット参照テーブルの4個であり、各テーブルが1KBのメモリ量を使用する。
【0032】
【数38】
Figure 0003736731
このとき、第1のS関数処理とP関数処理との合成処理は以下のように書き換えることができる。
【0033】
【数39】
Figure 0003736731
【0034】
したがって、このような処理を行う処理は図5のようになる。つまり入力データx1,x2,x3,x4でテーブルS6,S7,S8,S5がそれぞれ参照してS6(x1),S7(x2),S8(x3),S5(x4)が出力され、これらは回路31,32,33により排他的論理和演算が行われ、その演算結果Aが回路33から出力される。また入力データx5,x6,x7,x8によりテーブルS5,S6,S7,S8がそれぞれ参照され、S5(x5),S6(x6),S7(x7),S8(x8)が出力され、これらが回路34,35,36により排他的論理和演算が行われ、その演算結果Bが回路36から出力される。演算結果Aは回路37により下に1バイトローテーションされると共に回路38で演算結果Bと排他的論理和演算される。この演算結果Cは回路39により上に1バイトローテーションされると共に回路37の出力との排他的論理和演算が回路41で行われる。その演算結果Dは回路42で上に2バイトローテーションされると共に回路39の出力と排他的論理和演算が回路43で行われる。その演算結果Eは回路44で下に1バイトローテーションされると共に回路42の出力と排他的論理和演算が回路45で行われる。回路45の出力Fがz1′,z2′,z3′,z4′として、回路44の出力がz5′,z6′,z7′,z8′として出力される。
【0035】
この置換処理をコンピュータにより行うには、図3中のテーブルメモリ25にテーブルS1,S2,S3,S4の代りにS5,S6,S7,S8を設け、図6に示すようにステップ1でデータx1〜x8を取込み記憶部24に格納し、ステップ2で各データxiを対応するテーブルを参照してS6(x1),S7(x2),S8(x3),S5(x4),S5(x5),S6(x6),S7(x7),S8(x8)を求め、ステップ3でこれらを記憶部24に記憶する。ステップ4でS6(x1),S7(x2),S8(x3),S5(x4)を取出し、これらの排他的論理和演算を演算部26で行い、その結果Aを記憶部24に格納する。ステップ5でS5(x5),S6(x6),S7(x7),S8(x8)を取出し、これらの排他的論理和演算を演算部26で行う。ステップ6−1でその結果Bをローテーション部27により下に1バイトローテーションし、ステップ6−2で演算結果Aと演算結果Bとの排他的論理和演算を行い、その演算結果Cをステップ7−1で上に1バイトローテーションし、同時にステップ7−2で演算結果Cとステップ6−1のローテーションの結果との排他的論理和演算を行う。その演算結果Dをステップ8−1で上に2バイトローテーションすると共に、ステップ7−1のローテーションの結果と演算結果Dと排他的論理和演算をステップ8−2で行う。この演算結果Eをステップ9−1で下に1バイトローテーションすると共にステップ9−2で、ステップ8−1のローテーション結果と演算結果Eとの排他的論理和演算を行い、ステップ9−1,9−2の各結果をステップ10で出力する。
【0036】
図5、図6に示した置換処理によればテーブル参照8回、排他的論理和10回、ローテーション4回で構成可能であることがわかる。なお、前述したようにローテーションと排他的論理和は並列処理が可能であることを考慮すると、図5中の点線部の処理は4演算で処理が完了する。
さらに、S5(x)からS8(x)はs(x)とシフト処理によって実現可能である。つまり、xにより8ビットテーブルを参照してs(x)を求め、s(x)を4行目の要素とする4要素の縦行列を論理シフトする。この論理シフトはS5(x)が上3バイトシフトで実現され、またS6(x)が上2バイトシフト、S7(x)が上1バイトシフトで実現される。このことから、図5の処理においてS6(x1),S7(x2),S8(x3),S5(x4)はそれぞれs(x1)と上2バイトシフト、s(x2)と上1バイトシフト、s(x3),s(x4)と上3バイトシフトで実現できることがわかる。同様のことがS5(x5),S6(x6),S7(x7),S8(x8)についてもいえるので、図5の処理のテーブル参照はs(x)を得るテーブル参照と6回のシフトでも実現できることになる。このとき、使用するテーブルサイズは256Bとなる。
【0037】
最後に、256Bのテーブルを利用したときの実装法について述べる。ここで利用するテーブルはもともとのs−boxそのものである。この実施例の説明に示したP行列中の2つの行を取出し、対応する要素が一致しないものの数、いわゆるハミング重みの差が最小となるような順に演算を行う。このとき、上記のP関数処理は、
【0038】
【数40】
Figure 0003736731
【0039】
ここで、zi=S(Xi),(i=1,…,8)であることを考慮すると、S関数処理とP関数処理との合成処理はテーブル参照8回、排他的論理和25回で構成可能であることがわかる。
以上に述べた結果をまとめると、本実施例では、
(1)4KBのメモリを使用したときにはテーブル参照8回、排他的論理和8回、ローテーション1回の演算処理、
(2)4KBのメモリを使用したときにはテーブル参照8回、排他的論理和10回、ローテーション4回の演算処理、
(3)256Bのメモリを使用したとき、テーブル参照8回、シフト6回、排他的論理和10回、ローテーション4回の演算処理、
(4)256Bのメモリを使用したときにはテーブル参照8回、排他的論理和25回の演算処理、
の4種類の高速実装方法が提供できる。ちなみに、E2暗号での青木らの文献の結果によれば、E2暗号での高速実装結果は、
A)4KBのメモリを使用したときにはテーブル参照8回、排他的論理和11回、シフト演算4回の演算処理(このほかにデータのメモリ退避1回)、
B)8KBのメモリを使用したときにはテーブル参照12回、排他的論理和11回の演算処理、
C)256Bのメモリを使用したときの実装法について記述なし
である。ここで、テーブル参照は排他的論理和やシフト、ローテーションなどと比較して極めて低速な処理であることに注意。したがって、この実施例の置換処理のほうが、E2暗号で使われていた置換処理よりも高速で、かつ様々な実装環境に応じた柔軟な実装が可能となる。
実施例2
以下、この発明の実施例2を、図面を用いて説明する。
【0040】
図7は、この発明の実施例2を示す置換処理装置におけるS関数処理とP関数処理との合成処理を抜き出して示したものである。この合成処理は、
【0041】
【数41】
Figure 0003736731
という処理が行なわれ、行列表現z′=P・z=P・s(x)として、
【0042】
【数42】
Figure 0003736731
のように表される。これは、
【0043】
【数43】
Figure 0003736731
とすると、
【0044】
【数44】
Figure 0003736731
【0045】
と表すことができる。
この式による置換処理は実施例の対応する式との比較から、図2に示した構成と同様に構成できる。つまり図8に示すように、図2に対し、入力データx1〜x8中のx5,x6,x7,x8によるテーブルの参照がそれぞれS4,S1,S2,S3である点と、ローテーション回路18で下に1バイトローテーションを行う点が異なる。またこの場合も図4に示した処理手順と同様にしてコンピュータにより処理できることも容易に理解できよう。
同様に、下記の4KBメモリを用いることもできる。
【0046】
【数45】
Figure 0003736731
【0047】
この場合の置換処理の構成は図9に示すように、図5に示した構成とほぼ同様である。ただ入力データx1〜x8中のx1,x2,x3,x4による参照がそれぞれS8,S5,S6,S7である点と、回路37で上に1バイトローテーションする点と、回路39で下に1バイトローテーションする点と、回路44で上に1バイトローテーションする点が異なる。またこの場合も図6に示した処理手順と同様にしてコンピュータにより処理できることも容易に理解されよう。
【0048】
従ってこの実施例においても実施例1と同様に、
(1)4KBのメモリを使用したとき図8から、テーブル参照8回、排他的論理和8回、ローテーション1回で構成可能であることがわかる。なお、前述したようにローテーションと排他的論理和は並列処理が可能であることを考慮すると、図中の点線部の処理は2演算で処理が完了する。
(2)4KBのメモリを使用したとき、図9から、テーブル参照8回、排他的論理和10回、ローテーション4回で構成可能であることがわかる。なお、前述したようにローテーションと排他的論理和は並列処理が可能であることを考慮すると、図中の点線部の処理は4演算で処理が完了する。
(3)図9におけるテーブル参照は、実施例1で説明したのと同様の理由によりテーブル参照8回とシフト6回で実現できる。したがって、256Bのメモリを使用したとき、テーブル参照8回、シフト6回、排他的論理和10回、ローテーション4回の演算処理でも実現可能である。
(4)256Bのメモリを使用したときにはテーブル参照8回、排他的論理和25回の演算処理、
の4種類の高速実装方法が提供できる。
【0049】
実施例3
以下、この発明の実施例3を、図面を用いて説明する。
図10は、この発明の実施例3を示す置換処理装置におけるS関数処理とP関数処理との合成処理を抜き出して示したものである。この合成処理は、
【0050】
【数46】
Figure 0003736731
という処理が行なわれ、行列表現z′=P・z=P・s(x)として、
【0051】
【数47】
Figure 0003736731
のように表される。これは、
【0052】
【数48】
Figure 0003736731
とすると、
【0053】
【数49】
Figure 0003736731
【0054】
と表すことができる。
この実施例においても、実施例1と同様の考え方により、4KBメモリを使用した場合、図11に示すように実施例1の図2に示した構成と同様に構成することができ、4KBメモリのテーブルの参照で表わした式と、実施例2の対応する式との差から、図8に示した構成に対し、回路18で上に1バイトローテーションを行うようにした点を異ならせればよい。またこの置換処理を図4に示した手順とほぼ同様にコンピュータにより処理させることもできることは容易に理解できよう。
【0055】
4KBメモリを使用した別の場合は、図12に示すように実施例1の図5に示した構成と同様に構成することができる。ただ入力データx1〜x6中のx1,x2,x3,x4によりそれぞれテーブルS5,S6,S7,S8を参照する点、回路37で上に1バイトローテーションを行う点、回路39で下に1バイトローテーションを行う点、回路42で上に1バイトローテーションを行う点、回路44で上に1バイトローテーションを行う点、更に回路45の演算結果Fを回路46で下に2バイトローテーションを行って出力する点が図5と異なる。またこの場合も図6に示した処理手順に順じて同様にコンピュータにより置換処理を行うこともできることは容易に理解できよう。
【0056】
以上より
(1)4KBのメモリを使用したとき図11から、テーブル参照8回、排他的論理和8回、ローテーション1回で構成可能であることがわかる。なお、前述したようにローテーションと排他的論理和は並列処理が可能であることを考慮すると、図中の点線部の処理は2演算で処理が完了する。
(2)4KBのメモリを使用したとき、図12から、テーブル参照8回、排他的論理和10回、ローテーション5回で構成可能であることがわかる。なお、前述したようにローテーションと排他的論理和は並列処理が可能であることを考慮すると、図中の点線部の処理は5演算で処理が完了する。
(3)図12におけるテーブル参照は、実施例1で説明したのと同様の理由によりテーブル参照8回とシフト6回で実現できる。したがって、256Bのメモリを使用したとき、テーブル参照8回、シフト6回、排他的論理和10回、ローテーション5回の演算処理でも実現可能である。
(4)256Bのメモリを使用したときにはテーブル参照8回、排他的論理和25回の演算処理、
の4種類の高速実装方法が提供できる。
【0057】
実施例4
以下、この発明の実施例4を、図面を用いて説明する。
図13は、この発明の実施例4を示す置換処理装置におけるS関数処理とP関数処理との合成処理を抜き出して示したものである。この合成処理は、
【0058】
【数50】
Figure 0003736731
という処理が行なわれ、行列表現z′=P・z=P・s(x)として、
【0059】
【数51】
Figure 0003736731
のように表される。これは、
【0060】
【数52】
Figure 0003736731
とすると、
【0061】
【数53】
Figure 0003736731
【0062】
と表すことができる。
この実施例においても、実施例1と同様の考え方により、4KBメモリを用いた場合、この32ビットテーブルで表現した式を、実施例1の場合と比較すれば直ちに理解されるように、図14に示すように、図2中の回路18を下に1バイトローテーションに変更すればよい。またこの置換処理を図4に示した手順と同様にコンピュータにより行うこともできる。
【0063】
4KBメモリを用いた別の場合、図15に示すように図5に示した構成と同様に構成できる。ただ入力データx1〜x8中のx1,x2,x3,x4によりそれぞれテーブルS5,S6,S7,S8を参照する点、回路42で下に1バイトローテーションを行う点、回路45の演算結果Fを回路46で上に2バイトローテーションを行って出力する点が図2と異なる。またこの場合も、図6に示した処理手順とほぼ同様にコンピュータにより処理を行うこともできる。
【0064】
以上より
(1)4KBのメモリを使用したとき図14から、テーブル参照8回、排他的論理和8回、ローテーション1回で構成可能であることがわかる。なお、前述したようにローテーションと排他的論理和は並列処理が可能であることを考慮すると、図中の点線部の処理は2演算で処理が完了する。
(2)4KBのメモリを使用したとき、図15から、テーブル参照8回、排他的論理和10回、ローテーション5回で構成可能であることがわかる。なお、前述したようにローテーションと排他的論理和は並列処理が可能であることを考慮すると、図中の点線部の処理は5演算で処理が完了する。
(3)図15におけるテーブル参照は、実施例1で説明したのと同様の理由によりテーブル参照8回とシフト6回で実現できる。したがって、256Bのメモリを使用したとき、テーブル参照8回、シフト6回、排他的論理和10回、ローテーション5回の演算処理でも実現可能である。
(4)256Bのメモリを使用したときにはテーブル参照8回、排他的論理和25回の演算処理、
の4種類の高速実装方法が提供できる。
【0065】
【発明の効果】
以上、詳細に説明したように、この発明によれば、S−P構造を用いた置換処理装置において、S関数処理と行列Pで表現される置換(P関数処理)との合成処理を、
【0066】
【数54】
Figure 0003736731
【0067】
(ただし、<<<yは上yバイトのローテーション、S1(・)〜S8(・)のテーブルは32ビット参照テーブルを表す。なお、y<0のときは下|y|バイトのローテーションを表すものとする。)
のように書き直すことが可能となるような構造にすることによって、少なくとも(1)8KBのメモリを使用したときにはテーブル参照8回、排他的論理和8回、ローテーション1回の演算処理、(2)4KBのメモリを使用したときにはテーブル参照8回、排他的論理和10回、ローテーション4回または5回の演算処理、(3)256Bのメモリを使用したときにはテーブル参照8回、排他的論理和25回の演算処理、の3種類の高速実装方法が提供できる。なお、実施例のように、(2)の実装方法のときには、4KBのメモリを使用したテーブル参照の代わりに、256Bのメモリを使用したテーブル参照と6回のシフト演算によっても実現可能であり、このときテーブル参照8回、シフト6回、排他的論理和10回、ローテーション4回または5回の演算処理となる。また、特に{S1(・),S2(・),S3(・),S4(・)}={S5(・),S6(・),S7(・),S8(・)}を満たすのであれば、(1)の実装方法の時にはさらに4KBのメモリ使用量を削減可能であり、使用メモリは4KBとなる(他の演算処理量は変化しない)。これによって、E2暗号で使われていた置換処理よりも高速で、かつ合成処理そのものは同じでありながら、(1)の実装方法はPC向き、(2)は32ビットCPUを備えたハイエンドICカード向き、(3)は8ビットCPUを備えたローエンドICカード向きというように多様な実装環境に応じて最適かつ柔軟な実装が可能となる置換処理装置を提供できる。
【図面の簡単な説明】
【図1】この発明の実施例1における置換処理装置における処理を表す図。
【図2】実施例1における置換処理装置中のS関数処理と行列Pで表現される置換(P関数処理)との合成処理における4KBのメモリを使用したときの処理を表す図。
【図3】実施例1をコンピュータにより処理する場合の構成を示す図。
【図4】実施例1をコンピュータにより処理する場合の処理手順の例を示す流れ図。
【図5】実施例1における置換処理装置中のS関数処理と行列Pで表現される置換(P関数処理)との合成処理における4KBのメモリを使用したときのもう1つの処理を表す図。
【図6】実施例1の装置を4KBメモリを用いてコンピュータにより処理をする場合の処理手順の例を示す流れ図。
【図7】この発明の実施例2における置換処理装置における処理を表す図。
【図8】実施例2における置換処理装置中のS関数処理と行列Pで表現される置換(P関数処理)との合成処理における4KBのメモリを使用したときの処理を表す図。
【図9】実施例2における置換処理装置中のS関数処理と行列Pで表現される置換(P関数処理)との合成処理における4KBのメモリを使用したときのもう1つの処理を表す図。
【図10】この発明の実施例3における置換処理装置における処理を表す図。
【図11】実施例3における置換処理装置中のS関数処理と行列Pで表現される置換(P関数処理)との合成処理における4KBのメモリを使用したときの処理を表す図。
【図12】実施例3における置換処理装置中のS関数処理と行列Pで表現される置換(P関数処理)との合成処理における4KBのメモリを使用したときのもう1つの処理を表す図。
【図13】実施例4における置換処理装置における処理を表す図。
【図14】実施例4における置換処理装置中のS関数処理と行列Pで表現される置換(P関数処理)との合成処理における4KBのメモリを使用したときの処理を表す図。
【図15】実施例4における置換処理装置中のS関数処理と行列Pで表現される置換(P関数処理)との合成処理における4KBのメモリを使用したときのもう1つの処理を表す図。
【図16】E2暗号の置換処理を表す図。
【図17】E2暗号での第1のS関数処理と行列Pで表現される置換(P関数処理)との合成処理における高速な処理例を表す図。
【図18】E2暗号での第1のS関数処理と行列Pで表現される置換(P関数処理)との合成処理における別の高速な処理例を表す図。[0001]
BACKGROUND OF THE INVENTION
The present invention is mainly used in encryption technology, and in particular, used in a common key cryptosystem that encrypts or decrypts data in units of blocks under the control of a secret key. The first nonlinear transformation S-linear transformation The present invention relates to a replacement processing apparatus suitable for an apparatus that performs P-second nonlinear transformation S or an apparatus that performs nonlinear transformation S-linear transformation P.
[0002]
[Prior art]
An encryption technique is effective for concealing data. Encryption methods include common key encryption and public key encryption. A method using the same secret key for encryption and decryption is called common key encryption, and a method using different keys for encryption and decryption is called public key encryption. . From the viewpoint of processing speed, the common key encryption is more advantageous.
In order to construct a high-speed and secure common key cryptosystem, a method of dividing data to be encrypted into blocks of an appropriate length and encrypting each block is called a block cipher. As one of such encryption methods, E2 encryption (for example, the document “Kanda et al .:“ Proposal of 128-bit block cipher E2 ”, electronic information) that uses the SPS structure to enhance the security in replacement processing. Communication Association Information Security Study Group ISEC 98-12 ”).
[0003]
FIG. 16 shows a replacement process used in the E2 encryption. The P function processing in this case is combined with the first S function processing as a matrix expression z ′ = P · z = P · s (x),
[0004]
[Expression 24]
Figure 0003736731
It is expressed as
[0005]
[Expression 25]
Figure 0003736731
[0006]
The process is performed. Here, s (x) represents a value subjected to nonlinear transformation by an s-box constituting the first S function with x as an input.
Several high-speed implementation methods for the synthesis process of the first S function process and the replacement process (P function process) represented by the matrix P composed of {0, 1} elements have been considered. Et al .: “E2 software implementation, 1999 Cryptography and Information Security Symposium SCIS99-F1-2.2” describes its implementation.
For example, as an implementation example on a 32-bit processor, the following four 32-bit lookup tables
[0007]
[Equation 26]
Figure 0003736731
When the above is prepared, the above S function processing and P function processing composition processing can be rewritten as follows.
[0008]
[Expression 27]
Figure 0003736731
[0009]
Here, >> y is a logical shift of lower y bytes, and << y is a logical shift of upper y bytes. The vertical and horizontal lines in the above matrix are entered for easy understanding of the relationship between the matrix P.S (x) on the left side and the matrix composed of S1 (.) To S4 (.) On the right side. There is no meaning.
At this time, as shown in FIG. 17, in the synthesis process of the first S function process and the P function process, tables S1 (.) To S4 (.) That can be referred to all values of x, that is, 4 KB. Uses memory (the tables of S1 (•) to S4 (•) each require 1 KB of memory), and x1~ X8Requires 8 table references, 11 exclusive ORs, and 4 shift operations. In addition, although not specifically described in this document, it should be noted that in actual implementation, in addition to these arithmetic processes, halfway data memory saving is required once.
In another implementation example, the following four 32-bit reference tables in addition to the above-described tables of S1 (.) To S4 (.)
[0010]
[Expression 28]
Figure 0003736731
By preparing the above, the above replacement process can be rewritten as follows.
[0011]
[Expression 29]
Figure 0003736731
[0012]
At this time, in the synthesis process of the first S function process and the P function process, an 8 KB memory (the tables of S1 (•) to S8 (•) each require a 1 KB memory) is used. As shown in FIG. 18, it requires 12 table references and 11 exclusive ORs.
As explained above, the high-speed mounting method in the synthesis process of the first S function process and the P function process used in the E2 cipher is a table reference and an exclusive process even if the memory is used in 4 to 8 KB. The amount of processing such as logical OR or shift operation is large, and it cannot be said that it is always fast. In addition, when the memory usage is limited, the processing volume is expected to increase further.
[0013]
[Problems to be solved by the invention]
An object of the present invention is to realize a P function having a variety of implementations in a replacement process having at least an SP structure, thereby making the security in the replacement process the same and adapting to various mounting environments. A replacement processing apparatus that enables high-speed mounting in the synthesis processing of the optimal implementation, in particular, the synthesis processing of the S function processing and the replacement processing (P function processing) represented by the matrix P composed of {0, 1} elements. The purpose is to provide.
[0014]
[Means for Solving the Problems]
In the present invention, in the replacement processing apparatus for achieving the above object, the synthesis processing of the S function processing (nonlinear conversion processing) and the replacement processing expressed by the matrix P (P function processing: linear conversion processing) is as follows. By adopting such a structure that can be rewritten as described above, flexible high-speed mounting according to various mounting environments becomes possible.
[0015]
[30]
Figure 0003736731
[0016]
Here, << y is the y-byte rotation above, and the tables S1 (•) to S8 (•) represent reference tables. When y <0, | y | byte rotation is shown below.
[0017]
[Action]
According to the present invention, as a high-speed mounting method in the synthesis process of the S function process and the replacement process (P function process) expressed by the matrix P, at least (1) when the 8 KB memory is used, the table is referenced 8 times. Exclusive logical sum 8 times, rotation 1 time arithmetic processing, (2) When 4KB memory is used, table reference 8 times, exclusive logical sum 10 times, rotation 4 times or 5 times arithmetic processing, (3) 256B When this memory is used, it is possible to realize three types of operation processing: 8 times of table reference and 25 times of exclusive OR. In the mounting method (2), instead of table reference using 4 KB memory, it can be realized by table reference using 256 B memory and 6 shift operations. At this time, table reference 8 times , 6 shifts, 10 exclusive ORs, 4 or 5 rotations. In particular, {S1 (•), S2 (•), S3 (•), S4 (•)} = {S5 (•), S6 (•), S7 (•), S8 (•)} For example, in the mounting method of (1), the memory usage of 4 KB can be further reduced, and the used memory becomes 4 KB (the other calculation processing amount does not change).
[0018]
As a result, it is possible to provide a replacement processing apparatus that can be mounted faster and more flexibly than the replacement processing used in E2 cryptography. Furthermore, although the synthesis process is the same, (1) mounting method is for PC, (2) is for high-end IC card with 32-bit CPU, and (3) is for low-end IC card with 8-bit CPU. Thus, it is possible to implement an optimum and flexible mounting according to various mounting environments.
[0019]
DETAILED DESCRIPTION OF THE INVENTION
Example 1
Embodiment 1 of the present invention will be described below with reference to the drawings.
FIG. 1 shows extracted synthesis processing of S function processing and P function processing in the replacement processing apparatus showing Embodiment 1 of the present invention. This synthesis process
[0020]
[31]
Figure 0003736731
As a matrix expression z ′ = P · z = P · s (x),
[0021]
[Expression 32]
Figure 0003736731
It is expressed as this is,
[0022]
[Expression 33]
Figure 0003736731
Then,
[0023]
[Expression 34]
Figure 0003736731
Because
[0024]
[Expression 35]
Figure 0003736731
[0025]
It can be expressed as.
First, an implementation method when a 4 KB table is used will be described. The tables prepared here are four of the following 32-bit reference tables, and each table uses a memory amount of 1 KB.
[0026]
[Expression 36]
Figure 0003736731
The synthesis process of the S function process and the P function process can be rewritten as follows.
[0027]
[Expression 37]
Figure 0003736731
[0028]
Therefore, a processing diagram for performing such processing is as shown in FIG. X1, X2, XThree, XFourReferring to the tables S1, S2, S3, and S4, S1 (x1), S2 (x2), S3 (xThree), S4 (xFour), And these exclusive ORs are obtained by the circuits 11, 12, 13 and xFive, X6, X7, X8Referring to the tables S2, S3, S4 and S1, respectively, S2 (xFive), S3 (x6), S4 (x7), S1 (x8) And these exclusive ORs are obtained by the circuits 14, 15 and 16, and the exclusive OR operation result U2And the result of the exclusive OR operation U1Is obtained by the circuit 17 and z1′, Z2′, ZThree′, ZFour'And the exclusive OR operation result U from the circuit 162On the other hand, the upper one-byte rotation is performed by the circuit 18, and the exclusive OR operation is performed by the output of the circuit 17 and the circuit 19 z.Five′, Z6′, Z7′, Z8'Is obtained.
[0029]
This conversion process can also be performed by a computer. For example, as shown in FIG. 3, the control unit 21 composed of the CPU reads out the program stored in the program memory 22, executes the decoding, and performs the processing shown in FIG. In other words, the data x through the input unit 231~ X8And temporarily stores it in the storage unit 24 (step 1), and each of the data x1~ X8Are sequentially retrieved, the corresponding table in the table memory 25 is referred to (step 2), and the reference result is temporarily stored in the storage unit 24 (step 3). That is, in this example, the reference result S1 (x1), S2 (x2), S3 (xThree), S4 (xFour), S2 (xFive), S3 (x6), S4 (x7), S1 (x8) Is stored in the storage unit 24.
[0030]
S1 (x1), S2 (x2), S3 (xThree), S4 (xFour) And these exclusive OR operations are performed by the operation unit 26 of the control unit 21 (step 4), and the operation result U1Is temporarily stored in the storage unit 24, and S2 (xFive), S3 (x6), S4 (x7), S1 (x8), And the operation unit 26 performs these exclusive OR operations (step 5).2And the calculation result U1Is calculated by the calculation unit 26 (step 6-1) and the calculation result U is calculated by the rotation unit 27 of the control unit 21.2On the other hand, the lower 1-byte rotation is performed (step 6-2), and the operation unit 26 performs an exclusive OR operation between the rotation result and the result of the exclusive OR operation in step 6 (step 7). The calculation result U of this step 41Z1′, Z2′, ZThree′, ZFour′ And the operation result of step 8 is zFive′, Z6′, Z7′, Z8'Is output from the output unit 28 (step 8).
[0031]
It can be seen that the above replacement process can be configured with eight table references, eight exclusive ORs, and one rotation. When the input to the rotation circuit 18 is (one) input to another exclusive OR circuit 17, the rotation and exclusive OR can be processed in parallel. Therefore, the processing of the dotted line portion in FIG. 2 is completed in two operations when parallel processing is considered.
Next, a mounting method when another 4 KB memory is used will be described. The tables prepared here are four of the following 32-bit reference tables, and each table uses a memory amount of 1 KB.
[0032]
[Formula 38]
Figure 0003736731
At this time, the synthesis process of the first S function process and the P function process can be rewritten as follows.
[0033]
[39]
Figure 0003736731
[0034]
Therefore, the processing for performing such processing is as shown in FIG. That is, input data x1, X2, XThree, XFourTables S6, S7, S8, and S5 are referred to and S6 (x1), S7 (x2), S8 (xThree), S5 (xFourThese are subjected to an exclusive OR operation by the circuits 31, 32 and 33, and the operation result A is output from the circuit 33. Input data xFive, X6, X7, X8Tables S5, S6, S7, and S8 are referred to by S5 (xFive), S6 (x6), S7 (x7), S8 (x8These are subjected to exclusive OR operation by the circuits 34, 35 and 36, and the operation result B is output from the circuit 36. The operation result A is rotated one byte downward by the circuit 37 and is exclusive ORed with the operation result B by the circuit 38. The operation result C is rotated one byte upward by the circuit 39 and an exclusive OR operation with the output of the circuit 37 is performed by the circuit 41. The operation result D is rotated by 2 bytes upward in the circuit 42 and an exclusive OR operation with the output of the circuit 39 is performed in the circuit 43. The operation result E is rotated down by 1 byte in the circuit 44, and an exclusive OR operation with the output of the circuit 42 is performed in the circuit 45. The output F of the circuit 45 is z1′, Z2′, ZThree′, ZFour′, The output of the circuit 44 is zFive′, Z6′, Z7′, Z8Is output as ′.
[0035]
In order to perform this replacement process by a computer, the table memory 25 in FIG. 3 is provided with S5, S6, S7, and S8 instead of the tables S1, S2, S3, and S4, and the data x in step 1 as shown in FIG.1~ X8And store it in the storage unit 24, and in step 2, each data xiS6 (x1), S7 (x2), S8 (xThree), S5 (xFour), S5 (xFive), S6 (x6), S7 (x7), S8 (x8) And are stored in the storage unit 24 in step 3. In step 4, S6 (x1), S7 (x2), S8 (xThree), S5 (xFour), These exclusive OR operations are performed by the arithmetic unit 26, and the result A is stored in the storage unit 24. In step 5, S5 (xFive), S6 (x6), S7 (x7), S8 (x8) And these exclusive OR operations are performed by the arithmetic unit 26. In step 6-1, the result B is rotated downward by 1 byte by the rotation unit 27. In step 6-2, an exclusive OR operation is performed on the operation result A and the operation result B, and the operation result C is converted to step 7- Rotate 1 byte upward by 1, and simultaneously perform an exclusive OR operation between the operation result C and the rotation result of step 6-1 at step 7-2. The operation result D is rotated up to 2 bytes in step 8-1, and the result of rotation in step 7-1, the operation result D and exclusive OR operation are performed in step 8-2. The operation result E is rotated downward by 1 byte in step 9-1, and in step 9-2, an exclusive OR operation between the rotation result of step 8-1 and the operation result E is performed. Each result of -2 is output in step 10.
[0036]
According to the replacement process shown in FIGS. 5 and 6, it can be configured by referring to the table 8 times, exclusive OR 10 times, and rotation 4 times. As described above, considering that rotation and exclusive OR can be performed in parallel, the processing of the dotted line in FIG. 5 is completed with four operations.
Further, S5 (x) to S8 (x) can be realized by s (x) and shift processing. That is, s (x) is obtained by referring to an 8-bit table by x, and a 4-element vertical matrix having s (x) as an element in the fourth row is logically shifted. This logical shift is realized by shifting the upper 3 bytes of S5 (x), shifting the upper 2 bytes of S6 (x), and shifting the upper 1 byte of S7 (x). From this, S6 (x1), S7 (x2), S8 (xThree), S5 (xFour) Is s (x1) And upper 2 byte shift, s (x2) And upper 1 byte shift, s (xThree), S (xFour) And an upper 3 byte shift. The same is true for S5 (xFive), S6 (x6), S7 (x7), S8 (x8Therefore, the table reference in the process of FIG. 5 can be realized by a table reference for obtaining s (x) and six shifts. At this time, the table size to be used is 256B.
[0037]
Finally, an implementation method when using the 256B table will be described. The table used here is the original s-box itself. Two rows in the P matrix shown in the description of this embodiment are taken out, and operations are performed in the order that minimizes the difference in the number of corresponding elements that do not match, that is, the so-called Hamming weight difference. At this time, the above P function processing is
[0038]
[Formula 40]
Figure 0003736731
[0039]
Where zi= S (Xi), (I = 1,..., 8), it can be seen that the synthesizing process of the S function process and the P function process can be configured with 8 table references and 25 exclusive ORs.
To summarize the results described above, in this example,
(1) When a 4 KB memory is used, the table is referred to 8 times, exclusive OR 8 times, and rotation 1 time.
(2) When a 4 KB memory is used, the table is referred to 8 times, exclusive OR 10 times, and rotation 4 times.
(3) When a 256B memory is used, arithmetic processing is performed 8 times with reference to the table, 6 times with shift, 10 times with exclusive OR, and 4 times with rotation.
(4) When the 256B memory is used, the table is referred to 8 times and the exclusive OR is 25 times.
4 types of high-speed mounting methods can be provided. By the way, according to the result of Aoki et al. In E2 cipher, the result of high-speed implementation in E2 cipher is
A) When a 4 KB memory is used, the table is referenced 8 times, the exclusive OR 11 times, and the shift operation 4 times (in addition to the data memory save 1 time),
B) When using an 8 KB memory, the table is referenced 12 times, and the exclusive OR is 11 times.
C) No description of implementation method when using 256B memory
It is. Note that table referencing is extremely slow compared to exclusive OR, shift, and rotation. Therefore, the replacement process of this embodiment is faster than the replacement process used in the E2 cipher and can be implemented flexibly according to various mounting environments.
Example 2
Embodiment 2 of the present invention will be described below with reference to the drawings.
[0040]
FIG. 7 shows a synthesis process of the S function process and the P function process in the replacement processing apparatus showing Embodiment 2 of the present invention. This synthesis process
[0041]
[Expression 41]
Figure 0003736731
As a matrix expression z ′ = P · z = P · s (x),
[0042]
[Expression 42]
Figure 0003736731
It is expressed as this is,
[0043]
[Equation 43]
Figure 0003736731
Then,
[0044]
(44)
Figure 0003736731
[0045]
It can be expressed as.
The replacement process by this formula can be configured in the same manner as the configuration shown in FIG. 2 by comparison with the corresponding formula in the embodiment. In other words, as shown in FIG.1~ X8X insideFive, X6, X7, X8The table is referred to by S4, S1, S2, and S3, respectively, and the rotation circuit 18 performs a 1-byte rotation downward. Also in this case, it can be easily understood that the processing can be performed by a computer in the same manner as the processing procedure shown in FIG.
Similarly, the following 4 KB memory can also be used.
[0046]
[Equation 45]
Figure 0003736731
[0047]
The configuration of the replacement process in this case is almost the same as the configuration shown in FIG. 5, as shown in FIG. Just input data x1~ X8X inside1, X2, XThree, XFourAre the reference points S8, S5, S6, and S7, the point that the circuit 37 rotates 1 byte upward, the point that the circuit 39 rotates 1 byte downward, and the point that the circuit 44 rotates 1 byte upward, respectively. Is different. In this case, it can be easily understood that the processing can be performed by a computer in the same manner as the processing procedure shown in FIG.
[0048]
Therefore, in this embodiment, as in the first embodiment,
(1) When a 4 KB memory is used, it can be seen from FIG. 8 that the table can be configured with 8 times of table reference, 8 times of exclusive OR, and 1 time of rotation. In addition, considering that rotation and exclusive OR can be performed in parallel as described above, the processing of the dotted line portion in the figure is completed with two operations.
(2) When a 4 KB memory is used, it can be seen from FIG. 9 that the table can be configured with 8 times of table reference, 10 times of exclusive OR, and 4 times of rotation. In addition, considering that rotation and exclusive OR can be performed in parallel as described above, the processing of the dotted line portion in the figure is completed with four operations.
(3) The table reference in FIG. 9 can be realized with eight table references and six shifts for the same reason as described in the first embodiment. Therefore, when a 256-B memory is used, it is possible to realize the calculation process with 8 times of table reference, 6 times of shift, 10 times of exclusive OR, and 4 times of rotation.
(4) When the 256B memory is used, the table is referred to 8 times and the exclusive OR is 25 times.
4 types of high-speed mounting methods can be provided.
[0049]
Example 3
Embodiment 3 of the present invention will be described below with reference to the drawings.
FIG. 10 shows the combined processing of the S function processing and the P function processing in the replacement processing apparatus showing Embodiment 3 of the present invention. This synthesis process
[0050]
[Equation 46]
Figure 0003736731
As a matrix expression z ′ = P · z = P · s (x),
[0051]
[Equation 47]
Figure 0003736731
It is expressed as this is,
[0052]
[Formula 48]
Figure 0003736731
Then,
[0053]
[Formula 49]
Figure 0003736731
[0054]
It can be expressed as.
Also in this embodiment, when a 4 KB memory is used in the same way as in the first embodiment, it can be configured similarly to the configuration shown in FIG. 2 of the first embodiment as shown in FIG. Based on the difference between the expression shown by reference to the table and the corresponding expression in the second embodiment, the configuration shown in FIG. It can be easily understood that this replacement processing can be performed by a computer in substantially the same manner as the procedure shown in FIG.
[0055]
In another case where a 4 KB memory is used, a configuration similar to that shown in FIG. 5 of the first embodiment can be configured as shown in FIG. Just input data x1~ X6X inside1, X2, XThree, XFourPoints to refer to the tables S5, S6, S7, and S8, the point that the circuit 37 performs the 1-byte rotation, the circuit 39 that performs the 1-byte rotation, and the circuit 42 that performs the 1-byte rotation. 5 differs from FIG. 5 in that the circuit 44 performs 1-byte rotation upward, and further outputs the operation result F of the circuit 45 by performing 2-byte rotation downward in the circuit 46. Also in this case, it can be easily understood that the replacement process can be similarly performed by a computer in accordance with the processing procedure shown in FIG.
[0056]
From the above
(1) When a 4 KB memory is used, it can be seen from FIG. 11 that the table can be configured with eight table references, eight exclusive ORs, and one rotation. In addition, considering that rotation and exclusive OR can be performed in parallel as described above, the processing of the dotted line portion in the figure is completed with two operations.
(2) When a 4 KB memory is used, it can be seen from FIG. 12 that the table can be configured with 8 times of table reference, 10 times of exclusive OR, and 5 times of rotation. As described above, in consideration of the fact that rotation and exclusive OR can be performed in parallel, the processing of the dotted line in the figure is completed with five operations.
(3) The table reference in FIG. 12 can be realized with eight table references and six shifts for the same reason as described in the first embodiment. Therefore, when a 256-B memory is used, it is possible to realize an arithmetic process with 8 table references, 6 shifts, 10 exclusive ORs, and 5 rotations.
(4) When the 256B memory is used, the table is referred to 8 times and the exclusive OR is 25 times.
4 types of high-speed mounting methods can be provided.
[0057]
Example 4
Embodiment 4 of the present invention will be described below with reference to the drawings.
FIG. 13 shows the combined processing of S function processing and P function processing in the replacement processing apparatus showing Embodiment 4 of the present invention. This synthesis process
[0058]
[Equation 50]
Figure 0003736731
As a matrix expression z ′ = P · z = P · s (x),
[0059]
[Formula 51]
Figure 0003736731
It is expressed as this is,
[0060]
[Formula 52]
Figure 0003736731
Then,
[0061]
[53]
Figure 0003736731
[0062]
It can be expressed as.
Also in this embodiment, when a 4 KB memory is used based on the same concept as in the first embodiment, the expression expressed by this 32-bit table is readily understood by comparing with the case of the first embodiment, as shown in FIG. As shown in FIG. 2, the circuit 18 in FIG. This replacement process can also be performed by a computer in the same manner as the procedure shown in FIG.
[0063]
In another case using a 4 KB memory, as shown in FIG. 15, it can be configured similarly to the configuration shown in FIG. Just input data x1~ X8X inside1, X2, XThree, XFourReferring to the tables S5, S6, S7, and S8, respectively, the point that the circuit 42 performs 1-byte rotation, and the operation result F of the circuit 45 that is output by performing 2-byte rotation upward by the circuit 46. Different from 2. Also in this case, the processing can be performed by a computer in substantially the same manner as the processing procedure shown in FIG.
[0064]
From the above
(1) When a 4 KB memory is used, it can be seen from FIG. 14 that the table can be configured with 8 times of table reference, 8 times of exclusive OR, and 1 time of rotation. In addition, considering that rotation and exclusive OR can be performed in parallel as described above, the processing of the dotted line portion in the figure is completed with two operations.
(2) When a 4 KB memory is used, it can be seen from FIG. 15 that the table can be configured with 8 times of table reference, 10 times of exclusive OR, and 5 times of rotation. As described above, in consideration of the fact that rotation and exclusive OR can be performed in parallel, the processing of the dotted line in the figure is completed with five operations.
(3) The table reference in FIG. 15 can be realized with eight table references and six shifts for the same reason as described in the first embodiment. Therefore, when a 256-B memory is used, it is possible to realize an arithmetic process with 8 table references, 6 shifts, 10 exclusive ORs, and 5 rotations.
(4) When the 256B memory is used, the table is referred to 8 times and the exclusive OR is 25 times.
4 types of high-speed mounting methods can be provided.
[0065]
【The invention's effect】
As described above in detail, according to the present invention, in the replacement processing device using the SP structure, the synthesis process of the S function processing and the replacement expressed by the matrix P (P function processing)
[0066]
[Formula 54]
Figure 0003736731
[0067]
(<< y is a rotation of upper y bytes, and tables of S1 (·) to S8 (·) are 32-bit reference tables. When y << 0, lower | y | bytes are rotated. Suppose)
(1) When the 8 KB memory is used, at least (8) table reference operation, 8 exclusive OR operations, and 1 rotation operation processing. (2) When 4KB memory is used, table reference 8 times, exclusive OR 10 times, rotation 4 times or 5 times, (3) When 256B memory is used, table reference 8 times, exclusive OR 25 times 3 types of high-speed mounting methods can be provided. As in the embodiment, in the mounting method (2), instead of the table reference using the 4 KB memory, it can be realized by the table reference using the 256 B memory and six shift operations. At this time, the calculation process is 8 times with reference to the table, 6 times with the shift, 10 times with the exclusive OR, and 4 times or 5 times with the rotation. In particular, {S1 (•), S2 (•), S3 (•), S4 (•)} = {S5 (•), S6 (•), S7 (•), S8 (•)} For example, in the mounting method of (1), the memory usage of 4 KB can be further reduced, and the used memory becomes 4 KB (the other calculation processing amount does not change). As a result, it is faster than the replacement process used in E2 cryptography, and the synthesis process itself is the same, but the mounting method (1) is for PCs, and (2) is a high-end IC card equipped with a 32-bit CPU. Orientation, (3) can provide a replacement processing device that can be mounted optimally and flexibly according to various mounting environments, such as a low-end IC card equipped with an 8-bit CPU.
[Brief description of the drawings]
FIG. 1 is a diagram showing processing in a replacement processing apparatus according to Embodiment 1 of the present invention.
FIG. 2 is a diagram illustrating processing when a 4 KB memory is used in the synthesis processing of S function processing and replacement represented by a matrix P (P function processing) in the replacement processing apparatus according to the first exemplary embodiment.
FIG. 3 is a diagram showing a configuration when the first embodiment is processed by a computer.
FIG. 4 is a flowchart illustrating an example of a processing procedure when the first embodiment is processed by a computer.
FIG. 5 is a diagram illustrating another process when a 4 KB memory is used in the synthesis process of the S function process and the replacement represented by the matrix P (P function process) in the replacement processing apparatus according to the first embodiment.
FIG. 6 is a flowchart showing an example of a processing procedure when the apparatus of the first embodiment is processed by a computer using a 4 KB memory.
FIG. 7 is a diagram illustrating processing in a replacement processing apparatus according to Embodiment 2 of the present invention.
FIG. 8 is a diagram illustrating processing when a 4 KB memory is used in the synthesis processing of S function processing and replacement represented by a matrix P (P function processing) in the replacement processing apparatus according to the second embodiment.
FIG. 9 is a diagram illustrating another process when a 4 KB memory is used in the synthesis process of the S function process and the replacement represented by the matrix P (P function process) in the replacement processing apparatus according to the second embodiment.
FIG. 10 is a diagram showing processing in a replacement processing device according to Embodiment 3 of the present invention.
FIG. 11 is a diagram illustrating processing when a 4 KB memory is used in the synthesis processing of S function processing and replacement (P function processing) represented by a matrix P in the replacement processing device according to the third embodiment.
FIG. 12 is a diagram illustrating another process when a 4 KB memory is used in the synthesis process of the S function process and the replacement (P function process) represented by the matrix P in the replacement processing apparatus according to the third embodiment.
FIG. 13 is a diagram illustrating processing in a replacement processing device according to a fourth embodiment.
FIG. 14 is a diagram illustrating processing when a 4 KB memory is used in the synthesis processing of S function processing and replacement (P function processing) represented by a matrix P in the replacement processing apparatus according to the fourth embodiment.
FIG. 15 is a diagram illustrating another process when a 4 KB memory is used in the synthesis process of the S function process and the replacement (P function process) represented by the matrix P in the replacement processing apparatus according to the fourth embodiment.
FIG. 16 is a diagram illustrating an E2 encryption replacement process.
FIG. 17 is a diagram illustrating a high-speed processing example in the synthesis processing of the first S function processing in the E2 cipher and the replacement expressed by the matrix P (P function processing).
FIG. 18 is a diagram illustrating another example of high-speed processing in the synthesis processing of the first S function processing in E2 encryption and the replacement (P function processing) represented by the matrix P.

Claims (9)

入力データx1,x2,…,x8に対し、非線形変換と線形変換とを行う置換処理装置において、
上記非線形変換と上記線形変換の合成処理が
Figure 0003736731
のように表現することが可能であり、
ただし、Sj(・)(j=1,2,…,8)はxi(i=1,2,…,8)により32ビットテーブルを参照してSj(xi)を出力すること、<<<yはy>0の場合、上yバイトローテーション、y<0の場合は下|y|バイトローテーションを表わす。
S1(・),S2(・),…,S8(・)の各参照テーブルと、
上記参照テーブルを上記入力データにより参照する手段と、
上記参照テーブルの参照出力に対し排他的論理和演算を行う演算手段と、
排他的論理和演算に対しローテーションを施すローテーション手段と、
を具備し、
Figure 0003736731
であって、
上記テーブル参照手段はx1,x2,x3,x4,x5,x6,x7,x8によりそれぞれS1(x1),S2(x2),S3(x3),S4(x4),S4(x5),S1(x6),S2(x7),S3(x8)を出力する手段であり、
上記排他的論理和演算手段は、上記S1(x1),S2(x2),S3(x3),S4(x4)の排他的論理和演算を行って結果U1を得る手段と、上記S4(x5),S1(x6),S2(x7),S3(x8)の排他的論理和演算を行って結果U2を得る手段と、上記U1とU2の排他的論理和演算を行って結果U3を得る手段と、上記U3と上記ローテーション手段の出力の排他的論理和演算を行って結果U4を得る手段とよりなり、
上記ローテーション手段は上記U2を下に1バイトローテーションする手段であり、
上記U3,U4を置換処理結果z1′,z2′,…,z8′として出力することを特徴とする置換処理装置。
In a replacement processing device that performs nonlinear transformation and linear transformation on input data x 1 , x 2 ,..., X 8 ,
The synthesis process of the nonlinear transformation and the linear transformation is
Figure 0003736731
Can be expressed as
However, Sj (·) (j = 1, 2,..., 8) is to output Sj (x i ) by referring to the 32-bit table by x i (i = 1, 2,..., 8). << y represents upper y byte rotation when y> 0, and lower | y | byte rotation when y <0.
Each reference table of S1 (•), S2 (•),..., S8 (•),
Means for referring to the reference table by the input data;
Arithmetic means for performing an exclusive OR operation on the reference output of the reference table;
A rotation means for rotating the exclusive OR operation;
Comprising
Figure 0003736731
Because
Each said table referring means by x 1, x 2, x 3 , x 4, x 5, x 6, x 7, x 8 S1 (x 1), S2 (x 2), S3 (x 3), S4 ( x 4 ), S 4 (x 5 ), S 1 (x 6 ), S 2 (x 7 ), S 3 (x 8 )
The exclusive OR operation means performs the exclusive OR operation of the S1 (x 1 ), S2 (x 2 ), S3 (x 3 ), and S4 (x 4 ) to obtain a result U 1 ; Means for performing an exclusive OR operation of S4 (x 5 ), S 1 (x 6 ), S 2 (x 7 ), S 3 (x 8 ) to obtain a result U 2; and exclusive of U 1 and U 2 A means for obtaining a result U 3 by performing an OR operation, and a means for obtaining a result U 4 by performing an exclusive OR operation on the output of U 3 and the rotation means,
The rotation means is means for rotating the U 2 downward by 1 byte,
A replacement processing device characterized in that U 3 and U 4 are output as replacement processing results z 1 ′, z 2 ′,..., Z 8 ′.
入力データx1,x2,…,x8に対し、非線形変換と線形変換とを行う置換処理装置において、
上記非線形変換と上記線形変換の合成処理が
Figure 0003736731
のように表現することが可能であり、
ただし、Sj(・)(j=1,2,…,8)はxi(i=1,2,…,8)により32ビットテーブルを参照してSj(xi)を出力すること、<<<yはy>0の場合、上yバイトローテーション、y<0の場合は下|y|バイトローテーションを表わす。
S1(・),S2(・),…,S8(・)の各参照テーブルと、
上記参照テーブルを上記入力データにより参照する手段と、
上記参照テーブルの参照出力に対し排他的論理和演算を行う演算手段と、
排他的論理和演算に対しローテーションを施すローテーション手段と、
を具備し、
Figure 0003736731
であって、
上記テーブル参照手段はx1,x2,x3,x4,x5,x6,x7,x8によりそれぞれS1(x1),S2(x2),S3(x3),S4(x4),S4(x5),S1(x6),S2(x7),S3(x8)を出力する手段であり、
上記排他的論理和演算手段は、上記S1(x1),S2(x2),S3(x3),S4(x4)の排他的論理和演算を行って結果U1を得る手段と、上記S4(x5),S1(x6),S2(x7),S3(x8)の排他的論理和演算を行って結果U2を得る手段と、上記U1とU2の排他的論理和演算を行って結果U3を得る手段と、上記U3と上記ローテーション手段の出力の排他的論理和演算を行って結果U4を得る手段とよりなり、
上記ローテーション手段は上記U2を上に1バイトローテーションする手段であり、
上記U3,U4を置換処理結果z1′,z2′,…,z8′として出力することを特徴とする置換処理装置。
In a replacement processing device that performs nonlinear transformation and linear transformation on input data x 1 , x 2 ,..., X 8 ,
The synthesis process of the nonlinear transformation and the linear transformation is
Figure 0003736731
Can be expressed as
However, Sj (·) (j = 1, 2,..., 8) is to output Sj (x i ) by referring to the 32-bit table by x i (i = 1, 2,..., 8). << y represents upper y byte rotation when y> 0, and lower | y | byte rotation when y <0.
Each reference table of S1 (•), S2 (•),..., S8 (•),
Means for referring to the reference table by the input data;
Arithmetic means for performing an exclusive OR operation on the reference output of the reference table;
A rotation means for rotating the exclusive OR operation;
Comprising
Figure 0003736731
Because
Each said table referring means by x 1, x 2, x 3 , x 4, x 5, x 6, x 7, x 8 S1 (x 1), S2 (x 2), S3 (x 3), S4 ( x 4 ), S 4 (x 5 ), S 1 (x 6 ), S 2 (x 7 ), S 3 (x 8 )
The exclusive OR operation means performs the exclusive OR operation of the S1 (x 1 ), S2 (x 2 ), S3 (x 3 ), and S4 (x 4 ) to obtain a result U 1 ; Means for performing an exclusive OR operation of S4 (x 5 ), S 1 (x 6 ), S 2 (x 7 ), S 3 (x 8 ) to obtain a result U 2; and exclusive of U 1 and U 2 A means for obtaining a result U 3 by performing an OR operation, and a means for obtaining a result U 4 by performing an exclusive OR operation on the output of U 3 and the rotation means,
The rotation means is means for rotating the U 2 upward by 1 byte,
A replacement processing device characterized in that U 3 and U 4 are output as replacement processing results z 1 ′, z 2 ′,..., Z 8 ′.
入力データx1,x2,…,x8に対し、非線形変換と線形変換とを行う置換処理装置において、
上記非線形変換と上記線形変換の合成処理が
Figure 0003736731
のように表現することが可能であり、
ただし、Sj(・)(j=1,2,…,8)はxi(i=1,2,…,8)により32ビットテーブルを参照してSj(xi)を出力すること、<<<yはy>0の場合、上yバイトローテーション、y<0の場合は下|y|バイトローテーションを表わす。
S1(・),S2(・),…,S8(・)の各参照テーブルと、
上記参照テーブルを上記入力データにより参照する手段と、
上記参照テーブルの参照出力に対し排他的論理和演算を行う演算手段と、
排他的論理和演算に対しローテーションを施すローテーション手段と、
を具備し、
Figure 0003736731
であって、
上記テーブル参照手段はx1,x2,x3,x4,x5,x6,x7,x8によりそれぞれS1(x1),S2(x2),S3(x3),S4(x4),S2(x5),S3(x6),S4(x7),S1(x8)を出力する手段であり、
上記排他的論理和演算手段は、上記S1(x1),S2(x2),S3(x3),S4(x4)の排他的論理和演算を行って結果U1を得る手段と、上記S2(x5),S3(x6),S4(x7),S1(x8)の排他的論理和演算を行って結果U2を得る手段と、上記U1とU2の排他的論理和演算を行って結果U3を得る手段と、上記U3と上記ローテーション手段の出力の排他的論理和演算を行って結果U4を得る手段とよりなり、
上記ローテーション手段は上記U2を下に1バイトローテーションする手段であり、
上記U3,U4を置換処理結果z1′,z2′,…,z8′として出力することを特徴とする置換処理装置。
In a replacement processing device that performs nonlinear transformation and linear transformation on input data x 1 , x 2 ,..., X 8 ,
The synthesis process of the nonlinear transformation and the linear transformation is
Figure 0003736731
Can be expressed as
However, Sj (·) (j = 1, 2,..., 8) is to output Sj (x i ) by referring to the 32-bit table by x i (i = 1, 2,..., 8). << y represents upper y byte rotation when y> 0, and lower | y | byte rotation when y <0.
Each reference table of S1 (•), S2 (•),..., S8 (•),
Means for referring to the reference table by the input data;
Arithmetic means for performing an exclusive OR operation on the reference output of the reference table;
A rotation means for rotating the exclusive OR operation;
Comprising
Figure 0003736731
Because
Each said table referring means by x 1, x 2, x 3 , x 4, x 5, x 6, x 7, x 8 S1 (x 1), S2 (x 2), S3 (x 3), S4 ( x 4 ), S 2 (x 5 ), S 3 (x 6 ), S 4 (x 7 ), and S 1 (x 8 ).
The exclusive OR operation means performs the exclusive OR operation of the S1 (x 1 ), S2 (x 2 ), S3 (x 3 ), and S4 (x 4 ) to obtain a result U 1 ; the S2 (x 5), S3 ( x 6), S4 (x 7), means for obtaining the exclusive OR operation to be performed results U 2 of S1 (x 8), exclusive of said U 1 and U 2 A means for obtaining a result U 3 by performing an OR operation, and a means for obtaining a result U 4 by performing an exclusive OR operation on the output of U 3 and the rotation means,
The rotation means is means for rotating the U 2 downward by 1 byte,
A replacement processing device characterized in that U 3 and U 4 are output as replacement processing results z 1 ′, z 2 ′,..., Z 8 ′.
入力データx1,x2,…,x8に対し、非線形変換と線形変換とを行って出力データz1′,z2′,…,z8′を得る置換処理装置において、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS5(x)を出力する32ビットテーブルと、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS6(x)を出力する32ビットテーブルと、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS7(x)を出力する32ビットテーブルと、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS8(x)を出力する32ビットテーブルと、
1,x2,x3,x4,x5,x6,x7,x8により上記テーブルを参照してS6(x1),S7(x2),S8(x3),S5(x4),S5(x5),S6(x6),S7(x7),S8(x8)を出力するテーブル参照手段と、
上記S6(x1),S7(x2),S8(x3),S5(x4)の排他的論理和演算を行って結果Aを得る手段と、
上記S5(x5),S6(x6),S7(x7),S8(x8)の排他的論理和演算を行って結果Bを得る手段と、
AとBの排他的論理和演算を行ってCを得る手段と、
Aを下に1バイトローテーションする手段と、
そのローテーションの結果とCとの排他的論理和演算を行って結果Dを得る手段と、
Cを上に1バイトローテーションする手段と、
そのローテーションの結果とDとの排他的論理和演算を行って結果Eを得る手段と、
Dを上に2バイトローテーションする手段と、
そのローテーションの結果とEとの排他的論理和演算を行って結果Fを得る手段と、
Eを下に1バイトローテーションを行って結果Gを得る手段と、
を具備し、上記FとGを出力z1′,z2′,…,z8′とすることを特徴とする置換処理装置。
Input data x 1, x 2, ..., with respect to x 8, the output data z 1 performs a nonlinear transformation and linear transformation ', z 2', ..., the replacement processing unit to obtain the z 8 ',
The composition vector is
Figure 0003736731
A 32-bit table referenced by x and outputting S5 (x);
The composition vector is
Figure 0003736731
A 32-bit table that is referenced by x and outputs S6 (x);
The composition vector is
Figure 0003736731
A 32-bit table referenced by x and outputting S7 (x);
The composition vector is
Figure 0003736731
A 32-bit table that is referenced by x and outputs S8 (x);
Referring to the above table by x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 7 , x 8 , S 6 (x 1 ), S 7 (x 2 ), S 8 (x 3 ), S 5 ( x 4), S5 (x 5 ), S6 (x 6), S7 (x 7), a table reference means for outputting S8 (x 8),
Means for obtaining a result A by performing an exclusive OR operation of the above S6 (x 1 ), S7 (x 2 ), S8 (x 3 ), S5 (x 4 );
Means for performing the exclusive OR operation of S5 (x 5 ), S 6 (x 6 ), S 7 (x 7 ), and S 8 (x 8 ) to obtain a result B;
Means for performing an exclusive OR operation of A and B to obtain C;
Means to rotate A one byte down,
Means for performing an exclusive OR operation on the rotation result and C to obtain a result D;
Means to rotate C up by 1 byte;
Means for performing an exclusive OR operation of the rotation result and D to obtain a result E;
Means for rotating D up by 2 bytes;
Means for performing an exclusive OR operation of the rotation result and E to obtain a result F;
Means for rotating 1 byte below E to obtain the result G;
And F and G are output z 1 ′, z 2 ′,..., Z 8 ′.
入力データx1,x2,…,x8に対し、非線形変換と線形変換とを行って出力データz1′,z2′,…,z8′を得る置換処理装置において、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS5(x)を出力する32ビットテーブルと、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS6(x)を出力する32ビットテーブルと、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS7(x)を出力する32ビットテーブルと、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS8(x)を出力する32ビットテーブルと、
1,x2,x3,x4,x5,x6,x7,x8により上記テーブルを参照してS8(x1),S5(x2),S6(x3),S7(x4),S5(x5),S6(x6),S7(x7),S8(x8)を出力するテーブル参照手段と、
上記S8(x1),S5(x2),S6(x3),S7(x4)の排他的論理和演算を行なって結果Aを得る手段と、
上記S5(x5),S6(x6),S7(x7),S8(x8)の排他的論理和演算を行って結果Bを得る手段と、
AとBの排他的論理和演算を行ってCを得る手段と、
Aを上に1バイトローテーションする手段と、
そのローテーションの結果とCとの排他的論理和演算を行って結果Dを得る手段と、
Cを下に1バイトローテーションする手段と、
そのローテーションの結果とDとの排他的論理和演算を行って結果Eを得る手段と、
Dを上に2バイトローテーションする手段と、
そのローテーションの結果とEとの排他的論理和演算を行って結果Fを得る手段と、
Eを上に1バイトローテーションを行って結果Gを得る手段と、
を具備し、上記FとGを出力z1′,z2′,…,z8′とすることを特徴とする置換処理装置。
Input data x 1, x 2, ..., with respect to x 8, the output data z 1 performs a nonlinear transformation and linear transformation ', z 2', ..., the replacement processing unit to obtain the z 8 ',
The composition vector is
Figure 0003736731
A 32-bit table referenced by x and outputting S5 (x);
The composition vector is
Figure 0003736731
A 32-bit table that is referenced by x and outputs S6 (x);
The composition vector is
Figure 0003736731
A 32-bit table referenced by x and outputting S7 (x);
The composition vector is
Figure 0003736731
A 32-bit table that is referenced by x and outputs S8 (x);
Referring to the table by x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 7 , x 8 , S 8 (x 1 ), S 5 (x 2 ), S 6 (x 3 ), S 7 ( x 4), S5 (x 5 ), S6 (x 6), S7 (x 7), a table reference means for outputting S8 (x 8),
Means for performing an exclusive OR operation of S8 (x 1 ), S5 (x 2 ), S6 (x 3 ), and S7 (x 4 ) to obtain a result A;
Means for performing the exclusive OR operation of S5 (x 5 ), S 6 (x 6 ), S 7 (x 7 ), and S 8 (x 8 ) to obtain a result B;
Means for performing an exclusive OR operation of A and B to obtain C;
Means to rotate A up by 1 byte;
Means for performing an exclusive OR operation on the rotation result and C to obtain a result D;
Means to rotate C one byte down,
Means for performing an exclusive OR operation of the rotation result and D to obtain a result E;
Means for rotating D up by 2 bytes;
Means for performing an exclusive OR operation of the rotation result and E to obtain a result F;
Means for performing a 1-byte rotation on E and obtaining a result G;
And F and G are output z 1 ′, z 2 ′,..., Z 8 ′.
入力データx1,x2,…,x8に対し、非線形変換と線形変換とを行って出力データz1′,z2′,…,z8′を得る置換処理装置において、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS5(x)を出力する32ビットテーブルと、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS6(x)を出力する32ビットテーブルと、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS7(x)を出力する32ビットテーブルと、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS8(x)を出力する32ビットテーブルと、
1,x2,x3,x4,x5,x6,x7,x8により上記テーブルを参照してS5(x1),S6(x2),S7(x3),S8(x4),S5(x5),S6(x6),S7(x7),S8(x8)を出力するテーブル参照手段と、
上記S5(x1),S6(x2),S7(x3),S8(x4)の排他的論理和演算を行って結果Aを得る手段と、
上記S5(x5),S6(x6),S7(x7),S8(x8)の排他的論理和演算を行って結果Bを得る手段と、
AとBの排他的論理和演算を行ってCを得る手段と、
Aを上に1バイトローテーションする手段と、
そのローテーションの結果とCとの排他的論理和演算を行って結果Dを得る手段と、
Cを下に1バイトローテーションする手段と、
そのローテーションの結果とDとの排他的論理和演算を行って結果Eを得る手段と、
Dを上に1バイトローテーションする手段と、
そのローテーションの結果とEとの排他的論理和演算を行って結果Fを得る手段と、
Eを上に1バイトローテーションを行って結果Gを得る手段と、
Fを下に2バイトローテーションしてHを得る手段と、
を具備し、上記HとGを出力z1′,z2′,…,z8′とすることを特徴とする置換処理装置。
Input data x 1, x 2, ..., with respect to x 8, the output data z 1 performs a nonlinear transformation and linear transformation ', z 2', ..., the replacement processing unit to obtain the z 8 ',
The composition vector is
Figure 0003736731
A 32-bit table referenced by x and outputting S5 (x);
The composition vector is
Figure 0003736731
A 32-bit table that is referenced by x and outputs S6 (x);
The composition vector is
Figure 0003736731
A 32-bit table referenced by x and outputting S7 (x);
The composition vector is
Figure 0003736731
A 32-bit table that is referenced by x and outputs S8 (x);
Referring to the above table by x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 7 , x 8 , S 5 (x 1 ), S 6 (x 2 ), S 7 (x 3 ), S 8 ( x 4), S5 (x 5 ), S6 (x 6), S7 (x 7), a table reference means for outputting S8 (x 8),
Means for obtaining the result A by performing an exclusive OR operation of the above S5 (x 1 ), S6 (x 2 ), S7 (x 3 ), S8 (x 4 );
Means for performing the exclusive OR operation of S5 (x 5 ), S 6 (x 6 ), S 7 (x 7 ), and S 8 (x 8 ) to obtain a result B;
Means for performing an exclusive OR operation of A and B to obtain C;
Means to rotate A up by 1 byte;
Means for performing an exclusive OR operation on the rotation result and C to obtain a result D;
Means to rotate C one byte down,
Means for performing an exclusive OR operation of the rotation result and D to obtain a result E;
Means for rotating D up by 1 byte;
Means for performing an exclusive OR operation of the rotation result and E to obtain a result F;
Means for performing a 1-byte rotation on E and obtaining a result G;
Means to rotate F down 2 bytes to get H,
A replacement processing device characterized in that H and G are output as z 1 ′, z 2 ′,..., Z 8 ′.
入力データx1,x2,…,x8に対し、非線形変換と線形変換とを行って出力データz1′,z2′,…,z8′を得る置換処理装置において、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS5(x)を出力する32ビットテーブルと、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS6(x)を出力する32ビットテーブルと、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS7(x)を出力する32ビットテーブルと、
構成ベクトルが
Figure 0003736731
であり、xにより参照されてS8(x)を出力する32ビットテーブルと、
1,x2,x3,x4,x5,x6,x7,x8により上記テーブルを参照してS5(x1),S6(x2),S7(x3),S8(x4),S5(x5),S6(x6),S7(x7),S8(x8)を出力するテーブル参照手段と、
上記S5(x1),S6(x2),S7(x3),S8(x4)の排他的論理和演算を行なって結果Aを得る手段と、
上記S5(x5),S6(x6),S7(x7),S8(x8)の排他的論理和演算を行って結果Bを得る手段と、
AとBの排他的論理和演算を行ってCを得る手段と、
Aを下に1バイトローテーションする手段と、
そのローテーションの結果とCとの排他的論理和演算を行って結果Dを得る手段と、
Cを上に1バイトローテーションする手段と、
そのローテーションの結果とDとの排他的論理和演算を行って結果Eを得る手段と、
Dを下に1バイトローテーションする手段と、
そのローテーションの結果とEとの排他的論理和演算を行って結果Fを得る手段と、
Eを下に1バイトローテーションを行って結果Gを得る手段と、
Fを上に2バイトローテーションして結果Hを得る手段と、
を具備し、上記HとGを出力z1′,z2′,…,z8′とすることを特徴とする置換処理装置。
Input data x 1, x 2, ..., with respect to x 8, the output data z 1 performs a nonlinear transformation and linear transformation ', z 2', ..., the replacement processing unit to obtain the z 8 ',
The composition vector is
Figure 0003736731
A 32-bit table referenced by x and outputting S5 (x);
The composition vector is
Figure 0003736731
A 32-bit table that is referenced by x and outputs S6 (x);
The composition vector is
Figure 0003736731
A 32-bit table referenced by x and outputting S7 (x);
The composition vector is
Figure 0003736731
A 32-bit table that is referenced by x and outputs S8 (x);
Referring to the above table by x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 7 , x 8 , S 5 (x 1 ), S 6 (x 2 ), S 7 (x 3 ), S 8 ( x 4), S5 (x 5 ), S6 (x 6), S7 (x 7), a table reference means for outputting S8 (x 8),
Means for performing an exclusive OR operation of S5 (x 1 ), S6 (x 2 ), S7 (x 3 ), and S8 (x 4 ) to obtain a result A;
Means for performing the exclusive OR operation of S5 (x 5 ), S 6 (x 6 ), S 7 (x 7 ), and S 8 (x 8 ) to obtain a result B;
Means for performing an exclusive OR operation of A and B to obtain C;
Means to rotate A one byte down,
Means for performing an exclusive OR operation on the rotation result and C to obtain a result D;
Means to rotate C up by 1 byte;
Means for performing an exclusive OR operation of the rotation result and D to obtain a result E;
Means to rotate D down by 1 byte;
Means for performing an exclusive OR operation of the rotation result and E to obtain a result F;
Means for rotating 1 byte below E to obtain the result G;
Means for rotating F up to 2 bytes and obtaining the result H;
A replacement processing device characterized in that H and G are output as z 1 ′, z 2 ′,..., Z 8 ′.
請求項4から7の何れかに記載の置換処理装置おいて、
S5(x)からS8(x)で表されている32ビットテーブルが、xにより参照され、s(x)を出力する8ビットテーブルと、s(x)を1要素とする4要素縦行列を論理シフトするシフト手段との組み合わせにより実現されていることを特徴とする置換処理装置。
In the replacement processing apparatus according to any one of claims 4 to 7,
A 32-bit table represented by S5 (x) to S8 (x) is referred to by x, an 8-bit table that outputs s (x), and a 4-element vertical matrix having s (x) as one element. A replacement processing apparatus characterized by being implemented in combination with a shift means for logically shifting.
請求項1から8の何れかに記載の置換処理装置としてコンピュータを機能させるためのプログラムを記録したコンピュータ読取り可能なプログラム記録媒体。A computer-readable program recording medium recording a program for causing a computer to function as the replacement processing device according to claim 1.
JP2000044529A 2000-02-22 2000-02-22 Replacement processing apparatus and program recording medium thereof Expired - Lifetime JP3736731B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000044529A JP3736731B2 (en) 2000-02-22 2000-02-22 Replacement processing apparatus and program recording medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000044529A JP3736731B2 (en) 2000-02-22 2000-02-22 Replacement processing apparatus and program recording medium thereof

Publications (2)

Publication Number Publication Date
JP2001236017A JP2001236017A (en) 2001-08-31
JP3736731B2 true JP3736731B2 (en) 2006-01-18

Family

ID=18567268

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000044529A Expired - Lifetime JP3736731B2 (en) 2000-02-22 2000-02-22 Replacement processing apparatus and program recording medium thereof

Country Status (1)

Country Link
JP (1) JP3736731B2 (en)

Families Citing this family (2)

* 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
JP4189439B2 (en) * 2006-06-23 2008-12-03 パナソニック株式会社 Cryptographic processing apparatus, data conversion method, data conversion program, recording medium, and integrated circuit

Also Published As

Publication number Publication date
JP2001236017A (en) 2001-08-31

Similar Documents

Publication Publication Date Title
US7606368B2 (en) Method and apparatus for data encryption
US7532721B2 (en) Implementation of a switch-box using a subfield method
USRE44594E1 (en) Method and circuit for data encryption/decryption
US6189095B1 (en) Symmetric block cipher using multiple stages with modified type-1 and type-3 feistel networks
US7801307B2 (en) Method of symmetric key data encryption
JPH1055135A (en) Ciphering/deciphering device and method using programmable logic element/device
JPH06236148A (en) Data processing system for executing data-encrypting algorithm, wherein performance in ansi x3.92 data-encrypting algorithm standard is strengthened
TW200830327A (en) System and method for encrypting data
WO2021129470A1 (en) Polynomial-based system and method for fully homomorphic encryption of binary data
CN108063760B (en) Method and system for block encryption and method for block decryption
JP4479703B2 (en) Communication system and management device
JP3736731B2 (en) Replacement processing apparatus and program recording medium thereof
JP4395527B2 (en) Information processing device
JPWO2009090689A1 (en) Encryption apparatus and encryption processing method
ES2293665T3 (en) METHOD FOR THE CRYPTOGRAPHIC CONVERSION OF INPUT BLOCKS OF L DIGITAL DATA INFORMATION BITS IN OUTPUT BLOCKS OF L BITS.
JP3039334B2 (en) Encryption device
JP4644053B2 (en) Encryption apparatus and method, decryption apparatus and method
JP2008205753A (en) Signal processor
TW561435B (en) Method and device for executing a byte substitution operation of the AES algorithm according to Rijndael
Farmani et al. A high performance hardware implementation image encryption with AES algorithm
JP4094758B2 (en) Data replacement / division method and apparatus
JP2001513213A (en) Method and apparatus for computer-assisted transposition for transposition of digital signals and method and apparatus for encryption of digital signals
JP3494619B2 (en) Reverse byte sequence cyclic shift device and program recording medium therefor
JPH11212451A (en) Criptographic device
JP2000284691A (en) Substitution permutation device and program recording medium thereof

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A132

Effective date: 20041116

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050114

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050419

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050511

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

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20051020

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20051020

R150 Certificate of patent or registration of utility model

Ref document number: 3736731

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20091104

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20101104

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20101104

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20111104

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20111104

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20121104

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20121104

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20131104

Year of fee payment: 8

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