JP3547474B2 - Cryptographic operation circuit - Google Patents

Cryptographic operation circuit Download PDF

Info

Publication number
JP3547474B2
JP3547474B2 JP05086394A JP5086394A JP3547474B2 JP 3547474 B2 JP3547474 B2 JP 3547474B2 JP 05086394 A JP05086394 A JP 05086394A JP 5086394 A JP5086394 A JP 5086394A JP 3547474 B2 JP3547474 B2 JP 3547474B2
Authority
JP
Japan
Prior art keywords
data
input
selector
output
circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP05086394A
Other languages
Japanese (ja)
Other versions
JPH07261662A (en
Inventor
直哉 鳥居
高行 長谷部
裕輝 佐藤
克己 小林
俊文 藤本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP05086394A priority Critical patent/JP3547474B2/en
Publication of JPH07261662A publication Critical patent/JPH07261662A/en
Application granted granted Critical
Publication of JP3547474B2 publication Critical patent/JP3547474B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【産業上の利用分野】
本発明は暗号演算回路に係り、特に複数のモードでデータを暗号化、復号化する暗号演算回路に関する。
【0002】
暗号演算によるデータの暗号化、復号化には多数の操作モードが存在し、標準化も完了している(JIS X5052−1990:”64ビットのブロック暗号アルゴリズムの利用モード”)。利用者は、適用アプリケーションにより適切な処理モードを選択し使用する。その幅広い利用者に対応するために、その操作モードを共通の回路で汎用化を実現し、且つ、回路規模を最小に抑えることが要望されている。また、最短演算時間であることが望まれる。
【0003】
【従来の技術】
図23は従来の暗号演算回路の一例の構成を示す図である。
【0004】
図23に示す暗号演算回路100は、入力レジスタ101と、CBC暗号化回路102と、CBC復号化回路103と、CFB暗号化回路104と、CFB復号化回路105と、OFB回路106と、5入力のセレクタ107と、暗号処理回路108と、5入力のセレクタ109と、出力レジスタ110とから構成されている。
【0005】
CBC暗号化回路102及びCBC復号化回路103及びCFB暗号化回路104及びCFB復号化回路105及びOFB暗号化復号化回路106は並列に接続されており、セレクタ107と109を切り換えることで、CBCモード、CFBモード、及びOFBモードによる暗号演算を行うことができる。
【0006】
CBC暗号化回路102は、図24に示す如く、レジスタ111とエクスクルーシブオア回路112とから構成される。CBC復号化回路103は、図25に示す如く、レジスタ113とエクスクルーシブオア回路114とから構成される。
【0007】
CFB暗号化回路104は、図26に示す如く、シフトレジスタ115とエクスクルーシブオア回路116とから構成される。CFB復号化回路105は、図27に示す如く、シフトレジスタ117とエクスクルーシブオア回路118とから構成される。また、OFB暗号化復号化回路106は、図28に示す如く、シフトレジスタ119とエクスクルーシブオア回路120とから構成される。
【0008】
【発明が解決しようとする課題】
上記した従来の暗号演算回路では、1つの演算モードに対して各々専用の回路をセレクタにより切り換えて使用する構成であったため、多数の演算モードを必要とする場合には多入力のセレクタを2個必要とし、且つ、各々の回路が有するレジスタ(シフトレジスタ)は回路規模が大きいために、大がかりな回路となってしまう問題があった。
【0009】
また、kビットCFBモードあるいはkビットOFBモードでデータのkビットフィードバックを必要とする場合、データフィードバックにシフトレジスタを使用していたために、nビットをフィードバックするためにはkクロックを入力してやる必要がある。このため、kが増大するにつれてフィードバックに要する時間が増大し、暗号処理のための遅延時間が大きくなるという問題も生じていた。
【0010】
そこで本発明は、上記の問題点を解決した暗号演算回路を提供することを目的とする。
【0011】
【課題を解決するための手段】
上記の問題を解決するために、本発明では図1に示す原理図の通り構成した。
【0012】
すなわち、入力データが格納される入力レジスタ1と、入力レジスタ1からのデータを第1のゲート信号G1に応じてゲートして出力する第1のゲート手段2と、第1のデータを第2のゲート信号G2に応じてゲートして出力する第2のゲート手段4と、一方の入力に第1のゲート手段からの出力データを供給され、他方に第2のゲート手段4からの出力データを供給され、第1のゲート手段2からの出力データと第2のゲート手段4からの出力データとをエクスクルーシブオアしたデータを出力する第1のエクスクルーシブオア回路3と、第1のエクスクルーシブオア回路3からの出力データに対して暗号処理を行う暗号処理手段5と、第2のデータを第3のゲート信号G3に応じてゲートして出力する第3のゲート手段7と、一方の入力に暗号処理手段5からの出力データを供給され、他方の入力に第3のゲート手段7からの出力データを供給され、暗号処理手段5からの出力データと第3のゲート手段7からの出力データとをエクスクルーシブオアしたデータを出力する第2のエクスクルーシブオア回路6と、第2のエクスクルーシブオア回路6からの出力データを格納する出力レジスタ8と、入力レジスタ1からのデータと、暗号処理手段5からのデータと、第2のエクスクルーシブオア回路6からのデータと、第1のデータのいずれかを選択出力する第1のセレクタ9と、第1のセレクタ9からの出力データを一時的に格納し、第1のデータとして出力する格納手段10と、格納手段10からのデータと、入力レジスタ1からのデータのいずれかを第2のデータとして選択出力する第2のセレクタ11とから構成した。
【0013】
【作用】
上記構成の本発明によれば、第1のゲート信号G1及び第2のゲート信号G2及び第3のゲート信号G3に応じて第1のゲート手段2及び第2のゲート手段4及び第3のゲート手段7からの出力データがゲートされ、且つ、第1のセレクタと第2のセレクタの出力データが選択されることでデータの流れが制御され、ECBモード、CBCモード、CFBモード、及びOFBモードの各モードで回路が共用化されて動作するように作用する。
【0014】
すなわち、第1のゲート信号G1をハイレベル(1)、第2のゲート信号G2をローレベル(0)、第3のゲート信号G3をローレベル(0)とすることで、データの流れは図2に太線で示す様に制御される。したがって、ECBモードの暗号化及び復号化処理が行われる。
【0015】
また、第1のゲート信号G1をハイレベル(1)、第2のゲート信号G2をハイレベル(1)、第3のゲート信号G3をローレベル(0)とすることで、データの流れは図3に太線で示す様に制御される。したがって、CBCモードの暗号化処理が行われる。
【0016】
また、第1のゲート信号G1をハイレベル(1)、第2のゲート信号G2をローレベル(0)、第3のゲート信号G3をハイレベル(1)とすることで、データの流れは図4に太線で示す様に制御される。したがって、CBCモードの復号化処理が行われる。
【0017】
また、第1のゲート信号G1をローレベル(0)、第2のゲート信号G2をハイレベル(1)、第3のゲート信号G3をハイレベル(1)として第2のエクスクルーシブオア回路6からの下位kビットを第1のセレクタ9より出力することで、データの流れは図5に太線で示す様に制御される。したがって、kビットCFBモードの暗号化処理が行われる。
【0018】
また、第1のゲート信号G1をローレベル(0)、第2のゲート信号G2をハイレベル(1)、第3のゲート信号G3をハイレベル(1)として入力レジスタ1からの下位kビットを第1のセレクタ9より出力することで、データの流れは図6に太線で示す様に制御される。したがって、kビットCFBモードの復号化処理が行われる。
【0019】
なお、kビットの選択は第1のセレクタ9のkビット幅選択で行い、シフトレジスタを用いないため高速にフィードバックが可能となっている。
【0020】
そして、第1のゲート信号G1をローレベル(0)、第2のゲート信号G2をハイレベル(1)、第3のゲート信号G3をハイレベル(1)として暗号処理手段5からの下位kビットを第1のセレクタ9より出力することで、データの流れは図7に太線で示す様に制御される。したがって、OFBモードの暗号化及び復号化処理が行われる。
【0021】
【実施例】次に、図面を参照して本発明の実施例について説明する。図8は本発明の一実施例の構成図であり、LSI化されている。
【0022】
本実施例では、ブロック長は64ビットの米国標準暗号DES(Data Encryption Standard,FIPS 46,1977)で、モード処理は、ECBモード、CBCモード、1ビットCFBモード、8ビットCFBモード、16ビットCFBモード、1ビットOFBモード、64ビットOFBモードを実現している。
【0023】
データの入出力モードとして、パラレルインタフェースとシリアルインタフェースを持つが、その入出力モードと操作モードとの関係を図9に示す。
【0024】
すなわち、パラレルインタフェースではECBモード、CBCモード、8ビットCFBモード、16ビットCFBモード、64ビットOFBモード、及びIV(Initial Vector)設定が処理可能であり、シリアルインタフェースでは1ビットCFBモード、1ビットOFBモード、64ビットOFBモード、及びIV設定が処理可能である。
【0025】
図8に戻って説明するに、21は入力データが一時的に格納される入力レジスタである。22はECBモード、CBCモード時に第1のゲート信号G1がハイレベルとなり、入力レジスタ21からのデータをゲートして通す第1のゲート手段であるアンドゲートである。
【0026】
また、23はCBC暗号化モード、1ビットCFBモード、8ビットCFBモード、16ビットCFBモード、1ビットOFBモード、及び64ビットOFBモード時に第2のゲート信号G2がハイレベルとなり、格納手段であるIVレジスタ31からの第1のデータであるIVデータをゲートして通す第2のゲート手段であるアンドゲートである。
【0027】
アンドゲート22の出力とアンドゲート23の出力は、第1のエクスクルーシブオア回路である入力側エクスクルーシブオア回路24に入力される。25はDES演算を行うDESアルゴリズム回路である。DESアルゴリズム回路25の出力は、第2のエクスクルーシブオア回路である出力側エクスクルーシブオア回路26の一方の入力に入力される。27は出力側エクスクルーシブオア回路26からの出力データを一時的に格納する出力レジスタである。
【0028】
28は8ビットCFB暗号化モード、16ビットCFB暗号化モード時のフィードバックデータ(入力0)か、8ビットCFB復号化モード、16ビットCFB復号化モード時のフィードバックデータ(入力1)かを選択して出力する2入力セレクタである。29は16ビットCFBモード時のフィードバックデータ(入力0)か、8ビットCFBモード時のフィードバックデータ(入力1)かを選択して出力する2入力セレクタである。
【0029】
30は8ビットCFBモード、16ビットCFBモード時のフィードバックデータ(入力0)か、CBC暗号化/64ビットOFBモード時のフィードバックデータ(入力1)か、CBC復号化モード時のフィードバックデータ/IV設定時のIVデータ(入力2)か、1ビットOFBモード時のフィードバックデータ(入力3)か、1ビットCFBモード時のフィードバックデータ(入力4)かを選択して出力する5入力セレクタである。セレクタ28及び29及び30により第1のセレクタを構成している。
【0030】
31はIVデータを一時的に格納するIVレジスタである。32はCBC復号モード時のフィードバックデータ(入力0)か、64ビットOFBモード(パラレル入力)、8ビットCFBモード、16ビットCFBモード時のフィードバックデータ(入力1)かを選択して出力する2入力セレクタであり、第2のセレクタに相当する。
【0031】
33は1ビットCFB復号化モード時のフィードバックデータ(入力0)か1ビットCFB暗号化モード時のフィードバックデータ(入力1)かを選択して出力する2入力セレクタである。
【0032】
34は64ビットOFBモードのシリアルインタフェース時のIVレジスタ31の出力データ(DES演算結果)を64ビットパラレルデータからシリアルデータに変換するパラレル・シリアル変換回路である。35は1ビットOFBモード、1ビットCFBモードのシリアルインタフェース時のDES演算結果データ(入力0)か、64ビットOFBモードのシリアルインタフェース時のDES演算結果データ(入力1)かを選択して出力する2入力セレクタである。
【0033】
36はエクスクルーシブオア回路である。また、37はCBC復号化、8ビットCFBモード、16ビットCFBモード、64ビットOFBモード時に第3のゲート信号G3がハイレベルとなり、セレクタ32からの出力データをゲートして通すアンドゲートである。41はシリアル入力端子、42はシリアル出力端子である。
【0034】
図10はECB(Electric Code Book)モードを示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力される(セレクタ32の出力がオフ、他のセレクタ出力はドントケア(”X”))と、データの流れは同図(B)に太線で示す通りに制御される。
【0035】
すなわち、入力レジスタ21に入力された1ブロック(64ビット)のデータはアンドゲート22を通った後入力側エクスクルーシブオア回路24を通り、DESアルゴリズム回路25で暗号化(復号化)された後出力側エクスクルーシブオア回路26を通って出力レジスタ27でラッチされる。
【0036】
図11はIV設定を示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力(セレクタ30は入力2を出力し、他のセレクタ出力はドントケア(”X”))されると、データの流れは同図(B)に太線で示す通りに制御される。
【0037】
CBCモード、CFBモード、OFBモードで暗号化(復号化)する場合は、始に次のようにIV設定する必要がある。すなわち、入力レジスタ21でラッチされたIVデータ(64ビット)はセレクタ30の入力0に入力され、IVレジスタ31に設定される。
【0038】
図12はCBC(Cipher Block Chaining)暗号化モードを示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力される(セレクタ30が入力1を出力し、セレクタ32の出力がオフ、他のセレクタ出力はドントケア(”X”))と、データの流れは同図(B)に太線で示す通りに制御される。
【0039】
すなわち、IVレジスタ31にIVデータを設定(第11図参照)し、入力レジスタ21でラッチされた1ブロック目のデータは、アンドゲート22を通った後入力側エクスクルーシブオア回路24に入力される。入力側エクスクルーシブオア回路24のもう一方の入力には、IVレジスタ31に設定されたIVデータが入力され、このIVデータと入力データの排他的論理和をとったデータがDESアルゴリズム回路25で暗号化される。
【0040】
暗号化された出力データは、1ブロック目の暗号化データとして出力側エクスクルーシブオア回路26を通り出力レジスタ27でラッチされると共に、セレクタ30の入力1に入力されてセレクタ30より出力され、IVレジスタに設定される。2ブロック目の入力データは、IVレジスタ31に設定された1ブロック目の暗号化データと入力側エクスクルーシブオア回路24で排他的論理和をとり暗号化される。2ブロック目以降のデータは以上の操作の繰り返しとなる。
【0041】
図13はCBC復号化モードを示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力される(セレクタ30が入力2を出力し、セレクタ32が入力0を出力し、他のセレクタ出力はドントケア(”X”))と、データの流れは同図(B)に太線で示す通りに制御される。
【0042】
すなわち、IVレジスタ31にIVデータを設定(第11図参照)し、入力レジスタ21でラッチされた1ブロック目のデータは、アンドゲート22を通った後入力側エクスクルーシブオア回路24を通りDESアルゴリズム回路25に入力されると共に、セレクタ30の入力2に入力される。DESアルゴリズム回路25で復号化されたデータは、IVレジスタ31に設定されたIVデータと出力側エクスクルーシブオア回路26で排他的論理和をとり、出力レジスタ27でラッチされる。
【0043】
この時点で、1ブロック目の入力データはセレクタ30からIVレジスタ31に設定される。2ブロック目以降の入力データの復号化は、DESアルゴリズム回路25で復号化された後に1ブロック前の入力データとの排他的論理和をとり復号化データとなる。
【0044】
図14は1ビットCFB(Cipher Feed Back)暗号化モードを示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力される(セレクタ30が入力4を出力し、セレクタ33が入力0を出力し、セレクタ35が入力1を出力し、他のセレクタ出力はドントケア(”X”))と、データの流れは同図(B)に太線で示す通りに制御される。
【0045】
すなわち、IVレジスタ31にIVデータを設定(第11図参照)し、1ブロック目のIVデータはアンドゲート23を通った後入力側エクスクルーシブオア回路24を通り、DESアルゴリズム回路25で暗号化される。暗号化されたデータの上位1ビットはセレクタ35の入力0に入力されると共に、入力端子41よりシリアルで入力された入力データ1ビットとエクスクルーシブオア回路36で排他的論理和をとり、暗号化データとして出力端子42より出力される。
【0046】
2ブロック目のIVデータは、1ブロック目のIVデータの下位63ビットが上位63ビットとなり、最下位ビットはセレクタ33を通った1回目の暗号化データとなってセレクタ30の入力4に入力され、このセレクタ30の出力が2ブロック目のIVデータとしてIVレジスタ31に設定される。2回目以降は以上の繰り返しとなる。
【0047】
図15は1ビットCFB復号化モードを示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力される(セレクタ30が入力4を出力し、セレクタ33が入力0を出力し、セレクタ35が入力0を出力し、他のセレクタ出力はドントケア(”X”))と、データの流れは同図(B)に太線で示す通りに制御される。
【0048】
すなわち、IVレジスタ31にIVデータを設定(第11図参照)し、1ブロック目のIVデータはアンドゲート23を通った後入力側エクスクルーシブオア回路24を通り、DESアルゴリズム回路25で暗号化される。暗号化されたデータの上位1ビットはセレクタ35の入力0に入力されると共に、入力端子41よりシリアルで入力された入力データ1ビットとエクスクルーシブオア回路36で排他的論理和をとり、暗号化データとして出力端子42より出力される。
【0049】
2ブロック目のIVデータは、1ブロック目のIVデータの下位63ビットが上位63ビットとなり、最下位ビットはセレクタ33を通った1回目の入力データとなってセレクタ30の入力4に入力され、このセレクタ30の出力が2ブロック目のIVデータとしてIVレジスタ31に設定される。2回目以降は以上の繰り返しとなる。
【0050】
図16は8ビットCFB暗号化モードを示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力される(セレクタ30が入力0を出力し、セレクタ32が入力1を出力し、セレクタ29が入力1を出力し、セレクタ28が入力0を出力し、他のセレクタ出力はドントケア(”X”))と、データの流れは同図(B)に太線で示す通りに制御される。
【0051】
すなわち、IVレジスタ31にIVデータを設定(第11図参照)し、1ブロック目のIVデータはアンドゲート23を通った後入力側エクスクルーシブオア回路24を通り、DESアルゴリズム回路25で暗号化される。そして、入力レジスタ21でラッチされてセレクタ32を通った1ブロック目の入力データと出力側エクスクルーシブオア回路26で排他的論理和をとり、1ブロック目の暗号化データとして出力レジスタ27でラッチされる。
【0052】
同時に、暗号化データの上位16ビットはセレクタ28の入力0に入力されてセレクタ28より出力される。この出力の上位8ビットが2ブロック目のIVデータの下位8ビットに、また、1ブロック目のIVデータの下位56ビットが2ブロック目のIVデータの上位56ビットとなってセレクタ29の入力1に入力されてセレクタ29より出力される。セレクタ29からの出力データはセレクタ30の入力0に入力され、セレクタ30より出力される。セレクタ30からの出力データはIVレジスタ31に2ブロック目のIVデータとして設定される。2回目以降は以上の繰り返しとなる。
【0053】
図17は8ビットCFB復号化モードを示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力される(セレクタ30が入力0を出力し、セレクタ32が入力1を出力し、セレクタ29が入力1を出力し、セレクタ28が入力1を出力し、他のセレクタ出力はドントケア(”X”))と、データの流れは同図(B)に太線で示す通りに制御される。
【0054】
すなわち、IVレジスタ31にIVデータを設定(第11図参照)し、1ブロック目のIVデータはアンドゲート23を通った後入力側エクスクルーシブオア回路24を通り、DESアルゴリズム回路25で復号化される。そして、入力レジスタ21でラッチされてセレクタ32を通った1ブロック目の入力データと出力側エクスクルーシブオア回路26で排他的論理和をとり、1ブロック目の復号化データとして出力レジスタ27でラッチされる。
【0055】
同時に、1ブロック目の入力データの上位16ビットはセレクタ28の入力1に入力されてセレクタ28より出力される。この出力の上位8ビットが2ブロック目のIVデータの下位8ビットに、また、1ブロック目のIVデータの下位56ビットが2ブロック目のIVデータの上位56ビットとなってセレクタ29の入力1に入力されてセレクタ29より出力される。セレクタ29からの出力データはセレクタ30の入力0に入力され、セレクタ30より出力される。セレクタ30からの出力データはIVレジスタ31に2ブロック目のIVデータとして設定される。2回目以降は以上の繰り返しとなる。
【0056】
図18は16ビットCFB暗号化モードを示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力される(セレクタ30が入力0を出力し、セレクタ32が入力1を出力し、セレクタ29が入力0を出力し、セレクタ28が入力0を出力し、他のセレクタ出力はドントケア(”X”))と、データの流れは同図(B)に太線で示す通りに制御される。
【0057】
すなわち、IVレジスタ31にIVデータを設定(第11図参照)し、1ブロック目のIVデータはアンドゲート23を通った後入力側エクスクルーシブオア回路24を通り、DESアルゴリズム回路25で暗号化される。そして、入力レジスタ21でラッチされてセレクタ32を通った1ブロック目の入力データと出力側エクスクルーシブオア回路26で排他的論理和をとり、1ブロック目の暗号化データとして出力レジスタ27でラッチされる。
【0058】
同時に、暗号化データの上位16ビットはセレクタ28の入力0に入力されてセレクタ28より出力される。この出力の上位16ビットが2ブロック目のIVデータの下位16ビットに、また、1ブロック目のIVデータの下位48ビットが2ブロック目のIVデータの上位48ビットとなってセレクタ29の入力0に入力されてセレクタ29より出力される。セレクタ29からの出力データはセレクタ30の入力0に入力され、セレクタ30より出力される。セレクタ30からの出力データはIVレジスタ31に2ブロック目のIVデータとして設定される。2回目以降は以上の繰り返しとなる。
【0059】
図19は16ビットCFB復号化モードを示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力される(セレクタ30が入力0を出力し、セレクタ32が入力1を出力し、セレクタ29が入力0を出力し、セレクタ28が入力1を出力し、他のセレクタ出力はドントケア(”X”))と、データの流れは同図(B)に太線で示す通りに制御される。
【0060】
すなわち、IVレジスタ31にIVデータを設定(第11図参照)し、1ブロック目のIVデータはアンドゲート23を通った後入力側エクスクルーシブオア回路24を通り、DESアルゴリズム回路25で復号化される。そして、入力レジスタ21でラッチされてセレクタ32を通った1ブロック目の入力データと出力側エクスクルーシブオア回路26で排他的論理和をとり、1ブロック目の復号化データとして出力レジスタ27でラッチされる。
【0061】
同時に、1ブロック目の入力データの上位16ビットはセレクタ28の入力1に入力されてセレクタ28より出力される。この出力の上位16ビットが2ブロック目のIVデータの下位16ビットに、また、1ブロック目のIVデータの下位48ビットが2ブロック目のIVデータの上位48ビットとなってセレクタ29の入力0に入力されてセレクタ29より出力される。セレクタ29からの出力データはセレクタ30の入力0に入力され、セレクタ30より出力される。セレクタ30からの出力データはIVレジスタ31に2ブロック目のIVデータとして設定される。2回目以降は以上の繰り返しとなる。
【0062】
図20は1ビットOFB(Output Feed Back)モードを示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力される(セレクタ30が入力3を出力し、セレクタ35が入力0を出力し、他のセレクタ出力はドントケア(”X”))と、データの流れは暗号化、復号化共に同図(B)に太線で示す通りに制御される。
【0063】
すなわち、IVレジスタ31にIVデータを設定(第11図参照)し、1ブロック目のIVデータはアンドゲート23を通った後入力側エクスクルーシブオア回路24を通り、DESアルゴリズム回路25で暗号化される。暗号化データの上位1ビットはセレクタ35の入力0に入力されてセレクタ35より出力され、エクスクルーシブオア回路36の一方の入力に入力される。そして、シリアル入力端子41からエクスクルーシブオア回路36のもう一方の入力に入力される入力データ1ビットとエクスクルーシブオア回路36で排他的論理和をとり、暗号化(復号化)データとしてシリアル出力端子42より出力される。
【0064】
2ブロック目のIVデータは、1ブロック目のIVデータの下位63ビットが上位63ビットとなり、最下位ビットはDESアルゴリズム回路25の出力データの最上位ビットとなり、セレクタ30の入力3に入力されてセレクタ30より出力される。そして、セレクタ30からの出力が2ブロック目のIVデータとしてIVレジスタ31に設定される。2回目以降は以上の繰り返しとなる。
【0065】
図21は64ビットOFBモード シリアルインタフェースを示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力される(セレクタ30が入力1を出力し、セレクタ35が入力1を出力し、他のセレクタ出力はドントケア(”X”))と、データの流れは暗号化、復号化共に同図(B)に太線で示す通りに制御される。
【0066】
すなわち、IVレジスタ31にIVデータを設定(第11図参照)し、1ブロック目のIVデータはアンドゲート23を通った後入力側エクスクルーシブオア回路24を通り、DESアルゴリズム回路25で暗号化される。暗号化データ64ビットはパラレル・シリアル変換回路34でシリアルデータに変換された後、セレクタ35の入力1に入力されてセレクタ35より出力される。
【0067】
そして、セレクタ35からの出力データとシリアル入力端子41から入力された64ビットのデータを、エクスクルーシブオア回路36で1ビットずつ排他的論理和をとり、シリアルで64ビット単位で暗号化(復号化)データとしてシリアル出力端子42より出力する。
【0068】
また、DESアルゴリズム回路25からの出力データはセレクタ30の入力1に入力されてセレクタ30より出力され、セレクタ30からの出力データは2ブロック目のIVデータとしてIVレジスタ31に設定される。2回目以降は以上の繰り返しとなる。
【0069】
図22は64ビットOFBモード パラレルインタフェースを示す図である。同図(A)に示す如く各アンドゲート22,23がゲートされ、各セレクタ28,29,30,32,33,35からの出力が出力される(セレクタ30が入力1を出力し、セレクタ32が入力1を出力し、他のセレクタ出力はドントケア(”X”))と、データの流れは暗号化、復号化共に同図(B)に太線で示す通りに制御される。
【0070】
すなわち、IVレジスタ31にIVデータを設定(第11図参照)し、1ブロック目のIVデータはアンドゲート23を通った後入力側エクスクルーシブオア回路24を通り、DESアルゴリズム回路25で暗号化される。DESアルゴリズム回路25からの出力暗号化データは、入力レジスタ21でラッチされセレクタ32より選択出力された1ブロック目の入力データと出力側エクスクルーシブオア回路26で排他的論理和をとり、暗号化(復号化)データとして出力レジスタによりラッチされる。
【0071】
また、DESアルゴリズム回路25からの出力データはセレクタ30の入力1に入力されてセレクタ30より出力され、セレクタ30からの出力データは2ブロック目のIVデータとしてIVレジスタ31に設定される。2回目以降は以上の繰り返しとなる。
【0072】
このように本実施例によれば、各々のDES操作モードで共通する機能を共用化することにより、従来回路では64ビット×5=320個必要であったエクスクルーシブオア回路を、64ビット×2=128個で暗号演算回路を構成することができる。また、64ビットのシフトレジスタが5個必要であったものが64ビットのレジスタ1個でよく、64ビットの5入力セレクタが2個必要であったものが1乃至数個のセレクタで回路を構成可能となった。
【0073】
したがって、従来回路と同等の機能を持たせてLSI化することを考慮した場合、回路規模を大幅に削減して小型化することが可能である。また、データのフィードバック時の遅延時間が、フィードバック量にかかわらず1クロックとなることにより、データのフィードバックが必要なCBCモード、CFBモード、OFBモードでは、フィードバック量にかかわらず暗号処理時間を短縮することができる。
【0074】
【発明の効果】
上述の如く本発明によれば、第1のゲート信号G1及び第2のゲート信号G2及び第3のゲート信号G3に応じて第1のゲート手段2及び第2のゲート手段4及び第3のゲート手段7からの出力データがゲートされ、且つ、第1のセレクタと第2のセレクタの出力データが選択されることでデータの流れが制御され、ECBモード、CBCモード、CFBモード、及びOFBモードの各モードで回路が共用化されて動作するため、回路規模を従来よりも大幅に縮小することできて、LSI化すれば小型のLSIが得られる特長がある。
【図面の簡単な説明】
【図1】本発明の原理構成図である。
【図2】ECBモードの暗号化及び復号化処理を示す図である。
【図3】CBCモードの暗号化処理を示す図である。
【図4】CBCモードの復号化処理を示す図である。
【図5】kビットCFBモードの暗号化処理を示す図である。
【図6】kビットCFBモードの復号化処理を示す図である。
【図7】OFBモードの暗号化及び復号化処理を示す図である。
【図8】本発明の一実施例の構成図である。
【図9】入出力モードと操作モードの関係を示す図である。
【図10】ECBモードを示す図である。
【図11】IV設定を示す図である。
【図12】CBC暗号化モードを示す図である。
【図13】CBC復号化モードを示す図である。
【図14】1ビットCFB暗号化モードを示す図である。
【図15】1ビットCFB復号化モードを示す図である。
【図16】8ビットCFB暗号化モードを示す図である。
【図17】8ビットCFB復号化モードを示す図である。
【図18】16ビットCFB暗号化モードを示す図である。
【図19】
16ビットCFB復号化モードを示す図である。
【図20】
1ビットOFBモードを示す図である。
【図21】
64ビットOFBモード シリアルインタフェースを示す図である。
【図22】
64ビットOFBモード パラレルインタフェースを示す図である。
【図23】
従来の暗号演算回路の一例を示す図である。
【図24】
CBC暗号化回路を示す図である。
【図25】
CBC復号化回路を示す図である。
【図26】
CFB暗号化回路を示す図である。
【図27】
CFB復号化回路を示す図である。
【図28】
OFB暗号化・復号化回路を示す図である。
【符号の説明】
1,21 入力レジスタ
8,27 出力レジスタ
22,23,37 アンドゲート
24 入力側エクスクルーシブオア回路
25 DESアルゴリズム回路
26 出力側エクスクルーシブオア回路
28,29,30,32 セレクタ
31 IVレジスタ
[0001]
[Industrial applications]
The present invention relates to a cryptographic operation circuit, and more particularly to a cryptographic operation circuit that encrypts and decrypts data in a plurality of modes.
[0002]
There are many operation modes for encrypting and decrypting data by cryptographic operation, and standardization has been completed (JIS X5052-1990: "Usage mode of 64-bit block cipher algorithm"). The user selects and uses an appropriate processing mode according to the applied application. In order to respond to such a wide range of users, it is desired that the operation mode be generalized with a common circuit and the circuit scale be minimized. Further, it is desired that the operation time is the shortest.
[0003]
[Prior art]
FIG. 23 is a diagram showing a configuration of an example of a conventional cryptographic operation circuit.
[0004]
23 includes an input register 101, a CBC encryption circuit 102, a CBC decryption circuit 103, a CFB encryption circuit 104, a CFB decryption circuit 105, an OFB circuit 106, and five inputs. , A cryptographic processing circuit 108, a five-input selector 109, and an output register 110.
[0005]
The CBC encryption circuit 102, the CBC decryption circuit 103, the CFB encryption circuit 104, the CFB decryption circuit 105, and the OFB encryption decryption circuit 106 are connected in parallel. By switching the selectors 107 and 109, the CBC mode , CFB mode, and OFB mode.
[0006]
The CBC encryption circuit 102 includes a register 111 and an exclusive OR circuit 112, as shown in FIG. The CBC decoding circuit 103 includes a register 113 and an exclusive OR circuit 114, as shown in FIG.
[0007]
The CFB encryption circuit 104 includes a shift register 115 and an exclusive OR circuit 116, as shown in FIG. The CFB decoding circuit 105 includes a shift register 117 and an exclusive OR circuit 118, as shown in FIG. The OFB encryption / decryption circuit 106 includes a shift register 119 and an exclusive OR circuit 120, as shown in FIG.
[0008]
[Problems to be solved by the invention]
The above-described conventional cryptographic operation circuit has a configuration in which a dedicated circuit is switched by a selector for one operation mode, so that when a large number of operation modes are required, two multi-input selectors are required. There is a problem that the registers (shift registers) required and included in each circuit are large-scale circuits because the circuit scale is large.
[0009]
Further, when k-bit feedback of data is required in the k-bit CFB mode or the k-bit OFB mode, it is necessary to input k clocks in order to feed back n bits because a shift register is used for data feedback. is there. For this reason, there has been a problem that as k increases, the time required for feedback increases, and the delay time for encryption processing increases.
[0010]
Therefore, an object of the present invention is to provide a cryptographic operation circuit that solves the above-mentioned problems.
[0011]
[Means for Solving the Problems]
In order to solve the above problem, the present invention is configured as shown in the principle diagram of FIG.
[0012]
That is, an input register 1 in which input data is stored, first gate means 2 for gating data from the input register 1 in accordance with a first gate signal G1, and outputting the same, Second gate means 4 for gating the first data in accordance with the second gate signal G2 and outputting the gated data; One input is supplied with output data from the first gate means, On the other hand, the output data from the second gate means 4 is supplied, and the exclusive output of the output data from the first gate means 2 and the output data from the second gate means 4 is output. A first exclusive OR circuit 3, an encryption processing unit 5 for performing encryption processing on output data from the first exclusive OR circuit 3, Third gating means 7 for gating and outputting the second data according to the third gate signal G3; Output data from the encryption processing means 5 is supplied to one input, The other input is supplied with the output data from the third gate means 7, and outputs an exclusive OR of the output data from the encryption processing means 5 and the output data from the third gate means 7. A second exclusive OR circuit 6, an output register 8 for storing output data from the second exclusive OR circuit 6, data from the input register 1, data from the encryption processing means 5, and a second exclusive OR circuit. A first selector 9 for selecting and outputting data from the circuit 6 or one of the first data, and a storage unit for temporarily storing output data from the first selector 9 and outputting the data as first data 10 and a second selector 11 for selecting and outputting any of the data from the storage means 10 and the data from the input register 1 as the second data.
[0013]
[Action]
According to the present invention having the above-described configuration, the first gate means 2, the second gate means 4, and the third gate are controlled in accordance with the first gate signal G1, the second gate signal G2, and the third gate signal G3. The data flow is controlled by the output data from the means 7 being gated and the output data of the first selector and the second selector being selected, and the data flow of the ECB mode, CBC mode, CFB mode, and OFB mode is controlled. In each mode, the circuit operates so as to be shared.
[0014]
That is, the first gate signal G1 is at a high level (1), the second gate signal G2 is at a low level (0), and the third gate signal G3 is at a low level (0). 2 is controlled as shown by the thick line. Therefore, the ECB mode encryption and decryption processing is performed.
[0015]
The data flow is shown by setting the first gate signal G1 to high level (1), the second gate signal G2 to high level (1), and the third gate signal G3 to low level (0). 3 is controlled as shown by the thick line. Therefore, encryption processing in the CBC mode is performed.
[0016]
The data flow is shown by setting the first gate signal G1 to high level (1), the second gate signal G2 to low level (0), and the third gate signal G3 to high level (1). 4 is controlled as indicated by the thick line. Therefore, decoding processing in the CBC mode is performed.
[0017]
Further, the first gate signal G1 is set to a low level (0), the second gate signal G2 is set to a high level (1), and the third gate signal G3 is set to a high level (1). By outputting the lower k bits from the first selector 9, the data flow is controlled as shown by the thick line in FIG. Therefore, encryption processing in the k-bit CFB mode is performed.
[0018]
Further, the first gate signal G1 is set to low level (0), the second gate signal G2 is set to high level (1), and the third gate signal G3 is set to high level (1). By outputting the data from the first selector 9, the data flow is controlled as shown by the thick line in FIG. Therefore, decoding processing in the k-bit CFB mode is performed.
[0019]
The selection of k bits is performed by the k-bit width selection of the first selector 9, and a high-speed feedback is possible because no shift register is used.
[0020]
Then, the first gate signal G1 is set to low level (0), the second gate signal G2 is set to high level (1), and the third gate signal G3 is set to high level (1). Is output from the first selector 9, the data flow is controlled as shown by the thick line in FIG. Therefore, encryption and decryption processing in the OFB mode is performed.
[0021]
Next, an embodiment of the present invention will be described with reference to the drawings. FIG. 8 is a block diagram of one embodiment of the present invention, which is implemented as an LSI.
[0022]
In this embodiment, the block length is a 64-bit U.S. standard encryption DES (Data Encryption Standard, FIPS 46, 1977), and the mode processing is ECB mode, CBC mode, 1-bit CFB mode, 8-bit CFB mode, 16-bit CFB mode. Mode, 1-bit OFB mode, and 64-bit OFB mode are realized.
[0023]
The data input / output mode has a parallel interface and a serial interface. The relationship between the input / output mode and the operation mode is shown in FIG.
[0024]
That is, the parallel interface can process ECB mode, CBC mode, 8-bit CFB mode, 16-bit CFB mode, 64-bit OFB mode, and IV (Initial Vector) setting, and serial interface can process 1-bit CFB mode and 1-bit OFB. Mode, 64-bit OFB mode, and IV setting can be processed.
[0025]
Referring back to FIG. 8, reference numeral 21 denotes an input register in which input data is temporarily stored. Reference numeral 22 denotes an AND gate which is a first gate means for passing data from the input register 21 through the gate when the first gate signal G1 becomes high level in the ECB mode or the CBC mode.
[0026]
Reference numeral 23 denotes a storage means in which the second gate signal G2 is at a high level in the CBC encryption mode, the 1-bit CFB mode, the 8-bit CFB mode, the 16-bit CFB mode, the 1-bit OFB mode, and the 64-bit OFB mode. An AND gate, which is a second gate means for passing the IV data as the first data from the IV register 31 through the gate, is provided.
[0027]
The output of the AND gate 22 and the output of the AND gate 23 are input to an input-side exclusive OR circuit 24 that is a first exclusive OR circuit. Reference numeral 25 denotes a DES algorithm circuit that performs a DES operation. The output of the DES algorithm circuit 25 is input to one input of an output-side exclusive OR circuit 26 which is a second exclusive OR circuit. An output register 27 temporarily stores output data from the output-side exclusive OR circuit 26.
[0028]
28 selects feedback data (input 0) in the 8-bit CFB encryption mode or 16-bit CFB encryption mode, or feedback data (input 1) in the 8-bit CFB decryption mode or 16-bit CFB decryption mode. Is a two-input selector that outputs the data. A two-input selector 29 selects and outputs feedback data (input 0) in the 16-bit CFB mode or feedback data (input 1) in the 8-bit CFB mode.
[0029]
Reference numeral 30 denotes feedback data (input 0) in the 8-bit CFB mode or 16-bit CFB mode, feedback data (input 1) in the CBC encryption / 64-bit OFB mode, or feedback data / IV setting in the CBC decryption mode. This is a 5-input selector that selects and outputs IV data at the time (input 2), feedback data in the 1-bit OFB mode (input 3), or feedback data in the 1-bit CFB mode (input 4). The selectors 28, 29 and 30 constitute a first selector.
[0030]
An IV register 31 temporarily stores IV data. Reference numeral 32 denotes two inputs for selecting and outputting feedback data (input 0) in the CBC decoding mode or feedback data (input 1) in the 64-bit OFB mode (parallel input), the 8-bit CFB mode, and the 16-bit CFB mode. It is a selector and corresponds to a second selector.
[0031]
A two-input selector 33 selects and outputs feedback data (input 0) in the 1-bit CFB decryption mode or feedback data (input 1) in the 1-bit CFB encryption mode.
[0032]
Reference numeral 34 denotes a parallel-serial conversion circuit for converting output data (DES operation result) of the IV register 31 at the time of the serial interface in the 64-bit OFB mode from 64-bit parallel data to serial data. Reference numeral 35 selects and outputs DES operation result data (input 0) in the 1-bit OFB mode, 1-bit CFB mode serial interface, or DES operation result data in the 64-bit OFB mode serial interface (input 1). It is a two-input selector.
[0033]
36 is an exclusive OR circuit. Reference numeral 37 denotes an AND gate which gates the output data from the selector 32 by passing the third gate signal G3 at a high level in the CBC decoding, the 8-bit CFB mode, the 16-bit CFB mode, and the 64-bit OFB mode. 41 is a serial input terminal and 42 is a serial output terminal.
[0034]
FIG. 10 is a diagram showing an ECB (Electric Code Book) mode. As shown in FIG. 3A, the AND gates 22 and 23 are gated, and the outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the output of the selector 32 is turned off and the output of the other selectors is turned off). Is don't care ("X")), and the data flow is controlled as shown by the thick line in FIG.
[0035]
That is, one block (64 bits) of data input to the input register 21 passes through the AND gate 22 and then passes through the input-side exclusive OR circuit 24, and is encrypted (decrypted) by the DES algorithm circuit 25 and then output-side. The data is latched by the output register 27 through the exclusive OR circuit 26.
[0036]
FIG. 11 is a diagram showing the IV setting. As shown in FIG. 3A, the AND gates 22 and 23 are gated, and outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the selector 30 outputs the input 2 and the other selector outputs Is done ("X")), the data flow is controlled as shown by the thick line in FIG.
[0037]
When performing encryption (decryption) in the CBC mode, the CFB mode, and the OFB mode, it is necessary to first set the IV as follows. That is, the IV data (64 bits) latched by the input register 21 is input to the input 0 of the selector 30 and set in the IV register 31.
[0038]
FIG. 12 is a diagram showing a CBC (Cipher Block Chaining) encryption mode. As shown in FIG. 3A, the AND gates 22 and 23 are gated, and outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the selector 30 outputs the input 1 and the selector 32 Is turned off, the other selector outputs are don't care ("X"), and the data flow is controlled as shown by the thick line in FIG.
[0039]
That is, the IV data is set in the IV register 31 (see FIG. 11), and the data of the first block latched by the input register 21 is input to the input-side exclusive OR circuit 24 after passing through the AND gate 22. The IV data set in the IV register 31 is input to the other input of the input-side exclusive OR circuit 24. Data obtained by performing an exclusive OR operation on the IV data and the input data is encrypted by the DES algorithm circuit 25. Is done.
[0040]
The encrypted output data passes through the output-side exclusive OR circuit 26 and is latched by the output register 27 as the first block of encrypted data, and is also input to the input 1 of the selector 30 and output from the selector 30. Is set to The input data of the second block is exclusive-ORed with the encrypted data of the first block set in the IV register 31 by the input-side exclusive OR circuit 24 and encrypted. The above-mentioned operation is repeated for the data after the second block.
[0041]
FIG. 13 is a diagram showing the CBC decoding mode. As shown in FIG. 2A, the AND gates 22 and 23 are gated, and outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the selector 30 outputs the input 2 and the selector 32 Outputs an input 0, the other selector outputs are don't care ("X"), and the data flow is controlled as shown by the thick line in FIG.
[0042]
That is, the IV data is set in the IV register 31 (see FIG. 11), and the data of the first block latched by the input register 21 passes through the AND gate 22, passes through the exclusive OR circuit 24 on the input side, and the DES algorithm circuit 25 and input to input 2 of selector 30. The data decoded by the DES algorithm circuit 25 is exclusive-ORed with the IV data set in the IV register 31 by the output-side exclusive OR circuit 26 and latched by the output register 27.
[0043]
At this point, the input data of the first block is set in the IV register 31 from the selector 30. In the decoding of the input data of the second and subsequent blocks, the data is decoded by the DES algorithm circuit 25 and then exclusive-ORed with the input data of the previous block to obtain decoded data.
[0044]
FIG. 14 is a diagram showing a 1-bit CFB (Cipher Feed Back) encryption mode. As shown in FIG. 3A, the AND gates 22 and 23 are gated, and outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the selector 30 outputs the input 4 and the selector 33 Outputs an input 0, the selector 35 outputs an input 1, the other selector outputs are don't care ("X"), and the data flow is controlled as shown by the thick line in FIG.
[0045]
That is, IV data is set in the IV register 31 (see FIG. 11), and the IV data of the first block passes through the AND gate 23, passes through the exclusive OR circuit 24 on the input side, and is encrypted by the DES algorithm circuit 25. . The upper 1 bit of the encrypted data is input to the input 0 of the selector 35, and the exclusive OR circuit 36 performs an exclusive OR operation with the input data 1 bit serially input from the input terminal 41 to obtain the encrypted data. Is output from the output terminal 42.
[0046]
In the IV data of the second block, the lower 63 bits of the IV data of the first block become the upper 63 bits, and the least significant bit becomes the first encrypted data that has passed through the selector 33 and is input to the input 4 of the selector 30. The output of the selector 30 is set in the IV register 31 as IV data of the second block. The above is repeated from the second time.
[0047]
FIG. 15 shows the 1-bit CFB decoding mode. As shown in FIG. 3A, the AND gates 22 and 23 are gated, and outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the selector 30 outputs the input 4 and the selector 33 Outputs the input 0, the selector 35 outputs the input 0, the other selector outputs are don't care ("X"), and the data flow is controlled as shown by the thick line in FIG.
[0048]
That is, IV data is set in the IV register 31 (see FIG. 11), and the IV data of the first block passes through the AND gate 23, passes through the exclusive OR circuit 24 on the input side, and is encrypted by the DES algorithm circuit 25. . The upper 1 bit of the encrypted data is input to the input 0 of the selector 35, and the exclusive OR circuit 36 performs an exclusive OR operation with the input data 1 bit serially input from the input terminal 41 to obtain the encrypted data. Is output from the output terminal 42.
[0049]
In the IV data of the second block, the lower 63 bits of the IV data of the first block become the upper 63 bits, and the least significant bit becomes the first input data passing through the selector 33 and is inputted to the input 4 of the selector 30. The output of the selector 30 is set in the IV register 31 as IV data of the second block. The above is repeated from the second time.
[0050]
FIG. 16 shows the 8-bit CFB encryption mode. As shown in FIG. 2A, the AND gates 22 and 23 are gated, and outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the selector 30 outputs the input 0 and the selector 32 Outputs the input 1, the selector 29 outputs the input 1, the selector 28 outputs the input 0, the other selector outputs are don't care ("X"), and the data flow is shown by a thick line in FIG. Is controlled as shown by.
[0051]
That is, IV data is set in the IV register 31 (see FIG. 11), and the IV data of the first block passes through the AND gate 23, passes through the exclusive OR circuit 24 on the input side, and is encrypted by the DES algorithm circuit 25. . Then, the exclusive OR of the input data of the first block, which has been latched by the input register 21 and passed through the selector 32, and the output-side exclusive OR circuit 26, are latched by the output register 27 as encrypted data of the first block. .
[0052]
At the same time, the upper 16 bits of the encrypted data are input to the input 0 of the selector 28 and output from the selector 28. The upper 8 bits of this output become the lower 8 bits of the IV data of the second block, and the lower 56 bits of the IV data of the first block become the upper 56 bits of the IV data of the second block, and the input 1 of the selector 29 becomes And output from the selector 29. Output data from the selector 29 is input to the input 0 of the selector 30 and output from the selector 30. Output data from the selector 30 is set in the IV register 31 as IV data of the second block. The above is repeated from the second time.
[0053]
FIG. 17 is a diagram showing the 8-bit CFB decoding mode. As shown in FIG. 2A, the AND gates 22 and 23 are gated, and outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the selector 30 outputs the input 0 and the selector 32 Outputs the input 1, the selector 29 outputs the input 1, the selector 28 outputs the input 1, the other selector outputs are don't care ("X"), and the data flow is shown by a thick line in FIG. Is controlled as shown by.
[0054]
That is, IV data is set in the IV register 31 (see FIG. 11), and the IV data of the first block passes through the AND gate 23, passes through the exclusive OR circuit 24 on the input side, and is decoded by the DES algorithm circuit 25. . Then, the exclusive OR of the input data of the first block, which has been latched by the input register 21 and passed through the selector 32, and the output-side exclusive OR circuit 26 are taken and latched by the output register 27 as decoded data of the first block. .
[0055]
At the same time, the upper 16 bits of the input data of the first block are input to the input 1 of the selector 28 and output from the selector 28. The upper 8 bits of this output become the lower 8 bits of the IV data of the second block, and the lower 56 bits of the IV data of the first block become the upper 56 bits of the IV data of the second block, and the input 1 of the selector 29 becomes And output from the selector 29. Output data from the selector 29 is input to the input 0 of the selector 30 and output from the selector 30. Output data from the selector 30 is set in the IV register 31 as IV data of the second block. The above is repeated from the second time.
[0056]
FIG. 18 shows the 16-bit CFB encryption mode. As shown in FIG. 2A, the AND gates 22 and 23 are gated, and outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the selector 30 outputs the input 0 and the selector 32 Outputs the input 1, the selector 29 outputs the input 0, the selector 28 outputs the input 0, the other selector outputs are don't care ("X"), and the data flow is shown by a bold line in FIG. Is controlled as shown by.
[0057]
That is, IV data is set in the IV register 31 (see FIG. 11), and the IV data of the first block passes through the AND gate 23, passes through the exclusive OR circuit 24 on the input side, and is encrypted by the DES algorithm circuit 25. . Then, the exclusive OR of the input data of the first block, which has been latched by the input register 21 and passed through the selector 32, and the output-side exclusive OR circuit 26, are latched by the output register 27 as encrypted data of the first block. .
[0058]
At the same time, the upper 16 bits of the encrypted data are input to the input 0 of the selector 28 and output from the selector 28. The upper 16 bits of this output become the lower 16 bits of the IV data of the second block, the lower 48 bits of the IV data of the first block become the upper 48 bits of the IV data of the second block, and the input 0 of the selector 29 becomes And output from the selector 29. Output data from the selector 29 is input to the input 0 of the selector 30 and output from the selector 30. Output data from the selector 30 is set in the IV register 31 as IV data of the second block. The above is repeated from the second time.
[0059]
FIG. 19 shows the 16-bit CFB decoding mode. As shown in FIG. 2A, the AND gates 22 and 23 are gated, and outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the selector 30 outputs the input 0 and the selector 32 Outputs the input 1, the selector 29 outputs the input 0, the selector 28 outputs the input 1, the other selector outputs are don't care ("X"), and the data flow is shown by a bold line in FIG. Is controlled as shown by.
[0060]
That is, IV data is set in the IV register 31 (see FIG. 11), and the IV data of the first block passes through the AND gate 23, passes through the exclusive OR circuit 24 on the input side, and is decoded by the DES algorithm circuit 25. . Then, the exclusive OR of the input data of the first block, which has been latched by the input register 21 and passed through the selector 32, and the output-side exclusive OR circuit 26 are taken and latched by the output register 27 as decoded data of the first block. .
[0061]
At the same time, the upper 16 bits of the input data of the first block are input to the input 1 of the selector 28 and output from the selector 28. The upper 16 bits of this output become the lower 16 bits of the IV data of the second block, the lower 48 bits of the IV data of the first block become the upper 48 bits of the IV data of the second block, and the input 0 of the selector 29 becomes And output from the selector 29. Output data from the selector 29 is input to the input 0 of the selector 30 and output from the selector 30. Output data from the selector 30 is set in the IV register 31 as IV data of the second block. The above is repeated from the second time.
[0062]
FIG. 20 shows a 1-bit OFB (Output Feed Back) mode. As shown in FIG. 3A, the AND gates 22 and 23 are gated, and outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the selector 30 outputs the input 3 and the selector 35 Outputs an input 0, the other selector outputs are don't care ("X")), and the data flow is controlled as indicated by the thick line in FIG.
[0063]
That is, IV data is set in the IV register 31 (see FIG. 11), and the IV data of the first block passes through the AND gate 23, passes through the exclusive OR circuit 24 on the input side, and is encrypted by the DES algorithm circuit 25. . The upper one bit of the encrypted data is input to the input 0 of the selector 35, output from the selector 35, and input to one input of the exclusive OR circuit 36. Then, the exclusive OR circuit 36 takes an exclusive OR with one bit of input data input from the serial input terminal 41 to the other input of the exclusive OR circuit 36, and outputs it as encrypted (decrypted) data from the serial output terminal 42. Is output.
[0064]
In the IV data of the second block, the lower 63 bits of the IV data of the first block become the upper 63 bits, the least significant bit becomes the most significant bit of the output data of the DES algorithm circuit 25, and is inputted to the input 3 of the selector 30. It is output from the selector 30. Then, the output from the selector 30 is set in the IV register 31 as IV data of the second block. The above is repeated from the second time.
[0065]
FIG. 21 shows a 64-bit OFB mode serial interface. As shown in FIG. 3A, the AND gates 22 and 23 are gated, and outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the selector 30 outputs the input 1 and the selector 35 Outputs an input 1, the other selector outputs are don't care ("X")), and the data flow is controlled as shown by the thick line in FIG.
[0066]
That is, IV data is set in the IV register 31 (see FIG. 11), and the IV data of the first block passes through the AND gate 23, passes through the exclusive OR circuit 24 on the input side, and is encrypted by the DES algorithm circuit 25. . The 64-bit encrypted data is converted into serial data by the parallel / serial conversion circuit 34, input to the input 1 of the selector 35, and output from the selector 35.
[0067]
The exclusive OR circuit 36 performs an exclusive OR operation on the output data from the selector 35 and the 64-bit data input from the serial input terminal 41 one bit at a time, and serially encrypts (decrypts) the data in 64-bit units. The data is output from the serial output terminal 42 as data.
[0068]
The output data from the DES algorithm circuit 25 is input to the input 1 of the selector 30 and output from the selector 30, and the output data from the selector 30 is set in the IV register 31 as IV data of the second block. The above is repeated from the second time.
[0069]
FIG. 22 is a diagram showing a 64-bit OFB mode parallel interface. As shown in FIG. 3A, the AND gates 22 and 23 are gated, and outputs from the selectors 28, 29, 30, 32, 33 and 35 are output (the selector 30 outputs the input 1 and the selector 32 Outputs an input 1, the other selector outputs are don't care ("X")), and the data flow is controlled as shown by the thick line in FIG.
[0070]
That is, IV data is set in the IV register 31 (see FIG. 11), and the IV data of the first block passes through the AND gate 23, passes through the exclusive OR circuit 24 on the input side, and is encrypted by the DES algorithm circuit 25. . The output encrypted data from the DES algorithm circuit 25 is exclusive-ORed by the output-side exclusive OR circuit 26 with the input data of the first block which is latched by the input register 21 and selected and output by the selector 32, and is encrypted (decrypted). ) Is latched by the output register as data.
[0071]
The output data from the DES algorithm circuit 25 is input to the input 1 of the selector 30 and output from the selector 30, and the output data from the selector 30 is set in the IV register 31 as IV data of the second block. The above is repeated from the second time.
[0072]
As described above, according to the present embodiment, the functions common to the respective DES operation modes are shared, so that the exclusive OR circuit which required 64 bits × 5 = 320 in the conventional circuit is changed to 64 bits × 2 = A cryptographic operation circuit can be composed of 128 pieces. In addition, a circuit that requires five 64-bit shift registers may be replaced by a single 64-bit register, and a circuit that requires two 64-bit 5-input selectors is composed of one or several selectors. It has become possible.
[0073]
Therefore, in consideration of providing an LSI with functions equivalent to those of the conventional circuit, it is possible to greatly reduce the circuit scale and downsize the circuit. In addition, since the delay time at the time of data feedback is one clock regardless of the feedback amount, in the CBC mode, CFB mode, and OFB mode that require data feedback, the encryption processing time is reduced regardless of the feedback amount. be able to.
[0074]
【The invention's effect】
As described above, according to the present invention, the first gate means 2, the second gate means 4, and the third gate signal are provided in accordance with the first gate signal G1, the second gate signal G2, and the third gate signal G3. The data flow is controlled by the output data from the means 7 being gated and the output data of the first selector and the second selector being selected, and the data flow in the ECB mode, CBC mode, CFB mode, and OFB mode is controlled. Since the circuit is shared and operates in each mode, the circuit scale can be significantly reduced as compared with the related art, and there is a feature that a small LSI can be obtained by forming an LSI.
[Brief description of the drawings]
FIG. 1 is a principle configuration diagram of the present invention.
FIG. 2 is a diagram showing encryption and decryption processing in an ECB mode.
FIG. 3 is a diagram showing an encryption process in a CBC mode.
FIG. 4 is a diagram illustrating a decoding process in a CBC mode.
FIG. 5 is a diagram illustrating an encryption process in a k-bit CFB mode.
FIG. 6 is a diagram illustrating a decoding process in a k-bit CFB mode.
FIG. 7 is a diagram showing encryption and decryption processing in OFB mode.
FIG. 8 is a configuration diagram of one embodiment of the present invention.
FIG. 9 is a diagram showing a relationship between an input / output mode and an operation mode.
FIG. 10 is a diagram showing an ECB mode.
FIG. 11 is a diagram showing an IV setting.
FIG. 12 is a diagram illustrating a CBC encryption mode.
FIG. 13 is a diagram illustrating a CBC decoding mode.
FIG. 14 is a diagram illustrating a 1-bit CFB encryption mode.
FIG. 15 is a diagram illustrating a 1-bit CFB decoding mode.
FIG. 16 illustrates an 8-bit CFB encryption mode.
FIG. 17 is a diagram illustrating an 8-bit CFB decoding mode.
FIG. 18 is a diagram illustrating a 16-bit CFB encryption mode.
FIG.
FIG. 18 is a diagram illustrating a 16-bit CFB decoding mode.
FIG.
FIG. 3 is a diagram illustrating a 1-bit OFB mode.
FIG. 21
FIG. 3 is a diagram illustrating a 64-bit OFB mode serial interface.
FIG.
It is a figure which shows a 64-bit OFB mode parallel interface.
FIG. 23
FIG. 14 is a diagram illustrating an example of a conventional cryptographic operation circuit.
FIG. 24
FIG. 3 is a diagram illustrating a CBC encryption circuit.
FIG. 25
It is a figure which shows a CBC decoding circuit.
FIG. 26
FIG. 3 is a diagram illustrating a CFB encryption circuit.
FIG. 27
It is a figure which shows a CFB decoding circuit.
FIG. 28
FIG. 3 is a diagram illustrating an OFB encryption / decryption circuit.
[Explanation of symbols]
1,21 input register
8,27 output register
22, 23, 37 AND gate
24 Exclusive OR circuit on input side
25 DES algorithm circuit
26 Output-side exclusive OR circuit
28, 29, 30, 32 selector
31 IV Register

Claims (2)

入力データが格納される入力レジスタと、
前記入力レジスタからのデータを第1のゲート信号に応じてゲートして出力する第1のゲート手段と、
第1のデータを第2のゲート信号に応じてゲートして出力する第2のゲート手段と、
一方の入力に前記第1のゲート手段からの出力データを供給され、他方に前記第2のゲート手段からの出力データを供給され、前記第1のゲート手段からの出力データと前記第2のゲート手段からの出力データとをエクスクルーシブオアしたデータを出力する第1のエクスクルーシブオア回路と、
前記第1のエクスクルーシブオア回路からの出力データに対して暗号処理を行う暗号処理手段と、
第2のデータを第3のゲート信号に応じてゲートして出力する第3のゲート手段と、
一方の入力に前記暗号処理手段からの出力データを供給され、他方の入力に前記第3のゲート手段からの出力データを供給され、前記暗号処理手段からの出力データと前記第3のゲート手段からの出力データとをエクスクルーシブオアしたデータを出力する第2のエクスクルーシブオア回路と、
前記第2のエクスクルーシブオア回路からの出力データを格納する出力レジスタと、
前記入力レジスタからのデータと、前記暗号処理手段からのデータと、前記第2のエクスクルーシブオア回路からのデータと、前記第1のデータのいずれかを選択出力する第1のセレクタと、
前記第1のセレクタからの出力データを一時的に格納し、前記第1のデータとして出力する格納手段と、
前記格納手段からのデータと、前記入力レジスタからのデータのいずれかを前記第2のデータとして選択出力する第2のセレクタと
を具備したことを特徴とする暗号演算回路。
An input register for storing input data;
A first gate means for outputting the gate the data from the input register in response to a first gate signal,
Second gate means for gating and outputting the first data in accordance with a second gate signal;
Is supplied with output data from said first gate means to one input is supplied with output data from said second gate means to the other, the output data from said first gate means and said second gate A first exclusive OR circuit for outputting data obtained by exclusive ORing the output data from the means ,
Encryption processing means for performing encryption processing on output data from the first exclusive OR circuit;
Third gating means for gating and outputting the second data according to a third gate signal;
Is supplied with output data from the encryption processing means to one input is supplied with output data from said third gate means to the other input, the output data and the third gate means from said encryption processing means A second exclusive OR circuit that outputs data obtained by exclusive ORing the output data of
An output register for storing the output data from said second exclusive OR circuit,
A first selector for selecting and outputting one of the data from the input register, the data from the encryption processing means, the data from the second exclusive OR circuit, and the first data;
Storage means for temporarily storing output data from the first selector and outputting the data as the first data;
A cryptographic operation circuit comprising: a second selector for selecting and outputting any of data from the storage means and data from the input register as the second data.
前記格納手段からのパラレル出力データをシリアルデータに変換するパラレル・シリアル変換回路と
前記暗号処理手段からの出力データと、前記パラレル・シリアル変換回路からの出力データのいずれかを選択出力する第3のセレクタと
前記第3のセレクタからの出力データと、ブロック暗号を入力される入力手段からの入力データとを入力される第3のエクスクルーシブオア回路と
前記第3のエクスクルーシブオア回路からの出力データと、前記入力手段からの入力データのいずれかを選択出力して前記第1のセレクタに供給する第4のセレクタと
を更に具備してなることを特徴とする請求項1記載の暗号演算回路。
And parallel-to-serial conversion circuits for converting the parallel output data of the storage hand stage or found in the serial data,
The output data from the encryption processing unit, and a third selector for selecting and outputting one of the output data of the parallel-to-serial conversion circuits or al,
Said third selector or et of the output data, and a third exclusive OR circuits inputted and an input hand stage or these input data input block cipher,
It said third exclusive OR circuits or these output data, a fourth selector to be supplied to the first selector selects outputs one of the input data of the input hand stage or al <br / The cryptographic operation circuit according to claim 1, further comprising:
JP05086394A 1994-03-22 1994-03-22 Cryptographic operation circuit Expired - Fee Related JP3547474B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP05086394A JP3547474B2 (en) 1994-03-22 1994-03-22 Cryptographic operation circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP05086394A JP3547474B2 (en) 1994-03-22 1994-03-22 Cryptographic operation circuit

Publications (2)

Publication Number Publication Date
JPH07261662A JPH07261662A (en) 1995-10-13
JP3547474B2 true JP3547474B2 (en) 2004-07-28

Family

ID=12870569

Family Applications (1)

Application Number Title Priority Date Filing Date
JP05086394A Expired - Fee Related JP3547474B2 (en) 1994-03-22 1994-03-22 Cryptographic operation circuit

Country Status (1)

Country Link
JP (1) JP3547474B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020087332A (en) * 2001-05-14 2002-11-22 최병윤 Modular ECB, CBC, CFB, and OFB Mode Circuit of Symmetric Key Encryption
KR100528890B1 (en) * 2002-06-26 2005-11-22 한국전자통신연구원 High-speed block cipher with multi-interfaces and method of operating the same
KR20050032588A (en) * 2002-08-08 2005-04-07 마츠시타 덴끼 산교 가부시키가이샤 Encrypting/decrypting device and method, encrypting device and method, decrypting device and method, and transmitting/receiving device
JP4461351B2 (en) * 2002-08-15 2010-05-12 ソニー株式会社 Non-contact IC card
KR100583635B1 (en) * 2003-01-24 2006-05-26 삼성전자주식회사 Cryptographic apparatus for supporting multiple modes
KR100749414B1 (en) * 2005-12-10 2007-08-14 한국전자통신연구원 Apparatus and method of encryption, and apparatus and method of decryption of mobile internet system
US8538012B2 (en) 2007-03-14 2013-09-17 Intel Corporation Performing AES encryption or decryption in multiple modes with a single instruction
JP5228803B2 (en) * 2008-10-30 2013-07-03 富士通セミコンダクター株式会社 Swap circuit in common key block cipher and encryption / decryption circuit having the same

Also Published As

Publication number Publication date
JPH07261662A (en) 1995-10-13

Similar Documents

Publication Publication Date Title
AU767323B2 (en) Block encryption device using auxiliary conversion
US5381480A (en) System for translating encrypted data
JP4128395B2 (en) Data converter
JP4025722B2 (en) Method and apparatus for data encryption
JP3547474B2 (en) Cryptographic operation circuit
JP3824121B2 (en) Method and apparatus for decrypting encrypted data
JP3769804B2 (en) Decoding method and electronic device
JPH11298471A (en) Method and device for enciphering block
WO2009090689A1 (en) Encoding device, encoding method and program
JP2000075785A (en) High-speed cipher processing circuit and processing method
JPH1152850A (en) Device and method for cipher conversion
KR100546777B1 (en) Apparatus and method for SEED Encryption/Decryption, and F function processor therefor
JP4230152B2 (en) Cryptographic circuit
Ali et al. Optimal datapath design for a cryptographic processor: the Blowfish algorithm
KR100498736B1 (en) Apparatus and method for polynomial multiply of block cipher
JPH11212451A (en) Criptographic device
KR20030087893A (en) Modular AES Rijndael Round Key Scheduler with On-the-Fly Computation Scheme of Round Key
JPS59167147A (en) Ciphering device
WO2002058037A1 (en) Cipher circuit
KR20010107089A (en) Encryption method and device using data encryption standard algorithm
JPH06102820A (en) Cyphering device
Lablans Modified Reversible Radix-n Machine Computations with Novel N-state Carry Functions: Applications in Cryptography
JPH06102821A (en) Cyphering device
JPH01234883A (en) Variable enciphering process control system
JPWO2002058037A1 (en) Cryptographic circuit

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040120

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040319

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040413

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040414

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080423

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090423

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20090423

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100423

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110423

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110423

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees