JP2004045641A - Encryption processing device and method therefor - Google Patents
Encryption processing device and method therefor Download PDFInfo
- Publication number
- JP2004045641A JP2004045641A JP2002201631A JP2002201631A JP2004045641A JP 2004045641 A JP2004045641 A JP 2004045641A JP 2002201631 A JP2002201631 A JP 2002201631A JP 2002201631 A JP2002201631 A JP 2002201631A JP 2004045641 A JP2004045641 A JP 2004045641A
- Authority
- JP
- Japan
- Prior art keywords
- data
- held
- initial
- length
- input
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は暗号処理装置およびその方法に係り、例えば、DES暗号などのブロック暗号化方式を用いた暗号処理装置およびその方法に関するものである。
【0002】
【従来の技術】
デジタル・データの暗号化方式には様々な方式があるが、一定の長さを有したデータをそのブロック単位で暗号化するブロック暗号化方式のうち、現在最も広範に用いられている暗号化アルゴリズムとして、DES(data encryption standard)暗号が知られている。DES暗号は、米国標準暗号FIPS(federal information processing standard)46−2において規定されている標準化された暗号である。
【0003】
このDES暗号では、FIPS81において、4つの操作モード(ECBモード、CBCモード、OFBモードおよびCFBモード)が定められている。
【0004】
図21は、ECB(electronic codebook)モードの概要を説明するための図である。
ECBモードでは、送信される64ビットのメッセージMが送信者側のDES暗号演算部1aにおいてDES暗号化方式により暗号化されて、64ビットの暗号文Cに変換される。この暗号文Cは、受信者側のDES暗号演算部1bにおいてDES暗号化方式により復号化されて、元のメッセージMに復元される。
ECBモードは基本的な操作モードであり、構成が最も単純であるが、同一のメッセージMが常に同一の暗号文Cに暗号化されてしまう弱点がある。
【0005】
図22は、CBC(cipher block chaining)モードの概要を説明するための図である。
CBCモードでは、送信側のレジスタ2aに前回送信された暗号文が保持されており、この保持された前回の暗号文とメッセージMとの排他的論理和が演算回路3aにおいて演算される。この演算結果がDES暗号演算部1aにおいて暗号化されることにより、暗号文Cが生成される。生成された暗号文Cはレジスタ2aに保持され、次回送信されるメッセージとの排他的論理和の演算に用いられる。暗号文Cの受信側では、レジスタ2bに前回受信された暗号文が保持されており、この保持された暗号文と、その次に受信された暗号文CがDES暗号演算部1bにおいて復号化されたデータとの排他的論理和が演算回路3bにおいて演算されることにより、元のメッセージMが復元される。
【0006】
図23は、OFB(output feedback)モードの概要を説明するための図である。
OFBモードでは、初期状態において64ビットのIV(initial vector)データがレジスタ2aに保持され、このIVデータがDES暗号演算部1aにおいて暗号化されて、暗号化データEが出力される。次いで、暗号化データEの上位k(ただしkは1≦k≦64の整数を示す)ビット分のデータからデータ抽出部4aにより乱数データRが抽出され、これとメッセージMとの排他的論理和が演算回路3aにおいて演算される。この演算結果からkビットの暗号文Cが得られる。また乱数データRは、レジスタ2aに保持されたIVデータの下位ビット側に付加され、その上位kビット分のデータが棄却される。こうしてできる64ビットのデータがレジスタ2aにおいて新たに保持されて、次回送信される暗号文の乱数データを生成するために用いられる。暗号文Cの受信側でも、送信側と同様な構成によって同一の乱数データRが生成され、これと暗号文Cの排他的論理和の演算結果から、元のメッセージMが復元される。
【0007】
図24は、CFB(cipher feedback)モードの概要を説明するための図である。
CFBモードでは、レジスタに帰還されるデータが暗号文である点を除いて、OFBモードと同様の動作により暗号文が生成される。
すなわち、初期状態においてIVデータがレジスタ2aに保持され、このIVデータがDES暗号演算部1aにおいて暗号化されて、暗号化データEが出力される。次いで、暗号化データEの上位kビット分のデータから乱数データRが抽出され、これとkビットのメッセージMとの排他的論理和演算によって、kビットの暗号文Cが生成される。生成されたkビットの暗号文Cは、レジスタ2aに保持されたIVデータの下位ビット側に付加され、その上位kビット分のデータが棄却されて、レジスタ2aに保持される。次回送信される暗号文の乱数データは、この更新されたデータを用いて生成される。
【0008】
暗号文Cの受信側では、初期状態においてIVデータがレジスタ2bに保持され、このIVデータがDES暗号演算部1bにおいて暗号化されて、暗号化データEが出力される。次いで、暗号化データEの上位のkビット分のデータから乱数データRが抽出され、これとkビットの暗号文Cとの排他的論理和演算によって、kビットのメッセージMが復元される。受信されたkビットの暗号文Cは、レジスタ2bに保持されたIVデータの下位ビット側に付加され、その上位kビット分のデータが棄却されて、レジスタ2bに保持される。次回受信する暗号文との排他的論理和演算が行われる乱数データは、この更新されたデータを用いて生成される。
【0009】
【発明が解決しようとする課題】
上述したOFBモードおよびCFBモードを用いれば、DES暗号の1ブロック単位である64ビットよりもデータ長の短い単位で暗号化や復号化を行うことができる。例えば、文字単位の暗号化データで構成されるデータ・ストリームによってメッセージを伝送する場合に、送信側において供給された文字データを直ちに暗号化してデータ・ストリームに乗せることができる。また、これを受信側において直ちに復号化して文字データに復元することができる。したがって、ブロック単位で伝送が行われる他の操作モードに比べて、文字データなどの短いデータの暗号化や復号化を効率的に行うことが可能になるとともに、その処理時間を短縮することができる。
【0010】
しかしながら、上述のようにデータ長の短い単位で暗号化や復号化を行うことができたとしても、このようなデータを複数連続的に暗号化または復号化する場合には、生成された複数の暗号化データや復号化データを順次処理する必要がある。例えば、生成されたデータがレジスタ等に順次出力される場合、レジスタに保持された前回のデータが次に出力されるデータによって上書きされてしまわなように、これを別の記憶媒体へ順次移動させる処理が必要になる。通常、このような処理はソフトウェアによって制御されており、データが生成される度にこうした処理を実行する必要がある。このため、暗号化や復号化に要する処理時間が長くなってしまう問題や、ソフトウェアの処理が複雑化してしまう問題が生じる。
【0011】
また、OFBモードおよびCFBモードの特徴として、DES暗号演算部から出力される64ビットのデータのうち、上位の所定ビット分のデータ(上述の例ではkビット分のデータ)が有効なデータとしてメッセージの暗号化や復号化に用いられるので、これらのモードとECBモードやCBCモードとを併用する場合には、DES暗号の演算結果のうちの有効でないビットのデータを処理しないように制御する必要がある。このような制御も、一般的にソフトウェアで処理されるため、上述と同様に処理時間の増大やソフトウェアの複雑化などの問題が生じる。
【0012】
本発明はかかる事情に鑑みてなされたものであり、その目的は、ブロック暗号化方式を用いて単位ブロック・データよりもデータ長の短い複数のデータを順次暗号化または復号化する場合において、処理時間をより短くすることができ、ソフトウェアによる処理の負担を軽減できる暗号処理装置およびその方法を提供することにある。
【0013】
【課題を解決するための手段】
上記の目的を達成するため、本発明の第1の観点に係る暗号処理装置は、供給される第1のデータ長のデータを、供給される鍵データに基づいて暗号化するブロック暗号演算手段と、上記第1のデータ長を有するデータの保持が可能な初期データ保持手段と、上記ブロック暗号演算手段において演算されたデータの上位ビット側から、上記第1のデータ長より短い第2のデータ長分のデータを抽出して、上記初期データ保持手段に保持されたデータの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して出力する第1のデータ抽出手段と、上記第1のデータ抽出手段から出力されるデータ、または供給される初期データを選択して上記初期データ保持手段に供給する第1の選択手段と、上記第2のデータ長より長い第3のデータ長を有するデータの保持が可能な暗号化データ保持手段と、上記ブロック暗号演算手段において演算されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記暗号化データ保持手段に保持されたデータの上位ビット側に付加し、当該付加後のデータの上位ビット側から上記第3のデータ長分のデータを抽出して出力する第2のデータ抽出手段と、上記第3のデータ長を有する入力データと上記第2のデータ抽出手段の出力データとを受けて、所定の論理演算を実行する論理演算手段と、初期サイクルにおいて、上記第1の選択手段に上記初期データを選択させて上記初期データ保持手段に保持させ、上記初期データ保持手段の当該保持データを上記ブロック暗号演算手段に供給して演算を実行させ、上記ブロック暗号演算手段の当該演算結果を受けて上記第2のデータ抽出手段から出力されるデータを上記暗号化データ保持手段に保持させ、上記ブロック暗号演算手段の当該演算結果を受けて上記第1のデータ抽出手段から出力されるデータを上記第1の選択手段に選択させて上記初期データ保持手段に保持させ、上記初期サイクルに続く処理において、上記第1の選択手段に上記第1のデータ抽出手段の出力データを選択させた状態で、上記第2のデータ長と上記第3のデータ長とに応じたサイクル数だけ、上記初期サイクルと同等の処理を反復させる制御手段とを有し、上記制御手段の最後の処理サイクルにおいて、上記ブロック演算手段の演算結果を受けて上記第2のデータ抽出手段から出力されるデータと上記入力データとが上記論理演算手段において演算された結果を、上記入力データに対応する暗号化データまたは復号化データとして出力する。
【0014】
本発明の第1の観点に係る暗号処理装置によれば、上記初期サイクルでは、上記第1の選択手段において上記初期データが選択されて上記初期データ保持手段に保持され、当該保持データが上記ブロック暗号演算手段に供給されて上記鍵データに基づいた演算が実行される。上記ブロック暗号演算手段の当該演算結果は、上記第2のデータ抽出手段に供給され、これを受けて上記第2のデータ抽出手段から出力されるデータが上記暗号化データ保持手段に保持される。また、上記ブロック暗号演算手段の当該演算結果は上記第1のデータ抽出手段にも供給され、これを受けて上記第1のデータ抽出手段から出力されるデータは、上記第1の選択手段において選択されて上記初期データ保持手段に保持される。この保持データが、次回のサイクルにおいて上記ブロック暗号演算手段に供給される。上記初期サイクルに続く処理では、上記第1の選択手段において上記第1のデータ抽出手段の出力データが選択された状態で、上記第2のデータ長と上記第3のデータ長とに応じたサイクル数だけ、上記初期サイクルと同等の処理が反復される。当該処理の反復後、最後の処理サイクルにおいて上記ブロック演算手段の演算結果を受けて上記第2のデータ抽出手段から出力されるデータと、上記入力データとが上記論理演算手段において演算され、その演算結果が、上記入力データに対応する暗号化データまたは復号化データとして出力される。
【0015】
また、上記第3のデータ長を有するデータの保持が可能な入力データ保持手段と、上記入力データ保持手段に保持されたデータを、上記第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻すビット・ローテイト手段と、上記ビット・ローテイト手段に処理されたデータ、または供給される上記入力データを選択して上記入力データ保持手段に供給する第2の選択手段とを更に含んでも良い。この場合、上記論理演算手段は、上記入力データ保持手段に保持されたデータと上記第2のデータ抽出手段の出力データとを受けて上記所定の論理演算を実行し、上記制御手段は、上記初期サイクルにおいて、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記入力データ保持手段の当該保持データに対して上記ビット・ローテイト手段の処理を行わせ、当該処理後のデータを上記第2の選択手段に選択させて上記入力データ保持手段に保持させ、上記初期サイクルに続く処理サイクルにおいて、上記ビット・ローテイト手段に処理されたデータを上記第2の選択手段に選択させて上記入力データ保持手段に保持させても良い。
【0016】
上記の構成によれば、上記初期サイクルでは、上記第2の選択手段において上記入力データが選択されて上記入力データ保持手段に保持され、当該保持データに対して上記ビット・ローテイト手段の処理が行なわれ、当該処理後のデータが上記第2の選択手段に選択されて上記入力データ保持手段に保持される。上記初期サイクルに続く処理サイクルでは、上記ビット・ローテイト手段に処理されたデータが上記第2の選択手段に選択されて上記入力データ保持手段に保持され、これにより、上記入力データ保持手段の保持データは上記ビット・ローテイト手段における処理後のデータに順次更新される。
この各処理サイクルにおいて、上記ブロック演算手段の演算結果を受けて上記第2のデータ抽出手段から出力されるデータと上記入力データ保持手段に保持されたデータとが上記論理演算手段において演算され、その演算結果のうち、少なくとも上記第2のデータ長分のデータが、上記入力データに含まれる1つまたは複数の第2のデータ長を有した単位データに対応する暗号化データまたは復号化データとして出力される。
【0017】
本発明の第2の観点に係る暗号処理装置は、供給される第1のデータ長のデータを、供給される鍵データに基づいて暗号化するブロック暗号演算手段と、上記第1のデータ長を有するデータの保持が可能な初期データ保持手段と、供給されるデータの上位ビット側から第2のデータ長分のデータを抽出して、上記初期データ保持手段に保持されたデータの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して出力する第1のデータ抽出手段と、上記第1のデータ抽出手段から出力されるデータ、または供給される初期データを選択して上記初期データ保持手段に供給する第1の選択手段と、上記第2のデータ長より長い第3のデータ長を有するデータの保持が可能な暗号化データ保持手段および入力データ保持手段と、上記ブロック暗号演算手段において演算されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記暗号化データ保持手段に保持されたデータの上位ビット側に付加し、当該付加後のデータの上位ビット側から上記第3のデータ長分のデータを抽出して出力する第2のデータ抽出手段と、上記入力データ保持手段に保持されたデータを、上記第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻すビット・ローテイト手段と、上記ビット・ローテイト手段に処理されたデータ、または上記第3のデータ長を有した入力データを選択して上記入力データ保持手段に供給する第2の選択手段と、上記入力データ保持手段に保持されたデータと上記第2のデータ抽出手段の出力データとを受けて、所定の論理演算を実行する第1の論理演算手段と、上記入力データ保持手段に保持されたデータと上記ブロック暗号演算手段において演算されたデータとを受けて、上記所定の論理演算を実行する第2の論理演算手段と、上記入力データ保持手段に保持されたデータ、または上記第2の論理演算手段において演算されたデータを選択して上記第1のデータ抽出手段に供給する第3の選択手段と、第1の操作モードの暗号化処理を行う場合、その初期サイクルにおいて、上記第1の選択手段に上記初期データを選択させて上記初期データ保持手段に保持させ、上記初期データ保持手段の当該保持データを上記ブロック暗号演算手段に供給して演算を実行させ、上記ブロック暗号演算手段の当該演算結果を受けて上記第2のデータ抽出手段から出力されるデータを上記暗号化データ保持手段に保持させ、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記入力データ保持手段の当該保持データに対して上記ビット・ローテイト手段の処理を行わせ、当該処理後のデータを上記第2の選択手段に選択させて上記入力データ保持手段に保持させ、上記入力データ保持手段の当該保持データと上記ブロック暗号演算手段の当該演算結果とを受けた上記第2の論理演算手段の演算結果を上記第3の選択手段に選択させて上記第1のデータ抽出手段に供給させ、当該供給データを受けて上記第1のデータ抽出手段から出力されるデータを上記第1の選択手段に選択させて上記初期データ保持手段に保持させ、当該初期サイクルに続く処理において、上記第1の選択手段に上記第1のデータ抽出手段の出力データを、上記第2の選択手段に上記ビット・ローテイト手段の処理データをそれぞれ選択させた状態で、上記第2のデータ長と上記第3のデータ長とに応じたサイクル数だけ、上記初期サイクルと同等の処理を反復させ、上記第1の操作モードの復号化処理を行う場合には、その初期サイクルにおいて、上記第1の選択手段に上記初期データを選択させて上記初期データ保持手段に保持させ、上記初期データ保持手段の当該保持データを上記ブロック暗号演算手段に供給して演算を実行させ、上記ブロック暗号演算手段の当該演算結果を受けて上記第2のデータ抽出手段から出力されるデータを上記暗号化データ保持手段に保持させ、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記入力データ保持手段の当該保持データに対して上記ビット・ローテイト手段の処理を行わせ、当該処理後のデータを上記第2の選択手段に選択させて上記入力データ保持手段に保持させ、当該保持データを上記第3の選択手段に選択させて上記第1のデータ抽出手段に供給させ、当該供給データを受けて上記第1のデータ抽出手段から出力されるデータを上記第1の選択手段に選択させて上記初期データ保持手段に保持させ、当該初期サイクルに続く処理において、上記第1の選択手段に上記第1のデータ抽出手段の出力データを、上記第2の選択手段に上記ビット・ローテイト手段の処理データをそれぞれ選択させた状態で、上記第2のデータ長と上記第3のデータ長とに応じたサイクル数だけ、当該初期サイクルと同等の処理を反復させる制御手段とを有し、上記制御手段の各処理サイクルにおいて、上記ブロック演算手段の演算結果を受けて上記第2のデータ抽出手段から出力されるデータと、上記入力データ保持手段に保持された上記ビット・ローテイト手段の処理後のデータとが上記第1の論理演算手段において演算された結果のうち、少なくとも上記第2のデータ長分のデータを、上記入力データに含まれる1つまたは複数の第2のデータ長を有した単位データに対応する暗号化データまたは復号化データとして出力する。
【0018】
本発明の第2の観点に係る暗号処理装置によれば、第1の操作モードの暗号化処理が行われる場合、その初期サイクルでは、上記第1の選択手段において上記初期データが選択されて上記初期データ保持手段に保持され、当該保持データが上記ブロック暗号演算手段に供給されて演算が実行される。上記ブロック暗号演算手段の当該演算結果を受けて上記第2のデータ抽出手段から出力されるデータは、上記暗号化データ保持手段に保持される。一方、上記第2の選択手段において上記入力データが選択されて上記入力データ保持手段に保持され、当該保持データに対して上記ビット・ローテイト手段の処理が行われ、当該処理後のデータが上記第2の選択手段において選択されて上記入力データ保持手段に保持される。上記入力データ保持手段の当該保持データと上記ブロック暗号演算手段の当該演算結果とを受けて、上記第2の論理演算手段において所定の論理演算が実行され、その演算結果が、上記第3の選択手段において選択されて上記第1のデータ抽出手段に供給される。当該供給データを受けて上記第1のデータ抽出手段から出力されるデータは、上記第1の選択手段において選択されて上記初期データ保持手段に保持され、次のサイクルにおいて上記ブロック暗号演算手段に供給される。当該初期サイクルに続く処理では、上記第1の選択手段において上記第1のデータ抽出手段の出力データが、上記第2の選択手段において上記ビット・ローテイト手段の処理データがそれぞれ選択された状態で、上記第2のデータ長と上記第3のデータ長とに応じたサイクル数だけ、上記初期サイクルと同等の処理が反復される。
また、上記第1の操作モードの復号化処理が行われる場合、その初期サイクルでは、上記第1の選択手段において上記初期データが選択されて上記初期データ保持手段に保持され、当該保持データが上記ブロック暗号演算手段に供給されて演算が実行される。上記ブロック暗号演算手段の当該演算結果を受けて上記第2のデータ抽出手段から出力されるデータは、上記暗号化データ保持手段に保持される。一方、上記第2の選択手段において上記入力データが選択されて上記入力データ保持手段に保持され、当該保持データに対して上記ビット・ローテイト手段の処理が行われ、当該処理後のデータが上記第2の選択手段において選択されて上記入力データ保持手段に保持される。上記入力データ保持手段の当該保持データが、上記第3の選択手段において選択されて上記第1のデータ抽出手段に供給され、当該供給データを受けて上記第1のデータ抽出手段から出力されるデータが、上記第1の選択手段において選択されて上記初期データ保持手段に保持され、次のサイクルにおいて上記ブロック暗号演算手段に供給される。当該初期サイクルに続く処理では、上記第1の選択手段において上記第1のデータ抽出手段の出力データが、上記第2の選択手段において上記ビット・ローテイト手段の処理データがそれぞれ選択された状態で、上記第2のデータ長と上記第3のデータ長とに応じたサイクル数だけ、当該初期サイクルと同等の処理が反復される。
上記制御手段の各処理サイクルにおいて、上記ブロック演算手段の演算結果を受けて上記第2のデータ抽出手段から出力されるデータと、上記入力データ保持手段に保持された上記ビット・ローテイト手段の処理後のデータとが上記第1の論理演算手段において演算され、その演算結果のうち、少なくとも上記第2のデータ長分のデータが、上記単位データに対応する暗号化データまたは復号化データとして出力される。
【0019】
また、上記第3の選択手段が、上記ブロック暗号演算手段の演算結果を選択して上記第1のデータ抽出手段に供給可能であり、上記制御手段が、第2の操作モードの暗号化処理または復号化処理を行う場合において、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、その初期サイクルにおいて、上記第1の選択手段に上記初期データを選択させて上記初期データ保持手段に保持させ、上記初期データ保持手段の当該保持データを上記ブロック暗号演算手段に供給して演算を実行させ、上記ブロック暗号演算手段の当該演算結果を受けて上記第2のデータ抽出手段から出力されるデータを上記暗号化データ保持手段に保持させ、上記ブロック暗号演算手段の当該演算結果を上記第3の選択手段に選択させて上記第1のデータ抽出手段に供給させ、当該供給データを受けて上記第1のデータ抽出手段から出力されるデータを上記第1の選択手段に選択させて上記初期データ保持手段に保持させ、上記初期サイクルに続く処理において、上記第1の選択手段に上記第1のデータ抽出手段の出力データを選択させた状態で、上記第1のデータ長と上記第2のデータ長とに応じたサイクル数だけ、上記初期サイクルと同等の処理を反復させても良い。
【0020】
上記の構成によれば、第2の操作モードの暗号化処理または復号化処理が行われる場合、上記第2の選択手段において上記入力データが選択されて上記入力データ保持手段に保持される。初期サイクルでは、上記第1の選択手段において上記初期データが選択されて上記初期データ保持手段に保持され、当該保持データが上記ブロック暗号演算手段に供給されて演算が実行される。上記ブロック暗号演算手段の当該演算結果を受けて上記第2のデータ抽出手段から出力されるデータは、上記暗号化データ保持手段に保持される。また、上記ブロック暗号演算手段の当該演算結果が上記第3の選択手段において選択されて、上記第1のデータ抽出手段に供給される。この供給データを受けて上記第1のデータ抽出手段から出力されるデータが、上記第1の選択手段において選択されて上記初期データ保持手段に保持される。上記初期サイクルに続く処理では、上記第1の選択手段において上記第1のデータ抽出手段の出力データが選択された状態で、上記第1のデータ長と上記第2のデータ長とに応じたサイクル数だけ、上記初期サイクルと同等の処理が反復される。
最後の処理サイクルにおいて、上記ブロック演算手段の演算結果を受けて上記第2のデータ抽出手段から出力されるデータと上記入力データ保持手段に保持された入力データとが上記第1の論理演算手段において演算され、その演算結果が、上記入力データに対応する暗号化データまたは復号化データとして出力される。
【0021】
また、上記制御手段は、上記第2の操作モードの暗号化処理または復号化処理を行う場合、上記初期サイクルにおいて、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記入力データ保持手段の当該保持データに対して上記ビット・ローテイト手段の処理を行わせ、当該処理後のデータを上記第2の選択手段に選択させて上記入力データ保持手段に保持させ、上記初期サイクルに続く処理サイクルにおいて、上記ビット・ローテイト手段に処理されたデータを上記第2の選択手段に選択させて上記入力データ保持手段に保持させても良い。
【0022】
上記の構成によれば、上記第2の操作モードの暗号化処理または復号化処理が行われる場合、上記初期サイクルでは、上記第2の選択手段において上記入力データが選択されて上記入力データ保持手段に保持され、当該保持データに対して上記ビット・ローテイト手段の処理が行われ、当該処理後のデータが上記第2の選択手段に選択されて上記入力データ保持手段に保持される。上記初期サイクルに続く処理サイクルでは、上記ビット・ローテイト手段に処理されたデータが上記第2の選択手段において選択されて上記入力データ保持手段に保持され、これにより、上記入力データ保持手段の保持データは上記ビット・ローテイト手段における処理後のデータに順次更新される。
この各処理サイクルにおいて、上記ブロック演算手段の演算結果を受けて上記第2のデータ抽出手段から出力されるデータと上記入力データ保持手段に保持されたデータとが上記第1の論理演算手段において演算され、その演算結果のうち、少なくとも上記第2のデータ長分のデータが、上記入力データに含まれる1つまたは複数の第2のデータ長を有した単位データに対応する暗号化データまたは復号化データとして出力される。
【0023】
さらに、上記初期データ保持手段に保持されたデータ、または上記入力データ保持手段に保持されたデータを選択して上記ブロック暗号演算手段に供給する第4の選択手段と、上記第1の論理演算手段において演算されたデータ、または上記ブロック暗号演算手段において演算されたデータを選択して出力する第5の選択手段とを更に含んでも良い。この場合、上記ブロック暗号演算手段は、供給されるデータの暗号化演算または復号化演算を行い、上記制御手段は、第3の操作モードの暗号化処理または復号化処理を行う場合、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記第4の選択手段に上記入力データ保持手段の当該保持データを選択させて上記ブロック暗号演算手段に供給し、その演算を実行させ、上記ブロック暗号演算手段の当該演算結果を上記第5の選択手段に選択させて出力させ、上記第1の操作モードまたは上記第2の操作モードの処理を行う場合には、上記初期データ保持手段の保持データを上記第4の選択手段に選択させて上記ブロック暗号演算手段に供給させるとともに、上記第1の論理演算手段の演算データを上記第5の選択手段に選択させて出力させても良い。
【0024】
上記の構成によれば、第3の操作モードの暗号化処理または復号化処理が行われる場合、上記第2の選択手段において上記入力データが選択されて上記入力データ保持手段に保持され、上記第4の選択手段において上記入力データ保持手段の当該保持データが選択されて上記ブロック暗号演算手段に供給される。この供給データを受けた上記ブロック暗号演算手段において暗号化演算または復号化演算が実行され、その演算結果が上記第5の選択手段において選択されて出力される。一方、上記第1の操作モードまたは上記第2の操作モードの処理が行われる場合には、上記初期データ保持手段の保持データが上記第4の選択手段において選択されて上記ブロック暗号演算手段に供給されるとともに、上記第1の論理演算手段の演算データが上記第5の選択手段において選択されて出力される。
【0025】
また、上記初期データ保持手段に保持されたデータと上記入力データ保持手段に保持されたデータとを受けて、上記所定の論理演算を実行する第3の論理演算手段と、上記初期データ保持手段に保持されたデータと上記ブロック暗号演算手段において演算されたデータとを受けて、上記所定の論理演算を実行する第4の論理演算手段とを更に含んでも良い。そして、上記第4の選択手段が、上記第3の論理演算手段において演算されたデータを選択して上記ブロック暗号演算手段に供給可能であり、上記第5の選択手段が、上記第4の論理演算手段において演算されたデータを選択して出力可能であっても良い。さらに、上記制御手段は、第4の操作モードの暗号化処理を行う場合、その初期サイクルにおいて、上記第1の選択手段に上記初期データを選択させて上記初期データ保持手段に保持させ、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記初期データ保持手段の当該保持データと上記入力データ保持手段の当該保持データとを受けた上記第3の論理演算手段の演算結果を上記第4の選択手段に選択させて上記ブロック暗号演算手段に供給し、その演算を実行させ、上記ブロック暗号演算手段の当該演算結果を上記第5の選択手段に選択させて出力させ、上記ブロック暗号演算手段の当該演算結果を上記第3の選択手段に選択させて上記第1のデータ抽出手段に供給させ、上記第1のデータ抽出手段に当該供給データの上記第1のデータ長分のデータを抽出させ、上記第1のデータ抽出手段の当該抽出データを上記第1の選択手段に選択させて上記初期データ保持手段に保持させ、当該初期サイクルに続く処理サイクルにおいて、上記第1の選択手段に上記第1のデータ抽出手段の抽出データを選択させた状態で、当該初期サイクルと同等の処理を実行させ、上記第4の操作モードの復号化処理を行う場合には、その初期サイクルにおいて、上記第1の選択手段に上記初期データを選択させて上記初期データ保持手段に保持させ、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記入力データ保持手段の当該保持データを上記第4の選択手段に選択させて上記ブロック暗号演算手段に供給し、その演算を実行させ、上記ブロック暗号演算手段の当該演算結果と上記初期データ保持手段の当該保持データとを受けた上記第4の論理演算手段の演算結果を上記第5の選択手段に選択させて出力させ、上記入力データ保持手段の当該保持データを上記第3の選択手段に選択させて上記第1のデータ抽出手段に供給させ、上記第1のデータ抽出手段に当該供給データの上記第1のデータ長分のデータを抽出させ、上記第1のデータ抽出手段の当該抽出データを上記第1の選択手段に選択させて上記初期データ保持手段に保持させ、当該初期サイクルに続く処理サイクルにおいて、上記第1の選択手段に上記第1のデータ抽出手段の抽出データを選択させた状態で、当該初期サイクルと同等の処理を実行させても良い。
【0026】
上記の構成によれば、第4の操作モードの暗号化処理が行われる場合、その初期サイクルでは、上記第1の選択手段において上記初期データが選択されて上記初期データ保持手段に保持される。また、上記第2の選択手段において上記入力データが選択されて上記入力データ保持手段に保持される。上記初期データ保持手段の当該保持データと上記入力データ保持手段の当該保持データとを受けて、上記第3の論理演算手段において所定の論理演算が実行され、その演算結果が上記第4の選択手段において選択されて上記ブロック暗号演算手段に供給さる。当該供給データを受けて上記ブロック暗号演算手段において暗号化演算が実行され、その演算結果が上記第5の選択手段において選択されて出力される。また、上記ブロック暗号演算手段の当該演算結果は上記第3の選択手段において選択されて上記第1のデータ抽出手段に供給され、上記第1のデータ抽出手段において当該供給データの上記第1のデータ長分のデータが抽出される。上記第1のデータ抽出手段の当該抽出データが上記第1の選択手段において選択されて上記初期データ保持手段に保持される。当該初期サイクルに続く処理サイクルでは、上記第1の選択手段において上記第1のデータ抽出手段の抽出データが選択された状態で、当該初期サイクルと同等の処理が実行される。
また、上記第4の操作モードの復号化処理が行われる場合、その初期サイクルでは、上記第1の選択手段において上記初期データが選択されて上記初期データ保持手段に保持される。また、上記第2の選択手段において上記入力データが選択されて上記入力データ保持手段に保持される。上記入力データ保持手段の当該保持データが上記第4の選択手段において選択されて上記ブロック暗号演算手段に供給され、暗号化演算が実行される。上記ブロック暗号演算手段の当該演算結果と上記初期データ保持手段の当該保持データとを受けて上記第4の論理演算手段において所定の論理演算が実行され、その演算結果が上記第5の選択手段において選択されて出力される。また、上記入力データ保持手段の当該保持データは、上記第3の選択手段において選択されて上記第1のデータ抽出手段に供給され、上記第1のデータ抽出手段において当該供給データの上記第1のデータ長分のデータが抽出される。上記第1のデータ抽出手段の当該抽出データが上記第1の選択手段において選択されて上記初期データ保持手段に保持される。当該初期サイクルに続く処理サイクルでは、上記第1の選択手段において上記第1のデータ抽出手段の抽出データが選択された状態で、当該初期サイクルと同等の処理が実行される。
【0027】
本発明の第3の観点に係る暗号処理方法は、第1のデータ長を有する初期データを初期データ保持装置に保持させ、与えられた鍵データに基づいて、当該初期データを暗号化する第1のステップと、上記第1のステップにおいて暗号化されたデータの上位ビット側から、上記第1のデータ長より短い第2のデータ長分のデータを抽出し、当該抽出データを上位ビットとした、上記第2のデータ長より長い第3のデータ長を有するデータを生成して、暗号化データ保持装置に保持させる第2のステップと、上記第1のステップにおいて暗号化されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データを当該抽出データに更新する第3のステップとを含んだ初期ステップに続けて、上記初期データ保持装置に保持されたデータを、上記鍵データに基づいて暗号化する第4のステップと、上記第4のステップにおいて暗号化されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータの上位ビット側に付加し、当該付加後のデータの上位ビット側から上記第3のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータを当該抽出データに更新する第5のステップと、上記第4のステップにおいて暗号化されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータを当該抽出データに更新する第6のステップとを含んだ反復ステップを、上記第2のデータ長と上記第3のデータ長とに応じた回数だけ反復し、最後の上記第5のステップにおいて抽出される上記第3のデータ長のデータと、上記第3のデータ長を有する入力データとに所定の論理演算を行って、当該入力データに対応した暗号化データまたは復号化データを生成する。
【0028】
本発明の第4の観点に係る暗号処理方法は、第1のデータ長を有する初期データを初期データ保持装置に保持させ、与えられた鍵データに基づいて、当該初期データを暗号化する第1のステップと、第3のデータ長を有する入力データを、上記第1のデータ長および上記第3のデータ長より短い第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻す処理を行い、当該処理後のデータを入力データ保持装置に保持させる第2のステップと、上記第1のステップにおいて暗号化されたデータの上位ビット側から上記第2のデータ長分のデータを抽出し、当該抽出データを上位ビットとした上記第3のデータ長を有するデータを生成して、暗号化データ保持装置に保持させる第3のステップと、上記第1のステップにおいて暗号化されたデータと、上記入力データ保持装置に保持されたデータとに所定の論理演算を行い、当該演算結果の上位ビット側から上記第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データを当該抽出データに更新する第4のステップと、上記入力データ保持装置に保持されたデータと、上記第3のステップで生成された上記第3のデータ長を有するデータとに上記所定の論理演算を行って、上記入力データに含まれる上記第2のデータ長を有した単位データに対応する暗号化データを生成する第5のステップとを含んだ初期ステップに続けて、上記初期データ保持装置に保持されたデータを、上記鍵データに基づいて暗号化する第6のステップと、上記入力データ保持装置に保持されたデータを、上記第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻す処理を行い、上記入力データ保持装置に保持されたデータを当該処理後のデータに更新する第7のステップと、上記第6のステップにおいて暗号化されたデータの上位ビット側から第2のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータの上位ビット側に付加し、当該付加後のデータの上位ビット側から上記第3のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータを当該抽出データに更新する第8のステップと、上記第6のステップにおいて暗号化されたデータと、上記入力データ保持装置の上記更新されたデータとに上記所定の論理演算を行い、当該演算結果の上位ビット側から第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータを当該抽出データに更新する第9のステップと、上記入力データ保持装置の上記更新されたデータと、上記第8のステップで抽出された上記第3のデータ長を有するデータとに上記所定の論理演算を行って、少なくとも1つの上記単位データに対応する暗号化データを生成する第10のステップとを含んだ反復ステップを、上記第2のデータ長と上記第3のデータ長とに応じた回数だけ反復する。
【0029】
本発明の第5の観点に係る暗号処理方法は、第1のデータ長を有する初期データを初期データ保持装置に保持させ、与えられた鍵データに基づいて、当該初期データを暗号化する第1のステップと、第3のデータ長を有する暗号化された入力データを、上記第1のデータ長および上記第3のデータ長より短い第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻す処理を行い、当該処理後のデータを入力データ保持装置に保持させる第2のステップと、上記第1のステップにおいて暗号化されたデータの上位ビット側から上記第2のデータ長分のデータを抽出し、当該抽出データを上位ビットとした上記第3のデータ長を有するデータを生成して、暗号化データ保持装置に保持させる第3のステップと、上記入力データ保持装置に保持されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データを当該抽出データに更新する第4のステップと、上記入力データ保持装置に保持されたデータと、上記第3のステップで生成された上記第3のデータ長を有するデータとに所定の論理演算を行って、上記入力データに含まれる上記第2のデータ長を有した単位データに対応する復号化データを生成する第5のステップとを含んだ初期ステップに続けて、上記初期データ保持装置に保持されたデータを、上記鍵データに基づいて暗号化する第6のステップと、上記入力データ保持装置に保持されたデータを、上記第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻す処理を行い、上記入力データ保持装置に保持されたデータを当該処理後のデータに更新する第7のステップと、上記第6のステップにおいて暗号化されたデータの上位ビット側から第2のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータの上位ビット側に付加し、当該付加後のデータの上位ビット側から上記第3のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータを当該抽出データに更新する第8のステップと、上記入力データ保持装置の上記更新されたデータの上位ビット側から第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータを当該抽出データに更新する第9のステップと、上記入力データ保持装置の上記更新されたデータと、上記第8のステップで抽出された上記第3のデータ長を有するデータとに上記所定の論理演算を行って、少なくとも1つの上記単位データに対応する復号化データを生成する第10のステップとを含んだ反復ステップを、上記第2のデータ長と上記第3のデータ長とに応じた回数だけ反復する。
【0030】
【発明の実施の形態】
以下、本発明の3つの実施形態について、図面を参照しながら説明する。
【0031】
(第1の実施形態)
図1は、本発明の第1の実施形態に係る暗号処理装置の構成例を示すブロック図である。
図1に示す暗号処理装置は、ブロック暗号演算部11、入力レジスタ21、IVレジスタ22、出力レジスタ23、データ長設定レジスタ24、IVデータ保持部31、暗号化データ保持部32、第1の選択部41、第1のデータ抽出部51、第2のデータ抽出部52および制御部71を有する。
ブロック暗号演算部11は、本発明のブロック暗号演算手段の一実施形態である。
IVデータ保持部31は、本発明の初期データ保持手段の一実施形態である。
暗号化データ保持部32は、本発明の暗号化データ保持手段の一実施形態である。
第1の選択部41は、本発明の第1の選択手段の一実施形態である。
第1のデータ抽出部51は、本発明の第1のデータ抽出手段の一実施形態である。
第2のデータ抽出部52は、本発明の第2のデータ抽出手段の一実施形態である。
第1の論理演算部61は、本発明の論理演算手段および第1の論理演算手段の一実施形態である。
制御部71は、本発明の制御手段の一実施形態である。
【0032】
ブロック暗号演算部11は、供給される所定データ長のデータを、供給される鍵データに基づいて暗号化するユニットである。例えば、DES暗号化方式に基づいて64ビットを1ブロック単位とする暗号化の演算を行う。以降の説明では、このブロック暗号演算部11における暗号化の単位となるデータ長(第1のデータ長)をL1ビットとする。
【0033】
入力レジスタ21は、暗号化または復号化の対象となるデータSを保持する。この入力レジスタ21に保持される入力データのデータ長は、ブロック暗号演算部11の処理単位であるL1ビットと等しくても良いし、これより長くても良い。以降の説明では、この入力レジスタ21に暗号化または復号化の対象として保持されるデータのデータ長(第3のデータ長)をL3ビットとする。
【0034】
IVレジスタ22は、連続した暗号化または復号化が行われる際の初期の処理サイクルにおいて用いられるL1ビットのデータ(以降、IVデータと呼ぶ)を保持する。
【0035】
出力レジスタ23は、暗号化または復号化の結果として生成されたデータRを保持する。
【0036】
データ長設定レジスタ24は、暗号化または復号化の単位となるデータ長(第2のデータ長)を設定するためのデータを保持する。このデータ長は、ブロック暗号演算部11における暗号化の単位となるL1ビットのデータ長、および入力レジスタから供給されるL3ビットのデータ長よりも短い必要がある。以降の説明では、この第2のデータ長をL2ビットとする。
【0037】
図2は、入力レジスタ21に保持されるデータと出力レジスタ23に保持されるデータとの対応関係を説明するための図である。
図2Aの例は、データ長設定レジスタ24に”L2=1ビット”が設定された場合の例を示す。”L2=1ビット”の場合、後述するように、ブロック暗号演算部11において暗号化演算が1回行われる度に1ビットの暗号化データまたは復号化データが生成されるので、入力レジスタ21に64ビットのデータが保持されていれば、64個の暗号化データまたは復号化データの連続生成が可能となる。この場合、入力レジスタ21に保持される演算前のデータ(S0,…,S63)と、出力レジスタ23に保持される演算後のデータ(R0,…,R63)とは、ビットごとに1対1に対応する。
図2Bの例は、データ長設定レジスタ24に”L2=8ビット”が設定された場合の例を示す。”L2=8ビット”の場合には、ブロック暗号演算部11において暗号化演算が1回行われる度に8ビットの暗号化データまたは復号化データが生成されるので、入力レジスタ21に64ビットのデータが保持されていれば、8個の暗号化データまたは復号化データの連続生成が可能となる。この場合、入力レジスタ21に保持される演算前のデータ(S0,…,S7)と、出力レジスタ23に保持される演算後のデータ(R0,…,R7)とは、8ビットのブロックごとに1対1に対応している。
【0038】
IVデータ保持部31は、暗号化または復号化の際に用いられるL1ビットのデータを保持する。後述するように、IVデータ保持部31は初期の処理サイクルにおいてIVレジスタ22から供給されるL1ビットのIVデータを保持するが、これに続く処理サイクルにおいては、第1のデータ抽出部51において抽出されたL1ビットのデータを保持する。
このIVデータ保持部31において保持されるデータは、ブロック暗号演算部11および第1のデータ抽出部51に供給される。
【0039】
暗号化データ保持部32は、第2のデータ抽出部52において抽出されたデータを保持する。この暗号化データ保持部32に保持されるデータは、第2のデータ抽出部52に供給される。
【0040】
第1の選択部41は、制御部71からの図示しない制御信号に応じて、IVレジスタ22に保持されたIVデータまたは第1のデータ抽出部51からの出力データを選択し、この選択したデータをIVデータ保持部31に出力する。
【0041】
第1のデータ抽出部51は、ブロック暗号演算部11において演算されたデータの上位ビット側からL2ビット分のデータを抽出して、IVデータ保持部31に保持されたデータの下位ビット側に付加し、この付加後の(L1+L2)ビットのデータの下位ビット側からL1ビット分のデータを抽出して、第1の選択部41に出力する。
【0042】
第2のデータ抽出部52は、ブロック暗号演算ブロック暗号演算部11において演算されたデータの上位ビット側からL2ビット分のデータを抽出して、暗号化データ保持部32に保持されたデータの上位ビット側に付加し、この付加後の(L3+L2)ビットのデータの上位ビット側からL3ビットのデータを抽出して、暗号化データ保持部32および第1の論理演算部61に出力する。
【0043】
第1の論理演算部61は、入力レジスタ21から供給されるデータと、第2のデータ抽出部52から出力されるデータとを受けて、所定の論理演算、例えば各ビット同士の排他的論理和を実行する。
【0044】
制御部71は、データ長設定レジスタ24に設定された値に応じて、第1のデータ抽出部51および第2のデータ抽出部52において抽出される上位ビット側のデータ長(L2ビット)を設定する。また、この設定されたデータ長(L2ビット)と、入力レジスタ21に保持される入力データSのデータ長(L3ビット)とに応じて、この入力データSに対応した出力データRを生成するためにブロック暗号演算部11において演算処理を行う回数を決定する。例えば、図2Aに示すように、64ビットの入力データSに対して”L2=8ビット”が設定された場合、ブロック暗号演算部11において演算が反復される回数は8回となる。
【0045】
そして、この反復される処理の初期サイクルにおいて、第1の選択部41にIVレジスタ22のIVデータを選択させてIVデータ保持部31に保持させ、この保持データをブロック暗号演算部11に供給して暗号化演算を実行させる。さらに、このブロック暗号演算部11の演算結果を受けて第2のデータ抽出部52から出力されるデータを、暗号化データ保持部32に保持させる。また、ブロック暗号演算部11の演算結果を受けて第1のデータ抽出部51から出力されるデータを第1の選択部41に選択させてIVデータ保持部31に保持させ、次の処理サイクルにおいてブロック暗号演算部11に供給されるデータを準備させる。この初期サイクルに続く以降の処理サイクルでは、第1の選択部41に第1のデータ抽出部51の出力データを選択させた状態で、設定された回数だけ、初期サイクルと同等の処理を反復させる。
【0046】
ここで、上述した構成を有する図1の暗号処理装置の動作について、図3を参照しながら説明する。
図3は、図1の暗号処理装置における暗号化処理または復号化処理の流れを説明するためのフローチャートである。
【0047】
ステップST101:
入力レジスタ21に保持されたL1ビットのIVデータが第1の選択部41において選択され、IVデータ保持部31に保持される。そして、この保持されたIVデータがブロック暗号演算部11に供給され、与えられた鍵データに基づいて所定の暗号化演算が行われる。
【0048】
ステップST102:
ステップST101でブロック暗号演算部11により暗号化されたデータの上位ビット側からL2ビット分のデータが第2のデータ抽出部52によって抽出され、この抽出されたデータを上位ビットとしたL3ビットのデータが暗号化データ保持部32に保持される。なお、この場合、暗号化データ保持部32に保持されるデータの下位(L3−L2)ビットには、初期状態において暗号化データ保持部32に保持されていたデータの上位(L3−L2)ビットが付加される。
【0049】
ステップST103:
ステップST101でブロック暗号演算部11により暗号化されたデータの上位ビット側からL2ビット分のデータが第1のデータ抽出部51によって抽出され、IVデータ保持部31に保持されたIVデータの下位ビット側に付加され、付加後の(L1+L2)ビットのデータのうち下位ビット側からL1ビット分のデータが抽出されて、第1の選択部41に出力される。第1の選択部41において、この抽出されたL1ビットのデータが選択されて、IVデータ保持部31に供給される。IVデータ保持部31に保持されたIVデータは、この抽出されたL1ビットのデータに更新される。
【0050】
なお、ステップST102およびステップST103は、図1の暗号処理装置において並列して処理を実行することが可能である。
【0051】
ステップST104:
以上のステップST101〜ステップST103の初期サイクルに続けて、次に述べるステップST105〜ステップST107の処理サイクルが反復される。この反復回数は、上述したように、ビット数設定レジスタ24に設定されたデータ長(L2ビット)と、入力レジスタ21に保持される入力データSのデータ長(L3ビット)とに応じて設定される。
この設定された反復回数に達した場合にはステップST108へ、達していない場合にはステップST105へ処理が移行される。
【0052】
ステップST105:
IVデータ保持部31に保持されたデータがブロック暗号演算部11に供給され、暗号化演算が実行される。
【0053】
ステップST106:
ステップST105においてブロック暗号演算部11により暗号化されたデータの上位ビット側からL2ビット分のデータが第2のデータ抽出部52により抽出され、暗号化データ保持部32に保持されたデータの上位ビット側に付加され、付加後の(L3+L2)ビットのデータのうち上位ビット側からL3ビット分のデータが抽出される。暗号化データ保持部32に保持されたデータは、この抽出されたL3ビットのデータに更新される。
【0054】
ステップST107:
ステップST105においてブロック暗号演算部11により暗号化されたデータの上位ビット側からL2ビット分のデータが第1のデータ抽出部51により抽出され、IVデータ保持部31に保持されたデータの下位ビット側に付加され、付加後の(L1+L2)ビットのデータのうち下位ビット側からL1ビット分のデータが抽出されて、第1の選択部41に出力される。IVデータ保持部31に保持されたデータは、この抽出されたL1ビットのデータに再び更新される。
【0055】
なお、このステップST106およびステップST107についても、ステップST102およびステップST103と同様に、並列して処理を実行することが可能である。
【0056】
ステップST108:
ステップST104において演算の終了が判定されると、最後に実行されたステップST106において第2のデータ抽出部52により抽出されたL3ビットのデータと、入力レジスタ21に保持されたL3ビットの入力データとに対して、第1の論理演算部61において所定の論理演算がなされ、これにより、入力データに対応した暗号化データまたは復号化データが生成される。例えば、両データの対応するビット同士の排他的論理和が演算されることにより、暗号化データまたは復号化データが生成される。この生成されたデータは、出力データRとして出力レジスタ23に保持される。
【0057】
上述した処理の流れを踏まえて、暗号化データ保持部32に保持されるデータの変化について、図4に示す具体例を参照しながら説明する。
例えばL3ビットがL2ビットの4倍であるとする。この場合、図4Eに示すように、L3ビットの入力データSは、L2ビットの長さを有する4つの単位データ(S0,…,S3)に区分することができる。
【0058】
初期サイクルのステップST101においてブロック暗号演算部11から暗号化データEが出力されると、ステップST102においてその上位ビット側のL2ビット分のデータE0が抽出され、抽出されたデータE0を上位ビットとするL3ビットのデータが暗号化データ保持部32に保持される(図4A)。
【0059】
次の処理サイクルのステップST105においてブロック暗号演算部11から暗号化データEが出力されると、その上位L2ビット分のデータE1が抽出され、暗号化データ保持部32に保持されたE0の更に上位ビット側に付加される(図4B)。以降のサイクルにおいても同様に、ブロック暗号演算部11から出力される暗号化データEの上位L2ビット分のデータが抽出されて、暗号化データ保持部32に保持されたデータの上位側に付加され、その下位L2ビット分のデータが棄却される。結果として、各処理サイクルにおいてブロック暗号演算部11から出力される暗号化データEの上位L2ビット分のデータが、出力された順に下位側から並んで暗号化データ保持部32に保持される(図4D)。こうして生成されたL2ビットの長さを有する4つの暗号化データ(E0,…,E3)と、入力レジスタ21に保持された4つの単位データ(S0,…,S3)とが、それぞれ第1の論理演算部61において排他的論理和などの演算を施されることにより、L3ビットの入力データSに対応するL3ビットの出力データRが生成される。
【0060】
なお、上述したデータの変化は、下位ビット側にデータが順次付加される点を除いて、IVデータ保持部31においても同様である。すなわち、ブロック暗号演算部11から出力される暗号化データEの上位L2ビット分のデータが、IVデータ保持部31に保持されたデータの下位ビット側に順次付加されるとともに、その上位L2ビット分のデータが順次棄却される。
【0061】
以上説明したように、図1に示す暗号処理装置によれば、ブロック暗号演算部11の演算結果の一部(上位L2ビット分)がブロック暗号演算部11の入力に帰還され、次に生成するL2ビットの暗号化データまたは復号化データの生成に用いられる。したがって、上述した図23に示すOFBモードの暗号化処理や復号化処理と同等の処理を実現することができる。
【0062】
また、ブロック暗号演算部11の演算結果のうち上位L2ビット分が抽出され、この演算に用いられたブロック暗号演算部11への供給データの下位ビット側に付加され、この付加後のデータの下位ビット側からL1ビット分のデータ抽出されて、次の処理サイクルでブロック暗号演算部11に供給されるデータとして準備される。したがって、同様な処理をソフトウェアで実現する場合と比較して無用な待ち時間を低減させることができ、ブロック暗号演算部11の連続的な演算が可能となる。
さらに、ブロック暗号演算部11の演算結果のうち上位L2ビット分が抽出され、この抽出されたデータが、上位ビット側から順に詰めて暗号化データ保持部32に保持されるので、ブロック暗号演算部11から出力される有効な演算結果が上書きなどによって失われることなく確実に保持される。
【0063】
加えて、ビット数設定レジスタ24に設定されるデータ長(L2ビット)と入力レジスタ21に保持される入力データSのデータ長(L3ビット)とに応じて、ブロック暗号演算部11の演算回数が自動的に設定され、この設定された回数の処理が連続的に反復されて、ブロック暗号演算部11の有効な演算結果が必要な個数だけ暗号化データ保持部32に保持される。したがって、入力レジスタ21に保持された複数のL2ビットの単位データを一括して暗号化または復号化することができるので、例えば、L2ビットの暗号化データまたは復号化データが生成される度ごとに生成されたデータの転送などをソフトウェアによって処理する場合と比べて、処理時間を短縮できるとともにソフトウェアの処理負担を軽減することができる。
【0064】
ところで、図1の暗号処理装置では、L2ビットの複数の単位データを含むL3ビットの入力データSが一括して処理され、複数の暗号化データまたは復号化データが同時に生成されるが、データの処理方法によっては、L2ビットの単位データを所望の個数だけ暗号化または復号化したい場合も生じ得る。
【0065】
図5は、このような処理を実現できる暗号処理装置の構成例を示すブロック図である。
図5と図1の同一符号は同一の構成要素を示す。図5の暗号処理装置では、図1の暗号処理装置における制御部71が制御部71’に置き換えられている。この他、図5の暗号処理装置は、入力データ保持部33、第2の選択部42および右ローテイト回路81を有する。
入力データ保持部33は、本発明の入力データ保持手段の一実施形態である。
第2の選択部42は、本発明の第2の選択手段の一実施形態である。
右ローテイト回路81は、本発明のビット・ローテイト手段の一実施形態である。
【0066】
入力データ保持部33は、第2の選択部42から出力されるL3ビットのデータを保持する。
右ローテイト回路81は、入力データ保持部33に保持されたデータを、L2ビットだけ下位ビット側にシフトさせるとともに、このビット・シフトによって最下位ビットからあふれるデータを上位ビット側へ戻す処理(以降、右ローテイト処理と呼ぶ)を行う。
第2の選択部42は、右ローテイト回路81において右ローテイトされたデータ、または入力レジスタ21に保持されたL3ビットの入力データSを選択して、入力データ保持部33に供給する。
【0067】
なお、第1の論理演算部61は、入力データ保持部33に保持されたデータと第2のデータ抽出部52の出力データとを受けて排他的論理和などの論理演算を実行し、この演算結果を出力レジスタ23に出力する。
【0068】
制御部71’は、制御部71とほぼ同様な処理を行う他、次のような処理が追加される。IVレジスタ22に保持されたIVデータがIVデータ保持部31に保持される初期サイクルにおいて、第2の選択部42に入力レジスタ21の入力データSを選択させて、これを入力データ保持部33に保持させる。次いで、入力データ保持部33に保持された入力データSに対して右ローテイト回路81の右ローテイト処理を実行させ、この処理後のデータを第2の選択部42に選択させて再び入力データ保持部33に保持させる。
このように右ローテイトされて入力データ保持部33に保持された入力データと、ブロック暗号演算部11の演算結果を受けて第2のデータ抽出部52から出力されるデータとに対して、第1の論理演算部61において排他的論理和などの論理演算が実行され、その演算結果からL2ビットの暗号化データまたは復号化データが得られる。
【0069】
初期サイクルに続く処理サイクルにおいては、第2の選択部42において右ローテイト回路81の出力データを選択させた状態に設定し、前回の処理サイクルにおいて入力データ保持部33に保持されたデータを右ローテイト回路81において再び右ローテイトさせて、入力データ保持部33に保持させる。
この右ローテイト後のデータと第2のデータ抽出部52の出力データとに対して排他的論理和などの論理演算が行われ、その演算結果からL2ビットの暗号化データまたは復号化データが得られる。
【0070】
ここで、上述した構成を有する図5の暗号処理装置の動作について、図6を参照しながら説明する。
図6は、図5の暗号処理装置における暗号化処理または復号化処理の流れを説明するためのフローチャートである。
【0071】
ステップST201:
図3のステップST101と同様の処理が行われる。すなわち、入力レジスタ21のIVデータがIVデータ保持部31に保持され、このIVデータに対してブロック暗号演算部11の暗号化演算が行われる。
【0072】
ステップST202:
L3ビットの入力データSが第2の選択部42において選択されて、入力データ保持部33に保持される。次いで、右ローテイト回路81において、この保持されたデータが下位ビット側にL2ビットだけ右ローテイトされ、右ローテイト処理後のデータが第2の選択部42において選択されて、入力データ保持部33に保持される。これにより、入力レジスタ21に保持された入力データSが、1回だけ右ローテイトされた状態で入力データ保持部33に保持される。
このステップST202の処理は、ステップST201、ステップST203およびステップST204の処理と並列して実行することが可能である。
【0073】
ステップST203:
図3のステップST102と同様な処理が行われる。すなわち、ステップST201においてブロック暗号演算部11により暗号化されたデータの上位ビット側からL2ビット分のデータが第2のデータ抽出部52によって抽出され、これを上位ビットとしたL3ビットを有するデータが抽出されて、暗号化データ保持部32に保持される。
【0074】
ステップST204:
図3のステップST103と同様な処理が行われる。すなわち、ステップST201においてブロック暗号演算部11により暗号化されたデータの上位ビット側からL2ビット分のデータが第1のデータ抽出部51によって抽出され、IVデータ保持部31に保持されたIVデータの下位ビット側に付加され、この付加後の(L1+L2)ビットのデータのうち下位ビット側からL1ビット分のデータが抽出される。IVデータ保持部31の保持データは、この抽出されたL1ビットのデータに更新される。
【0075】
なお、ステップST203およびステップST204は、図3のステップST101およびステップST102と同様に、並列して処理を実行することが可能である。
【0076】
ステップST205:
入力データ保持部33に保持されたデータと、ステップST203において第2のデータ抽出部52により抽出されたL3ビットのデータとに対し、排他的論理和などの所定の論理演算が第1の論理演算部61において実行される。これにより、入力レジスタ21の入力データSに含まれる複数のL2ビットの単位データのうちの1つに対応する暗号化データまたは復号化データが生成されて、出力レジスタ23に保持される。
【0077】
ステップST206:
以上のステップST201〜ステップST205の初期サイクルに続けて、次に述べるステップST207〜ステップST211の処理サイクルが反復される。この反復回数は、図1の暗号処理装置と同様に、ビット数設定レジスタ24に設定されたデータ長(L2ビット)と、入力レジスタ21に保持される入力データSのデータ長(L3ビット)とに応じて設定される。
この設定された反復回数に達した場合には、入力データSの処理が終了される。
【0078】
ステップST207:
図3のステップST105と同様な処理が行われる。すなわち、IVデータ保持部31に保持されているL1ビットのデータがブロック暗号演算部11に供給されて、暗号化演算が実行される。
【0079】
ステップST208:
入力データ保持部33に保持されている前回の右ローテイト処理後のデータが、更に右ローテイト回路81において右ローテイトされ、第2の選択部42において選択されて入力データ保持部33に供給される。入力データ保持部33に保持されたデータは、この右ローテイト処理後のデータに更新される。
このステップST208の処理は、ステップST207、ステップST209およびステップST210の処理と並列して実行することが可能である。
【0080】
ステップST209:
図3のステップST106と同様な処理が行われる。すなわち、ステップST207においてブロック暗号演算部11により暗号化されたデータの上位ビット側からL2ビット分のデータが第2のデータ抽出部52によって抽出され、暗号化データ保持部32に保持されたデータの上位ビット側に付加され、付加後の(L3+L2)ビットのデータのうち上位ビット側からL3ビット分のデータが抽出される。暗号化データ保持部32の保持データは、この抽出されたL3ビットのデータに更新される。
【0081】
ステップST210:
図3のステップST107と同様な処理が行われる。すなわち、ステップST207においてブロック暗号演算部11により暗号化されたデータの上位ビット側からL2ビット分のデータが第1のデータ抽出部51によって抽出され、IVデータ保持部31に保持されたデータの下位ビット側に付加され、付加後の(L1+L2)ビットのデータのうち下位ビット側からL1ビット分のデータが抽出される。IVデータ保持部31の保持データは、この抽出されたL1ビットのデータに更新される。
【0082】
ステップST211:
入力データ保持部33に保持されたデータと、ステップST209において第2のデータ抽出部52により抽出されたL3ビットのデータとに対し、排他的論理和などの所定の論理演算が第1の論理演算部61において実行される。これにより、入力レジスタ21の入力データSに含まれる複数のL2ビットの単位データのうち、すくなくともその1つに対応する暗号化データまたは復号化データが生成されて、出力レジスタ23に保持される。
【0083】
なお、このステップST210およびステップST211についても、ステップST203およびステップST204と同様に、並列して処理を実行することが可能である。
【0084】
ここで、図5の暗号処理装置において暗号化データ保持部32および入力データ保持部33に保持されるデータの変化について、図7に示す具体例を参照しながら説明する。
図4の例と同様に、図5の例においても、L3ビットがL2ビットの4倍であるとする。したがって、L3ビットの入力データSは、L2ビットの長さを有する4つの単位データ(S0,…,S3)に区分することができる。
【0085】
初期サイクルのステップST202において、入力レジスタ21の入力データSに対し右ローテイト処理が一回施されると、入力データ保持部33に保持されたデータにおいて、LSB側の単位データS0がMSB側に移される(図7A)。したがって、このMSB側に移された単位データS0と、第2のデータ抽出部52から出力されるデータにおける上位L2ビット分のデータE0との対応するビット同士において排他的論理和などの論理演算が実行されると、その演算結果の上位L2ビットから、単位データS0に対応した暗号化データまたは復号化データが得られる。
【0086】
次の処理サイクルのステップST208において、入力レジスタ21の入力データSに対し右ローテイト処理が一回施されると、入力データ保持部33に保持されたデータにおいて、LSB側の単位データS1がMSB側に移される(図7B)。したがって、この単位データS1と、ブロック暗号演算部11から出力されるデータの上位L2ビット分のデータE1との対応するビット同士において排他的論理和などの論理演算が実行されると、その演算結果の上位L2ビットから、単位データS1に対応した暗号化データまたは復号化データが得られる。さらに、入力データ保持部33に保持されたデータのMSB側から2番目に位置する単位データS0と、第2のデータ抽出部52から出力されるデータのMSB側から2番目に位置するL2ビットのデータE0との論理演算によって、単位データS0に対応した暗号化データまたは復号化データも得られる。すなわち、2つの単位データに対応する暗号化データまたは復号化データを同時に得ることができる。
【0087】
以降の処理サイクルにおいても同様であり、右ローテイト処理の回数が増えるとともに、同時に得られる暗号化データまたは復号化データの数も多くなる。最終的に、右ローテイト回路81による右ローテイト処理によってデータが一巡して、入力データ保持部33に保持されたデータにおける単位データの並び順と、入力レジスタ21に保持された単位データの並び順とが同じになった場合、入力データSが含む全単位データに対応した暗号化データまたは復号化データを、一括して得ることができる。
【0088】
このように、図5に示す暗号処理装置によれば、入力データSが含む複数の単位データのそれぞれに対応した暗号化データまたは復号化データを、連続して順に出力することができる。また、出力レジスタ23からデータを読み出す処理サイクルを適切に設定することにより、暗号化データまたは復号化データを所望の個数だけ一括して読み出すこともできる。
【0089】
(第2の実施形態)
第1の実施形態に係る図1の暗号処理装置では、図23に示すOFBモードを用いた暗号化処理および復号化処理を実行できるが、次に述べる第2の実施形態に係る図8の暗号処理装置では、このOFBモードに加えて、図24に示すCFBモードを用いた暗号化処理および復号化処理も実行可能となる。
【0090】
図8は、本発明の第2の実施形態に係る暗号処理装置の構成例を示すブロック図である。
図8と図5の同一符号は同一の構成要素を示す。図8の暗号処理装置では、図5の暗号処理装置における制御部71’が制御部72に置き換えられている。その他、図8の暗号処理装置は、第3の選択部43および第2の論理演算部62を有する。
第3の選択部43は、本発明の第3の選択手段の一実施形態である。
第2の論理演算部62は、本発明の第2の論理演算手段の一実施形態である。
【0091】
第2の論理演算部62は、入力データ保持部33に保持されたデータとブロック暗号演算部11において演算されたデータとを受けて、排他的論理和などの所定の論理演算を実行する。
【0092】
第3の選択部43は、入力データ保持部33に保持されたデータ、第2の論理演算部62において演算されたデータ、またはブロック暗号演算部11において演算されたデータを選択して、第1のデータ抽出部51に供給する。
【0093】
なお、第1のデータ抽出部51は、第3の選択部43において選択されたデータの上位ビット側からL2ビット分のデータを抽出して、IVデータ保持部31に保持されたデータの下位ビット側に付加し、この付加後の(L1+L2)ビットのデータの下位ビット側からL1ビット分のデータを抽出して、第1の選択部41に出力する。
【0094】
制御部72は、OFBモードまたはCFBモードでの暗号化または復号化を行うための各種制御を行う。
いずれの操作モードにおいても、まず、データ長設定レジスタ24に設定された値に応じて、第1のデータ抽出部51および第2のデータ抽出部52において抽出される上位ビット側のデータ長(L2ビット)を設定する。また、この設定されたデータ長(L2ビット)と、入力レジスタ21に保持される入力データSのデータ長(L3ビット)とに応じて、入力データSに対応した出力データRを生成するためにブロック暗号演算部11において演算処理を行う回数を決定する。
【0095】
CFBモードの暗号化処理を行う場合、その初期サイクルにおいて、第1の選択部41にIVレジスタ22のIVデータを選択させてIVデータ保持部31に保持させ、この保持データをブロック暗号演算部11に供給して暗号化演算を実行させる。次いで、ブロック暗号演算部11の演算結果を受けて第2のデータ抽出部52から出力されるデータを、暗号化データ保持部32に保持させる。また、第2の選択部42に入力レジスタ21の入力データSを選択させて入力データ保持部33に保持させ、この保持データに対して右ローテイト回路81の右ローテイト処理を実行させ、処理後のデータを第2の選択部42に選択させて入力データ保持部33に保持させる。こうして右ローテイトされて入力データ保持部33に保持された入力データと、ブロック暗号演算部11の演算結果を受けて第2のデータ抽出部52から出力されるデータとに対し、第1の論理演算部61において排他的論理和などの論理演算が実行され、その演算結果からL2ビットの暗号化データまたは復号化データが得られる。さらに、入力データ保持部33に保持された右ローテイト処理後のデータとブロック暗号演算部11の演算結果と受けて第2の論理演算部62から出力される演算結果を、第3の選択部43に選択させて第1のデータ抽出部51に供給させる。この供給データを受けて第1のデータ抽出部51から出力されるデータを、第1の選択部41に選択させてIVデータ保持部31に保持させ、次のサイクルでブロック暗号演算部11に供給されるデータを準備させる。
この初期サイクルに続く処理においては、第1の選択部41に第1のデータ抽出部51の出力データを、第2の選択部42に右ローテイト回路81の処理後のデータをそれぞれ選択させた状態で、上述の初期サイクルと同様の処理を設定された回数だけ反復させる。
【0096】
また、CFBモードの復号化処理を行う場合には、その初期サイクルにおいて、第1の選択部41にIVレジスタ22のIVデータを選択させてIVデータ保持部31に保持させ、この保持データをブロック暗号演算部11に供給して暗号化演算を実行させる。次いで、ブロック暗号演算部11の演算結果を受けて第2のデータ抽出部52から出力されるデータを、暗号化データ保持部32に保持させる。また、第2の選択部42に入力レジスタ21の入力データSを選択させて入力データ保持部33に保持させ、この保持データに対して右ローテイト回路81の右ローテイト処理を実行させ、処理後のデータを第2の選択部42に選択させて入力データ保持部33に保持させる。こうして右ローテイトされて入力データ保持部33に保持された入力データと、ブロック暗号演算部11の演算結果を受けて第2のデータ抽出部52から出力されるデータとに対し、第1の論理演算部61において排他的論理和などの論理演算が実行され、その演算結果からL2ビットの暗号化データまたは復号化データが得られる。以上はCFBモードの暗号化処理と同様である。CFBモードの復号化処理では、入力データ保持部33に保持された右ローテイト処理後のデータを、第3の選択部43に選択させて第1のデータ抽出部51に供給させ、これを受けて第1のデータ抽出部51から出力されるデータを、第1の選択部41に選択させてIVデータ保持部31に保持させることにより、次のサイクルでブロック暗号演算部11に供給されるデータを準備させる。
この初期サイクルに続く処理においては、第1の選択部41に第1のデータ抽出部51の出力データを、第2の選択部42に右ローテイト回路81の処理後のデータをそれぞれ選択させた状態で、上述の初期サイクルと同様の処理を設定された回数だけ反復させる。
【0097】
OFBモードの暗号化処理または復号化処理を行う場合には、第3の選択部43にブロック暗号演算部11の演算結果を選択させた状態に設定する。その他の制御については、図5における制御部71’と同様である。
【0098】
ここで、上述した構成を有する図8の暗号処理装置の動作について、図9〜図12を参照しながら説明する。
図9は、図8の暗号処理装置におけるCFBモードの暗号化処理の流れを説明するためのフローチャートである。
図10は、図8の暗号処理装置においてCFBモードの暗号化処理が行われる場合に有効または無効となる信号を示す。
図11は、図8の暗号処理装置においてCFBモードの復号化処理が行われる場合に有効または無効となる信号を示す。
図12は、図8の暗号処理装置においてOFBモードの暗号化処理または復号化処理が行われる場合に有効または無効となる信号を示す。
なお、図10〜図12と図8とにおいて同一の符号は同一の構成要素を示しており、また、実線で示した信号は有効な信号を、点線で示した信号は無効な信号をそれぞれ示している。
【0099】
まず、CFBモードの暗号化処理が行われる場合について説明する。
この場合、図10に示すように、第3の選択部43において第2の論理演算部62からの出力信号が選択されて第1のデータ抽出部51に供給される。
【0100】
ステップST301:
図6のステップST201と同様な処理が行われる。すなわち、入力レジスタ21のIVデータがIVデータ保持部31に保持され、このIVデータに対してブロック暗号演算部11の暗号化演算が行われる。
【0101】
ステップST302:
図6のステップST202と同様な処理が行われる。すなわち、L3ビットの入力データSが第2の選択部42において選択されて、入力データ保持部33に保持される。次いで、右ローテイト回路81において、この保持されたデータが下位ビット側にL2ビットだけ右ローテイトされ、右ローテイト処理後のデータが第2の選択部42において選択されて、入力データ保持部33に保持される。これにより、入力レジスタ21に保持された入力データSが、1回だけ右ローテイトされた状態で入力データ保持部33に保持される。
このステップST302の処理は、ステップST301およびステップST303の処理と並列して実行することが可能である。
【0102】
ステップST303:
図6のステップST203と同様な処理が行われる。すなわち、ステップST301においてブロック暗号演算部11により暗号化されたデータの上位ビット側からL2ビット分のデータが第2のデータ抽出部52によって抽出され、これを上位ビットとしたL3ビットを有するデータが抽出されて、暗号化データ保持部32に保持される。
【0103】
ステップST304:
ステップST301においてブロック暗号演算部11により暗号化されたデータと、ステップST302の右ローテイト処理がなされて入力データ保持部33に保持されたデータとに対し、第2の論理演算部62において排他的論理和などの論理演算が実行され、この演算結果が第3の選択部43において選択されて、第1のデータ抽出部51に供給される。第1のデータ抽出部51において、この供給されたデータの上位ビット側からL2ビット分のデータが抽出され、IVデータ保持部31に保持されたIVデータの下位ビット側に付加され、付加後の(L1+L2)ビットのデータのうち下位ビット側からL1ビット分のデータが抽出される。抽出されたデータは、第1の選択部41において選択されてIVデータ保持部31に供給される。IVデータ保持部31の保持データは、この抽出されたL1ビットのデータに更新される。
なお、ステップST304の処理は、ステップST303およびステップST305の処理と並列して実行することが可能である。
【0104】
ステップST305:
入力データ保持部33に保持された右ローテイト処理後のデータと、ステップST303において第2のデータ抽出部52により抽出されたL3ビットのデータとに対し、排他的論理和などの所定の論理演算が第1の論理演算部61において実行される。これにより、入力レジスタ21の入力データSに含まれる複数のL2ビットの単位データのうちの1つに対応する暗号化データまたは復号化データが生成されて、出力レジスタ23に保持される。
【0105】
ステップST306:
以上のステップST301〜ステップST305の初期サイクルに続けて、次に述べるステップST307〜ステップST311の処理サイクルが反復される。この反復回数は、図1の暗号処理装置と同様に、ビット数設定レジスタ24に設定されたデータ長(L2ビット)と、入力レジスタ21に保持される入力データSのデータ長(L3ビット)とに応じて設定される。
この設定された反復回数に達した場合には、入力データSの処理が終了される。
【0106】
ステップST307:
図6のステップST207と同様な処理が行われる。すなわち、IVデータ保持部31に保持されているL1ビットのデータがブロック暗号演算部11に供給されて、暗号化演算が実行される。
【0107】
ステップST308:
図6のステップST208と同様な処理が行われる。すなわち、入力データ保持部33に保持されている前回の右ローテイト処理後のデータが、更に右ローテイト回路81において右ローテイトされ、第2の選択部42において選択されて入力データ保持部33に供給される。入力データ保持部33の保持データは、この右ローテイト処理後のデータに更新される。
このステップST308の処理は、ステップST307およびステップST309の処理と並列して実行することができる。
【0108】
ステップST309:
図6のステップST209と同様な処理が行われる。すなわち、ステップST307においてブロック暗号演算部11により暗号化されたデータの上位ビット側からL2ビット分のデータが第2のデータ抽出部52によって抽出され、暗号化データ保持部32に保持されたデータの上位ビット側に付加され、付加後の(L3+L2)ビットのデータのうち上位ビット側からL3ビット分のデータが抽出される。暗号化データ保持部32の保持データは、この抽出されたL3ビットのデータに更新される。
【0109】
ステップST310:
ステップST307においてブロック暗号演算部11により暗号化されたデータと、前回の処理サイクルにおいて右ローテイト処理がなされて入力データ保持部33に保持されたデータとに対し、第2の論理演算部62において排他的論理和などの論理演算が実行され、この演算結果が第3の選択部43において選択されて、第1のデータ抽出部51に供給される。第1のデータ抽出部51において、この供給されたデータの上位ビット側からL2ビット分のデータが抽出され、IVデータ保持部31に保持されたIVデータの下位ビット側に付加され、付加後の(L1+L2)ビットのデータのうち下位ビット側からL1ビット分のデータが抽出される。抽出されたデータは、第1の選択部41において選択されてIVデータ保持部31に供給される。IVデータ保持部31の保持データは、この抽出されたL1ビットのデータに更新される。
なお、ステップST310の処理は、ステップST309およびステップST311の処理と並列して実行することが可能である。
【0110】
ステップST311:
入力データ保持部33に保持された右ローテイト処理後のデータと、ステップST309において第2のデータ抽出部52により抽出されたL3ビットのデータとに対し、排他的論理和などの所定の論理演算が第1の論理演算部61において実行される。これにより、入力レジスタ21の入力データSに含まれる複数のL2ビットの単位データのうちの、少なくともその1つに対応する暗号化データが生成されて、出力レジスタ23に保持される。
【0111】
上述した処理の流れはCFBモードの暗号化処理に関するものであるが、CFBモードの復号化処理についても同様の処理が実行される。ただし、CFBモードの復号化処理では、図11に示すように、第3の選択部43において入力データ保持部33の保持データが選択されて第1のデータ抽出部51に供給される点で、暗号化処理の場合と異なっている。すなわち、上述したステップST304およびステップST310において、入力データ保持部33に保持された右ローテイト処理後のデータから、第1のデータ抽出部51による抽出処理が行われ、次回の処理サイクルでブロック暗号演算部11に供給されるデータが生成される。その他のステップについては、暗号化処理の場合と同様である。
【0112】
また、OFBモードの暗号化処理または復号化処理が行われる場合には、図12に示すように、第3の選択部43においてブロック暗号演算部11の演算結果が選択されて、第1のデータ抽出部51に供給される。このため、図12の接続状態における構成は図5の暗号処理装置と等価になる。この接続状態で、図5における制御部71’と同様な処理が制御部72において実行されて、図5の暗号処理装置と同様なOFBモードの処理が実現される。
【0113】
以上説明したように、図8に示す暗号処理装置によれば、図5の暗号処理装置に対して第3の選択部43および第2の論理演算部62が追加された簡易な構成でありながら、OFBモードに加えてCFBモードの処理を行うことが可能になる。
【0114】
また、CFBモードにおいても、図5の暗号処理装置におけるOFBモードの場合と同様に、入力データSが含む複数の単位データのそれぞれに対応した暗号化データまたは復号化データを、連続して順に出力することができる。出力レジスタ23からデータを読み出す処理サイクルを適切に設定すれば、暗号化データまたは復号化データを所望の個数だけ一括して読み出すこともできる。
【0115】
(第3の実施形態)
第2の実施形態に係る図8の暗号処理装置では、OFBモードおよびCFBモードの処理が実行可能であるが、次に述べる第3の実施形態に係る図13の暗号処理装置では、これらの操作モードに加えて、図21に示すECBモードや、図22に示すCBCモードの処理も実行可能となる。
【0116】
図13は、本発明の第3の実施形態に係る暗号処理装置の構成例を示すなブロック図である。
図13と図8の同一符号は同一の構成要素を示している。図13の暗号処理装置では、図8の暗号処理装置における制御部72が制御部73に置き換えられている。その他、図13の暗号処理装置は、第4の選択部44、第5の選択部45、第3の論理演算部63および第4の論理演算部64を有する。
第4の選択部44は、本発明の第4の選択手段の一実施形態である。
第5の選択部45は、本発明の第5の選択手段の一実施形態である。
第3の論理演算部63は、本発明の第3の論理演算手段の一実施形態である。
第4の論理演算部64は、本発明の第4の論理演算手段の一実施形態である。
【0117】
第3の論理演算部63は、IVデータ保持部31に保持されたデータと入力データ保持部33に保持されたデータとを受けて、排他的論理和などの所定の論理演算を実行する。
【0118】
第4の選択部44は、IVデータ保持部31に保持されたデータ、入力データ保持部33に保持されたデータ、または第3の論理演算部63において演算されたデータを選択して、ブロック暗号演算部11に供給する。
【0119】
なお、ブロック暗号演算部11は、第4の選択部44から供給されたデータに対して、与えられた鍵データに基づいた暗号化演算または復号化演算を実行する。
【0120】
第4の論理演算部64は、IVデータ保持部31に保持されたデータとブロック暗号演算部11において演算されたデータとを受けて、排他的論理和などの所定の論理演算を実行する。
【0121】
第5の選択部45は、第1の論理演算部61において演算されたデータ、ブロック暗号演算部11において演算されたデータ、または第4の論理演算部64において演算されたデータを選択して、出力レジスタ23に出力する。
【0122】
制御部73は、ECBモード、CBCモード、OFBモードまたはCFBモードでの暗号化または復号化を行うための各種制御を行う。
【0123】
ここで、上述した構成を有する図8の暗号処理装置の各操作モードにおける動作について、図14〜図20を参照しながら説明する。
図14は、図13の暗号処理装置においてECBモードの暗号化処理または復号化処理が行われる場合に有効または無効となる信号を示す。
図16は、図13の暗号処理装置においてCBCモードの暗号化処理が行われる場合に有効または無効となる信号を示す。
図17は、図13の暗号処理装置においてCBCモードの復号化処理が行われる場合に有効または無効となる信号を示す。
図18は、図13の暗号処理装置においてOFBモードの暗号化処理または復号化処理が行われる場合に有効または無効となる信号を示す。
図19は、図13の暗号処理装置においてCFBモードの暗号化処理が行われる場合に有効または無効となる信号を示す。
図20は、図13の暗号処理装置においてCFBモードの復号化暗号化処理が行われる場合に有効または無効となる信号を示す。
なお、図14および図16〜図20と図13とにおいて同一の符号は同一の構成要素を示しており、また、実線で示した信号は有効な信号を、点線で示した信号は無効な信号をそれぞれ示している。
【0124】
<ECBモードの暗号化処理および復号化処理>
ECBモードの暗号化処理または復号化処理が行われる場合、図14に示すように、入力レジスタ21、第2の選択部42、入力データ保持部33、第4の選択部44、ブロック暗号演算部11、第5の選択部45および出力レジスタ23が有効状態となり、IVレジスタ22、IVデータ保持部31、暗号化データ保持部32、第1の選択部41、第3の選択部43、第1のデータ抽出部51、第2のデータ抽出部52、第1の論理演算部61、第2の論理演算部62、第3の論理演算部63、第4の論理演算部64および右ローテイト回路81が無効状態となる。
【0125】
この場合、第2の選択部42において入力レジスタ21の入力データが選択されて入力データ保持部33に供給され、入力データ保持部33に保持された入力データが第4の選択部44において選択されてブロック暗号演算部11に供給されて、暗号化または復号化される。このブロック暗号演算部11の演算結果が第5の選択部45において選択されて、出力レジスタ23に出力される。すなわち、入力レジスタ21に保持された入力データがそのままブロック暗号演算部11に供給されて、暗号化または復号化の演算が実行され、その演算結果が出力レジスタ23に出力される。
したがって、入力レジスタ21に保持される入力データのデータ長(L3ビット)は、ブロック暗号演算部11において処理されるデータ長(L1ビット)と等しくなる。例えば”L1=L3=64ビット”の場合、図15に示すように、入力レジスタに保持される64ビットの入力データに対応した、64ビットの暗号化データまたは復号化データが出力レジスタ23に保持される。
【0126】
<CBCモードの暗号化処理>
CBCモードの暗号化処理が行われる場合、図16に示すように、ブロック暗号演算部11、入力レジスタ21、IVレジスタ22、出力レジスタ23、IVデータ保持部31、入力データ保持部33、第1の選択部41、第2の選択部42、第3の選択部43、第4の選択部44、第5の選択部45、第1のデータ抽出部51および第3の論理演算部63が有効状態となり、暗号化データ保持部32、第2のデータ抽出部52、第1の論理演算部61、第2の論理演算部62、第4の論理演算部64および右ローテイト回路81が無効状態となる。
【0127】
この場合、先ず1つ目の入力データに対応した暗号化データが生成される初期サイクルでは、第1の選択部41においてIVレジスタ22のIVデータが選択されてIVデータ保持部31に保持されるとともに、第2の選択42において入力レジスタ21の入力データが選択されて入力データ保持部33に保持される。そして、IVデータ保持部31に保持されたIVデータと入力データ保持部33に保持された入力データとが第3の論理演算部63に入力され、排他的論理和などの論理演算が実行される。この第3の論理演算部63の演算結果が第4の選択部44において選択されてブロック暗号演算部11に供給され、そこで暗号化の演算が実行され、この演算結果が第5の選択部45において選択されて出力レジスタ23に出力される。
【0128】
また、この初期サイクルにおいて、ブロック暗号演算部11の演算結果は、第3の選択部43において選択されて第1のデータ抽出部51にも供給される。この場合、第1のデータ抽出部51においては、既に述べた図1の暗号処理装置などにおける動作とは異なり、ブロック暗号演算部11から出力されるL1ビット分のデータがそのまま第1の選択部41に出力される。第1の選択部41において、この第1のデータ抽出部51から出力されたデータ(すなわちブロック暗号演算部11の演算結果)が選択されてIVデータ保持部31に保持され、次の処理サイクルでブロック暗号演算部11に供給されるデータを生成するために準備される。
【0129】
初期サイクルに続く、2つ目以降の入力データに対応した暗号化データを生成するサイクルでは、第1の選択部41において第1のデータ抽出部51から出力されるデータが選択された状態で、上述した初期サイクルと同等の処理が実行される。すなわち、ブロック暗号演算部11の演算結果がそのまま出力レジスタ23に出力されるとともに、この演算結果が次回のサイクルにおいてブロック暗号演算部11に供給されるデータを生成するために用いられる。
【0130】
<CBCモードの復号化処理>
CBCモードの復号化処理が行われる場合、図17に示すように、ブロック暗号演算部11、入力レジスタ21、IVレジスタ22、出力レジスタ23、IVデータ保持部31、入力データ保持部33、第1の選択部41、第2の選択部42、第3の選択部43、第4の選択部44、第5の選択部45、第1のデータ抽出部51および第4の論理演算部64が有効状態となり、暗号化データ保持部32、第2のデータ抽出部52、第1の論理演算部61、第2の論理演算部62、第3の論理演算部63および右ローテイト回路81が無効状態となる。
【0131】
この場合、先ず1つ目の入力データに対応した暗号化データが生成される初期サイクルでは、第1の選択部41においてIVレジスタ22のIVデータが選択されてIVデータ保持部31に保持されるとともに、第2の選択42において入力レジスタ21の入力データが選択されて入力データ保持部33に保持される。IVデータ保持部31に保持されたIVデータが第4の選択部44において選択されてブロック暗号演算部11に供給され、暗号化の演算が実行される。この演算結果と、IVデータ保持部31に保持されたIVデータとが第4の論理演算部64に入力されて排他的論理和などの演算が実行され、その演算結果が第5の選択部45において選択されて出力レジスタ23に出力される。
【0132】
また、この初期サイクルにおいて、入力データ保持部33に保持された入力データは、第3の選択部43において選択されて第1のデータ抽出部51にも供給され、CBCモードの暗号化処理の場合と同様に、入力レジスタ21に保持されたL1ビット分のデータがそのまま第1の選択部41に出力される。第1の選択部41において、この第1のデータ抽出部51から出力されたデータ(すなわち入力データ保持部33に保持された入力データ)が選択されてIVデータ保持部31に保持され、次の処理サイクルでブロック暗号演算部11に供給されるデータとして準備される。
【0133】
初期サイクルに続く、2つ目以降の入力データに対応した暗号化データを生成するサイクルでは、第1の選択部41において第1のデータ抽出部51から出力されるデータが選択された状態で、上述した初期サイクルと同等の処理が実行される。すなわち、入力データ保持部33に保持された前のサイクルの入力データが、そのまま次のサイクルにおいてブロック暗号演算部11に供給される。
【0134】
なお、上述したCBCモードの暗号化処理および復号化処理においても、ECBモードの場合と同様に、入力レジスタ21に保持される入力データのデータ長(L3ビット)は、ブロック暗号演算部11において処理されるデータ長(L1ビット)と等しくなる。すなわち、図15に示すように、入力レジスタに保持されたL1ビットの入力データに対応したL1ビットの暗号化データまたは復号化が生成されて、出力レジスタ23に保持される。
【0135】
<OFBモードの暗号化処理および復号化処理>
OFBモードの暗号化処理および復号化処理が行われる場合、図18に示すように、ブロック暗号演算部11、入力レジスタ21、IVレジスタ22、出力レジスタ23、IVデータ保持部31、暗号化データ保持部32、入力データ保持部33、第1の選択部41、第2の選択部42、第3の選択部43、第4の選択部44、第5の選択部45、第1のデータ抽出部51、第2のデータ抽出部52、第1の論理演算部61および右ローテイト回路81が有効状態となり、第2の論理演算部62、第3の論理演算部63および第4の論理演算部64が無効状態となる。
【0136】
この場合、第4の選択部44においてIVデータ保持部31の保持データが選択されてブロック暗号演算部11に供給され、第5の選択部45において第1の論理演算部61の演算結果が選択されて出力レジスタ23に出力されるとともに、第3の選択部43においてブロック暗号演算部11の演算結果が選択されて第1のデータ抽出部51に出力される。こうした図18の接続状態は、図8の暗号処理装置の図12に示す接続状態と等価になる。したがって、図8の暗号処理装置におけるOFBモードの場合と同様な制御が制御部73において行われることにより、図8の暗号処理装置と同様なOFBモードの処理を実現することが可能になる。
【0137】
<CFBモードの暗号化処理>
CFBモードの暗号化処理が行われる場合、図19に示すように、ブロック暗号演算部11、入力レジスタ21、IVレジスタ22、出力レジスタ23、IVデータ保持部31、暗号化データ保持部32、入力データ保持部33、第1の選択部41、第2の選択部42、第3の選択部43、第4の選択部44、第5の選択部45、第1のデータ抽出部51、第2のデータ抽出部52、第1の論理演算部61、第2の論理演算部62および右ローテイト回路81が有効状態となり、第3の論理演算部63および第4の論理演算部64が無効状態となる。
【0138】
この場合、第4の選択部44においてIVデータ保持部31の保持データが選択されてブロック暗号演算部11に供給され、第5の選択部45において第1の論理演算部61の演算結果が選択されて出力レジスタ23に出力されるとともに、第3の選択部43において第2の論理演算部62の演算結果が選択されて第1のデータ抽出部51に出力される。こうした図19の接続状態は、図8の暗号処理装置の図10に示す接続状態と等価になる。したがって、図8の暗号処理装置におけるCFBモードの暗号化処理の場合と同様な制御が制御部73において行われることにより、図8の暗号処理装置と同様なCFBモードの暗号化処理を実現することが可能になる。
【0139】
<CFBモードの復号化処理>
CFBモードの復号化処理が行われる場合、図20に示すように、ブロック暗号演算部11、入力レジスタ21、IVレジスタ22、出力レジスタ23、IVデータ保持部31、暗号化データ保持部32、入力データ保持部33、第1の選択部41、第2の選択部42、第3の選択部43、第4の選択部44、第5の選択部45、第1のデータ抽出部51、第2のデータ抽出部52、第1の論理演算部61および右ローテイト回路81が有効状態となり、第2の論理演算部62、第3の論理演算部63および第4の論理演算部64が無効状態となる。
【0140】
この場合、第4の選択部44においてIVデータ保持部31の保持データが選択されてブロック暗号演算部11に供給され、第5の選択部45において第1の論理演算部61の演算結果が選択されて出力レジスタ23に出力されるとともに、第3の選択部43において入力データ保持部33の保持データが選択されて第1のデータ抽出部51に出力される。こうした図20の接続状態は、図8の暗号処理装置の図11に示す接続状態と等価になる。したがって、図8の暗号処理装置におけるCFBモードの復号化処理の場合と同様な制御が制御部73において行われることにより、図8の暗号処理装置と同様なCFBモードの復号化処理を実現することが可能になる。
【0141】
以上説明したように、図13に示す暗号処理装置によれば、図8の暗号処理装置に対して第4の選択部44、第5の選択部45、第3の論理演算部63および第4の論理演算部64が追加された簡易な構成でありながら、OFBモードおよびCFBモードの処理に加えて、ECBモードやCBCモードの処理を行うことが可能になる。したがって、ブロック暗号演算部11として例えばDES暗号方式の暗号化または復号化の演算を行うユニットを適用した場合、図13に示す暗号処理装置によれば、FIPS81において定められている4つの操作モードを全て実現することが可能になる。
【0142】
なお、本発明は上述した実施形態に限定されない。
例えば、本発明の実施形態の説明において用いられているビット列の「上位」および「下位」の区別は、処理されるデータのビット列における一方の端を「上位」として適当に定めた場合に、他方の端を「下位」と見なして区別すること意味しており、データの内容や値、データが伝送される順序などに応じてビット列の「上位」および「下位」が限定されることを意味していない。
【0143】
【発明の効果】
本発明によれば、第1に、ブロック暗号化方式を用いて単位ブロック・データよりもデータ長の短い複数のデータを順次暗号化または復号化する場合において、処理時間をより短くすることができ、ソフトウェアによる処理の負担を軽減できるできる。
第2に、簡易な構成で、複数の操作モードの処理を実行することが可能になる。
【図面の簡単な説明】
【図1】本発明の第1の実施形態に係る暗号処理装置の構成例を示すブロック図である。
【図2】入力レジスタに保持されるデータと出力レジスタに保持されるデータとの対応関係を説明するための第1の図である。
【図3】図1の暗号処理装置における暗号化処理または復号化処理の流れを説明するためのフローチャートである。
【図4】暗号化データ保持部に保持されるデータの変化について説明するための図である。
【図5】本発明の第1の実施形態に係る暗号処理装置の他の構成例を示すブロック図である。
【図6】図5の暗号処理装置における暗号化処理または復号化処理の流れを説明するためのフローチャートである。
【図7】暗号化データ保持部および入力データ保持部に保持されるデータの変化について説明するための図である。
【図8】本発明の第2の実施形態に係る暗号処理装置の構成例を示すブロック図である。
【図9】図8の暗号処理装置におけるCFBモードの暗号化処理の流れを説明するためのフローチャートである。
【図10】図8の暗号処理装置においてCFBモードの暗号化処理が行われる場合に有効または無効となる信号を示す図である。
【図11】図8の暗号処理装置においてCFBモードの復号化処理が行われる場合に有効または無効となる信号を示す図である。
【図12】図8の暗号処理装置においてOFBモードの暗号化処理または復号化処理が行われる場合に有効または無効となる信号を示す図である。
【図13】本発明の第3の実施形態に係る暗号処理装置の構成例を示すブロック図である。
【図14】図13の暗号処理装置においてECBモードの暗号化処理または復号化処理が行われる場合に有効または無効となる信号を示す図である。
【図15】入力レジスタに保持されるデータと出力レジスタに保持されるデータとの対応関係を説明するための第2の図である。
【図16】図13の暗号処理装置においてCBCモードの暗号化処理が行われる場合に有効または無効となる信号を示す図である。
【図17】図13の暗号処理装置においてCBCモードの復号化処理が行われる場合に有効または無効となる信号を示す図である。
【図18】図13の暗号処理装置においてOFBモードの暗号化処理または復号化処理が行われる場合に有効または無効となる信号を示す図である。
【図19】図13の暗号処理装置においてCFBモードの暗号化処理が行われる場合に有効または無効となる信号を示す図である。
【図20】図13の暗号処理装置においてCFBモードの復号化暗号化処理が行われる場合に有効または無効となる信号を示す図である。
【図21】ECBモードの概要を説明するための図である。
【図22】CBCモードの概要を説明するための図である。
【図23】OFBモードの概要を説明するための図である。
【図24】CFBモードの概要を説明するための図である。
【符号の説明】
11…ブロック暗号演算部、21…入力レジスタ、22…IVレジスタ、23…出力レジスタ、24…データ長設定レジスタ、31…IVデータ保持部、32…暗号化データ保持部、33…入力データ保持部、41…第1の選択部、42…第2の選択部、43…第3の選択部、44…第4の選択部、45…第5の選択部、51…第1のデータ抽出部、52…第2のデータ抽出部、61…第1の論理演算部、62…第2の論理演算部、63…第3の論理演算部、64…第4の論理演算部、71,71’,72,73…制御部、81…右ローテイト回路。[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a cryptographic processing device and a method thereof, and for example, to a cryptographic processing device and a method using a block encryption system such as DES encryption.
[0002]
[Prior art]
There are various digital data encryption methods. Of the block encryption methods that encrypt data of a fixed length in block units, the encryption algorithm that is currently most widely used As such, DES (data encryption standard) encryption is known. The DES cipher is a standardized cipher defined in the US standard cipher FIPS (federal information processing standard) 46-2.
[0003]
In the DES encryption, four operation modes (ECB mode, CBC mode, OFB mode, and CFB mode) are defined in the FIPS 81.
[0004]
FIG. 21 is a diagram for describing an overview of an ECB (electronic codebook) mode.
In the ECB mode, the transmitted 64-bit message M is encrypted by the
The ECB mode is a basic operation mode and has the simplest configuration, but has a weak point that the same message M is always encrypted into the same ciphertext C.
[0005]
FIG. 22 is a diagram for describing an outline of a CBC (cipher block chaining) mode.
In the CBC mode, the ciphertext transmitted last time is held in the
[0006]
FIG. 23 is a diagram for describing an overview of an OFB (output feedback) mode.
In the OFB mode, 64-bit initial vector (IV) data is held in the
[0007]
FIG. 24 is a diagram for describing an outline of a cipher feedback (CFB) mode.
In the CFB mode, a ciphertext is generated by the same operation as in the OFB mode, except that the data fed back to the register is a ciphertext.
That is, in the initial state, the IV data is held in the
[0008]
On the receiving side of the ciphertext C, in the initial state, the IV data is held in the
[0009]
[Problems to be solved by the invention]
By using the above-described OFB mode and CFB mode, encryption and decryption can be performed in units having a data length shorter than 64 bits, which is a block unit of the DES encryption. For example, when transmitting a message by a data stream composed of character-by-character encrypted data, the character data supplied on the transmission side can be immediately encrypted and added to the data stream. Further, this can be immediately decoded on the receiving side and restored to character data. Therefore, compared to other operation modes in which transmission is performed in units of blocks, it is possible to efficiently encrypt and decrypt short data such as character data, and to shorten the processing time. .
[0010]
However, even if encryption or decryption can be performed in a unit having a short data length as described above, when such data is continuously encrypted or decrypted, a plurality of generated It is necessary to sequentially process encrypted data and decrypted data. For example, when the generated data is sequentially output to a register or the like, the data is sequentially moved to another storage medium so that the previous data held in the register is not overwritten by the next output data. Processing is required. Usually, such processing is controlled by software, and it is necessary to execute such processing each time data is generated. For this reason, there arises a problem that the processing time required for encryption and decryption becomes long and a problem that software processing becomes complicated.
[0011]
Also, as a feature of the OFB mode and the CFB mode, out of the 64-bit data output from the DES cryptographic operation unit, data of predetermined high-order bits (k-bit data in the above example) is regarded as valid data. When these modes are used in combination with the ECB mode or the CBC mode, it is necessary to control not to process data of invalid bits in the operation result of the DES encryption. is there. Since such control is generally processed by software, problems such as an increase in processing time and complication of software arise as described above.
[0012]
The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a method for sequentially encrypting or decrypting a plurality of data having a shorter data length than unit block data using a block encryption method. An object of the present invention is to provide a cryptographic processing device and a method thereof that can shorten the time and reduce the processing load of software.
[0013]
[Means for Solving the Problems]
In order to achieve the above object, a cryptographic processing device according to a first aspect of the present invention includes a block cipher operation unit that encrypts supplied data having a first data length based on supplied key data. An initial data holding unit capable of holding data having the first data length, and a second data length shorter than the first data length from the upper bit side of the data calculated by the block cipher calculation unit. And adds the data to the lower bits of the data held in the initial data holding means, and extracts and outputs the data of the first data length from the lower bits of the data after the addition. First data extracting means for selecting data output from the first data extracting means or supplied initial data and supplying the selected initial data to the initial data holding means; Encrypted data holding means capable of holding data having a third data length longer than the second data length; and Data is extracted and added to the upper bit side of the data held in the encrypted data holding means, and data of the third data length is extracted and output from the upper bit side of the added data. A second data extracting unit, a logical operation unit that receives the input data having the third data length and the output data of the second data extracting unit, and executes a predetermined logical operation; The first selection means selects the initial data, causes the initial data holding means to hold the initial data, and supplies the held data of the initial data holding means to the block cipher operation means. Receiving the operation result of the block cipher operation means, holding the data output from the second data extracting means in the encrypted data holding means, and executing the operation result of the block cipher operation means. In response to this, the data output from the first data extracting means is selected by the first selecting means and held in the initial data holding means. In the processing subsequent to the initial cycle, the first selecting means Control means for repeating a process equivalent to the initial cycle by the number of cycles corresponding to the second data length and the third data length in a state where the output data of the first data extraction means is selected; And in the last processing cycle of the control means, the data output from the second data extraction means in response to the calculation result of the block calculation means, and The result of the operation performed on the input data by the logical operation means is output as encrypted data or decrypted data corresponding to the input data.
[0014]
According to the cryptographic processing device of the first aspect of the present invention, in the initial cycle, the initial data is selected by the first selecting means and held in the initial data holding means, and the held data is stored in the block. The operation is supplied to the cryptographic operation means and the operation based on the key data is executed. The operation result of the block cipher operation means is supplied to the second data extraction means, and in response thereto, data output from the second data extraction means is held in the encrypted data holding means. The operation result of the block cipher operation means is also supplied to the first data extraction means, and the data output from the first data extraction means is selected by the first selection means. Then, the data is held in the initial data holding means. This held data is supplied to the block cipher operation means in the next cycle. In the processing subsequent to the initial cycle, a cycle according to the second data length and the third data length in a state where the output data of the first data extracting means is selected by the first selecting means. A process equivalent to the above initial cycle is repeated by the number of times. After the repetition of the processing, in the last processing cycle, the data output from the second data extracting means in response to the operation result of the block operation means and the input data are operated by the logical operation means, and the operation is performed. The result is output as encrypted data or decrypted data corresponding to the input data.
[0015]
Further, the input data holding means capable of holding data having the third data length, and the data held in the input data holding means are shifted to the lower bit side by the second data length, and Bit rotating means for returning data overflowing from the least significant bit to the upper bit side by shifting, and selecting the data processed by the bit rotating means or the input data to be supplied to the input data holding means Second selection means may be further included. In this case, the logic operation means receives the data held in the input data holding means and the output data of the second data extraction means, and executes the predetermined logic operation. In the cycle, the second selection means selects the input data, causes the input data holding means to hold the input data, and causes the input data holding means to perform the bit rotation processing on the held data. The processed data is selected by the second selecting means and held by the input data holding means. In a processing cycle following the initial cycle, the data processed by the bit rotating means is selected by the second selecting means. May be stored in the input data holding means.
[0016]
According to the above configuration, in the initial cycle, the input data is selected by the second selection means and held in the input data holding means, and the processing of the bit rotation means is performed on the held data. Then, the processed data is selected by the second selecting means and held in the input data holding means. In a processing cycle following the initial cycle, the data processed by the bit rotate means is selected by the second selection means and held in the input data holding means, whereby the data held in the input data holding means is stored. Are sequentially updated to the data processed by the bit rotation means.
In each of the processing cycles, the data output from the second data extraction means in response to the operation result of the block operation means and the data held in the input data holding means are operated by the logic operation means. At least the data of the second data length in the operation result is output as encrypted data or decrypted data corresponding to unit data having one or more second data lengths included in the input data. Is done.
[0017]
A cryptographic processing device according to a second aspect of the present invention includes a block cipher operation unit for encrypting data of a supplied first data length based on supplied key data; An initial data holding unit capable of holding data having the data, and extracting data of a second data length from a higher-order bit side of the supplied data to a lower-order bit side of the data held by the initial data holding unit. First data extraction means for adding and extracting data of the first data length from the lower bit side of the data after the addition, and data output from the first data extraction means; or First selection means for selecting the supplied initial data and supplying it to the initial data holding means; and encrypted data holding means capable of holding data having a third data length longer than the second data length. And input data holding means for extracting data of the second data length from the upper bits of the data calculated by the block cipher calculation means, and extracting the upper bits of the data held by the encrypted data holding means. A second data extracting means for extracting the data of the third data length from the higher-order bit side of the data after the addition and outputting the data, and data held in the input data holding means. A bit rotating means for shifting the lower bits by the second data length and returning data overflowing from the least significant bit to the upper bits by the shift; data processed by the bit rotating means; Second selecting means for selecting input data having a data length of 3 and supplying the selected input data to the input data holding means; First logical operation means for executing a predetermined logical operation in response to the data held by the means and the output data of the second data extracting means, the data held by the input data holding means and the block A second logical operation unit that receives the data calculated by the cryptographic operation unit and executes the predetermined logical operation; and a data held by the input data holding unit or an operation performed by the second logical operation unit. A third selecting means for selecting the selected data and supplying the selected data to the first data extracting means; and performing an encryption process in a first operation mode, in the initial cycle, the first selecting means transmits the data to the first selecting means. Selecting the initial data and causing the initial data holding means to hold the data; supplying the held data of the initial data holding means to the block cipher operation means to execute the operation; Upon receiving the calculation result of the block cipher calculation means, the data output from the second data extraction means is held in the encrypted data holding means, and the second selection means is allowed to select the input data and to input the data. The data holding means holds the input data holding means, and the stored data of the input data holding means is processed by the bit rotating means. The processed data is selected by the second selecting means to hold the input data. Means for receiving the data held by the input data holding means and the operation result of the block cipher operation means, and causing the third selection means to select the operation result of the second logical operation means. The first data extracting means is supplied with the data, and the data output from the first data extracting means is selected by the first selecting means upon receiving the supplied data. In the processing following the initial cycle, the output data of the first data extracting means is stored in the first selecting means, and the processing data of the bit rotating means is stored in the second selecting means. Are respectively selected, a process equivalent to the initial cycle is repeated by the number of cycles corresponding to the second data length and the third data length, and the decoding process in the first operation mode is performed. Is performed, in the initial cycle, the first selecting means selects the initial data and causes the initial data holding means to hold the initial data, and stores the held data of the initial data holding means in the block cipher operation means. The data is supplied to execute the operation, and the data output from the second data extraction means in response to the operation result of the block cipher operation means is converted to the encrypted data. The input data is held by the holding means, the input data is selected by the second selecting means, and the input data holding means is held by the input data holding means. Then, the processed data is selected by the second selecting means and held by the input data holding means, and the held data is selected by the third selecting means and supplied to the first data extracting means. Receiving the supply data, causing the first selection means to select the data output from the first data extraction means, and holding the data in the initial data holding means, and in a process following the initial cycle, The first selection means selects the output data of the first data extraction means, and the second selection means selects the processing data of the bit rotation means. Control means for repeating a process equivalent to the initial cycle by the number of cycles corresponding to the second data length and the third data length, and in each processing cycle of the control means, The data output from the second data extraction means in response to the operation result of the operation means and the data processed by the bit rotation means held in the input data holding means are combined with the first logical operation means Of the result calculated in the above, at least data corresponding to the second data length is converted into encrypted data or decrypted data corresponding to unit data having one or more second data lengths included in the input data. Output as data.
[0018]
According to the encryption processing device according to the second aspect of the present invention, when the encryption processing in the first operation mode is performed, in the initial cycle, the first selection means selects the initial data, and The data is held in the initial data holding means, and the held data is supplied to the block cipher operation means to execute the operation. The data output from the second data extraction unit in response to the operation result of the block cipher operation unit is held in the encrypted data holding unit. On the other hand, the input data is selected by the second selecting means and held in the input data holding means, and the held data is processed by the bit rotating means. 2 is selected by the selection means and held in the input data holding means. In response to the data held in the input data holding means and the operation result of the block cipher operation means, a predetermined logical operation is executed in the second logical operation means, and the operation result is stored in the third selection operation. The selected data is supplied to the first data extracting means. The data output from the first data extracting means in response to the supplied data is selected by the first selecting means and held in the initial data holding means, and is supplied to the block cipher operation means in the next cycle. Is done. In the processing subsequent to the initial cycle, the output data of the first data extraction means is selected by the first selection means, and the processing data of the bit rotation means is selected by the second selection means. The same processing as the initial cycle is repeated by the number of cycles corresponding to the second data length and the third data length.
Further, when the decoding process of the first operation mode is performed, in the initial cycle, the initial data is selected by the first selecting means and held in the initial data holding means, and the held data is stored in the initial data holding means. The calculation is supplied to the block cipher calculation means and executed. The data output from the second data extraction unit in response to the operation result of the block cipher operation unit is held in the encrypted data holding unit. On the other hand, the input data is selected by the second selecting means and held in the input data holding means, and the held data is processed by the bit rotating means. 2 is selected by the selection means and held in the input data holding means. The data held by the input data holding means is selected by the third selecting means and supplied to the first data extracting means, and the data outputted from the first data extracting means in response to the supplied data Is selected by the first selection means, held in the initial data holding means, and supplied to the block cipher operation means in the next cycle. In the processing subsequent to the initial cycle, the output data of the first data extraction means is selected by the first selection means, and the processing data of the bit rotation means is selected by the second selection means. The same processing as the initial cycle is repeated by the number of cycles corresponding to the second data length and the third data length.
In each processing cycle of the control means, the data output from the second data extraction means in response to the operation result of the block operation means, and the data after processing by the bit rotation means held in the input data holding means. Is calculated by the first logical operation means, and at least the data of the second data length out of the operation result is output as encrypted data or decrypted data corresponding to the unit data. .
[0019]
Further, the third selecting means can select an operation result of the block cipher operation means and supply the result to the first data extracting means, and the control means can execute an encryption process or a second operation mode. In performing the decoding process, the second selection means selects the input data and the input data holding means holds the input data. In the initial cycle, the first selection means selects the initial data. Holding the initial data holding means, supplying the held data of the initial data holding means to the block cipher operation means to execute the operation, receiving the operation result of the block cipher operation means, and receiving the second data The data output from the extracting means is held in the encrypted data holding means, and the operation result of the block cipher operation means is selected by the third selecting means. Receiving the supplied data, causing the first selection means to select the data output from the first data extraction means, and holding the data in the initial data holding means; In a process following the initial cycle, the number of cycles according to the first data length and the second data length in a state where the first selection means selects the output data of the first data extraction means. Only, the same processing as in the above initial cycle may be repeated.
[0020]
According to the above configuration, when the encryption processing or the decryption processing in the second operation mode is performed, the input data is selected by the second selection means and held in the input data holding means. In the initial cycle, the initial data is selected by the first selecting means and held in the initial data holding means, and the held data is supplied to the block cipher operation means to execute an operation. The data output from the second data extraction unit in response to the operation result of the block cipher operation unit is held in the encrypted data holding unit. Further, the operation result of the block cipher operation means is selected by the third selection means and supplied to the first data extraction means. The data output from the first data extracting means in response to the supplied data is selected by the first selecting means and held in the initial data holding means. In a process following the initial cycle, a cycle corresponding to the first data length and the second data length in a state where the output data of the first data extraction unit is selected by the first selection unit. A process equivalent to the above initial cycle is repeated by the number of times.
In the last processing cycle, the data output from the second data extraction means in response to the operation result of the block operation means and the input data held in the input data holding means are input to the first logic operation means. The operation is performed, and the operation result is output as encrypted data or decrypted data corresponding to the input data.
[0021]
Further, when performing the encryption process or the decryption process in the second operation mode, the control unit causes the second selection unit to select the input data in the initial cycle, and causes the input data holding unit to select the input data. And causing the input data holding means to perform the processing of the bit rotation means on the held data, causing the second selection means to select the processed data, and causing the input data holding means to hold the data. In a processing cycle following the initial cycle, the data processed by the bit rotating means may be selected by the second selecting means and held by the input data holding means.
[0022]
According to the above configuration, when the encryption processing or the decryption processing in the second operation mode is performed, in the initial cycle, the input data is selected by the second selection means and the input data holding means is selected. Is processed by the bit rotating means, and the processed data is selected by the second selecting means and held by the input data holding means. In the processing cycle following the initial cycle, the data processed by the bit rotate means is selected by the second selection means and held by the input data holding means, whereby the data held by the input data holding means is held. Are sequentially updated to the data processed by the bit rotation means.
In each of the processing cycles, the data output from the second data extraction means in response to the operation result of the block operation means and the data held in the input data holding means are calculated by the first logic operation means. Out of the operation result, at least data of the second data length is encrypted data or decryption data corresponding to unit data having one or more second data lengths included in the input data. Output as data.
[0023]
A fourth selecting means for selecting the data held in the initial data holding means or the data held in the input data holding means and supplying the selected data to the block cipher operation means; And a fifth selecting means for selecting and outputting the data calculated in the above or the data calculated in the block cipher calculating means. In this case, the block cipher operation unit performs an encryption operation or a decryption operation on the supplied data, and the control unit performs an encryption operation or a decryption operation in the third operation mode. The selection means selects the input data and causes the input data holding means to hold the input data, and causes the fourth selection means to select the holding data of the input data holding means and supplies the data to the block cipher operation means. When performing the calculation, causing the fifth selection means to select and output the calculation result of the block cipher calculation means, and performing the processing in the first operation mode or the second operation mode, The data held by the initial data holding means is selected by the fourth selection means and supplied to the block cipher operation means, and the operation data of the first logic operation means is transmitted to the block cipher operation means. To 5 of the selection means may be output by selection.
[0024]
According to the above configuration, when the encryption process or the decryption process in the third operation mode is performed, the input data is selected by the second selection unit and is stored in the input data storage unit, and the input data is stored in the input data storage unit. The selection data of the input data holding means is selected by the selection means and supplied to the block cipher operation means. An encryption operation or a decryption operation is executed in the block cipher operation means receiving the supply data, and the operation result is selected and output by the fifth selecting means. On the other hand, when the processing of the first operation mode or the second operation mode is performed, the data held by the initial data holding means is selected by the fourth selection means and supplied to the block cipher operation means. At the same time, the operation data of the first logic operation means is selected and output by the fifth selection means.
[0025]
A third logical operation means for receiving the data held in the initial data holding means and the data held in the input data holding means and executing the predetermined logical operation; A fourth logical operation unit that receives the held data and the data calculated by the block cipher operation unit and executes the predetermined logical operation may be further included. The fourth selecting means can select the data calculated by the third logical calculating means and supply the data to the block cipher calculating means, and the fifth selecting means can select the data calculated by the fourth logical calculating means. The data calculated by the calculation means may be selected and output. Further, when performing the encryption process in the fourth operation mode, the control means causes the first selection means to select the initial data in the initial cycle and causes the initial data holding means to hold the initial data. A second selection means for selecting the input data and holding the input data in the input data holding means, and receiving the held data of the initial data holding means and the held data of the input data holding means; The operation result of the means is selected by the fourth selecting means and supplied to the block cipher operation means, the operation is executed, and the operation result of the block cipher operation means is selected by the fifth selecting means. And the third cipher selecting means selects the calculation result of the block cipher calculating means and supplies it to the first data extracting means. The data for the first data length of the supply data is extracted, and the extracted data of the first data extraction means is selected by the first selection means and held by the initial data holding means. In the processing cycle following the cycle, the same processing as in the initial cycle is executed with the first selecting means selecting the extracted data of the first data extracting means, and the decoding of the fourth operation mode is performed. In the case of performing the conversion process, in the initial cycle, the first selection means selects the initial data, the initial data holding means holds the initial data, and the second selection means selects the input data. The input data holding unit holds the input data, the input data holding unit selects the data held by the fourth selection unit, and supplies the selected data to the block cipher operation unit. Calculation, and the fifth selection means selects and outputs the operation result of the fourth logic operation means which receives the operation result of the block cipher operation means and the held data of the initial data holding means. Then, the data held by the input data holding means is selected by the third selection means and supplied to the first data extraction means, and the first data extraction means causes the first data extraction means to select the first data of the supplied data. The first data extracting means selects the extracted data by the first data extracting means and causes the initial data holding means to hold the extracted data. In a processing cycle subsequent to the initial cycle, A process equivalent to the initial cycle may be executed in a state where the first selection unit selects the extracted data of the first data extraction unit.
[0026]
According to the above configuration, when the encryption processing in the fourth operation mode is performed, in the initial cycle, the initial data is selected by the first selecting means and held in the initial data holding means. Further, the input data is selected by the second selecting means and held by the input data holding means. Upon receiving the data held by the initial data holding means and the data held by the input data holding means, a predetermined logical operation is executed in the third logical operation means, and the operation result is stored in the fourth selection means. And is supplied to the block cipher operation means. Receiving the supplied data, the block cipher operation means performs an encryption operation, and the operation result is selected and output by the fifth selecting means. The operation result of the block cipher operation means is selected by the third selecting means and supplied to the first data extracting means, and the first data extracting means selects the first data of the supplied data. The long data is extracted. The extracted data of the first data extracting means is selected by the first selecting means and held by the initial data holding means. In a processing cycle subsequent to the initial cycle, a process equivalent to that of the initial cycle is executed in a state where the extracted data of the first data extracting unit is selected by the first selecting unit.
In the case where the decoding process in the fourth operation mode is performed, in the initial cycle, the initial data is selected by the first selecting means and held in the initial data holding means. Further, the input data is selected by the second selecting means and held by the input data holding means. The data held by the input data holding means is selected by the fourth selection means and supplied to the block cipher operation means, and the encryption operation is executed. Upon receiving the operation result of the block cipher operation unit and the data held by the initial data holding unit, a predetermined logical operation is executed in the fourth logical operation unit, and the operation result is sent to the fifth selection unit. Selected and output. Further, the held data of the input data holding means is selected by the third selection means and supplied to the first data extraction means, and the first data extraction means selects the first data of the supplied data. Data of the data length is extracted. The extracted data of the first data extracting means is selected by the first selecting means and held by the initial data holding means. In a processing cycle subsequent to the initial cycle, a process equivalent to that of the initial cycle is executed in a state where the extracted data of the first data extracting unit is selected by the first selecting unit.
[0027]
According to a third aspect of the present invention, there is provided an encryption processing method comprising: holding an initial data having a first data length in an initial data holding device; and encrypting the initial data based on given key data. And extracting the data of the second data length shorter than the first data length from the upper bits of the data encrypted in the first step, and setting the extracted data as the upper bits. A second step of generating data having a third data length longer than the second data length, and causing the encrypted data holding device to hold the data; and a higher bit side of the data encrypted in the first step. , The data corresponding to the second data length is extracted and added to the lower bits of the initial data held in the initial data holding device, and the first data is read from the lower bits of the data after the addition. A third step of extracting data of a data length and updating the initial data held in the initial data holding device to the extracted data, and holding the initial data held in the initial data holding device. A fourth step of encrypting the encrypted data based on the key data, and extracting data of the second data length from the upper bit side of the data encrypted in the fourth step, The data is added to the upper bit side of the data held in the encrypted data holding device, the data of the third data length is extracted from the upper bit side of the data after the addition, and held in the encrypted data holding device. A fifth step of updating the encrypted data with the extracted data, and extracting data of the second data length from the upper bits of the data encrypted in the fourth step. The data held in the initial data holding device is added to the lower bit side, and the data of the first data length is extracted from the lower bit side of the data after the addition. And a sixth step of updating the data held in the first data into the extracted data by the number of times corresponding to the second data length and the third data length. A predetermined logical operation is performed on the data having the third data length extracted in step 5 and the input data having the third data length to obtain the encrypted data or the decrypted data corresponding to the input data. Generate
[0028]
According to a fourth aspect of the present invention, there is provided an encryption processing method comprising: holding an initial data having a first data length in an initial data holding device; and encrypting the initial data based on given key data. And shifting the input data having the third data length to the lower bit side by the first data length and the second data length shorter than the third data length. Performing a process of returning data overflowing from the upper bits to the upper bit side, and holding the processed data in the input data holding device; and performing the second step from the upper bits side of the data encrypted in the first step. 2, and generates data having the third data length with the extracted data as upper bits, and stores the data in the encrypted data holding device. Performing a predetermined logical operation on the data encrypted in the first step and the data held in the input data holding device, and performing a second logical operation on the upper bit side of the operation result. Is extracted and added to the lower bits of the initial data held in the initial data holding device, and the data of the first data length is added from the lower bits of the data after the addition. A fourth step of extracting and updating the initial data held in the initial data holding device to the extracted data; a data held in the input data holding device; The predetermined logical operation is performed on the data having the third data length to generate encrypted data corresponding to the unit data having the second data length included in the input data. A fifth step of encrypting the data held in the initial data holding device based on the key data, and a sixth step of encrypting the data held in the initial data holding device. Is shifted to the lower bit side by the second data length, and data overflowing from the least significant bit is returned to the upper bit side by the shift, and the data held in the input data holding device is shifted to the lower bit side. A seventh step of updating the data after processing, and extracting data of a second data length from the upper bit side of the data encrypted in the sixth step, and holding the extracted data in the encrypted data holding device. The data having the third data length is extracted from the upper bit side of the data after the addition, and is added to the upper bit side of the added data. An eighth step of updating the data held in the data holding device to the extracted data; the data encrypted in the sixth step; and the updated data of the input data holding device. , And extracts data of the second data length from the upper bit side of the operation result, and adds the data to the lower bit side of the data held in the initial data holding device. A ninth step of extracting data of the first data length from the lower bit side of the data and updating the data held in the initial data holding device to the extracted data; and updating the input data holding device. The predetermined logical operation is performed on the extracted data and the data having the third data length extracted in the eighth step to correspond to at least one unit data. The tenth iteration step including the steps of generating encrypted data is repeated a number of times corresponding to the said second data length and the third data length.
[0029]
A cryptographic processing method according to a fifth aspect of the present invention is a cryptographic processing method, comprising: holding initial data having a first data length in an initial data holding device; and encrypting the initial data based on given key data. And shifting the encrypted input data having the third data length to the lower bit side by the first data length and the second data length shorter than the third data length. A second step of returning the data overflowing from the least significant bit to the upper bit side, and holding the processed data in the input data holding device; and a higher bit of the data encrypted in the first step. Side to extract data of the second data length, generate data having the third data length using the extracted data as upper bits, and generate encrypted data. A third step of holding the data held by the holding device; extracting data of the second data length from the higher-order bit side of the data held by the input data holding device; The data is added to the lower bit side of the data, the data of the first data length is extracted from the lower bit side of the added data, and the initial data held in the initial data holding device is updated to the extracted data. Performing a predetermined logical operation on the data held in the input data holding device and the data having the third data length generated in the third step to obtain the input data. And a fifth step of generating decoded data corresponding to the unit data having the second data length included in the initial data holding unit. A sixth step of encrypting the obtained data on the basis of the key data, and shifting the data held in the input data holding device to the lower bits by the second data length. A seventh step of performing a process of returning data overflowing from the least significant bit to the upper bit side, and updating the data held in the input data holding device to the processed data; and The data of the second data length is extracted from the upper bits of the data, and added to the upper bits of the data held in the encrypted data holding device. An eighth step of extracting data of a third data length and updating the data held in the encrypted data holding device to the extracted data; The data of the second data length is extracted from the upper bit side of the updated data of the input data holding device, and added to the lower bit side of the data held in the initial data holding device. A ninth step of extracting the data of the first data length from the lower bit side of the data and updating the data held in the initial data holding device to the extracted data; The predetermined logical operation is performed on the updated data and the data having the third data length extracted in the eighth step to generate decoded data corresponding to at least one of the unit data. The repetition step including the tenth step is repeated a number of times corresponding to the second data length and the third data length.
[0030]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, three embodiments of the present invention will be described with reference to the drawings.
[0031]
(1st Embodiment)
FIG. 1 is a block diagram illustrating a configuration example of the cryptographic processing device according to the first embodiment of the present invention.
The cryptographic processing apparatus shown in FIG. 1 includes a block
The block
The IV
The encrypted
The
The first
The second
The first
The
[0032]
The block
[0033]
The input register 21 holds data S to be encrypted or decrypted. The data length of the input data held in the
[0034]
The
[0035]
The
[0036]
The data
[0037]
FIG. 2 is a diagram for explaining the correspondence between the data held in the
FIG. 2A shows an example in which “L2 = 1 bit” is set in the data
FIG. 2B shows an example in which “L2 = 8 bits” is set in the data
[0038]
The IV
The data held in the IV
[0039]
The encrypted
[0040]
The
[0041]
The first
[0042]
The second
[0043]
The first
[0044]
The
[0045]
Then, in the initial cycle of the repeated processing, the
[0046]
Here, the operation of the cryptographic processing apparatus of FIG. 1 having the above configuration will be described with reference to FIG.
FIG. 3 is a flowchart for explaining a flow of an encryption process or a decryption process in the encryption processing device of FIG.
[0047]
Step ST101:
The L1 bit IV data held in the
[0048]
Step ST102:
In step ST101, L2 bits of data are extracted by the second
[0049]
Step ST103:
In step ST101, L2 bits of data are extracted by the first
[0050]
Steps ST102 and ST103 can be performed in parallel in the cryptographic processing apparatus of FIG.
[0051]
Step ST104:
Subsequent to the initial cycle of steps ST101 to ST103, a processing cycle of steps ST105 to ST107 described below is repeated. As described above, the number of repetitions is set according to the data length (L2 bits) set in the bit
If the set number of repetitions has been reached, the process proceeds to step ST108; otherwise, the process proceeds to step ST105.
[0052]
Step ST105:
The data held in the IV
[0053]
Step ST106:
In step ST105, L2 bits of data are extracted by the second
[0054]
Step ST107:
In step ST105, L2 bits of data are extracted by the first
[0055]
It should be noted that the processes in steps ST106 and ST107 can be performed in parallel, similarly to steps ST102 and ST103.
[0056]
Step ST108:
If the end of the operation is determined in step ST104, the L3 bit data extracted by the second
[0057]
Based on the above-described processing flow, changes in data stored in the encrypted
For example, assume that the L3 bit is four times the L2 bit. In this case, as shown in FIG. 4E, the input data S of L3 bits can be divided into four unit data (S0,..., S3) having a length of L2 bits.
[0058]
When the encrypted data E is output from the block
[0059]
When the encrypted data E is output from the block
[0060]
Note that the above-described change in data is the same in the IV
[0061]
As described above, according to the cryptographic processing device shown in FIG. 1, a part of the calculation result (upper L2 bits) of the block
[0062]
The upper L2 bits of the operation result of the block
Furthermore, the upper L2 bits of the operation result of the block
[0063]
In addition, according to the data length (L2 bits) set in the bit
[0064]
By the way, in the cryptographic processing apparatus of FIG. 1, L3-bit input data S including a plurality of L2-bit unit data are collectively processed, and a plurality of encrypted data or decrypted data are generated at the same time. Depending on the processing method, there may be a case where it is desired to encrypt or decrypt a desired number of L2-bit unit data.
[0065]
FIG. 5 is a block diagram illustrating a configuration example of a cryptographic processing device that can realize such processing.
5 and 1 indicate the same components. In the cryptographic processing device of FIG. 5, the
The input
The
The right rotate
[0066]
The input
The right rotate
The
[0067]
The first
[0068]
The control unit 71 'performs substantially the same processing as the
The input data held in the input
[0069]
In the processing cycle following the initial cycle, the output data of the
A logical operation such as exclusive OR is performed on the data after the right rotation and the output data of the second
[0070]
Here, the operation of the cryptographic processing apparatus of FIG. 5 having the above configuration will be described with reference to FIG.
FIG. 6 is a flowchart for explaining the flow of encryption processing or decryption processing in the encryption processing device of FIG.
[0071]
Step ST201:
The same processing as step ST101 in FIG. 3 is performed. That is, the IV data of the
[0072]
Step ST202:
The L3-bit input data S is selected by the
The processing in step ST202 can be executed in parallel with the processing in steps ST201, ST203, and ST204.
[0073]
Step ST203:
The same processing as step ST102 in FIG. 3 is performed. That is, in step ST201, L2 bits of data are extracted from the upper bits of the data encrypted by the block
[0074]
Step ST204:
The same processing as step ST103 in FIG. 3 is performed. That is, in step ST201, data of L2 bits is extracted by the first
[0075]
Steps ST203 and ST204 can be executed in parallel, similarly to steps ST101 and ST102 in FIG.
[0076]
Step ST205:
A predetermined logical operation such as an exclusive OR operation is performed on the data held in the input
[0077]
Step ST206:
Subsequent to the initial cycle of steps ST201 to ST205, a processing cycle of steps ST207 to ST211 described below is repeated. The number of repetitions is determined by the data length (L2 bits) set in the bit
When the set number of repetitions has been reached, the processing of the input data S is terminated.
[0078]
Step ST207:
The same processing as in step ST105 in FIG. 3 is performed. That is, the L1 bit data held in the IV
[0079]
Step ST208:
The data after the previous right rotation processing held in the input
The processing in step ST208 can be executed in parallel with the processing in steps ST207, ST209, and ST210.
[0080]
Step ST209:
The same processing as step ST106 in FIG. 3 is performed. That is, in step ST207, L2 bits of data are extracted by the second
[0081]
Step ST210:
The same processing as step ST107 in FIG. 3 is performed. That is, in step ST207, L2 bits of data are extracted from the upper bits of the data encrypted by the block
[0082]
Step ST211:
A predetermined logical operation such as an exclusive OR is performed by the first logical operation on the data held in the input
[0083]
It should be noted that the processes in steps ST210 and ST211 can be executed in parallel, similarly to steps ST203 and ST204.
[0084]
Here, changes in data held in the encrypted
Similar to the example of FIG. 4, it is assumed that the L3 bit is four times the L2 bit in the example of FIG. Therefore, the input data S of L3 bits can be divided into four unit data (S0,..., S3) having a length of L2 bits.
[0085]
In step ST202 of the initial cycle, once the right rotation process is performed on the input data S of the
[0086]
In step ST208 of the next processing cycle, when the right rotation processing is performed once on the input data S of the
[0087]
The same applies to the subsequent processing cycles. The number of times of the right rotation process increases, and the number of encrypted data or decrypted data obtained simultaneously also increases. Finally, the data rotates once by the right rotation processing by the
[0088]
As described above, according to the cryptographic processing device shown in FIG. 5, it is possible to sequentially and sequentially output the encrypted data or the decrypted data corresponding to each of the plurality of unit data included in the input data S. Further, by appropriately setting a processing cycle for reading data from the
[0089]
(Second embodiment)
Although the encryption processing apparatus of FIG. 1 according to the first embodiment can execute the encryption processing and the decryption processing using the OFB mode shown in FIG. 23, the encryption processing apparatus of FIG. In the processing device, in addition to the OFB mode, an encryption process and a decryption process using the CFB mode shown in FIG. 24 can be executed.
[0090]
FIG. 8 is a block diagram illustrating a configuration example of a cryptographic processing device according to the second embodiment of the present invention.
8 and 5 indicate the same components. In the cryptographic processing device of FIG. 8, the control unit 71 'in the cryptographic processing device of FIG. In addition, the cryptographic processing device of FIG. 8 includes a third selecting
The
The second
[0091]
The second
[0092]
The
[0093]
The first
[0094]
The
In any of the operation modes, first, the data length (L2) of the upper bit extracted by the first
[0095]
When the encryption process in the CFB mode is performed, in the initial cycle, the
In the processing subsequent to this initial cycle, the
[0096]
When the CFB mode decoding process is performed, in the initial cycle, the
In the processing subsequent to this initial cycle, the
[0097]
When performing the encryption process or the decryption process in the OFB mode, the
[0098]
Here, the operation of the cryptographic processing apparatus of FIG. 8 having the above-described configuration will be described with reference to FIGS.
FIG. 9 is a flowchart for explaining the flow of the encryption processing in the CFB mode in the encryption processing device of FIG.
FIG. 10 shows signals that become valid or invalid when the CFB mode encryption processing is performed in the encryption processing device of FIG.
FIG. 11 shows signals that become valid or invalid when the decryption process in the CFB mode is performed in the cryptographic processing device in FIG.
FIG. 12 shows signals that become valid or invalid when the encryption processing or decryption processing in the OFB mode is performed in the encryption processing apparatus in FIG.
In FIGS. 10 to 12 and FIG. 8, the same reference numerals indicate the same components, and the signal indicated by a solid line indicates a valid signal, and the signal indicated by a dotted line indicates an invalid signal. ing.
[0099]
First, a case where the encryption processing in the CFB mode is performed will be described.
In this case, as shown in FIG. 10, the output signal from the second
[0100]
Step ST301:
The same processing as step ST201 in FIG. 6 is performed. That is, the IV data of the
[0101]
Step ST302:
The same processing as step ST202 in FIG. 6 is performed. That is, the input data S of L3 bits is selected by the
The processing in step ST302 can be executed in parallel with the processing in steps ST301 and ST303.
[0102]
Step ST303:
The same processing as step ST203 in FIG. 6 is performed. That is, in step ST301, L2 bits of data are extracted from the upper bits of the data encrypted by the block
[0103]
Step ST304:
The second
Note that the process of step ST304 can be executed in parallel with the processes of step ST303 and step ST305.
[0104]
Step ST305:
A predetermined logical operation such as exclusive OR is performed on the data after the right rotation processing held in the input
[0105]
Step ST306:
Subsequent to the initial cycle of steps ST301 to ST305, a processing cycle of steps ST307 to ST311 described below is repeated. The number of repetitions is determined by the data length (L2 bits) set in the bit
When the set number of repetitions has been reached, the processing of the input data S is terminated.
[0106]
Step ST307:
The same processing as step ST207 in FIG. 6 is performed. That is, the L1 bit data held in the IV
[0107]
Step ST308:
The same processing as step ST208 in FIG. 6 is performed. That is, the data after the previous right rotation processing held in the input
The processing in step ST308 can be executed in parallel with the processing in steps ST307 and ST309.
[0108]
Step ST309:
The same processing as step ST209 in FIG. 6 is performed. That is, in step ST307, data of L2 bits is extracted by the second
[0109]
Step ST310:
The second
Note that the process of step ST310 can be executed in parallel with the processes of step ST309 and step ST311.
[0110]
Step ST311:
A predetermined logical operation such as exclusive OR is performed on the data after the right rotation processing held in the input
[0111]
Although the above-mentioned processing flow relates to the encryption processing in the CFB mode, the same processing is executed also in the decryption processing in the CFB mode. However, in the decoding process in the CFB mode, as shown in FIG. 11, the data held in the input
[0112]
When the encryption process or the decryption process in the OFB mode is performed, the operation result of the block
[0113]
As described above, the cryptographic processing device shown in FIG. 8 has a simple configuration in which the third selecting
[0114]
In the CFB mode, similarly to the OFB mode in the cryptographic processing apparatus in FIG. 5, encrypted data or decrypted data corresponding to each of a plurality of unit data included in the input data S is output sequentially and sequentially. can do. If a processing cycle for reading data from the
[0115]
(Third embodiment)
The cryptographic processing device of FIG. 8 according to the second embodiment can execute the OFB mode and CFB mode processing, but the cryptographic processing device of FIG. 13 according to the third embodiment described below performs these operations. In addition to the mode, processing in the ECB mode shown in FIG. 21 and the processing in the CBC mode shown in FIG. 22 can also be executed.
[0116]
FIG. 13 is a block diagram illustrating a configuration example of a cryptographic processing device according to the third embodiment of the present invention.
The same reference numerals in FIGS. 13 and 8 indicate the same components. In the cryptographic processing device of FIG. 13, the
The
The
The third
The fourth
[0117]
The third
[0118]
The
[0119]
The block
[0120]
The fourth
[0121]
The
[0122]
The
[0123]
Here, an operation in each operation mode of the cryptographic processing apparatus of FIG. 8 having the above-described configuration will be described with reference to FIGS.
FIG. 14 shows signals that become valid or invalid when the encryption processing or the decryption processing in the ECB mode is performed in the encryption processing apparatus in FIG.
FIG. 16 shows signals that become valid or invalid when the encryption processing in FIG. 13 performs the encryption processing in the CBC mode.
FIG. 17 shows signals that become valid or invalid when the decryption processing in the CBC mode is performed in the cryptographic processing device in FIG. 13.
FIG. 18 shows signals that become valid or invalid when the encryption processing or decryption processing in the OFB mode is performed in the encryption processing apparatus in FIG.
FIG. 19 shows signals that become valid or invalid when the encryption processing in the CFB mode is performed in the cryptographic processing apparatus in FIG. 13.
FIG. 20 shows signals that are valid or invalid when the decryption encryption processing in the CFB mode is performed in the encryption processing device in FIG.
14 and FIGS. 16 to 20 and FIG. 13, the same reference numerals denote the same components, the signal indicated by a solid line is a valid signal, and the signal indicated by a dotted line is an invalid signal. Are respectively shown.
[0124]
<Encryption processing and decryption processing in ECB mode>
When the encryption or decryption processing in the ECB mode is performed, as shown in FIG. 14, the
[0125]
In this case, the input data of the
Therefore, the data length (L3 bits) of the input data held in the
[0126]
<Encryption processing in CBC mode>
When the encryption process in the CBC mode is performed, as shown in FIG. 16, the block
[0127]
In this case, first, in the initial cycle in which the encrypted data corresponding to the first input data is generated, the IV data of the
[0128]
In this initial cycle, the operation result of the block
[0129]
In a cycle following the initial cycle in which encrypted data corresponding to the second and subsequent input data is generated, in a state where the data output from the first
[0130]
<Decoding process in CBC mode>
When the decryption process in the CBC mode is performed, as shown in FIG. 17, the block
[0131]
In this case, first, in the initial cycle in which the encrypted data corresponding to the first input data is generated, the IV data of the
[0132]
In this initial cycle, the input data held in the input
[0133]
In a cycle following the initial cycle in which encrypted data corresponding to the second and subsequent input data is generated, in a state where the data output from the first
[0134]
In the above-described encryption and decryption processing in the CBC mode, the data length (L3 bits) of the input data held in the
[0135]
<Encryption processing and decryption processing in OFB mode>
When encryption processing and decryption processing in the OFB mode are performed, as shown in FIG. 18, the block
[0136]
In this case, the data stored in the IV
[0137]
<CFB mode encryption processing>
When the encryption processing in the CFB mode is performed, as shown in FIG. 19, the block
[0138]
In this case, the data stored in the IV
[0139]
<Decoding process in CFB mode>
When the decryption process in the CFB mode is performed, as shown in FIG. 20, the block
[0140]
In this case, the data stored in the IV
[0141]
As described above, according to the encryption processing device shown in FIG. 13, the
[0142]
Note that the present invention is not limited to the embodiment described above.
For example, the distinction between “upper” and “lower” of a bit string used in the description of the embodiment of the present invention is obtained by appropriately defining one end of a bit string of data to be processed as “upper”. Means that the end of the bit string is regarded as “lower” and distinguished, and that the “upper” and “lower” of the bit string are limited according to the data content and value, the order in which the data is transmitted, etc. Not.
[0143]
【The invention's effect】
According to the present invention, firstly, when sequentially encrypting or decrypting a plurality of data having a shorter data length than the unit block data using the block encryption method, the processing time can be further reduced. Thus, the processing load of software can be reduced.
Secondly, it is possible to execute processing in a plurality of operation modes with a simple configuration.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration example of a cryptographic processing device according to a first embodiment of the present invention.
FIG. 2 is a first diagram for explaining a correspondence relationship between data held in an input register and data held in an output register.
FIG. 3 is a flowchart illustrating a flow of an encryption process or a decryption process in the encryption processing device of FIG. 1;
FIG. 4 is a diagram illustrating a change in data held in an encrypted data holding unit.
FIG. 5 is a block diagram illustrating another configuration example of the cryptographic processing device according to the first embodiment of the present invention.
FIG. 6 is a flowchart illustrating a flow of an encryption process or a decryption process in the encryption processing device of FIG. 5;
FIG. 7 is a diagram for explaining changes in data held in an encrypted data holding unit and an input data holding unit.
FIG. 8 is a block diagram illustrating a configuration example of a cryptographic processing device according to a second embodiment of the present invention.
FIG. 9 is a flowchart illustrating a flow of a CFB mode encryption process in the encryption processing device of FIG. 8;
10 is a diagram illustrating signals that are valid or invalid when the encryption processing in the CFB mode is performed in the encryption processing device of FIG. 8;
11 is a diagram illustrating signals that become valid or invalid when a decryption process in the CFB mode is performed in the cryptographic processing device in FIG. 8;
12 is a diagram illustrating signals that become valid or invalid when the encryption processing or the decryption processing in the OFB mode is performed in the encryption processing apparatus in FIG. 8;
FIG. 13 is a block diagram illustrating a configuration example of a cryptographic processing device according to a third embodiment of the present invention.
14 is a diagram illustrating signals that are enabled or disabled when an encryption process or a decryption process in the ECB mode is performed in the encryption processing device in FIG. 13;
FIG. 15 is a second diagram illustrating a correspondence between data held in an input register and data held in an output register.
16 is a diagram illustrating signals that become valid or invalid when encryption processing in the CBC mode is performed in the encryption processing device in FIG. 13;
17 is a diagram illustrating signals that are valid or invalid when the CBC mode decryption processing is performed in the cryptographic processing device of FIG. 13;
18 is a diagram illustrating signals that are valid or invalid when the encryption processing or the decryption processing in the OFB mode is performed in the encryption processing apparatus in FIG. 13;
19 is a diagram illustrating signals that become valid or invalid when the encryption processing in the CFB mode is performed in the encryption processing device in FIG. 13;
20 is a diagram illustrating signals that become valid or invalid when the decryption encryption processing in the CFB mode is performed in the encryption processing device in FIG. 13;
FIG. 21 is a diagram for describing an outline of an ECB mode.
FIG. 22 is a diagram for describing an overview of a CBC mode.
FIG. 23 is a diagram for describing an outline of an OFB mode.
FIG. 24 is a diagram illustrating an overview of a CFB mode.
[Explanation of symbols]
11: Block cipher operation unit, 21: Input register, 22: IV register, 23: Output register, 24: Data length setting register, 31: IV data holding unit, 32: Encrypted data holding unit, 33: Input
Claims (11)
上記第1のデータ長を有するデータの保持が可能な初期データ保持手段と、
上記ブロック暗号演算手段において演算されたデータの上位ビット側から、上記第1のデータ長より短い第2のデータ長分のデータを抽出して、上記初期データ保持手段に保持されたデータの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して出力する第1のデータ抽出手段と、
上記第1のデータ抽出手段から出力されるデータ、または供給される初期データを選択して上記初期データ保持手段に供給する第1の選択手段と、
上記第2のデータ長より長い第3のデータ長を有するデータの保持が可能な暗号化データ保持手段と、
上記ブロック暗号演算手段において演算されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記暗号化データ保持手段に保持されたデータの上位ビット側に付加し、当該付加後のデータの上位ビット側から上記第3のデータ長分のデータを抽出して出力する第2のデータ抽出手段と、
上記第3のデータ長を有する入力データと上記第2のデータ抽出手段の出力データとを受けて、所定の論理演算を実行する論理演算手段と、
初期サイクルにおいて、上記第1の選択手段に上記初期データを選択させて上記初期データ保持手段に保持させ、上記初期データ保持手段の当該保持データを上記ブロック暗号演算手段に供給して演算を実行させ、上記ブロック暗号演算手段の当該演算結果を受けて上記第2のデータ抽出手段から出力されるデータを上記暗号化データ保持手段に保持させ、上記ブロック暗号演算手段の当該演算結果を受けて上記第1のデータ抽出手段から出力されるデータを上記第1の選択手段に選択させて上記初期データ保持手段に保持させ、上記初期サイクルに続く処理において、上記第1の選択手段に上記第1のデータ抽出手段の出力データを選択させた状態で、上記第2のデータ長と上記第3のデータ長とに応じたサイクル数だけ、上記初期サイクルと同等の処理を反復させる制御手段とを有し、
上記制御手段の最後の処理サイクルにおいて、上記ブロック演算手段の演算結果を受けて上記第2のデータ抽出手段から出力されるデータと上記入力データとが上記論理演算手段において演算された結果を、上記入力データに対応する暗号化データまたは復号化データとして出力する、
暗号処理装置。Block cipher operation means for encrypting the supplied first data length data based on the supplied key data;
Initial data holding means capable of holding data having the first data length;
Data of a second data length shorter than the first data length is extracted from the higher bit side of the data calculated by the block cipher calculating means, and the lower bit of the data held by the initial data holding means is extracted. First data extracting means for extracting the data of the first data length from the lower bit side of the added data and outputting the extracted data.
First selection means for selecting data output from the first data extraction means or supplied initial data and supplying the selected data to the initial data holding means;
Encrypted data holding means capable of holding data having a third data length longer than the second data length;
The data corresponding to the second data length is extracted from the upper bits of the data calculated by the block cipher calculator, and added to the upper bits of the data held in the encrypted data holding means. Second data extracting means for extracting and outputting data of the third data length from the upper bit side of the subsequent data;
Logic operation means for receiving input data having the third data length and output data of the second data extraction means and executing a predetermined logic operation;
In the initial cycle, the first selecting means selects the initial data, causes the initial data holding means to hold the initial data, supplies the held data of the initial data holding means to the block cipher operation means, and executes the operation. Receiving the operation result of the block cipher operation means, holding the data output from the second data extracting means in the encrypted data holding means, receiving the operation result of the block cipher operation means, The data output from the first data extracting means is selected by the first selecting means and held in the initial data holding means. In the processing subsequent to the initial cycle, the first data is sent to the first selecting means. In a state where the output data of the extracting means is selected, the number of cycles corresponding to the second data length and the third data length is equal to the initial cycle. And a control means for repeating the same process and,
In the last processing cycle of the control means, receiving the operation result of the block operation means, the data output from the second data extraction means and the input data are calculated by the logic operation means, Output as encrypted data or decrypted data corresponding to the input data,
Cryptographic processing unit.
上記入力データ保持手段に保持されたデータを、上記第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻すビット・ローテイト手段と、
上記ビット・ローテイト手段に処理されたデータ、または供給される上記入力データを選択して上記入力データ保持手段に供給する第2の選択手段とを更に含み、
上記論理演算手段は、上記入力データ保持手段に保持されたデータと上記第2のデータ抽出手段の出力データとを受けて上記所定の論理演算を実行し、
上記制御手段は、上記初期サイクルにおいて、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記入力データ保持手段の当該保持データに対して上記ビット・ローテイト手段の処理を行わせ、当該処理後のデータを上記第2の選択手段に選択させて上記入力データ保持手段に保持させ、上記初期サイクルに続く処理サイクルにおいて、上記ビット・ローテイト手段に処理されたデータを上記第2の選択手段に選択させて上記入力データ保持手段に保持させ、
上記制御手段の各処理サイクルにおいて、上記ブロック演算手段の演算結果を受けて上記第2のデータ抽出手段から出力されるデータと上記入力データ保持手段に保持されたデータとが上記論理演算手段において演算された結果のうち、少なくとも上記第2のデータ長分のデータを、上記入力データに含まれる1つまたは複数の第2のデータ長を有した単位データに対応する暗号化データまたは復号化データとして出力する、
請求項1に記載の暗号処理装置。Input data holding means capable of holding data having the third data length;
Bit rotating means for shifting the data held in the input data holding means to the lower bits by the second data length, and returning data overflowing from the least significant bits to the upper bits by the shift;
Second selecting means for selecting the data processed by the bit rotating means or the input data to be supplied and supplying the selected data to the input data holding means,
The logic operation means receives the data held in the input data holding means and the output data of the second data extraction means, and executes the predetermined logic operation;
In the initial cycle, the control means causes the second selection means to select the input data and causes the input data holding means to hold the input data, and the bit rotation means for the held data of the input data holding means. Is performed, and the processed data is selected by the second selection means and held by the input data holding means. In a processing cycle following the initial cycle, the data processed by the bit rotation means is processed. Is selected by the second selection means and held by the input data holding means,
In each processing cycle of the control means, in response to the operation result of the block operation means, the data output from the second data extraction means and the data held in the input data holding means are operated by the logic operation means. Among the results obtained, at least data of the second data length is used as encrypted data or decrypted data corresponding to unit data having one or more second data lengths included in the input data. Output,
The cryptographic processing device according to claim 1.
上記第1のデータ長を有するデータの保持が可能な初期データ保持手段と、
供給されるデータの上位ビット側から第2のデータ長分のデータを抽出して、上記初期データ保持手段に保持されたデータの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して出力する第1のデータ抽出手段と、
上記第1のデータ抽出手段から出力されるデータ、または供給される初期データを選択して上記初期データ保持手段に供給する第1の選択手段と、
上記第2のデータ長より長い第3のデータ長を有するデータの保持が可能な暗号化データ保持手段および入力データ保持手段と、
上記ブロック暗号演算手段において演算されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記暗号化データ保持手段に保持されたデータの上位ビット側に付加し、当該付加後のデータの上位ビット側から上記第3のデータ長分のデータを抽出して出力する第2のデータ抽出手段と、
上記入力データ保持手段に保持されたデータを、上記第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻すビット・ローテイト手段と、
上記ビット・ローテイト手段に処理されたデータ、または上記第3のデータ長を有した入力データを選択して上記入力データ保持手段に供給する第2の選択手段と、
上記入力データ保持手段に保持されたデータと上記第2のデータ抽出手段の出力データとを受けて、所定の論理演算を実行する第1の論理演算手段と、
上記入力データ保持手段に保持されたデータと上記ブロック暗号演算手段において演算されたデータとを受けて、上記所定の論理演算を実行する第2の論理演算手段と、
上記入力データ保持手段に保持されたデータ、または上記第2の論理演算手段において演算されたデータを選択して上記第1のデータ抽出手段に供給する第3の選択手段と、
第1の操作モードの暗号化処理を行う場合、その初期サイクルにおいて、上記第1の選択手段に上記初期データを選択させて上記初期データ保持手段に保持させ、上記初期データ保持手段の当該保持データを上記ブロック暗号演算手段に供給して演算を実行させ、上記ブロック暗号演算手段の当該演算結果を受けて上記第2のデータ抽出手段から出力されるデータを上記暗号化データ保持手段に保持させ、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記入力データ保持手段の当該保持データに対して上記ビット・ローテイト手段の処理を行わせ、当該処理後のデータを上記第2の選択手段に選択させて上記入力データ保持手段に保持させ、上記入力データ保持手段の当該保持データと上記ブロック暗号演算手段の当該演算結果とを受けた上記第2の論理演算手段の演算結果を上記第3の選択手段に選択させて上記第1のデータ抽出手段に供給させ、当該供給データを受けて上記第1のデータ抽出手段から出力されるデータを上記第1の選択手段に選択させて上記初期データ保持手段に保持させ、当該初期サイクルに続く処理において、上記第1の選択手段に上記第1のデータ抽出手段の出力データを、上記第2の選択手段に上記ビット・ローテイト手段の処理データをそれぞれ選択させた状態で、上記第2のデータ長と上記第3のデータ長とに応じたサイクル数だけ、上記初期サイクルと同等の処理を反復させ、
上記第1の操作モードの復号化処理を行う場合には、その初期サイクルにおいて、上記第1の選択手段に上記初期データを選択させて上記初期データ保持手段に保持させ、上記初期データ保持手段の当該保持データを上記ブロック暗号演算手段に供給して演算を実行させ、上記ブロック暗号演算手段の当該演算結果を受けて上記第2のデータ抽出手段から出力されるデータを上記暗号化データ保持手段に保持させ、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記入力データ保持手段の当該保持データに対して上記ビット・ローテイト手段の処理を行わせ、当該処理後のデータを上記第2の選択手段に選択させて上記入力データ保持手段に保持させ、当該保持データを上記第3の選択手段に選択させて上記第1のデータ抽出手段に供給させ、当該供給データを受けて上記第1のデータ抽出手段から出力されるデータを上記第1の選択手段に選択させて上記初期データ保持手段に保持させ、当該初期サイクルに続く処理において、上記第1の選択手段に上記第1のデータ抽出手段の出力データを、上記第2の選択手段に上記ビット・ローテイト手段の処理データをそれぞれ選択させた状態で、上記第2のデータ長と上記第3のデータ長とに応じたサイクル数だけ、当該初期サイクルと同等の処理を反復させる制御手段とを有し、
上記制御手段の各処理サイクルにおいて、上記ブロック演算手段の演算結果を受けて上記第2のデータ抽出手段から出力されるデータと、上記入力データ保持手段に保持された上記ビット・ローテイト手段の処理後のデータとが上記第1の論理演算手段において演算された結果のうち、少なくとも上記第2のデータ長分のデータを、上記入力データに含まれる1つまたは複数の第2のデータ長を有した単位データに対応する暗号化データまたは復号化データとして出力する、
暗号処理装置。Block cipher operation means for encrypting the supplied first data length data based on the supplied key data;
Initial data holding means capable of holding data having the first data length;
Data of the second data length is extracted from the upper bit side of the supplied data and added to the lower bit side of the data held in the initial data holding means, and from the lower bit side of the data after the addition. First data extraction means for extracting and outputting data of the first data length;
First selection means for selecting data output from the first data extraction means or supplied initial data and supplying the selected data to the initial data holding means;
Encrypted data holding means and input data holding means capable of holding data having a third data length longer than the second data length;
The data corresponding to the second data length is extracted from the upper bits of the data calculated by the block cipher calculator, and added to the upper bits of the data held in the encrypted data holding means. Second data extracting means for extracting and outputting data of the third data length from the upper bit side of the subsequent data;
Bit rotating means for shifting the data held in the input data holding means to the lower bits by the second data length, and returning data overflowing from the least significant bits to the upper bits by the shift;
Second selecting means for selecting the data processed by the bit rotating means or the input data having the third data length and supplying the selected data to the input data holding means;
First logic operation means for receiving a data held in the input data holding means and output data of the second data extraction means and executing a predetermined logic operation;
A second logical operation unit that receives the data held in the input data holding unit and the data calculated in the block cipher operation unit, and executes the predetermined logical operation;
Third selection means for selecting the data held in the input data holding means or the data calculated in the second logic operation means and supplying the selected data to the first data extraction means;
When performing the encryption processing in the first operation mode, in the initial cycle, the first selection means selects the initial data and causes the initial data holding means to hold the initial data. Is supplied to the block cipher operation means to execute the operation, and the data output from the second data extraction means in response to the operation result of the block cipher operation means is held in the encrypted data holding means, The second selection means selects the input data, causes the input data holding means to hold the input data, and causes the bit data rotating means to perform processing on the held data of the input data holding means. The data is selected by the second selecting means and held by the input data holding means, and the held data of the input data holding means and the block The third selection means selects the operation result of the second logical operation means receiving the operation result of the encryption operation means and supplies the result to the first data extraction means. The data outputted from the first data extracting means is selected by the first selecting means and held in the initial data holding means. In the processing subsequent to the initial cycle, the first selecting means causes the first selecting means to select the first data. The number of cycles corresponding to the second data length and the third data length in a state where the output data of the data extracting means is selected by the second selecting means and the processing data of the bit rotating means, respectively. Only, the same process as the above initial cycle is repeated,
When performing the decoding process in the first operation mode, in the initial cycle, the first selection means selects the initial data and causes the initial data holding means to hold the initial data. The stored data is supplied to the block cipher operation means to execute the operation, and the data output from the second data extracting means in response to the operation result of the block cipher operation means is transmitted to the encrypted data holding means. Causing the second selection means to select the input data, causing the input data holding means to hold the input data, and causing the bit data rotating means to perform processing on the held data of the input data holding means; The processed data is selected by the second selection means and held by the input data holding means, and the held data is selected by the third selection means. Receiving the supplied data, causing the first selection means to select data output from the first data extraction means, and causing the initial data holding means to hold the data, In a process following the initial cycle, in a state where the output data of the first data extraction unit is selected by the first selection unit and the processing data of the bit rotation unit is selected by the second selection unit, Control means for repeating a process equivalent to the initial cycle by the number of cycles corresponding to the second data length and the third data length,
In each processing cycle of the control means, the data output from the second data extraction means in response to the operation result of the block operation means, and the data output from the bit rotation means held in the input data holding means. And at least one second data length included in the input data among at least the data of the second data length among the results obtained by the first logical operation means. Output as encrypted data or decrypted data corresponding to the unit data,
Cryptographic processing unit.
上記制御手段は、第2の操作モードの暗号化処理または復号化処理を行う場合、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、その初期サイクルにおいて、上記第1の選択手段に上記初期データを選択させて上記初期データ保持手段に保持させ、上記初期データ保持手段の当該保持データを上記ブロック暗号演算手段に供給して演算を実行させ、上記ブロック暗号演算手段の当該演算結果を受けて上記第2のデータ抽出手段から出力されるデータを上記暗号化データ保持手段に保持させ、上記ブロック暗号演算手段の当該演算結果を上記第3の選択手段に選択させて上記第1のデータ抽出手段に供給させ、当該供給データを受けて上記第1のデータ抽出手段から出力されるデータを上記第1の選択手段に選択させて上記初期データ保持手段に保持させ、上記初期サイクルに続く処理において、上記第1の選択手段に上記第1のデータ抽出手段の出力データを選択させた状態で、上記第1のデータ長と上記第2のデータ長とに応じたサイクル数だけ、上記初期サイクルと同等の処理を反復させ、
上記制御手段の最後の処理サイクルにおいて、上記ブロック演算手段の演算結果を受けて上記第2のデータ抽出手段から出力されるデータと上記入力データ保持手段に保持された入力データとが上記第1の論理演算手段において演算された結果を、上記入力データに対応する暗号化データまたは復号化データとして出力する、
請求項3に記載の暗号処理装置。The third selecting means can select the operation result of the block cipher operation means and supply it to the first data extracting means,
When performing the encryption process or the decryption process in the second operation mode, the control unit causes the second selection unit to select the input data and cause the input data holding unit to hold the input data. Causing the first selection means to select the initial data and cause the initial data holding means to hold the initial data; supplying the held data of the initial data holding means to the block cipher operation means to execute the operation; The data output from the second data extraction means in response to the operation result of the operation means is held in the encrypted data holding means, and the operation result of the block cipher operation means is selected by the third selection means. The data is supplied to the first data extracting means, and the data output from the first data extracting means in response to the supplied data is received by the first selecting means. In the initial data holding means, and in a process subsequent to the initial cycle, in a state where the first selecting means selects the output data of the first data extracting means, the first data A process equivalent to the initial cycle is repeated by the number of cycles corresponding to the length and the second data length,
In the last processing cycle of the control means, the data output from the second data extraction means in response to the operation result of the block operation means and the input data held in the input data holding means are stored in the first data cycle. Outputting the result calculated by the logical operation means as encrypted data or decrypted data corresponding to the input data;
The cryptographic processing device according to claim 3.
上記制御手段の各処理サイクルにおいて、上記ブロック演算手段の演算結果を受けて上記第2のデータ抽出手段から出力されるデータと上記入力データ保持手段に保持されたデータとが上記第1の論理演算手段において演算された結果のうち、少なくとも上記第2のデータ長分のデータを、上記入力データに含まれる1つまたは複数の第2のデータ長を有した単位データに対応する暗号化データまたは復号化データとして出力する、
請求項4に記載の暗号処理装置。When performing the encryption processing or the decryption processing in the second operation mode, the control means causes the second selection means to select the input data in the initial cycle and causes the input data holding means to hold the input data. Causing the input data holding means to perform the processing of the bit rotation means on the held data, causing the second selection means to select the processed data, and causing the input data holding means to hold the data, In a processing cycle following the initial cycle, the data processed by the bit rotate means is selected by the second selection means and held by the input data holding means,
In each processing cycle of the control means, the data outputted from the second data extraction means in response to the operation result of the block operation means and the data held in the input data holding means are subjected to the first logical operation. In the result calculated by the means, at least data of the second data length is converted into encrypted data or decryption corresponding to unit data having one or more second data lengths included in the input data. Output as coded data,
The cryptographic processing device according to claim 4.
上記第1の論理演算手段において演算されたデータ、または上記ブロック暗号演算手段において演算されたデータを選択して出力する第5の選択手段とを更に含み、
上記ブロック暗号演算手段は、供給されるデータの暗号化演算または復号化演算を行い、
上記制御手段は、第3の操作モードの暗号化処理または復号化処理を行う場合、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記第4の選択手段に上記入力データ保持手段の当該保持データを選択させて上記ブロック暗号演算手段に供給し、その演算を実行させ、上記ブロック暗号演算手段の当該演算結果を上記第5の選択手段に選択させて出力させ、上記第1の操作モードまたは上記第2の操作モードの処理を行う場合には、上記初期データ保持手段の保持データを上記第4の選択手段に選択させて上記ブロック暗号演算手段に供給させるとともに、上記第1の論理演算手段の演算データを上記第5の選択手段に選択させて出力させ、
上記第5の選択手段から、上記入力データに対応する暗号化データまたは復号化データを出力する、
請求項4に記載の暗号処理装置。Fourth selection means for selecting the data held in the initial data holding means or the data held in the input data holding means and supplying the selected data to the block cipher operation means;
Fifth selecting means for selecting and outputting the data calculated by the first logical calculating means or the data calculated by the block cipher calculating means,
The block cipher operation means performs an encryption operation or a decryption operation on supplied data,
When performing the encryption process or the decryption process in the third operation mode, the control means causes the second selection means to select the input data, causes the input data holding means to hold the input data, and causes the fourth selection mode to perform the fourth selection mode. Means for selecting the held data of the input data holding means, supplying the data to the block cipher operation means, executing the operation, and causing the fifth selection means to select the operation result of the block cipher operation means. When the output is performed and the processing in the first operation mode or the second operation mode is performed, the data held in the initial data holding means is selected by the fourth selection means and supplied to the block cipher operation means. And causing the fifth selection means to select and output the operation data of the first logic operation means,
Outputting encrypted data or decrypted data corresponding to the input data from the fifth selecting means;
The cryptographic processing device according to claim 4.
上記初期データ保持手段に保持されたデータと上記ブロック暗号演算手段において演算されたデータとを受けて、上記所定の論理演算を実行する第4の論理演算手段とを更に含み、
上記第4の選択手段は、上記第3の論理演算手段において演算されたデータを選択して上記ブロック暗号演算手段に供給可能であり、
上記第5の選択手段は、上記第4の論理演算手段において演算されたデータを選択して出力可能であり、
上記制御手段は、第4の操作モードの暗号化処理を行う場合、その初期サイクルにおいて、上記第1の選択手段に上記初期データを選択させて上記初期データ保持手段に保持させ、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記初期データ保持手段の当該保持データと上記入力データ保持手段の当該保持データとを受けた上記第3の論理演算手段の演算結果を上記第4の選択手段に選択させて上記ブロック暗号演算手段に供給し、その演算を実行させ、上記ブロック暗号演算手段の当該演算結果を上記第5の選択手段に選択させて出力させ、上記ブロック暗号演算手段の当該演算結果を上記第3の選択手段に選択させて上記第1のデータ抽出手段に供給させ、上記第1のデータ抽出手段に当該供給データの上記第1のデータ長分のデータを抽出させ、上記第1のデータ抽出手段の当該抽出データを上記第1の選択手段に選択させて上記初期データ保持手段に保持させ、当該初期サイクルに続く処理サイクルにおいて、上記第1の選択手段に上記第1のデータ抽出手段の抽出データを選択させた状態で、当該初期サイクルと同等の処理を実行させ、
上記第4の操作モードの復号化処理を行う場合には、その初期サイクルにおいて、上記第1の選択手段に上記初期データを選択させて上記初期データ保持手段に保持させ、上記第2の選択手段に上記入力データを選択させて上記入力データ保持手段に保持させ、上記入力データ保持手段の当該保持データを上記第4の選択手段に選択させて上記ブロック暗号演算手段に供給し、その演算を実行させ、上記ブロック暗号演算手段の当該演算結果と上記初期データ保持手段の当該保持データとを受けた上記第4の論理演算手段の演算結果を上記第5の選択手段に選択させて出力させ、上記入力データ保持手段の当該保持データを上記第3の選択手段に選択させて上記第1のデータ抽出手段に供給させ、上記第1のデータ抽出手段に当該供給データの上記第1のデータ長分のデータを抽出させ、上記第1のデータ抽出手段の当該抽出データを上記第1の選択手段に選択させて上記初期データ保持手段に保持させ、当該初期サイクルに続く処理サイクルにおいて、上記第1の選択手段に上記第1のデータ抽出手段の抽出データを選択させた状態で、当該初期サイクルと同等の処理を実行させる、
請求項6に記載の暗号処理装置。Third logic operation means for receiving the data held in the initial data holding means and the data held in the input data holding means and executing the predetermined logic operation;
A fourth logical operation unit that receives the data held in the initial data holding unit and the data calculated by the block cipher operation unit and executes the predetermined logical operation;
The fourth selecting means can select the data calculated by the third logical calculating means and supply the selected data to the block cipher calculating means,
The fifth selecting means can select and output the data calculated by the fourth logical calculating means,
When performing the encryption processing in the fourth operation mode, the control means causes the first selection means to select the initial data in the initial cycle and causes the initial data holding means to hold the initial data, and The selecting means selects the input data and causes the input data holding means to hold the input data. The third logic operation means receives the held data of the initial data holding means and the held data of the input data holding means. The operation result is selected by the fourth selecting means, supplied to the block cipher operation means, the operation is executed, and the operation result of the block cipher operation means is selected and output by the fifth selecting means. And causing the third selection means to select the calculation result of the block cipher calculation means and to supply the selected result to the first data extraction means. The data for the first data length of the data is extracted, and the extracted data of the first data extracting means is selected by the first selecting means and held by the initial data holding means. In the subsequent processing cycle, with the first selecting means selecting the extracted data of the first data extracting means, a process equivalent to the initial cycle is executed;
When performing the decoding process in the fourth operation mode, in the initial cycle, the first selecting means selects the initial data and causes the initial data holding means to hold the initial data, and the second selecting means To select the input data, hold the input data in the input data holding means, select the data held in the input data holding means by the fourth selection means, supply the selected data to the block cipher operation means, and execute the operation. The fifth selection means selects and outputs the operation result of the fourth logic operation means which has received the operation result of the block cipher operation means and the held data of the initial data holding means, The third selection means selects the data held by the input data holding means and supplies the data to the first data extraction means. A process for extracting data corresponding to the first data length, causing the first selection unit to select the extracted data of the first data extraction unit and holding the selected data in the initial data holding unit, and a process subsequent to the initial cycle. In the cycle, the same processing as in the initial cycle is executed in a state where the first selecting means selects the extracted data of the first data extracting means.
The cryptographic processing device according to claim 6.
上記第1のステップにおいて暗号化されたデータの上位ビット側から、上記第1のデータ長より短い第2のデータ長分のデータを抽出し、当該抽出データを上位ビットとした、上記第2のデータ長より長い第3のデータ長を有するデータを生成して、暗号化データ保持装置に保持させる第2のステップと、
上記第1のステップにおいて暗号化されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データを当該抽出データに更新する第3のステップとを含んだ初期ステップに続けて、
上記初期データ保持装置に保持されたデータを、上記鍵データに基づいて暗号化する第4のステップと、
上記第4のステップにおいて暗号化されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータの上位ビット側に付加し、当該付加後のデータの上位ビット側から上記第3のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータを当該抽出データに更新する第5のステップと、
上記第4のステップにおいて暗号化されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータを当該抽出データに更新する第6のステップとを含んだ反復ステップを、上記第2のデータ長と上記第3のデータ長とに応じた回数だけ反復し、
最後の上記第5のステップにおいて抽出される上記第3のデータ長のデータと、上記第3のデータ長を有する入力データとに所定の論理演算を行って、当該入力データに対応した暗号化データまたは復号化データを生成する、
暗号処理方法。A first step of causing an initial data holding device to hold initial data having a first data length, and encrypting the initial data based on the given key data;
The second step of extracting data of a second data length shorter than the first data length from the upper bits of the data encrypted in the first step, and setting the extracted data as upper bits; A second step of generating data having a third data length longer than the data length and causing the encrypted data holding device to hold the data;
The data of the second data length is extracted from the upper bits of the data encrypted in the first step, and added to the lower bits of the initial data held in the initial data holding device. Extracting the data of the first data length from the lower bit side of the added data, and updating the initial data held in the initial data holding device to the extracted data. Following the steps,
A fourth step of encrypting the data held in the initial data holding device based on the key data;
The data of the second data length is extracted from the upper bits of the data encrypted in the fourth step, and added to the upper bits of the data held in the encrypted data holding device. A fifth step of extracting data of the third data length from the higher-order bit side of the added data, and updating the data held in the encrypted data holding device to the extracted data;
In the fourth step, data of the second data length is extracted from the upper bits of the data encrypted in the fourth step, and the extracted data is added to the lower bits of the data held in the initial data holding device. A sixth step of extracting the data of the first data length from the lower bit side of the subsequent data and updating the data held in the initial data holding device to the extracted data. , Iterating the number of times according to the second data length and the third data length,
A predetermined logical operation is performed on the data having the third data length extracted in the last fifth step and the input data having the third data length to obtain encrypted data corresponding to the input data. Or generate decrypted data,
Cryptographic processing method.
第3のデータ長を有する入力データを、上記第1のデータ長および上記第3のデータ長より短い第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻す処理を行い、当該処理後のデータを入力データ保持装置に保持させる第2のステップと、
上記第1のステップにおいて暗号化されたデータの上位ビット側から上記第2のデータ長分のデータを抽出し、当該抽出データを上位ビットとした上記第3のデータ長を有するデータを生成して、暗号化データ保持装置に保持させる第3のステップと、
上記第1のステップにおいて暗号化されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データを当該抽出データに更新する第4のステップと、
上記入力データ保持装置に保持されたデータと、上記第3のステップで生成された上記第3のデータ長を有するデータとに所定の論理演算を行って、上記入力データに含まれる上記第2のデータ長を有した単位データに対応する暗号化データまたは復号化データを生成する第5のステップとを含んだ初期ステップに続けて、
上記初期データ保持装置に保持されたデータを、上記鍵データに基づいて暗号化する第6のステップと、
上記入力データ保持装置に保持されたデータを、上記第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻す処理を行い、上記入力データ保持装置に保持されたデータを当該処理後のデータに更新する第7のステップと、
上記第6のステップにおいて暗号化されたデータの上位ビット側から第2のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータの上位ビット側に付加し、当該付加後のデータの上位ビット側から上記第3のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータを当該抽出データに更新する第8のステップと、
上記第6のステップにおいて暗号化されたデータの上位ビット側から第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータを当該抽出データに更新する第9のステップと、
上記入力データ保持装置の上記更新されたデータと、上記第8のステップで抽出された上記第3のデータ長を有するデータとに上記所定の論理演算を行って、少なくとも1つの上記単位データに対応する暗号化データまたは復号化データを生成する第10のステップとを含んだ反復ステップを、上記第2のデータ長と上記第3のデータ長とに応じた回数だけ反復する、
暗号処理方法。A first step of causing an initial data holding device to hold initial data having a first data length, and encrypting the initial data based on the given key data;
The input data having the third data length is shifted toward the lower bits by the first data length and the second data length shorter than the third data length, and the data overflowing from the least significant bit is shifted by the shift. A second step of performing a process of returning to the upper bit side, and causing the input data holding device to hold the processed data;
Extracting the data of the second data length from the higher-order bit side of the data encrypted in the first step, and generating data having the third data length using the extracted data as the higher-order bit; A third step of holding the encrypted data holding device;
The data of the second data length is extracted from the upper bits of the data encrypted in the first step, and added to the lower bits of the initial data held in the initial data holding device. A fourth step of extracting data of the first data length from the lower bit side of the added data and updating the initial data held in the initial data holding device to the extracted data;
By performing a predetermined logical operation on the data held in the input data holding device and the data having the third data length generated in the third step, the second data included in the input data is processed. A fifth step of generating encrypted data or decrypted data corresponding to the unit data having the data length, and
A sixth step of encrypting the data held in the initial data holding device based on the key data;
The input data holding device shifts the data held in the input data holding device toward the lower bits by the second data length, and returns data overflowing from the least significant bit to the upper bits by the shift. A seventh step of updating the data held in the device with the processed data;
In the sixth step, data of a second data length is extracted from the upper bits of the data encrypted in the sixth step, and the extracted data is added to the upper bits of the data held in the encrypted data holding device. An eighth step of extracting the data of the third data length from the higher-order bit side of the subsequent data and updating the data held in the encrypted data holding device to the extracted data;
In the sixth step, data of the second data length is extracted from the upper bits of the encrypted data and added to the lower bits of the data held in the initial data holding device. A ninth step of extracting data corresponding to the first data length from the lower bit side of the data of (i) and updating the data held in the initial data holding device to the extracted data;
The predetermined logical operation is performed on the updated data of the input data holding device and the data having the third data length extracted in the eighth step to correspond to at least one of the unit data. Repeating a tenth step of generating encrypted data or decrypted data, the number of times corresponding to the second data length and the third data length.
Cryptographic processing method.
第3のデータ長を有する入力データを、上記第1のデータ長および上記第3のデータ長より短い第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻す処理を行い、当該処理後のデータを入力データ保持装置に保持させる第2のステップと、
上記第1のステップにおいて暗号化されたデータの上位ビット側から上記第2のデータ長分のデータを抽出し、当該抽出データを上位ビットとした上記第3のデータ長を有するデータを生成して、暗号化データ保持装置に保持させる第3のステップと、
上記第1のステップにおいて暗号化されたデータと、上記入力データ保持装置に保持されたデータとに所定の論理演算を行い、当該演算結果の上位ビット側から上記第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データを当該抽出データに更新する第4のステップと、
上記入力データ保持装置に保持されたデータと、上記第3のステップで生成された上記第3のデータ長を有するデータとに上記所定の論理演算を行って、上記入力データに含まれる上記第2のデータ長を有した単位データに対応する暗号化データを生成する第5のステップとを含んだ初期ステップに続けて、
上記初期データ保持装置に保持されたデータを、上記鍵データに基づいて暗号化する第6のステップと、
上記入力データ保持装置に保持されたデータを、上記第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻す処理を行い、上記入力データ保持装置に保持されたデータを当該処理後のデータに更新する第7のステップと、
上記第6のステップにおいて暗号化されたデータの上位ビット側から第2のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータの上位ビット側に付加し、当該付加後のデータの上位ビット側から上記第3のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータを当該抽出データに更新する第8のステップと、
上記第6のステップにおいて暗号化されたデータと、上記入力データ保持装置の上記更新されたデータとに上記所定の論理演算を行い、当該演算結果の上位ビット側から第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータを当該抽出データに更新する第9のステップと、
上記入力データ保持装置の上記更新されたデータと、上記第8のステップで抽出された上記第3のデータ長を有するデータとに上記所定の論理演算を行って、少なくとも1つの上記単位データに対応する暗号化データを生成する第10のステップとを含んだ反復ステップを、上記第2のデータ長と上記第3のデータ長とに応じた回数だけ反復する、
暗号処理方法。A first step of causing an initial data holding device to hold initial data having a first data length, and encrypting the initial data based on the given key data;
The input data having the third data length is shifted toward the lower bits by the first data length and the second data length shorter than the third data length, and the data overflowing from the least significant bit is shifted by the shift. A second step of performing a process of returning to the upper bit side, and causing the input data holding device to hold the processed data;
Extracting the data of the second data length from the higher-order bit side of the data encrypted in the first step, and generating data having the third data length using the extracted data as the higher-order bit; A third step of holding the encrypted data holding device;
A predetermined logical operation is performed on the data encrypted in the first step and the data held in the input data holding device, and data corresponding to the second data length is read from the upper bit side of the operation result. Extracted and added to the lower bit side of the initial data held in the initial data holding device, extracting data of the first data length from the lower bit side of the added data, A fourth step of updating the initial data held in the holding device to the extracted data;
The predetermined logical operation is performed on the data held in the input data holding device and the data having the third data length generated in the third step, and the second data included in the input data is processed. A fifth step of generating encrypted data corresponding to unit data having a data length of
A sixth step of encrypting the data held in the initial data holding device based on the key data;
The input data holding device shifts the data held in the input data holding device toward the lower bits by the second data length, and returns data overflowing from the least significant bit to the upper bits by the shift. A seventh step of updating the data held in the device with the processed data;
In the sixth step, data of a second data length is extracted from the upper bits of the data encrypted in the sixth step, and the extracted data is added to the upper bits of the data held in the encrypted data holding device. An eighth step of extracting the data of the third data length from the higher-order bit side of the subsequent data and updating the data held in the encrypted data holding device to the extracted data;
The predetermined logical operation is performed on the data encrypted in the sixth step and the updated data of the input data holding device, and data corresponding to a second data length from the upper bit side of the operation result And adds the data to the lower bit side of the data held in the initial data holding device, extracts data of the first data length from the lower bit side of the data after the addition, and A ninth step of updating the data held in the holding device to the extracted data,
The predetermined logical operation is performed on the updated data of the input data holding device and the data having the third data length extracted in the eighth step to correspond to at least one of the unit data. Repeating the repeating step including the tenth step of generating encrypted data to be performed by the number of times corresponding to the second data length and the third data length.
Cryptographic processing method.
第3のデータ長を有する暗号化された入力データを、上記第1のデータ長および上記第3のデータ長より短い第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻す処理を行い、当該処理後のデータを入力データ保持装置に保持させる第2のステップと、
上記第1のステップにおいて暗号化されたデータの上位ビット側から上記第2のデータ長分のデータを抽出し、当該抽出データを上位ビットとした上記第3のデータ長を有するデータを生成して、暗号化データ保持装置に保持させる第3のステップと、
上記入力データ保持装置に保持されたデータの上位ビット側から上記第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持された初期データを当該抽出データに更新する第4のステップと、
上記入力データ保持装置に保持されたデータと、上記第3のステップで生成された上記第3のデータ長を有するデータとに所定の論理演算を行って、上記入力データに含まれる上記第2のデータ長を有した単位データに対応する復号化データを生成する第5のステップとを含んだ初期ステップに続けて、
上記初期データ保持装置に保持されたデータを、上記鍵データに基づいて暗号化する第6のステップと、
上記入力データ保持装置に保持されたデータを、上記第2のデータ長だけ下位ビット側にシフトさせるとともに、当該シフトによって最下位ビットからあふれるデータを上位ビット側へ戻す処理を行い、上記入力データ保持装置に保持されたデータを当該処理後のデータに更新する第7のステップと、
上記第6のステップにおいて暗号化されたデータの上位ビット側から第2のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータの上位ビット側に付加し、当該付加後のデータの上位ビット側から上記第3のデータ長分のデータを抽出して、上記暗号化データ保持装置に保持されたデータを当該抽出データに更新する第8のステップと、
上記入力データ保持装置の上記更新されたデータの上位ビット側から第2のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータの下位ビット側に付加し、当該付加後のデータの下位ビット側から上記第1のデータ長分のデータを抽出して、上記初期データ保持装置に保持されたデータを当該抽出データに更新する第9のステップと、
上記入力データ保持装置の上記更新されたデータと、上記第8のステップで抽出された上記第3のデータ長を有するデータとに上記所定の論理演算を行って、少なくとも1つの上記単位データに対応する復号化データを生成する第10のステップとを含んだ反復ステップを、上記第2のデータ長と上記第3のデータ長とに応じた回数だけ反復する、
暗号処理方法。A first step of causing an initial data holding device to hold initial data having a first data length, and encrypting the initial data based on the given key data;
The encrypted input data having the third data length is shifted to the lower bit side by the first data length and the second data length shorter than the third data length, and the least significant bit is shifted by the shift. A second step of performing a process of returning data overflowing from the upper bit side, and causing the input data holding device to hold the processed data;
Extracting the data of the second data length from the higher-order bit side of the data encrypted in the first step, and generating data having the third data length using the extracted data as the higher-order bit; A third step of holding the encrypted data holding device;
The data of the second data length is extracted from the upper bits of the data held in the input data holding device, and added to the lower bits of the initial data held in the initial data holding device. A fourth step of extracting data of the first data length from the lower bit side of the subsequent data and updating the initial data held in the initial data holding device to the extracted data;
By performing a predetermined logical operation on the data held in the input data holding device and the data having the third data length generated in the third step, the second data included in the input data is processed. A fifth step of generating decoded data corresponding to the unit data having the data length, and
A sixth step of encrypting the data held in the initial data holding device based on the key data;
The input data holding device shifts the data held in the input data holding device toward the lower bits by the second data length, and returns data overflowing from the least significant bit to the upper bits by the shift. A seventh step of updating the data held in the device with the processed data;
In the sixth step, data of a second data length is extracted from the upper bits of the data encrypted in the sixth step, and the extracted data is added to the upper bits of the data held in the encrypted data holding device. An eighth step of extracting the data of the third data length from the higher-order bit side of the subsequent data and updating the data held in the encrypted data holding device to the extracted data;
The data of the second data length is extracted from the upper bit side of the updated data of the input data holding device and added to the lower bit side of the data held in the initial data holding device. A ninth step of extracting the data of the first data length from the lower bit side of the data of (i) and updating the data held in the initial data holding device to the extracted data;
The predetermined logical operation is performed on the updated data of the input data holding device and the data having the third data length extracted in the eighth step to correspond to at least one of the unit data. Repeating the tenth step of generating the decoded data to be performed by the number of times corresponding to the second data length and the third data length.
Cryptographic processing method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002201631A JP2004045641A (en) | 2002-07-10 | 2002-07-10 | Encryption processing device and method therefor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002201631A JP2004045641A (en) | 2002-07-10 | 2002-07-10 | Encryption processing device and method therefor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2004045641A true JP2004045641A (en) | 2004-02-12 |
Family
ID=31708110
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002201631A Pending JP2004045641A (en) | 2002-07-10 | 2002-07-10 | Encryption processing device and method therefor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2004045641A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007105709A1 (en) | 2006-03-14 | 2007-09-20 | Nec Corporation | Information processing system, information processing method, and information processing program |
JP2010501895A (en) * | 2006-08-24 | 2010-01-21 | エルエスアイ コーポレーション | Dual mode AES implementation supporting single and multiple AES operations |
-
2002
- 2002-07-10 JP JP2002201631A patent/JP2004045641A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007105709A1 (en) | 2006-03-14 | 2007-09-20 | Nec Corporation | Information processing system, information processing method, and information processing program |
US8121284B2 (en) | 2006-03-14 | 2012-02-21 | Nec Corporation | Information processing system, information processing method, and information processing program |
JP5131187B2 (en) * | 2006-03-14 | 2013-01-30 | 日本電気株式会社 | Information processing system, information processing method, and information processing program |
JP2010501895A (en) * | 2006-08-24 | 2010-01-21 | エルエスアイ コーポレーション | Dual mode AES implementation supporting single and multiple AES operations |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5724428A (en) | Block encryption algorithm with data-dependent rotations | |
EP0802653B1 (en) | Multi-cycle non-parallel data encryption engine | |
WO2005073842A1 (en) | Pseudo random number generation device and pseudo random number generation program | |
EP0802652A2 (en) | Data encryptor having a scalable clock | |
US7447311B2 (en) | Method of designing optimum encryption function and optimized encryption apparatus in a mobile communication system | |
US20040252831A1 (en) | Key expander, key expansion method, and key expansion program | |
US6732271B1 (en) | Method of deciphering ciphered data and apparatus for same | |
US7657034B2 (en) | Data encryption in a symmetric multiprocessor electronic apparatus | |
KR0137709B1 (en) | Method for protecting an enciphered computer object code against cryptanalysis | |
JP3769804B2 (en) | Decoding method and electronic device | |
CN114444140A (en) | Non-duplicable function application in memory | |
JP2004045641A (en) | Encryption processing device and method therefor | |
US20090097638A1 (en) | Information processing apparatus | |
TW202218373A (en) | Hybrid multistage algorithm encryption and decryption system, transmitting device thereof, and receiving device thereof | |
JPH04335730A (en) | Random ciphering communication system | |
KR100494560B1 (en) | Real time block data encryption/decryption processor using Rijndael block cipher and method therefor | |
JP4644053B2 (en) | Encryption apparatus and method, decryption apparatus and method | |
KR100546777B1 (en) | Apparatus and method for SEED Encryption/Decryption, and F function processor therefor | |
WO2004105306A1 (en) | Method and apparatus for a low memory hardware implementation of the key expansion function | |
JP2001016197A (en) | Self-synchronized stream enciphering system and mac generating method using the same | |
JPH10303883A (en) | Enciphering method | |
KR100226867B1 (en) | Stream cipher system of wireless communication | |
JP2002023624A (en) | Block cipher communication method and device therefor, and recording medium with block cipher communication program recorded thereon | |
CN117725605B (en) | Method and system for remotely and automatically compiling electronic archive file information confidentiality | |
KR100317250B1 (en) | Method of Cryptographing Data |