JP2001266103A - Ic card and microcomputer - Google Patents

Ic card and microcomputer

Info

Publication number
JP2001266103A
JP2001266103A JP2000323178A JP2000323178A JP2001266103A JP 2001266103 A JP2001266103 A JP 2001266103A JP 2000323178 A JP2000323178 A JP 2000323178A JP 2000323178 A JP2000323178 A JP 2000323178A JP 2001266103 A JP2001266103 A JP 2001266103A
Authority
JP
Japan
Prior art keywords
storage circuit
stored
result
modn
mod
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
Application number
JP2000323178A
Other languages
Japanese (ja)
Inventor
Chiaki Tanimoto
千晶 谷本
Kunihiko Nakada
邦彦 中田
Yuichiro Nariyoshi
雄一郎 成吉
Taku Tsukamoto
卓 塚元
Shigeo Hirabayashi
茂雄 平林
Hiroshi Watase
弘 渡瀬
雅聡 ▲高▼橋
Masaaki Takahashi
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.)
Hitachi Ltd
Hitachi Solutions Technology Ltd
Original Assignee
Hitachi Ltd
Hitachi ULSI Systems Co 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 Hitachi Ltd, Hitachi ULSI Systems Co Ltd filed Critical Hitachi Ltd
Priority to JP2000323178A priority Critical patent/JP2001266103A/en
Priority to TW090100141A priority patent/TW536672B/en
Priority to US09/754,190 priority patent/US6907526B2/en
Priority to US09/754,064 priority patent/US20010047480A1/en
Priority to KR1020010001133A priority patent/KR20010083099A/en
Publication of JP2001266103A publication Critical patent/JP2001266103A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an IC card and a microcomputer, which reinforce security and speed up and reinforce a signal processing for security. SOLUTION: In an IC card, an operation voltage is supplied by the electrical connection of an outer terminal with a read/write device and the input/output operation of data with a ciphering processing and a decoding processing is performed. A dummy processing operation aiming at disturbance is included in the ciphering processing or the decoding processing and the operation timing and the operation current of an inner circuit are unified. In the microcomputer of module constitution, which includes the input/output operation of data with the ciphering processing or the decoding processing, the dummy processing operation aiming at disturbance is included in the ciphering processing or the decoding processing and the operation timing and the operation current of the inner circuit are unified.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、ICカードとマ
イクロコンピュータに関し、特にICカードやプログラ
ム内蔵の1チップマイクロコンピュータのようなCPU
とメモリを含み暗号鍵を使ったデータ処理を行なうもの
の機密保護技術に利用して有効な技術に関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an IC card and a microcomputer, and more particularly, to a CPU such as an IC card and a one-chip microcomputer with a program.
The present invention relates to a technology that is effective for use in confidentiality protection technology, although it performs data processing using an encryption key including a memory and a memory.

【0002】[0002]

【従来の技術】メモリに保存されている鍵情報を用いて
データの暗号処理化又は復号化処理を行なうようにした
ICカードにおいて、処理時間の違いを利用して実行内
容や暗号鍵を推定するTA(Timing Attack )法のよう
なハッキング手法に対抗するため、暗号処理化又は復号
化処理の実行中又は実行の前後に、鍵情報の内容との時
間的な相関関係を喪失させる遅延処理を実行する技術の
例として、特開平10−69222号がある。また、I
Cカードに関しては、オーム社出版電子情報通信学会編
水沢順一著「ICカード」などがある。
2. Description of the Related Art In an IC card in which data is encrypted or decrypted using key information stored in a memory, an execution content and an encryption key are estimated using a difference in processing time. In order to counter hacking techniques such as the TA (Timing Attack) method, delay processing is performed during or before or after the execution of encryption or decryption processing to lose the temporal correlation with the contents of key information. Japanese Patent Application Laid-Open No. H10-69222 discloses an example of such a technique. Also, I
As for the C card, there is “IC card” written by Junichi Mizusawa, edited by Ohmsha Publishing Electronic Information Communication Society.

【0003】[0003]

【発明が解決しようとする課題】近年、ICカードが暗
号処理を行っている時の消費電流を観測して解析するこ
とにより、容易に暗号処理の内容や暗号鍵が推定される
ことの可能性が示唆されている。このことについては、
John Wiley & sons 社 W.Rankl & W. Effing著「Smart C
ard Handbook 」 の8.5.1.1 Passive protective mechan
isms( 263ページ) に記載されている。
In recent years, by observing and analyzing current consumption when an IC card is performing encryption processing, it is possible to easily estimate the contents of encryption processing and encryption keys. Has been suggested. For this,
John Wiley & sons W.Rankl & W. Effing's Smart C
ard Handbook '' 8.5.1.1 Passive protective mechan
It is described in isms (page 263).

【0004】つまり、SPA( Simple Power Analysi
s)法では、演算命令の違い、あるいは処理されている
データの違いにより生じる消費電流波形の違いから、暗
号鍵や処理されているデータを解析し、DPA(Differ
entia1 Power Analysis )法では、消費電流波形を統計
処理して暗号鍵を推定する。このDPA法では、例えば
DESのある部分に仮定した暗号鍵をあてはめて、平文
を変化させながら消費電流波形を測定して統計する。暗
号鍵を様々に変化させながらこの作業を繰り返し、正し
い鍵のときには電流波形が大きなピークを示す。
That is, SPA (Simple Power Analysi)
In the s) method, the encryption key and the data being processed are analyzed based on the difference in the current consumption waveform caused by the difference in the operation instruction or the data being processed, and the DPA (Differ
In the entia1 Power Analysis method, a current consumption waveform is statistically processed to estimate an encryption key. In the DPA method, for example, an assumed encryption key is applied to a certain portion of DES, and a current consumption waveform is measured and statistically changed while changing plain text. This operation is repeated while changing the encryption key in various ways, and when the key is correct, the current waveform shows a large peak.

【0005】前記公報に記載のようにTA(Timing Att
ack )法のみを考慮した遅延処理では、実際の演算によ
る消費電流の相関性までも喪失させることができず、上
記のような消費電流波形を観測するというSPA又はD
PA法のようなハッキング手法には対抗できない。そこ
で、本願発明者等においては、上記ICカード及びIC
カード等のようなモジュールに搭載されるマイクロコン
ピュータのように内蔵のプログラムにより一定のデータ
処理動作を行うものに対して上記のような消費電流の観
測による暗号処理の内容や暗号鍵の解読をより確実に防
止することができる機密保護技術を開発するに至った。
As described in the above publication, TA (Timing Att
ack) In the delay processing in which only the method is considered, even the correlation of the current consumption by the actual calculation cannot be lost, and the SPA or D of observing the current consumption waveform as described above is observed.
It cannot compete with hacking techniques such as the PA method. Therefore, the inventors of the present application disclose the above IC card and IC
For those that perform a certain data processing operation by a built-in program such as a microcomputer mounted on a module such as a card, etc., the contents of the encryption processing and the decryption of the encryption key by observing the above current consumption are improved We have developed security technology that can be reliably prevented.

【0006】この発明の目的は、機密保護の強化を実現
したICカードとマイクロコンピュータを提供すること
にある。この発明の他の目的は、機密保護のための信号
処理の高速化とその強化を実現したICカードとマイク
ロコンピュータを提供することにある。この発明の前記
ならびにそのほかの目的と新規な特徴は、本明細書の記
述および添付図面から明らかになるであろう。
An object of the present invention is to provide an IC card and a microcomputer that realize enhanced security. Another object of the present invention is to provide an IC card and a microcomputer which realize high-speed signal processing for security protection and its enhancement. The above and other objects and novel features of the present invention will become apparent from the description of the present specification and the accompanying drawings.

【0007】[0007]

【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば、下
記の通りである。すなわち、外部端子がリードライト装
置と電気的に接続されることによって動作電圧が供給さ
れ、かつ、暗号化処理又は復号化処理を伴ったデータの
入出力動作を含むICカードにおいて、上記暗号化処理
又は復号化処理に本来の処理動作に似た攪乱目的のダミ
ー処理動作を含ませて内部回路の動作タイミング及び動
作電流の画一化を行なうようにする。
The following is a brief description of an outline of a typical invention among the inventions disclosed in the present application. That is, in an IC card to which an operating voltage is supplied by an external terminal being electrically connected to a read / write device and which includes an input / output operation of data accompanied by an encryption process or a decryption process, Alternatively, the decoding process includes a dummy processing operation for the purpose of disturbance similar to the original processing operation, so that the operation timing and the operation current of the internal circuit are made uniform.

【0008】本願において開示される発明のうち他の代
表的なものの概要を簡単に説明すれば、下記の通りであ
る。すなわち、暗号化処理又は復号化処理を伴ったデー
タの入出力動作を含むモジュール構成のマイクロコンピ
ュータにおいて、上記暗号化処理又は復号化処理に本来
の処理動作に似た攪乱目的のダミー処理動作を含ませて
内部回路の動作タイミング及び動作電流の画一化を行な
うようにする。
[0008] The following is a brief description of the outline of another typical invention disclosed in the present application. That is, in a microcomputer having a module configuration including an input / output operation of data accompanied by an encryption process or a decryption process, the encryption process or the decryption process includes a dummy processing operation for the purpose of disturbance similar to the original processing operation. Instead, the operation timing and operation current of the internal circuit are made uniform.

【0009】[0009]

【発明の実施の形態】図1には、この発明が適用される
ICカードの一実施例の外観図が示されている。ICカ
ードは、プラスチックケースからなるカード101と、
かかるカード101の内部に搭載された図示しない1チ
ップのマイクロコンピュータ等からなるICカード用チ
ップを持つものである。上記ICカードは、さらに上記
ICカード用チップの外部端子に接続されている複数の
接点(電極)102を持つ。複数の接点102は、後で
図2によって説明するような電源端子VCC、電源基準
電位端子VSS、リセット入力端子RESバー、クロッ
ク端子CLK、データ端子I/O−1/IRQバー、I
/O−2/IRQバーとされる。ICカードは、かかる
接点102を通して図示しないリーダーライタのような
外部結合装置から電源供給を受け、また外部結合装置と
の間でのデータの通信を行う。
FIG. 1 is an external view of one embodiment of an IC card to which the present invention is applied. The IC card includes a card 101 made of a plastic case,
It has an IC card chip including a one-chip microcomputer (not shown) mounted inside the card 101. The IC card further has a plurality of contacts (electrodes) 102 connected to external terminals of the IC card chip. The plurality of contacts 102 include a power supply terminal VCC, a power supply reference potential terminal VSS, a reset input terminal RES bar, a clock terminal CLK, a data terminal I / O-1 / IRQ bar, I
/ O-2 / IRQ bar. The IC card receives power supply from an external coupling device such as a reader / writer (not shown) through the contact point 102, and performs data communication with the external coupling device.

【0010】図2には、この発明に係るICカードに搭
載されるICカード用チップ(マイクロコンピュータ)
の一実施例の概略ブロック図が示されている。同図の各
回路ブロックは、公知のMOS集積回路の製造技術によ
り、特に制限されないが、単結晶シリコンのような1個
の半導体基板上において形成される。
FIG. 2 shows an IC card chip (microcomputer) mounted on the IC card according to the present invention.
1 is a schematic block diagram of one embodiment. Each circuit block in FIG. 1 is formed on a single semiconductor substrate such as single crystal silicon, though not particularly limited, by a known MOS integrated circuit manufacturing technique.

【0011】この発明に係るICカード用チップの構成
は、基本的にマイクロコンピュータと同じような構成で
ある。その構成は、クロック生成回路205、中央処理
装置(以下単にCPUという場合がある)201、RO
M(Read Only Memory)206やRAM(Random Access M
emory)207、不揮発性メモリ208などの記憶装置、
暗号化及び復号化処理の演算を行なうコプロセッサ20
9、入出力ポート(I/Oポート)202などからな
る。
The structure of the IC card chip according to the present invention is basically the same as that of a microcomputer. The configuration includes a clock generation circuit 205, a central processing unit (hereinafter, sometimes simply referred to as a CPU) 201, an RO
M (Read Only Memory) 206 and RAM (Random Access M
emory) 207, a storage device such as a nonvolatile memory 208,
Coprocessor 20 for performing operations of encryption and decryption processing
9, an input / output port (I / O port) 202 and the like.

【0012】クロック生成回路205は、図示しないリ
ーダライタ(外部結合装置)から図1の接点102を介
して供給される外部クロックCLKを受け、かかる外部
クロック信号に同期したシステムクロック信号を形成
し、それをチップ内部に供給する回路である。CPU2
01は、論理演算や算術演算などを行う装置であり、シ
ステムコントロールロジック、乱数発生器及びセキュリ
ィロジック及びタイマなどを制御する。記憶装置20
6、207、208は、プログラムやデータを格納する
装置である。コプロセッサ209は、後述するようにR
SA暗号法などに応用可能なべき乗剰余乗算動作を行な
う演算器とレジスタ及び制御論理から構成される。I/
O(入出力)ポート202は、リーダライタと通信を行
う装置である。データバス204とアドレスバス203
は、各装置を相互に接続するバスである。
A clock generation circuit 205 receives an external clock CLK supplied from a reader / writer (external coupling device) (not shown) via the contact 102 in FIG. 1, and forms a system clock signal synchronized with the external clock signal. This is the circuit that supplies it inside the chip. CPU2
Reference numeral 01 denotes a device that performs a logical operation or an arithmetic operation, and controls a system control logic, a random number generator, a security logic, a timer, and the like. Storage device 20
6, 207 and 208 are devices for storing programs and data. The coprocessor 209 outputs R
It is composed of an arithmetic unit that performs a power-residue multiplication operation applicable to SA cryptography and the like, a register, and control logic. I /
The O (input / output) port 202 is a device that communicates with a reader / writer. Data bus 204 and address bus 203
Is a bus for interconnecting the devices.

【0013】上記記憶装置206,207,208のう
ち、ROM206は、記憶内容が不揮発的に固定されて
いるメモリであり、主にプログラムを格納するメモリで
ある。揮発性メモリ(以下、RAMという)207は自
由に記憶情報の書き換えができるメモリであるが、電源
の供給が中断されると、記憶している内容が消えてなく
なる。ICカードがリーダライタから抜かれると電源の
供給が中断されるため、RAM207の内容は、保持さ
れなくなる。
Of the storage devices 206, 207, and 208, the ROM 206 is a memory whose storage contents are fixed in a nonvolatile manner, and is mainly a memory for storing programs. A volatile memory (hereinafter, referred to as a RAM) 207 is a memory in which stored information can be freely rewritten. However, when power supply is interrupted, stored contents are erased. When the IC card is removed from the reader / writer, the power supply is interrupted, so that the contents of the RAM 207 are not retained.

【0014】上記不揮発性メモリ(以下、EEPROM
(Electrical Erasable Programmable Read Only Memor
y)という)208は、内容の書き換えが可能な不揮発
性メモリであり、その中に一旦書き込まれた情報は、電
源の供給が停止されてもその内部に保持される。このE
EPROM208は、書き換える必要があり、かつIC
カードがリーダライタから抜かれても保持すべきデータ
を格納するために使われる。例えば、ICカードがプリ
ペイドカードとして使用されるような場合、のプリペイ
ドの度数などは、使用するたびに書き換えられる。この
場合の度数などは、リーダライタか抜かれてもICカー
ド内で記憶保持する必要があるため、EEPROM20
8で保持される。
The nonvolatile memory (hereinafter referred to as an EEPROM)
(Electrical Erasable Programmable Read Only Memor
208) is a rewritable nonvolatile memory, and the information once written therein is retained therein even when the power supply is stopped. This E
EPROM 208 needs to be rewritten, and IC
Used to store data that should be retained even if the card is removed from the reader / writer. For example, in a case where an IC card is used as a prepaid card, the frequency of the prepaid card is rewritten each time the card is used. In this case, the frequency and the like need to be stored and held in the IC card even if the reader / writer is removed.
8 is held.

【0015】CPU201は、いわゆるマイクロプロセ
ッサと同様な構成にされる。すなわち、その詳細を図示
しないけれども、その内部に命令レジスタ、命令レジス
タに書込まれた命令をデコードし、各種のマイクロ命令
ないしは制御信号を形成するマイクロ命令ROM、演算
回路、汎用レジスタ(RG6等)、内部バスBUSに結
合するバスドライバ、バスレシーバなどの入出力回路を
持つ。CPU201は、ROM206などに格納されて
いる命令を読み出し、その命令に対応する動作を行う。
CPU201は、I/Oポート202を介して入力され
る外部データの取り込み、ROM206からの命令や命
令実行のために必要となる固定データのようなデータの
読み出し、RAM207やEEPROM208に対する
データの書き込みと読み出し動作制御等を行う。
The CPU 201 has a configuration similar to a so-called microprocessor. That is, although not shown in detail, an instruction register therein, a micro instruction ROM for decoding an instruction written in the instruction register and forming various micro instructions or control signals, an arithmetic circuit, a general-purpose register (RG6, etc.) And an input / output circuit such as a bus driver and a bus receiver coupled to the internal bus BUS. The CPU 201 reads an instruction stored in the ROM 206 or the like, and performs an operation corresponding to the instruction.
The CPU 201 captures external data input through the I / O port 202, reads out data such as commands from the ROM 206 and fixed data necessary for executing the commands, and writes and reads data into and from the RAM 207 and the EEPROM 208. Operation control and the like are performed.

【0016】上記CPU201は、クロック生成回路2
05から発生されるシステムクロック信号を受けそのシ
ステムクロック信号によって決められる動作タイミン
グ、周期をもって動作される。CPU201は、その内
部の主要部がPチャンネル型MOSFETとNチャンネ
ル型MOSFETとからなるCMOS回路から構成され
る。特に制限されないが、CPU201は、CMOSス
タティックフリップフロップのようなスタティック動作
可能なCMOSスタテック回路と、信号出力ノードへの
電荷のプリチャージと信号出力ノードへの信号出力とを
システムクロック信号に同期して行うようなCMOSダ
イナミック回路とを含む。
The CPU 201 includes a clock generation circuit 2
The system clock signal is generated from the system clock signal 05 and is operated with an operation timing and a period determined by the system clock signal. The main part of the CPU 201 is composed of a CMOS circuit including a P-channel MOSFET and an N-channel MOSFET. Although not particularly limited, the CPU 201 synchronizes a statically operated CMOS static circuit such as a CMOS static flip-flop, a precharge of a charge to a signal output node and a signal output to a signal output node with a system clock signal. And a CMOS dynamic circuit.

【0017】ICカードのセキュリティ機能としては、
チップ内部で乱数を自動生成する乱数発生器や、ランダ
ムに割込みを生成するタイマー機能などの他に、本願発
明にかかる高セキュリテイ機能として、ICカードと外
部装置とのデータ送受信の際に用いるRSA暗号法など
に応用可能なべき乗剰余演算動作を行なう暗号処理用演
算ユニット(コプロセッサ)209を内蔵している。こ
のコプロセッサ209は専用のレジスタが内蔵されてい
る。
The security functions of the IC card include:
In addition to a random number generator that automatically generates random numbers inside the chip, a timer function that generates random interrupts, and the like, a high security function according to the present invention includes an RSA encryption used when data is transmitted and received between an IC card and an external device. A cryptographic processing operation unit (coprocessor) 209 for performing a modular exponentiation operation applicable to the law and the like is built in. The coprocessor 209 includes a dedicated register.

【0018】ICカードにおけるセキュリティ・システ
ムでは、通信データの暗号処理は必須であり、この実施
例でも現在最も多く利用されている公開鍵暗号としてR
SA暗号が用いられる。この暗号法では、暗号化・復号
化ともにべき乗剰余乗算XYmodNを用いるが、これ
は古くから知られている計算アルゴリズムによって剰余
乗算A2 modNとABmodNの2つの形に分解する
ことができる。つまり、Y=en n-1 ・・・e1 の値
i を上位en から最下位のe1 まで順に1ビットずつ
見ていき、ei =0だったらA2 modNのみを、ei
=1だったらA 2 modNとABmodNを演算する。
したがって、ei =0のときにはA2 modNの演算の
後にi=0であるかの判定処理が行なわれ、ei =1の
ときにはA2 modNとABmodNとの演算の後にi
=0であるかの判定処理が行なわれるために、ei =0
と1とに対応した2通りの電流波形の形態が現れてしま
う。
Security system for IC card
System, encryption of communication data is indispensable.
In the example, R is used as the public key
SA encryption is used. This encryption method uses encryption / decryption
Modular exponentiation XYmodN is used.
Is the remainder by a long-known calculation algorithm.
Multiplication ATwoDecompose into two forms, modN and ABmodN
be able to. That is, Y = enen-1... e1The value of the
eiEnTo the lowest e1One bit at a time until
Look, eiA = 0TwomodN only, ei
A if = 1 TwoCalculate modN and ABmodN.
Therefore, eiA when = 0TwomodN operation
Thereafter, a process of determining whether i = 0 is performed, and ei= 1
Sometimes ATwoAfter the operation of modN and ABmodN, i
Since the determination process of whether = 0 is performed, ei= 0
There are two types of current waveforms corresponding to and 1.
U.

【0019】この実施例のようにコプロセツサ209を
用いた場合には、その消費電流はCPUの消費電流に比
べて比較的大きいため、この部分の電流波形を観測する
ことによりコプロセッサの動作形態を比較的容易に識別
することができ、前記TA法とSPA法により暗号鍵Y
の値を解読されてしまう可能性が高い。そこで、この実
施例のコプロセッサ209では、上記暗号化・復号化と
もに用いられるべき乗剰余乗算XY modNの演算を行
なうに当たり攪乱目的のダミーの演算が挿入される。つ
まり、図3のタイミング図及び図4のフローチャート図
に示すようにe i =0でも1でもA2 modNとABm
odNの両方の演算を常に行なうようにするものであ
る。
As in this embodiment, the coprocessor 209 is
When used, the current consumption is lower than the current consumption of the CPU.
Observe the current waveform in this part because everything is relatively large
Makes it easy to identify the coprocessor operation mode
The encryption key Y can be obtained by the TA method and the SPA method.
Is likely to be deciphered. So, this fruit
In the coprocessor 209 of the embodiment, the encryption / decryption
Power multiplication X used forYPerform modN operation
In this case, a dummy operation for the purpose of disturbance is inserted. One
That is, the timing chart of FIG. 3 and the flowchart of FIG.
E as shown iA = 0 or 1TwomodN and ABm
in order to always perform both operations of oddN.
You.

【0020】図3のタイミング図において、(a)に示
すように本来は、en =1のときにはA2 modNの演
算を行い、en の判定の1により時間t1を経てABm
odNの演算を行い、その演算後にiをデクリメント
(n−1)してi=0の判定に時間t2を費やす。次い
で、次ビットen-1 =0のときは、A2 modNの演算
を行い、en-1 =0の判定とiをデクリメント(n−
2)してi=0の判定に時間t3を費やす。そして、次
ビットen-2 =1のときには、A2 modNの演算を行
い、en-2 の判定の1により時間t1を経てABmod
Nの演算を行い、その演算後にiをデクリメント(n−
3)してi=0の判定に時間t2を費やす。以下、同様
にe1 まで同様な動作を繰り返すものである。
In the timing chart of FIG. 3, as shown in FIG. 3A, when e n = 1, the calculation of A 2 modN is originally performed, and after the time t 1, ABm is calculated by 1 in the determination of e n.
The calculation of the oddN is performed, and after the calculation, i is decremented (n-1), and the time t2 is spent for the determination of i = 0. Next, when the next bit e n-1 = 0, the operation of A 2 modN is performed, the judgment of e n-1 = 0 and i are decremented (n−
2) Then, time t3 is spent for determining i = 0. When the next bit e n−2 = 1, the arithmetic operation of A 2 mod N is performed, and ABmod is applied after a time t1 by the determination 1 of e n−2.
N is calculated, and after the calculation, i is decremented (n−
3) Then, time t2 is spent for determining i = 0. Hereinafter, those repeating the same similar operation to e 1.

【0021】この実施例のコプロサッサ209において
は、上記暗号鍵Yの各ビットei の論理0又は1に無関
係にA2 modNの演算の後にABmodNの演算を行
なうようにする。図3(b)のen-1 =0のときのよう
にei が論理0のときにおける上記ABmodNの演算
が攪乱目的のダミー演算として挿入される。つまり、
(b)のタイミング図及び図4のフローチャート図のよ
うに、A2 modNとABmodNの演算動作の間に
は、例えばei の判定の判定を含む時間t1が費やさ
れ、ABmodNと次ビットに対応したA2 modNの
演算動作の間には、iのデクリメント動作とi=0の判
定時間t2が費やされる画一化された動作タイミング及
び動作電流とすることができる。ただし、この実施例で
は、ei の判定処理は、その結果が演算動作の分岐の条
件とされないため図4のフローチャート図では省略され
ている。
In the coprocessor 209 of this embodiment, the operation of AB mod N is performed after the operation of A 2 mod N regardless of the logic 0 or 1 of each bit e i of the encryption key Y. The operation of ABmodN described above when e i is a logical 0, such as when e n-1 = 0 in FIG. 3B, is inserted as a dummy operation for the purpose of disturbance. That is,
As shown in the timing chart of (b) and the flow chart of FIG. 4, for example, a time t1 including the determination of the determination of e i is spent between the arithmetic operations of A 2 modN and ABmodN. Between the corresponding A 2 modN operation operations, a uniform operation timing and operation current can be obtained in which the decrement operation of i and the determination time t2 of i = 0 are spent. However, in this embodiment, the determination processing of e i is omitted in the flowchart of FIG. 4 because the result is not used as a condition for branching the operation.

【0022】図5には、上記コプロセッサの一実施例の
ブロック図が示されいてる。この実施例では、主に演算
器、制御論理、専用レジスタブロックより構成され、べ
き乗剰余演算の最終結果はデータバツファ、データバス
を介して中央処理装置CPUに送信される。専用レジス
タは、アドレスバスから供給されるアドレス信号に対応
してその選択動作が行なわれる。
FIG. 5 is a block diagram showing one embodiment of the coprocessor. In this embodiment, it is mainly composed of an arithmetic unit, control logic, and a dedicated register block, and the final result of the modular exponentiation operation is transmitted to the central processing unit CPU via a data buffer and a data bus. The selection operation of the dedicated register is performed in response to an address signal supplied from an address bus.

【0023】この実施例では、内部バスMDBとレジス
タブロックのリードライトバッファ(R/W Buffer)
との間にゲート回路1が設けられる。このゲート回路1
は、制御論理により制御が行なわれて、ei が論理0な
らばA2 modN動作の演算結果が内部バスMDBとリ
ードライトバッファを介して所定のレジスタCDAに取
り込まれた後開いていたゲートが閉じるようにされる。
つまり、上記演算結果がリードライトバッファに取り込
まれると、その後にゲートを閉じてしまいリードライト
バッファへの新たなデータの書き込みを禁止する。した
がって、その後に行なわれるABmodNの演算結果は
無効データとして扱われることとなる。また、ei が論
理1ならばゲート回路1はゲートを開いた状態のままと
される。
In this embodiment, the internal bus MDB and the read / write buffer (R / W Buffer) of the register block are used.
And a gate circuit 1 is provided. This gate circuit 1
Is controlled by the control logic, and if e i is logic 0, the gate that has been opened after the operation result of the A 2 modN operation is taken into the predetermined register CDA via the internal bus MDB and the read / write buffer is read. It is made to close.
In other words, when the operation result is taken into the read / write buffer, the gate is closed thereafter, and writing of new data to the read / write buffer is prohibited. Therefore, the calculation result of ABmodN performed thereafter is treated as invalid data. If e i is logic 1, the gate circuit 1 keeps the gate open.

【0024】図6には、上記コプロセッサの他の一実施
例のブロック図が示されている。この実施例では、レジ
スタブロックのリードライトバッファ(R/W Buffe
r)と各レジスタとの間にゲート回路2が設けられる。こ
のゲート回路2は、前記同様に制御論理により制御が行
なわれて、ei が論理0ならばA2 modN動作の演算
結果が内部バスMDBとリードライトバッファとを介し
て所定のレジスタCDAに書き込まれた後に開いていた
ゲートが閉じるようにされる。つまり、上記演算結果が
レジスタCDAに取り込まれると、その後にゲートを閉
じてしまいかかかるレジスタCDAへの新たなデータの
書き込みを禁止する。したがって、その後に行なわれる
ABmodNの演算結果は、リードライトバッファまで
は書き込まれるが、実際には無効データとして扱われる
こととなる。また、ei が論理1ならばゲート回路2は
ゲートを開いた状態のままとされる。
FIG. 6 is a block diagram showing another embodiment of the coprocessor. In this embodiment, the read / write buffer (R / W Buffer) of the register block is used.
A gate circuit 2 is provided between r) and each register. The gate circuit 2 is controlled by the control logic in the same manner as described above. If e i is logic 0, the operation result of the A 2 modN operation is written to a predetermined register CDA via the internal bus MDB and the read / write buffer. The gates that were open after being closed are closed. That is, when the result of the operation is taken into the register CDA, the gate is closed thereafter, and writing of new data to the register CDA is prohibited. Therefore, the operation result of ABmodN performed thereafter is written to the read / write buffer, but is actually treated as invalid data. If e i is logic 1, the gate circuit 2 keeps the gate open.

【0025】図7には、上記ゲート回路の一実施例の内
部構成図が示されている。ダミー書き込み制御ユニット
は、アンドゲート回路によって構成され、一方の入力に
は制御論理からのライトイネーブル信号が供給され、他
方の入力には演算器で生成されたライトストローブ信号
が供給される。上記ゲート回路の出力信号は、データバ
ッファ(R/W Buffer)と専用レジスタにライトスロ
ーブ信号として伝えられる。
FIG. 7 is a diagram showing the internal configuration of an embodiment of the gate circuit. The dummy write control unit is configured by an AND gate circuit. One input is supplied with a write enable signal from the control logic, and the other input is supplied with a write strobe signal generated by an arithmetic unit. The output signal of the gate circuit is transmitted to a data buffer (R / W Buffer) and a dedicated register as a write slope signal.

【0026】この実施例では、演算結果そのものの伝達
制御するものに代えて、レジスタ又はデータバッファへ
の書き込み動作を指示するライトストローブ信号の発生
タイミングを切り換えるようにするものである。つま
り、ei =0のときには、A2modN動作の演算結果
が出力された後にライトイネーブル信号をロウレベルと
してアンドゲート回路のゲートが閉じるようにするもの
である。逆に、ei =1のときには、制御論理はライト
イネーブル信号をハイレベルのままとして、演算器で形
成されたライトストローブ信号がそのままデータバッフ
ァ又は専用レジスタに伝えられる。この構成では、複数
ビットからなる演算結果Aに対応して、複数個のゲート
回路を設ける必要がないので簡素化が可能になる。
In this embodiment, the generation timing of a write strobe signal for instructing a write operation to a register or a data buffer is switched, instead of controlling transmission of the operation result itself. In other words, when e i = 0, the write enable signal is set to low level after the operation result of the A 2 modN operation is output so that the gate of the AND gate circuit is closed. Conversely, when e i = 1, the control logic keeps the write enable signal at the high level, and the write strobe signal formed by the arithmetic unit is transmitted to the data buffer or the dedicated register as it is. In this configuration, it is not necessary to provide a plurality of gate circuits corresponding to the operation result A composed of a plurality of bits, so that simplification is possible.

【0027】図8には、上記コプロセッサの他の一実施
例のブロック図が示されいてる。この実施例では、レジ
スタブロックのリードライトバッファ(R/W Buffe
r)と各レジスタとの間にセレクタ2とレジスタブロック
にダミーレジスタ1が設けられる。このセレクタ2は、
前記同様に制御論理により制御が行なわれて、ei が論
理0ならばA2 modN動作の演算結果が内部バスMD
Bとリードライトバッファとを介して所定のレジスタC
DAに書き込まれるような信号経路を形成し、その後に
ダミーレジスタ1を選択するような信号経路を形成す
る。
FIG. 8 is a block diagram showing another embodiment of the coprocessor. In this embodiment, the read / write buffer (R / W Buffer) of the register block is used.
A selector 2 is provided between r) and each register, and a dummy register 1 is provided in a register block. This selector 2
Control is performed by the control logic in the same manner as described above. If e i is logic 0, the operation result of the A 2 modN operation is
B and a predetermined register C via the read / write buffer.
A signal path for writing to DA is formed, and then a signal path for selecting the dummy register 1 is formed.

【0028】つまり、上記演算結果がレジスタCDAに
取り込まれると、その後にダミーレジスタ1を選択する
ので、レジスタCDAへの新たなデータの書き込みを禁
止しつつその後に行なわれるABmodNの演算結果が
ダミーレジスタに書き込まれものとなる。ei が論理1
ならばセレクタ2は常にレジスタCDAを選択する。こ
の構成は、演算結果をレジスタに書き込む動作を含めて
i が論理0のときと論理1のときとで電流波形でみた
ときに全く同一にすることができるから、電流波形を利
用したアタックをより確実に無力化することができる。
That is, when the above operation result is taken into the register CDA, the dummy register 1 is selected thereafter. Therefore, while the writing of new data to the register CDA is inhibited, the operation result of ABmodN that is performed thereafter is stored in the dummy register 1A. Will be written to. e i is logical 1
Then, the selector 2 always selects the register CDA. This configuration can be made completely the same when the current waveform is viewed when e i is logic 0 and when it is logic 1 including the operation of writing the operation result to the register. Neutralization can be performed more reliably.

【0029】図9には、この発明に係るコプロセッサの
他の一実施例の動作を説明するための構成図が示されて
いる。図9(a)のタイミング図及び(b)のフローチ
ャート図において、前記説明したように、A2 modN
の演算後、ei の判定の時間t1の間もダミー演算動作
としてA2 modNを継続してABmodNの演算に移
行する。
FIG. 9 is a block diagram for explaining the operation of another embodiment of the coprocessor according to the present invention. In the timing chart of FIG. 9A and the flowchart of FIG. 9B, as described above, A 2 modN
After the calculation of ( i) , A 2 modN is continued as a dummy calculation operation during the time t1 of the determination of e i , and the operation proceeds to the calculation of ABmodN.

【0030】その演算後にiをデクリメント(−1)し
てi=0の判定に時間t2を費やすが、その間も上記A
BmodNの演算を継続させる。以下、同様にe1 まで
同様な動作を繰り返すものである。この構成は、演算動
作中は、ei が論理0と1のときに関係なく上記のよう
な演算動作を継続するので、電流波形でみたときに格別
な特徴を見出すことができないから、電流波形を利用し
たアタックを無力化することができる。
After the operation, i is decremented (-1), and time t2 is spent for determination of i = 0.
The calculation of BmodN is continued. Hereinafter, those repeating the same similar operation to e 1. In this configuration, during the arithmetic operation, the arithmetic operation as described above is continued irrespective of when ei is logic 0 and 1, so that no special feature can be found when viewed from the current waveform. Can be neutralized by using the attack.

【0031】図10には、図9のコプロセッサの動作を
実現するための一実施例のブロック図が示されている。
制御論理では、ダミーイネーブル信号とコプロイネーブ
ル信号を送出する。上記ダミーイネーブル信号とコプロ
イネーブル信号は、オアゲート回路を通して演算器に入
力される。それ故、コプロイネーブル信号がアクティブ
であるときに加えて、ダミーイネーブル信号がアクティ
ブであるときにも演算器は演算動作を行なうようにされ
る。
FIG. 10 is a block diagram showing one embodiment for realizing the operation of the coprocessor shown in FIG.
In the control logic, a dummy enable signal and a copro enable signal are transmitted. The dummy enable signal and the co-pro enable signal are input to an arithmetic unit through an OR gate circuit. Therefore, the arithmetic unit performs an arithmetic operation when the dummy enable signal is active in addition to when the copro enable signal is active.

【0032】上記ダミーイネーブル信号は、インバータ
回路を通してアンドゲート回路の一方の入力に供給さ
れ、かかるアンドゲート回路の他方の入力には演算器で
形成されたライトストローブ信号が供給される。つま
り、演算器で形成されたライトストローブ信号の伝達を
ダミーイネーブル信号で選択的に停止できるようにす
る。コプロイネーブル信号がアクティブにされて、前記
正規の演算動作が終了すると、その演算結果を出力する
ためのライトストローブ信号が形成される。このように
コプロイネーブル信号がアクティブのときには、ダミー
イネーブル信号の反転信号がアクティブレベルとなって
アンドゲート回路のゲートを開くように制御するので、
上記正規演算結果はライトストローブ信号によって、R
/Wバッファ又はレジスタブロックの所定のレジスタに
書き込まれる。
The dummy enable signal is supplied to one input of an AND gate circuit through an inverter circuit, and the other input of the AND gate circuit is supplied with a write strobe signal formed by an arithmetic unit. That is, transmission of the write strobe signal formed by the arithmetic unit can be selectively stopped by the dummy enable signal. When the normal operation is completed by activating the co-pro enable signal, a write strobe signal for outputting the operation result is formed. As described above, when the co-pro enable signal is active, the inverted signal of the dummy enable signal is set to the active level to control the gate of the AND gate circuit to be opened.
The result of the normal operation is represented by R
/ W buffer or a predetermined register of the register block.

【0033】上記のような正規演算が終了すると、ダミ
ーイネーブル信号がアクティブとなって演算器に対して
演算動作を指示する。この演算の終了によって、上記ラ
イトストローブ信号が形成されるが、上記ダミーイネー
ブル信号の反転信号によってアンドゲート回路がゲート
を閉じているので、上記攪乱目的のダミー演算動作によ
って発生されたライトストローブ信号がR/Wバッファ
又はレジスタブロックの所定のレジスタに伝えられるこ
とはない。これにより、攪乱目的のダミー演算結果は無
効データとして消失させられる。
When the above-described normal operation is completed, the dummy enable signal becomes active, and instructs the operation unit to execute the operation. Upon completion of this operation, the write strobe signal is formed. However, since the AND gate circuit closes the gate by the inverted signal of the dummy enable signal, the write strobe signal generated by the dummy operation operation for the purpose of the disturbance is generated. It is not transmitted to a predetermined register of the R / W buffer or the register block. As a result, the dummy operation result for the purpose of the disturbance is erased as invalid data.

【0034】図11には、この発明に係るコプロセッサ
の他の一実施例の動作を説明するためのタイミング図が
示されている。前記図3に示した実施例のように、攪乱
目的のダミー演算を挿入して、(a)のタイミング図の
ように、ei に対して画一化してA2 modNとABm
odNの演算を一対として行なうようにした場合でも、
各演算には、演算結果にオーバーフロー処理を必要とす
るもの(あり)のものと、オーバーフロー処理を必要と
しないもの(なし)が発生する。
FIG. 11 is a timing chart for explaining the operation of another embodiment of the coprocessor according to the present invention. As in the embodiment shown in FIG. 3, a dummy operation for the purpose of disturbance is inserted, and A 2 modN and ABm are unified with respect to e i as shown in the timing diagram of FIG.
Even if the calculation of the oddN is performed as a pair,
For each operation, there are those that require overflow processing (Yes) and those that do not require overflow processing (None).

【0035】このようなオーバーフロー処理は、演算時
間を長くするものであるので電流波形でみると、オーバ
ーフロー処理ありとなしとの識別が可能になる。このよ
うな電流波形の特徴から演算内容や演算データを推測す
ることも不可能ではないと考えられるため、この実施例
では(b)のタイミング図に示すようにオーバーフロー
処理を不要とする演算に対しても必要なときと同様にオ
ーバーフロー処理を挿入する。つまり、みかけ上は、全
ての演算A2 modNとABmodNの演算において画
一的にオーバーフロー処理のための動作が実施されるた
めに、その識別を無力化するものである。
Since such an overflow process increases the operation time, it is possible to distinguish between the presence and absence of the overflow process in the current waveform. Since it is considered that it is not impossible to infer the calculation contents and calculation data from such characteristics of the current waveform, in this embodiment, as shown in the timing chart of FIG. Even if necessary, overflow processing is inserted. That is, apparently, the operation for the overflow process is uniformly performed in all the calculations A 2 modN and ABmodN, so that the identification is disabled.

【0036】図12は、この発明に係るコプロセッサの
他の一実施例の動作を説明するためのフローチャート図
が示されている。このフローチャート図は、前記図11
(b)に対応している。A2 modNとABmodNの
各演算は、剰余演算部とオーバーフロー演算部からな
り、演算結果に無関係に上記オーバーフロー演算処理を
実施するものである。
FIG. 12 is a flow chart for explaining the operation of another embodiment of the coprocessor according to the present invention. This flowchart is shown in FIG.
This corresponds to (b). Each operation of A 2 modN and ABmodN includes a remainder operation unit and an overflow operation unit, and performs the overflow operation process regardless of the operation result.

【0037】図13には、この発明に係るコプロセッサ
の他の一実施例の動作の詳細を説明するためのタイミン
グ図が示されている。この実施例による対策前では、前
記A 2 modNとABmodNのようなコプロ演算にお
いては、その演算結果に対応してオーバーフロー処理の
あるものと無いもの2種類が存在したが、この実施例に
よる対策後では、前記A2 modNとABmodNのよ
うなコプロ演算においては、その演算結果に無関係に常
にオーバーフロー処理が実行される。このため、本来は
オーバーフロー処理が不要な演算動作に対して実施され
たオーバーフロー処理は、攪乱目的のダミー動作とされ
る。
FIG. 13 shows a coprocessor according to the present invention.
Timing for explaining operation details of another embodiment of
FIG. Before the countermeasure according to this embodiment,
Note A TwoFor co-production operations like modN and ABmodN
In addition, overflow processing is performed according to the operation result.
There were two types, one with and one without, but in this example
After the countermeasure byTwomodN and ABmodN
In such a co-production operation,
Is executed. For this reason,
Performed for arithmetic operations that do not require overflow processing.
Overflow processing is a dummy operation for the purpose of disturbance.
You.

【0038】図14には、図11ないし図13に示した
コプロセッサの動作を実現するための一実施例のブロッ
ク図が示されている。制御論理では、ダミーオーバーフ
ロー信号とコプロオーバーフロー信号を送出する。上記
ダミーオーバーフロー信号とコプロオーバーフロー信号
は、オアゲート回路を通して演算器に入力される。それ
故、コプロオーバーフロー信号がアクティブであるとき
に加えて、ダミーオーバーフロー信号がアクティブであ
るときにも演算器はオーバーフロー処理動作を行なうよ
うにされる。
FIG. 14 is a block diagram showing one embodiment for realizing the operation of the coprocessor shown in FIGS. The control logic sends out a dummy overflow signal and a co-pro overflow signal. The dummy overflow signal and the co-pro overflow signal are input to an arithmetic unit through an OR gate circuit. Therefore, the arithmetic unit performs the overflow processing operation when the dummy overflow signal is active in addition to when the copro overflow signal is active.

【0039】上記コプロオーバーフロー信号は、アンド
ゲート回路の一方の入力に供給され、かかるアンドゲー
ト回路の他方の入力に演算器で形成されたライトストロ
ーブ信号が供給される。つまり、演算器で形成されたラ
イトストローブ信号の伝達をコプロオーバーフロー信号
がアクティブレベルでないときに選択的に停止できるよ
うにする。つまり、コプロオーバーフロー信号がアクテ
ィブレベルでないときはダミーオーバーフロー信号によ
って演算器がオーバーフロー処理を行なっているので、
かかるオーバーフロー処理で形成されたライトストロー
ブ信号は上記ゲート回路のゲートを閉じることによって
無効にするものである。したがって、前記正規のオーバ
ーフロー処理終了すると、その処理結果を出力するため
のライトストローブ信号が形成されて、R/Wバッファ
又はレジスタブロックの所定のレジスタに処理結果が書
き込まれる。
The copro overflow signal is supplied to one input of an AND gate circuit, and the other input of the AND gate circuit is supplied with a write strobe signal formed by an arithmetic unit. That is, transmission of the write strobe signal formed by the arithmetic unit can be selectively stopped when the copro overflow signal is not at the active level. In other words, when the co-pro overflow signal is not at the active level, the arithmetic unit performs overflow processing using the dummy overflow signal.
The write strobe signal formed by the overflow processing is invalidated by closing the gate of the gate circuit. Therefore, when the normal overflow processing is completed, a write strobe signal for outputting the processing result is formed, and the processing result is written to a predetermined register of the R / W buffer or the register block.

【0040】これに対して、ダミーオーバーフロー信号
がアクティブとなって演算器に対してオーバーフロー処
理動作を指示した場合には、そのオーバーフロー処理に
よって形成されたライトストローブ信号は、上記コプロ
オーバーフロー信号によってアンドゲート回路のゲート
が閉じられるものであるから、上記攪乱目的のダミーオ
ーバーフロー処理動作によって発生されたライトストロ
ーブ信号がR/Wバッファ又はレジスタブロックの所定
のレジスタに伝えられることはない。これにより、攪乱
目的のダミーオーバーフロー処理結果は無効データとし
て消失させられる。
On the other hand, when the dummy overflow signal becomes active to instruct the arithmetic unit to perform the overflow processing operation, the write strobe signal formed by the overflow processing is AND gated by the co-pro overflow signal. Since the gate of the circuit is closed, the write strobe signal generated by the dummy overflow processing operation for the purpose of the disturbance is not transmitted to the R / W buffer or the predetermined register of the register block. As a result, the result of the dummy overflow processing for the purpose of the disturbance is erased as invalid data.

【0041】図15には、この発明に係るコプロセッサ
の更に他の一実施例の動作を説明するためのタイミング
図が示されている。(a)に示すように本来は、en
1のときにはA2 modNの演算を行い、en の判定の
1により時間t1を経てABmodNの演算を行い、そ
の演算後にiをデクリメント(n−1)してi=0の判
定に時間t2を費やす。次いで、次ビットen-1 =0の
ときは、A2 modNの演算を行い、en-1 =0の判定
とiをデクリメント(n−2)してi=0の判定に時間
t3を費やすような演算動作に対して、上記各演算毎の
時間t1、t2及びt3に対して攪乱目的のダミーサイ
クルが挿入される。
FIG. 15 is a timing chart for explaining the operation of still another embodiment of the coprocessor according to the present invention. Originally as shown in (a), e n =
Performs an operation of A 2 modN when one performs computation of ABmodN over time t1 by first determination of e n, the time t2 to determine i = 0 is decremented (n-1) the i after the operation spend. Next, when the next bit e n-1 = 0, the calculation of A 2 modN is performed, and the determination of e n-1 = 0 and i are decremented (n-2), and the time t3 is determined by the determination of i = 0. For the operation operation to be spent, a dummy cycle for the purpose of disturbance is inserted for the time t1, t2, and t3 for each operation.

【0042】(b)のタイミング図では、上記攪乱目的
のダミーサイクルの挿入は、各演算毎の時間を最も長い
時間t3に揃えるように挿入するものである。これによ
り、時間t3をインターバルとしてA2 modN又はA
BmodNのいずれかの演算が実施されるために、みか
け上は演算動作に対応した電流波形が画一化されてその
識別を無力化するものである。これに対して、(c)タ
イミング図では、上記(b)とは逆に上記演算毎のイン
ターバルにおいて時間がランダムに変化する攪乱目的の
ダミーサイクルが挿入される。上記A2 modN又はA
BmodNのいずれかの演算が時間的にランダムに実施
される。そのため、電流波形でみると上記各演算動作と
無関係で、かつ不規則性の電流値にされる。言い換える
ならば、上記演算器において同じ状態及び同じ動作でも
毎回異なるよう、統計的な観点での非再現性を持つよう
にされるために、その識別を無力化することができる。
In the timing diagram (b), the dummy cycle for the purpose of the disturbance is inserted so that the time for each operation is aligned with the longest time t3. As a result, A 2 mod N or A 2
Since any operation of BmodN is performed, apparently, the current waveform corresponding to the operation is made uniform and the identification is disabled. On the other hand, in the timing diagram (c), a dummy cycle for the purpose of disturbance whose time randomly changes is inserted in the interval of each operation, contrary to the above (b). The above A 2 mod N or A
Any operation of BmodN is randomly performed in time. Therefore, when viewed from the current waveform, the current value is irrelevant to each of the arithmetic operations and irregular. In other words, since the arithmetic unit has a non-reproducibility from a statistical point of view such that the same state and the same operation are different every time, the identification can be disabled.

【0043】上記のような攪乱目的のダミーサイクル
は、前記図2に示されたようにタイマーを利用して演算
間隔を可変にするものである。あるいはコプロセッサの
外部にタイマーを設けて一定の時間が経過するまで次の
演算の実行を待つようにする。つまり、コプロセッサに
よるべき乗剰余乗算の演算において、図15(a)に示
した前記各演算毎の時間t1,t2,t3に攪乱目的の
ダミーのサイクルを挿入し、一定時間後にタイマーから
の割込みを入れる。これにより、図15(b)に示すよ
うにt1,t2,t3の時間が全て一定となり、電流波
形からのアタックを困難にする。あるいはタイマーには
乱数発生器で生成した乱数をセットしておき、(c)に
示すように毎回t1,t2,t3の時間をランダムに変
化させることも可能である。また、タイマーを用いなく
ても、ソフトウエアでカウントすることも可能である。
The dummy cycle for the purpose of the disturbance as described above makes the calculation interval variable using a timer as shown in FIG. Alternatively, a timer is provided outside the coprocessor, and the execution of the next operation is waited until a certain time elapses. That is, in the operation of the modular exponentiation multiplication by the coprocessor, a dummy cycle for the purpose of disturbance is inserted into the times t1, t2, and t3 of each operation shown in FIG. Put in. As a result, the times t1, t2, and t3 are all constant as shown in FIG. 15B, making it difficult to attack from the current waveform. Alternatively, a random number generated by a random number generator may be set in the timer, and the times t1, t2, and t3 may be randomly changed every time as shown in (c). Also, the counting can be performed by software without using a timer.

【0044】べき乗剰余乗算において、コプロセッサに
よる演算の高速化を目的とし、Yの値を2ビット、ある
いは3ビットずつ処理するようにすると、例えば図16
のフローチャート図に示すように、2ビット処理の例で
説明するなら常にA2 modN−A2 modN−ABm
odN及びi−2とi=0?の各ステップの繰り返しに
なるので、前記1ビットずつ行なう場合のような攪乱目
的のダミー演算を行なわなくとも、処理時間や電流波形
が一定になる。そのため、電流波形からYの値を推定す
るのは困難になる。また演算の回数も、前記のバイナリ
法だと最大で2n回かかっていたものを、2ビット処理
だと常に1.5n回で済むために、動作時間の短縮にも
つながる。
In the modular exponentiation multiplication, if the value of Y is processed by 2 bits or 3 bits at a time for the purpose of speeding up the operation by the coprocessor, for example, FIG.
As shown in the flow chart of FIG. 2, if the description is made using the example of 2-bit processing, A 2 mod N−A 2 mod N−ABm
odN and i-2 and i = 0? Are repeated, so that the processing time and the current waveform are constant without performing the dummy operation for the purpose of disturbance as in the case of performing one bit at a time. Therefore, it becomes difficult to estimate the value of Y from the current waveform. In addition, the number of operations is 2n at the maximum in the case of the binary method, but 1.5n is always required in the case of 2-bit processing, which leads to a reduction in operation time.

【0045】コプロセッサの演算が開始するまでにA,
B,Nの値をそれぞれコプロセツサ専用レジスタに転送
し格納しておく。しかしながら、2ビット処理を行う場
合、、Yの値によって4通りのBの値B1 、B2
3 、B4 が必要になり、これらの値は前もって計算し
て.RAMやEEPROMなどに格納しておきヽ毎回コ
プロセツサ専用レジスタに転送することになるが。この
際、4通りのBの値によって転送中の電流波形に特徴が
現れる可能性がある。
By the time the coprocessor operation starts, A,
The values of B and N are respectively transferred to and stored in the coprocessor dedicated register. However, when performing 2-bit processing, there are four B values B 1 , B 2 ,
B 3 and B 4 are required, and these values are calculated in advance. It is stored in a RAM or EEPROM, etc. {circle around (1)} every time it is transferred to the coprocessor dedicated register. At this time, there is a possibility that a characteristic may appear in the current waveform during transfer depending on the four values of B.

【0046】例えば、16ビットのプリチャージバスに
データを転送する場合を考える。プリチャージバスは、
データ転送の前にすべてのバスの値を“1”にそろえる
バスである。このバスに、値は違うが“1”のビットの
数が同じデータ、例えば、“1”のビットの数が2であ
る16進数で“88”と“11”、を転送した場合、電
流波形はほぼ同じ波形になると予測される。この理由
は、“1”から“0”へ変化したビットの数が同じであ
るため、同じように電流を消費し、同じ電流波形になる
からである。
For example, consider the case where data is transferred to a 16-bit precharge bus. The precharge bus is
This is a bus in which the values of all buses are set to "1" before data transfer. When data having different values but the same number of “1” bits, for example, “88” and “11” in hexadecimal with the number of “1” bits being 2 are transferred to this bus, the current waveform Are expected to have approximately the same waveform. This is because the same number of bits have changed from “1” to “0”, so that current is consumed in the same manner and the current waveform becomes the same.

【0047】もし、“1”のビットの数が1つ異なるデ
ータ、例えば、“1”のビットの数が3である“89”
や“19”を転送した場合、“1”のビットの数が2の
データとは消費電流が異なる。これは、13ビット分バ
スの値が“1”から“0”に変わったため、その分の電
流が消費される。そのため、先の14ビットが変化した
データに比べて消費電流が1ビット分小さくなる。一般
に、変化するビットの数が多いほど電流波形は高くなる
という規則性がある。この規則性から転送されているデ
ータを推定することができると思われる、電流アタック
の対象となりやすい。これを防ぐため次のような工夫を
行なうものである。
If the number of bits of “1” is different from that of data by one, for example, “89” where the number of bits of “1” is three
Or "19", the current consumption is different from that of the data in which the number of bits of "1" is 2. Since the value of the bus for 13 bits has changed from "1" to "0", the current is consumed by that amount. Therefore, the current consumption is reduced by one bit as compared with the data in which the previous 14 bits have changed. Generally, there is a regularity that the current waveform becomes higher as the number of changing bits increases. It is likely that the data being transferred can be estimated from this regularity, and is likely to be subject to current attacks. The following measures are taken to prevent this.

【0048】図17と図18には、この発明に係るコプ
ロセッサの他の一実施例のブロック図がそれぞれ示され
ている。この実施例のコプロセッサは、2ビット処理と
3ビット処理に向けられている。つまり、コプロセッサ
のレジスタ容量を増やして、2ビット処理の場合には4
通りのBの値B1 〜B4 を、3ビット処理の場合には8
通りのBの値B1 〜B8 をコプロセッサのレジスタに格
納しておく。従って、演算の途中で記憶回路(RAM)
からデータバスを通して上記コプロセッサのれレジスタ
に前記のような転送の必要がなくなり、前記電流アタッ
クに対して防御することができる。
FIGS. 17 and 18 are block diagrams of another embodiment of the coprocessor according to the present invention. The coprocessor of this embodiment is directed to 2-bit processing and 3-bit processing. In other words, the register capacity of the coprocessor is increased, and in the case of 2-bit processing, 4
B values B 1 to B 4 are set to 8 in the case of 3-bit processing.
Storing the value B 1 .about.B 8 street B in a register of the coprocessor. Therefore, during the operation, the storage circuit (RAM)
This eliminates the need for such a transfer to the coprocessor register through the data bus, and can protect against the current attack.

【0049】 [0049]

【0050】 [0050]

【0051】つまり、前記図16に示したようなフロー
チャート図において、コプロセッサがABmodNを実
行する際、下記のように4つ(3ビット処理のときには
あるいは8つ)のうちの正しいBレジスタCDBから値
を選んで実行できるように、Yの2ビット(あるいは3
ビット)の値をコプロセッサの制御レジスタ(CCN
T)のビットに当てはめ、前記に示す制御レジスタ及び
演算の種類のように、2ビット処理の場合には、AB1
modN, AB2 modN,AB3 modN,AB4
odNのうちどの演算をするかを選択させるようにす
る。
In other words, in the flowchart shown in FIG. 16, when the coprocessor executes ABmodN, the correct B register CDB out of four (when three-bit processing or eight) is executed as described below. The two bits of Y (or 3
Bit) to the coprocessor control register (CCN
T), and in the case of 2-bit processing, AB 1
modN, AB 2 modN, AB 3 modN, AB 4 m
The operator is allowed to select which operation to perform from among oddN.

【0052】図19には、この発明に係るコプロセッサ
の他の一実施例のブロック図が示されている。この実施
例のコプロセッサも、2ビット処理や3ビット処理のよ
うな複数ビット処理に向けられている。この実施例で
は、データバスにスイッチを設けて演算をしながら転送
できるようにする。この構成により、コプロセッサのレ
ジスタ容量を増加させることなく、実行時間の短縮と電
流アタック対策の両方に効果的である。
FIG. 19 is a block diagram showing another embodiment of the coprocessor according to the present invention. The coprocessor of this embodiment is also directed to multi-bit processing such as 2-bit processing and 3-bit processing. In this embodiment, a switch is provided on the data bus so that data can be transferred while performing calculations. This configuration is effective in both reducing the execution time and preventing current attacks without increasing the register capacity of the coprocessor.

【0053】コプロセツサ専用レジスタ(CDA,CD
B,CDN,CDW)は、同図に示すように4つのレジ
スタがCPUとコプロセッサの演算器との間で排他的に
使用されている。2ビット処理を行う場合、2回のA2
modNを行いながらその間にBの値をRAMからコプ
ロセッサ専用レジスタユニット中のBレジスタCDBに
転送できるようにすると効率的である。
Coprocessor dedicated registers (CDA, CD
B, CDN, and CDW), as shown in the figure, four registers are exclusively used between the CPU and the arithmetic unit of the coprocessor. When performing 2-bit processing, two A 2
It is efficient if the value of B can be transferred from the RAM to the B register CDB in the coprocessor dedicated register unit while performing modN.

【0054】コプロセッサのAレジスタCDAとBレジ
スタCDBのI/Oを分け、それぞれにリード/ライト
バッファ(R/W Buffer)を設けて、それぞれ独立に
動作できるようにする。演算器がA2 modNを演算し
ている間は、制御信号によりデータバスをパス1(pa
th1)につなぎ、図示しないCPUのRAMからBの
値を上記独立に設けられたリード/ライトバッファを介
してBレジスタCDBに転送する。次に演算器がABm
odNを実行する際には、制御信号によりパス2(pa
th2)に切り換え、上記BレジスタのB値を演算器に
送り上記CPUがBレジスタCDBにアクセスできない
ようにする。この方法を取ると、A2 modNを演算動
作と、B値の転送動作が同時に行なわれるから演算時間
が短縮されるだけでなく、演算と転送の消費電流が重な
るため双方の波形が識別できなくなり、電流アタック対
策に有効である。
The I / O of the A register CDA and the B register CDB of the coprocessor are separated, and a read / write buffer (R / W Buffer) is provided for each, so that they can operate independently. While the computing unit is computing A 2 modN, the control signal passes the data bus through path 1 (pa).
th1), the value of B is transferred from the RAM of the CPU (not shown) to the B register CDB via the independently provided read / write buffer. Next, the arithmetic unit is ABm
When executing the odN, a path 2 (pa) is controlled by a control signal.
th2), and sends the B value of the B register to the arithmetic unit so that the CPU cannot access the B register CDB. According to this method, the operation of A 2 modN and the operation of transferring the B value are performed at the same time, so that not only the operation time is shortened, but also the current consumption of the operation and the transfer are overlapped, so that both waveforms cannot be identified. It is effective for current attack countermeasures.

【0055】図20には、この発明に係るICカード用
チップの他の一実施例の要部ブロック図が示されてい
る。この実施例では、暗号処理用演算ユニットとメモリ
(RAM)間の転送の際、メモリにカウンタを設けるよ
うにするものである。この実施例では、2ビット処理に
用いる4通りの値、あるいは3ビット処理に用いる8通
りの値をコプロセッサ外部メモリRAMからコプロセッ
サ専用レジスタユニット中のBレジスタCDBに転送す
る際の電流撹乱を行なうようにするものである。
FIG. 20 is a block diagram showing a main part of another embodiment of the IC card chip according to the present invention. In this embodiment, a counter is provided in the memory at the time of transfer between the cryptographic processing operation unit and the memory (RAM). In this embodiment, current disturbance when transferring four values used for 2-bit processing or eight values used for 3-bit processing from the coprocessor external memory RAM to the B register CDB in the coprocessor dedicated register unit is described. It is something to do.

【0056】この実施例では、前記図2に示したような
ICカード用チップにおいて、RAMの側にカウンタが
設けられる。RAMは、カウンタで形成されたアドレス
信号をデコードしてデータをデータバスに送出する。こ
のとき、アドレスバスには、乱数発生器が形成された偽
アドレスが送出される。これにより、アドレスとデータ
との相関が無くなり、電流解析を困難とさせることがで
きる。
In this embodiment, in the IC card chip shown in FIG. 2, a counter is provided on the RAM side. The RAM decodes the address signal formed by the counter and sends the data to the data bus. At this time, a fake address formed with a random number generator is transmitted to the address bus. Thereby, the correlation between the address and the data is lost, and the current analysis can be made difficult.

【0057】図21には、上記カウンタの一実施例のブ
ロック図が示されている。カウンタは、転送したいブロ
ックの最初のアドレスを保持する先頭アドレスレジスタ
とインクリメンタを用い、ブロック転送をイネーブルに
するイネーブル信号とクロック又はリード/ライト信号
などによるインクリメント指示信号で制御する。ブロッ
ク転送を開始する際、まず転送の先頭アドレスと転送開
始のイネーブル信号がCPUよりカウンタに送信され、
上記先頭アドレスレジスタに保持される。その後は、イ
ンクリメント指示信号によって、インクリメンタが動作
して先頭アドレスレジスタの先頭アドレスA+1を形成
して、アドレスを生成するとともに上記先頭アドレスレ
ジスタの内容を書き換えるので、図22のタイミング図
に示すように、RAMアドレスが順番にインクリメント
A、A+1、A+2、・・・されていき、そのアドレス
に従って順次データDA 、DA+1 、DA+2 ・・・・が書
込まれ/読み出される。
FIG. 21 is a block diagram showing one embodiment of the counter. The counter uses a head address register that holds the first address of the block to be transferred and an incrementer, and is controlled by an enable signal for enabling block transfer and an increment instruction signal such as a clock or a read / write signal. When starting a block transfer, first, a transfer start address and a transfer start enable signal are transmitted from the CPU to the counter.
It is held in the above-mentioned head address register. After that, the incrementer operates according to the increment instruction signal to form the start address A + 1 of the start address register, and generates the address and rewrites the contents of the start address register. As shown in the timing chart of FIG. increment RAM address in order a, a + 1, a + 2, will be ..., sequential data D a in accordance with the address, D a + 1, D a + 2 · · · · is written / read.

【0058】この実施例では、ブロック転送がイネーブ
ルになった後はアドレスバスからのアドレスをカウンタ
が受け付けないため、アドレスバスにどのような値が来
ようとデータは正しく読み出されていく。従って、アド
レスバスに乱数発生器などで生成した乱数B、C、D、
E・・・が出力されるとアドレスバスの消費電流を撹乱
でき、この効果からチップ全体の消費電流を撹乱できる
ため、チップ内部動作の解析を困難にすることが可能に
なる。
In this embodiment, after the block transfer is enabled, the address from the address bus is not accepted by the counter, so that the data is correctly read no matter what value comes to the address bus. Therefore, random numbers B, C, D,
Is output, the current consumption of the address bus can be disturbed. From this effect, the current consumption of the entire chip can be disturbed. This makes it difficult to analyze the internal operation of the chip.

【0059】図23には、この発明に係るICカード用
チップの更に他の一実施例を示す要部ブロック図が示さ
れている。この実施例でも、暗号処理用演算ユニットと
メモリ(RAM)間の転送の際、メモリにカウンタを設
けるようにするものであが、かかる暗号処理用演算ユニ
ットとメモリRAMの最初のアドレスをも撹乱するよう
アドレスオフセット機能が設けられる。つまり、乱数発
生器などで生成した乱数をあらかじめCPUとカウンタ
側に同時に転送しておき、ブロック転送の最初のアドレ
スに乱数を加えるか又は引くかした値をアドレスバスに
出力する。カウンタ側ではアドレスバスの値を同じ乱数
を用いて復号化し、最初のアドレスを得る。
FIG. 23 is a main block diagram showing still another embodiment of the IC card chip according to the present invention. Also in this embodiment, a counter is provided in the memory at the time of transfer between the cryptographic processing operation unit and the memory (RAM). Address offset function is provided. That is, a random number generated by a random number generator or the like is simultaneously transferred to the CPU and the counter side in advance, and a value obtained by adding or subtracting the random number to the first address of the block transfer is output to the address bus. The counter decodes the value of the address bus using the same random number to obtain the first address.

【0060】図24には、上記転送動作を説明するため
のタイミング図が示されている。乱数発生器で形成され
た乱数をあらかじめCPUとRAMに転送しておき、オ
フセット演算部1によりブロック転送の最初のアドレス
Aに乱数Sを加えるか引くかしたアドレスA±Sをアド
レスバスに送出する。カウンタ側では、アドレスバスの
値を同じ乱数Sを用いて復号化し、オフセット演算部2
により最初のアドレスAを得て、以後前記同様にインク
リメントしてアドレスA+1、A+2・・・を生成す
る。このようなアドレスA+1、A+2に同期して、乱
数発生器が乱数B、C、D・・・をアドレスバスに送出
するので、先頭のアドレスを含めてアドレスバスの消費
電流を撹乱でき、チップ内部動作の解析をいっそう困難
にすることが可能になる。
FIG. 24 is a timing chart for explaining the transfer operation. The random number generated by the random number generator is transferred to the CPU and the RAM in advance, and the address A ± S obtained by adding or subtracting the random number S to or from the first address A of the block transfer by the offset calculation unit 1 is sent to the address bus. . On the counter side, the value of the address bus is decoded using the same random number S, and the offset calculation unit 2
, The first address A is obtained, and thereafter, it is incremented in the same manner as described above to generate addresses A + 1, A + 2,. Since the random number generator sends out random numbers B, C, D,... To the address bus in synchronization with the addresses A + 1, A + 2, the current consumption of the address bus including the head address can be disturbed, and the chip internal It becomes possible to make the operation analysis more difficult.

【0061】前記実施例のような暗号化/復号化装置に
おいて、べき乗剰余演算「XY modN」(X,Y,N
は正の整数)を用いた場合、X,Y,Nが、通常100
ビット〜2000ビット程度の非常に大きな数が使用さ
れるため、「XY modN」をいかにして高速に実行す
るかが重要となる。その一つの解法として、剰余乗算
「ABR-1modN」を実行する次のようなアルゴリズ
ムが知られており、本願出願人においては、特開平10
−21057号公報(米国登録番号5,961,57
8)において、「ABR-1modN」のアルゴリズムを
基にした積和演算器を用いたマイクロコンピュータを提
案している。
In the encryption / decryption device as in the above-described embodiment, the modular exponentiation operation “X Y modN” (X, Y, N
Is a positive integer), X, Y and N are usually 100
Since a very large number of bits to about 2000 bits is used, it is important how to execute " XY modN" at high speed. As one of the solutions, the following algorithm for executing the remainder multiplication “ABR −1 modN” is known.
No. 21057 (U.S. Registration No. 5,961,57)
8) proposes a microcomputer using a multiply-accumulate unit based on the algorithm of "ABR -1 mod N".

【0062】上記アルゴリズムは、次のステップ(1) な
いし(12)からなる。 (1) input X,Y= en en-1 ・・・ e1 , N,R (2) B=R2 modN (3) A=X (4) A=ABR-1modN+kN (5) B=A (6) for i=n−1 to 1 step−1{ (7) A=A2 -1modN+kN (8) if ei =1 then A=ABR-1modN+kN (9) } (10) A=AR-1modN+kN (11) A=AmodN (12) output A
The above algorithm includes the following steps (1) to (12). (1) input X, Y = e n e n-1 ··· e 1, N, R (2) B = R 2 modN (3) A = X (4) A = ABR -1 modN + kN (5) B = A (6) for i = n-1 to 1 step-1 {(7) A = A 2 R -1 modN + kN (8) if e i = 1 then A = ABR -1 modN + kN (9)} (10) A = AR -1 modN + kN (11) A = AmodN (12) output A

【0063】この発明の他の実施例では、前記図2コプ
ロセッサ209において、上記アルゴリズム5のステッ
プ(4) 、ステップ(7) 、ステップ(8) 、ステップ(10)で
示された「A=ABR-1modN+kN」等に記述され
る「剰余乗算」を実行するようにされる。かかるコプロ
セッサ209は、後述するような演算回路と制御回路が
含まれる。剰余乗算の入力値A,B,R,N及び出力値
Aは専用レジスタ又はRAMなどの記憶装置に保持され
る。
In another embodiment of the present invention, in the coprocessor 209 shown in FIG. 2, "A = "Remainder multiplication" described in ABR -1 mod N + kN or the like is executed. The coprocessor 209 includes an arithmetic circuit and a control circuit as described later. The input values A, B, R, N and the output value A of the remainder multiplication are held in a dedicated register or a storage device such as a RAM.

【0064】図26には、この発明に用いられるコプロ
セッサの他の一実施例のブロック図が示されている。同
図において33は第1の積和演算器、34は第2の積和
演算器、35は一次記憶値Tempを保持するテンポラ
リレジスタ、36は値Aの格納に利用されるレジスタ、
37は値Bの格納に利用されるレジスタ、38は値Nの
格納に利用されるレジスタである。39はMi生成ロジ
ック、40はMi生成ロジック39で生成された値Mi
を保持するラッチ、41は「÷2L 」を行うためのシフ
ト回路である。
FIG. 26 is a block diagram showing another embodiment of the coprocessor used in the present invention. In the figure, reference numeral 33 denotes a first product-sum operation unit, reference numeral 34 denotes a second product-sum operation unit, reference numeral 35 denotes a temporary register holding a primary storage value Temp, reference numeral 36 denotes a register used for storing a value A,
37 is a register used for storing the value B, and 38 is a register used for storing the value N. 39 is a Mi generation logic, 40 is a value M i generated by the Mi generation logic 39
Is a shift circuit for performing “÷ 2 L ”.

【0065】この実施例では、前記公報に詳細に説明さ
れているようなブロック分割に基づいて演算「( ABi
+Mi N)/2L 」を実行するようにされる。先ず、第1
の積和演算器33は、レジスタ35の値Temp、レジ
スタ36の値A、レジスタ37の値Bi を入力として、
積和演算「Temp+A・Bi 」を実行する。その演算
結果は値Temp2として次段の第2の積和演算器34
へ送られる。上記値Temp2はn+Lビット長の整数
である。
In this embodiment, the operation "(AB i
+ M i N) / 2 L ". First, first
The multiply-add unit 33, the value of the register 35 Temp, the value A of the register 36, the value B i of the register 37 as an input,
The product-sum operation “Temp + A · B i ” is executed. The result of the operation is set as a value Temp2 in the second product-sum operation unit 34 in the next stage.
Sent to The value Temp2 is an integer of n + L bit length.

【0066】一方、Mi生成ロジック39は、Lビット
長の数A0 , Bi , N0 を入力としてLビットの整数M
i を生成し、この正数Mi はレジスタ40に一時的に保
持される。第2の積和演算器34は、前記Temp2,
N,Mi を入力として、積和演算「Temp2+Mi
N」を実行する。n+Lビット長の演算結果の下位Lビ
ットは全て0であり、これをシフタ41によって消去し
て(すなわち2L で割って)、nビット長の結果が値T
empとしてレジスタ35に送られて保持される。
On the other hand, the Mi generation logic 39 receives the L-bit length numbers A 0 , B i , N 0 as inputs and receives an L-bit integer M
generates i, the positive number M i is temporarily held in the register 40. The second sum-of-products arithmetic unit 34 calculates the Temp2,
With N and M i as inputs, the product-sum operation “Temp2 + M i
N ". The lower L bits of the operation result having the n + L bit length are all 0, and this is erased by the shifter 41 (that is, divided by 2 L ), and the result having the n bit length becomes the value T.
It is sent to the register 35 as emp and held.

【0067】以上の動作をn/L回繰り返し実行すれ
ば、演算「(AB+MN)/R」が実現できる。これに
よれば、nビットの整数Mをあらかじめ計算して保持す
る必要はなく、Lビット長のMi のみを積和演算器33
の計算中に求めてレジスタ40に保持すればよく、値M
の計算時間の削除、および値Mを保持する記憶手段の規
模を縮小することができる。さらに、積和演算器33と
積和演算器34を直列的に接続して連続的に動作させる
ことにより、n+Lビット長の中間結果Temp2を一
時的に保持する記憶手段を特別に設けることも必要なく
なる。
By repeating the above operation n / L times, the operation "(AB + MN) / R" can be realized. According to this, it is not necessary to calculate and hold the n-bit integer M in advance, and only the L-bit length M i is calculated by the product-sum calculator 33.
May be obtained during the calculation of the value and held in the register 40, and the value M
Can be eliminated, and the scale of the storage means for holding the value M can be reduced. Further, by connecting the product-sum calculator 33 and the product-sum calculator 34 in series and operating them continuously, it is also necessary to provide a special storage means for temporarily holding the intermediate result Temp2 having an n + L bit length. Disappears.

【0068】レジスタ35〜38を積和演算器33、3
4にバス43で接続される。したがって前記レジスタ3
5〜38をRAM42で構成することができる。これに
より、半導体チップ上のレジスタ面積の低減が可能とな
る。また、この構成においては、特にデータバス43に
よるデータ転送量が多いため、バス幅が大きくなって半
導体チップの面積が大きくならないようにする必要が生
じるが、図26の実施例のように積和演算器33と積和
演算器34を直列的に接続することにより、中間結果T
emp2をデータバスを用いて転送することが不要にな
るため、バスによるデータ転送量の低減を図ることがで
きる。
The registers 35 to 38 are stored in the product-sum operation units 33, 3
4 via a bus 43. Therefore, register 3
5 to 38 can be constituted by the RAM 42. As a result, the area of the register on the semiconductor chip can be reduced. Also, in this configuration, since the data transfer amount by the data bus 43 is particularly large, it is necessary to prevent the bus width from increasing and the area of the semiconductor chip from increasing. By connecting the calculator 33 and the product-sum calculator 34 in series, the intermediate result T
Since it is unnecessary to transfer emp2 using the data bus, it is possible to reduce the amount of data transferred by the bus.

【0069】この実施例のコプロセッサでは、第1の積
和演算器33でTemp=0、第2の積和演算器34で
i ・N=0、さらにセレクタ41による「÷2L 」の
動作を行なわないことにより、同図に示される演算手段
を、「A・Bi 」のような多倍長乗算(小さな数Bi
その多倍長に相当する大きな数Aとの乗算)を実行する
回路として使用することができる。「A・Bi 」のよう
な多倍長乗算演算は、上記アルゴリズムのステップ(2)
の演算「R2 mod N」をマイクロプロセッサ201
を用いて実行するときに適用されることにより、その演
算の高速化を図ることができる。
[0069] In the co-processor of this embodiment, Temp = 0 in the first product-sum operation unit 33, M i · N = 0 in the second product-sum operation unit 34, further by the selector 41 of the "÷ 2 L" By not performing the operation, the arithmetic means shown in the figure can perform a multiple length multiplication (multiplication of a small number B i and a large number A corresponding to the multiple length thereof) such as “A · B i ”. It can be used as a running circuit. The multiple-precision multiplication operation such as “A · B i ” is performed in step (2) of the above algorithm.
Calculation “R 2 mod N” of the microprocessor 201
By applying the above when executing using, it is possible to speed up the operation.

【0070】図27の「R2 modN」の計算の概念図
に示されていように、R=2n 、n=512とされ、N
は512ビット、R2 は最上位ビットだけが1で下位側
1024ビット全てが0の値とされる。マイクロプロセ
ッサで演算「R2 mod N」を行うとき、大きな数の
2 を同様に大きな数のNで直接に除算するのは効率的
でないから、被除数を最上位側から64ビット単位のブ
ロックとして把握し、また、除数を最上位側から32ビ
ット単位のブロックとして把握し、順次上位側のブロッ
ク同士を対象に除算を行い、それによって得られる値を
商の概数として把握する。
As shown in the conceptual diagram of the calculation of “R 2 modN” in FIG. 27, R = 2 n , n = 512, and N
Is 512 bits, R 2 is lower 1024 bits all only the most significant bit is 1 is the value of 0. When the operation “R 2 mod N” is performed by a microprocessor, it is not efficient to directly divide a large number of R 2 by a similarly large number of N, so the dividend is divided into blocks of 64 bits from the most significant side. In addition, the divisor is grasped as a block of 32 bits from the most significant side, and division is sequentially performed on the higher-order blocks, and the value obtained thereby is grasped as an approximate number of the quotient.

【0071】同図において、例えばQ(=Da÷Na)
を商の概数として把握する。概略的には、R2 の上位側
に対して「Q・Na」を減算し、その減算結果の上位側
に対して「Q・Nb」を減算する。「Q・Nb」の減算
結果に対して同様の処理を行い、更にその結果の対して
同様の処理を繰り返すという手法によって、「R2 mo
dN」の結果を得ることができる。
In the figure, for example, Q (= Da ÷ Na)
As an approximate number of quotients. Schematically, “Q · Na” is subtracted from the upper side of R 2 , and “Q · Nb” is subtracted from the upper side of the subtraction result. The same processing is performed on the subtraction result of “Q · Nb”, and the same processing is repeated on the result, thereby obtaining “R 2 mo”.
dN ”can be obtained.

【0072】実際にはその途上で、余剰ビットを消去す
るための減算処理が介在される。このとき、前記演算
「Q・Nb」の処理は、第1回目では32ビットと48
0ビットという大きな数の乗算処理とされる。しかもそ
のような大きな数の乗算処理は何回も繰り返される。こ
のとき、前記図26に示されるコプロセッサによって演
算可能な前記「A・Bi 」のような多倍長乗算演算を利
用することにより、換言すれば、そのような多倍長乗算
演算をコプロセッサに負担させれば、上記アルゴリズム
5におけるステップ2の演算「R2 modN」をマイク
ロプロセッサ201を用いて実行するとき、その演算処
理の高速化を図ることができる。
In practice, a subtraction process for erasing surplus bits is interposed on the way. At this time, the processing of the calculation “Q · Nb” is performed in the first time by using 32 bits and 48 bits
This is a multiplication process of a large number of 0 bits. Moreover, such a large number of multiplication processes is repeated many times. At this time, by using a multiple length multiplication operation such as “A · B i ” which can be operated by the coprocessor shown in FIG. 26, in other words, such multiple length multiplication operation is If the processor is burdened, when the operation “R 2 modN” of step 2 in the above algorithm 5 is executed using the microprocessor 201, the speed of the arithmetic processing can be increased.

【0073】前記のようなアルゴリズムにおける「A=
ABR-1modN」の演算処理では、前記公報(特開平
10−21057号)において詳述されているように、
剰余乗算において、オーバーフロー有りのときには更に
演算結果WからNを減算W−Nするものであるため、オ
ーバーフローの有無により演算時間や消費電流の違いが
生じる。このため、前記のようなICカードLSIの消
費電流を観測し、そのタイミングや統計的処理の結果か
らチップ内の動作を解析されてしまう可能性を持ってい
る。
In the above algorithm, “A =
In the arithmetic processing of “ABR −1 modN”, as described in detail in the above-mentioned publication (Japanese Patent Laid-Open No. 10-21057),
In the remainder multiplication, when there is an overflow, N is further subtracted from the operation result W-N, so that the operation time and current consumption differ depending on the presence or absence of the overflow. Therefore, there is a possibility that the current consumption of the IC card LSI as described above is observed, and the operation in the chip is analyzed from the timing and the result of the statistical processing.

【0074】図28には、この発明に係る暗号化処理用
演算ユニットの一実施例の要部ブロック図が示されてい
る。この実施例の暗号化処理用演算ユニットは、前記の
ようなICカード等に搭載される1チップのマイクロコ
ンピュータに含まれるコプロセッサに含まれる。
FIG. 28 is a block diagram showing a main part of an embodiment of the arithmetic unit for encryption processing according to the present invention. The arithmetic unit for encryption processing of this embodiment is included in a coprocessor included in a one-chip microcomputer mounted on an IC card or the like as described above.

【0075】図28において、前記図26に示した第1
と第2の積和演算器33、34を含む積和演算器によ
り、前記A2 -1modN又はABR-1modNの演算
が行われ、その演算結果WはテンポラリレジスタTem
pに格納され、演算結果にオーバーフローが発生した場
合には演算器からのオーバーフローフラグOVが制御論
理のOV格納レジスタに記憶される。そして、続いて上
記剰余乗算の後にテンポラリレジスタTempに格納さ
れた演算結果W−Nの減算が行われる。
Referring to FIG. 28, the first type shown in FIG.
When the product-sum operation unit comprising a second sum of product arithmetic unit 33, the A 2 R -1 modN or operation of ABR -1 modN is performed, the calculation result W is temporary register Tem
The overflow flag OV from the arithmetic unit is stored in the OV storage register of the control logic when an overflow occurs in the operation result. Then, after the remainder multiplication, the operation result WN stored in the temporary register Temp is subtracted.

【0076】上記オーバーフローフラグOVが有る時
(論理1)には上記減算W−Nの結果は、テンポラリレ
ジスタTempに格納され、オーバーフローフラグOV
が無い時(論理0)には減算W−Nの結果は、テンポラ
リレジスタTempに格納されず、上記テンポラリレジ
スタTemp以外の適当な記憶回路、例えばレジスタA
に格納される。つまり、前記減算W−Nと、それにより
形成された無効データを適当な記憶回路に格納する動作
は、前記錯乱目的のダミー動作とされる。これにより、
前記剰余乗算においてオーバーフローが生じないときで
も、W−Nの減算及びその演算結果をレジスタに格納す
ることに伴うICカードの動作電流が常に発生し、オー
バーフローの有無を外部より識別困難とすることができ
るものとなる。
When the overflow flag OV is present (logic 1), the result of the subtraction WN is stored in a temporary register Temp, and the overflow flag OV
When there is no (logic 0), the result of the subtraction WN is not stored in the temporary register Temp, and an appropriate storage circuit other than the temporary register Temp, for example, the register A
Is stored in In other words, the operation of storing the subtraction WN and the invalid data formed by the subtraction in an appropriate storage circuit is the dummy operation for the purpose of confusion. This allows
Even when the overflow does not occur in the remainder multiplication, the operation current of the IC card accompanying the subtraction of the WN and storing the operation result in the register always occurs, and it is difficult to externally determine whether or not the overflow exists. You can do it.

【0077】上記の信号処理は、次のようなプログラム
によって実施される。 W ← (AB+MN)/R Store OV bit if OV then W ← W−N (正規のオーバーフロー処理とWへの書き込み) Else A ← W−N (ダミーのオーバーフロー処理とAへの書き込み) Exchange W and A Output A
The above signal processing is performed by the following program. W ← (AB + MN) / R Store OV bit if OV then W ← W−N (Regular overflow processing and writing to W) Else A ← W−N (Dummy overflow processing and writing to A) Exchange W and A Output A

【0078】上記プログラムにおいて、Wはテンポラリ
レジスタ及びそのデータを表している。そして、オーバ
ーフローフラグOV無しのときに、テンポラリレジスタ
TempのアドレスをレジスタAのアドレスを交換する
ことにより、オーバーフローフラグOVの有り/無しに
対応してW又はAのデータが有効なデータとして出力さ
れる。この実施例では、Exchange W and
Aのようなアドレス交換によって、レジスタAのアド
レス指定によりテンポラリレジスタ(W)のデータを出
力させるものである。
In the above program, W represents a temporary register and its data. By exchanging the address of the temporary register Temp with the address of the register A when the overflow flag OV is absent, the data of W or A is output as valid data corresponding to the presence / absence of the overflow flag OV. . In this embodiment, Exchange W and
By the address exchange such as A, the data of the temporary register (W) is output by specifying the address of the register A.

【0079】上記の信号処理は、次のようなプログラム
に置き換えることができる。 W ← (AB+NM)/R Store OV bit A ← W−N (オーバーフロー処理とレジスタAへの書き込み) if! OV then Exchange W and A Else nop Output A
The above signal processing can be replaced by the following program. W ← (AB + NM) / R Store OV bit A ← WN (Overflow processing and writing to register A) if! OV then Exchange W and A Else nop Output A

【0080】つまり、オーバーフローOVの有無に無条
件でのオーバーフロー処理のための減算W−Nとその減
算結果をAレジスタの書き込みを行った後に、オーバー
フローフラグOVが無ければ、Exchange W
and Aのようにアドレス交換を行ってレジスタAの
アドレス指定によりテンポラリレジスタ(W)のデータ
を出力させ、無ければアドレスを交換することなくAレ
ジスタのデータW−Nを有効なデータとして出力させ
る。
That is, after the subtraction WN for the overflow processing unconditionally and the result of the subtraction are written into the A register depending on the presence or absence of the overflow OV, if the overflow flag OV is not present, Exchange W
As in the case of "and A", the address is exchanged to output the data of the temporary register (W) by specifying the address of the register A, and if not, the data W-N of the A register is output as valid data without exchanging the address.

【0081】上記の信号処理は、更に次のようなプログ
ラムに置き換えることができる。 W ← (AB+NM)/R Store OV bit Exchange W and A W ← A−N (オーバーフロー処理とレジスタAへの書き込み) if OV then Exchange W and A Else nop Output A
The above signal processing can be further replaced by the following program. W ← (AB + NM) / R Store OV bit Exchange W and A W ← AN (Overflow processing and writing to register A) if OV then Exchange W and A Else no Output A

【0082】つまり、オーバーフローOVの有無に無条
件でのオーバーフロー処理のための減算W−Aを行う前
にExchange W and Aのようにアドレス
交換を行ってA−Nの減算、つまりはW−Nの減算を行
ってテンポラリレジスタ(W)、つまりレジスタAにデ
ータを出力させる。そして、オーバーフローフラグOV
が有れば、Exchange W and Aのように
再度アドレス交換を行い、レジスタAのアドレス指定に
よりレジスタAのデータを、オーバーフローフラグOV
が無ければ前記のように交換したままレジスタAのアド
レス指定によりテンポラリレジスタ(W)のデータを出
力させる。この構成では、レジスタへの書き込みを行う
論理回路は、みかけ上テンポラリレジスタ(W)を書き
込むような構成となり、レジスタAへの書き込み用論理
が不要となって回路の簡素化が可能になる。
That is, before performing the subtraction WA for the unconditional overflow processing in the presence or absence of the overflow OV, the address is exchanged as in Exchange W and A, and the AN is subtracted, that is, WN And outputs data to a temporary register (W), that is, a register A. And the overflow flag OV
If there is, the address is exchanged again as in the case of Exchange W and A, and the data in the register A is changed to the overflow flag OV by specifying the address of the register A.
If there is no data, the data of the temporary register (W) is output by specifying the address of the register A while the data is exchanged as described above. In this configuration, the logic circuit for writing to the register has a configuration in which the temporary register (W) is apparently written, so that the logic for writing to the register A becomes unnecessary and the circuit can be simplified.

【0083】前記テンポラリレジスタTempとレジス
タAのアドレス交換は、フラグ反転回路により実現でき
る。つまり、アドレスバスから供給されるアドレス信号
のうち、例えば最下位ビットのような1ビットがテンポ
ラリレジスタTempとレジスタAとで異なるように設
定しておき、フラグ反転回路により選択的にかかるビッ
トを交換するだけで、テンポラリレジスタTempに割
り当てられたアドレス指定によりレジスタAを選択で
き、逆にレジスタAに割り当てられたアドレスによりテ
ンポラリレジスタTempを選択することができる。
The address exchange between the temporary register Temp and the register A can be realized by a flag inversion circuit. That is, of the address signals supplied from the address bus, for example, one bit such as the least significant bit is set to be different between the temporary register Temp and the register A, and the bit inversion is selectively exchanged by the flag inversion circuit. By simply doing so, the register A can be selected by specifying the address assigned to the temporary register Temp, and conversely, the temporary register Temp can be selected by the address assigned to the register A.

【0084】図28の実施例において、2つのレジスタ
TempとAを用い、オーバーフローフラグOVに対応
して、常に一方(例えばテンポラリレジスタTemp)
に有効データを格納させ、前記のようなアドレス交換に
よってレジスタAを指定するアドレスにより有効なデー
タを出力させる。前記減算W−Nと、それにより形成さ
れた無効データを適当な記憶回路に格納する動作が錯乱
目的のダミー動作とされる。これにより、前記剰余乗算
においてオーバーフローが生じないときでも、W−Nの
減算及びその演算結果をレジスタに格納することに伴う
ICカードの動作電流が常に発生し、オーバーフローの
有無を外部より識別困難とすることができるものとな
る。
In the embodiment shown in FIG. 28, two registers Temp and A are used, and one register (for example, a temporary register Temp) is always used in correspondence with the overflow flag OV.
And the valid data is output by the address designating the register A by the address exchange as described above. The operation of storing the subtraction WN and the invalid data formed by the subtraction in an appropriate storage circuit is a dummy operation for the purpose of confusion. Thereby, even when the overflow does not occur in the remainder multiplication, the operation current of the IC card is always generated due to the subtraction of the WN and storing the operation result in the register, and it is difficult to externally determine whether or not the overflow exists. Can be done.

【0085】前記実施例のように積和演算器の前記のよ
うなオーバーフローフラグに代えてボロー(Borro
w)フラグBRを利用するものであってもよい。つま
り、前記A2 -1modN又はABR-1modNの演算
結果WはテンポラリレジスタTempに格納し、W−N
の減算が行われときの演算器からのボローフラグBRを
記憶し、ボローフラグBRが有るときのみ、テンポラリ
レジスタTempとレジスタAのアドレスを交換し、最
終的にはレジスタAのアドレス指定により有効なデータ
を読み出すようにするものであってもよい。
As in the above embodiment, a borrow (Borro) is used instead of the overflow flag of the multiply-accumulate operation unit.
w) The flag BR may be used. That is, the operation result W of the A 2 R -1 modN or the ABR -1 mod N is stored in the temporary register Temp, and W-N
The borrow flag BR from the arithmetic unit when the subtraction is performed is stored. Only when the borrow flag BR is present, the address of the temporary register Temp and the address of the register A are exchanged. The information may be read out.

【0086】上記の信号処理は、次のようなプログラム
により実現できる。
The above signal processing can be realized by the following program.

【0087】図29には、この発明に係る暗号化処理用
演算ユニットの他の一実施例の要部ブロック図が示され
ている。この実施例の暗号化処理用演算ユニットも前記
のようなICカード等に搭載される1チップのマイクロ
コンピュータに含まれるコプロセッサに含まれる。この
実施例では、データバスの信号と前記のような積和演算
器の出力とのうちのいずれか一方を前記のようなOVフ
ラグ格納レジスタに記憶されたオーバーフローフラグO
Vに従って出力させるセレクタが追加される。
FIG. 29 is a block diagram showing a main part of another embodiment of the encryption processing operation unit according to the present invention. The encryption processing operation unit of this embodiment is also included in the coprocessor included in the one-chip microcomputer mounted on the above-described IC card or the like. In this embodiment, one of the signal of the data bus and the output of the multiply-accumulate unit is used as the overflow flag O stored in the OV flag storage register.
A selector for outputting according to V is added.

【0088】上記剰余乗算の後W−Nの減算が行われ、
この減算結果W−Nと演算のためにデータバス上に読み
出されたWの値がセレクタに入力され、オーバーフロー
フラグOVが有るときには減算結果W−Nが、オーバー
フローフラグOVが無いときにはデータバスWの値が選
択され、この選択された値がレジスタAに格納され、A
が最終的に有効なデータとして出力されることにより、
W−Nの減算とレジスタヘの書込みに伴うICカードや
マイクロコンピュータの動作電流が常に発生し、オーバ
ーフローの有無を外部より識別困難とされる。
After the remainder multiplication, WN subtraction is performed.
The subtraction result WN and the value of W read on the data bus for the operation are input to the selector, and the subtraction result WN is output when the overflow flag OV is present, and the data bus W is output when the overflow flag OV is not present. Is selected, and the selected value is stored in the register A.
Is finally output as valid data,
An operating current of the IC card or the microcomputer is always generated due to the subtraction of WN and the writing to the register, which makes it difficult to externally determine whether or not overflow has occurred.

【0089】図30には、この発明に係る暗号化処理用
演算ユニットの更に他の一実施例の要部ブロック図が示
されている。この実施例は、前記図28の実施例におい
てレジスタブロックにレジスタXが追加される。前記同
様に剰余乗算の後W−Nの減算が行われ、オーバーフロ
ーフラグOVが有る時にはこの減算結果W−Nがレジス
タAに、オーバーフローフラグOVが無い時にはダミー
演算専用のレジスタXに減算W−Nが書込まれる。この
後に、オーバーフローフラグOVが無い時には、テンポ
ラリレジスタ(W)とレジスタAとのアドレスを交換し
て、最終的にレジスタAを選択するアドレスにより有効
なデータを出力させる。
FIG. 30 is a block diagram showing a main part of still another embodiment of the arithmetic unit for encryption processing according to the present invention. In this embodiment, a register X is added to the register block in the embodiment of FIG. In the same manner as described above, the subtraction of WN is performed after the remainder multiplication, and when the overflow flag OV is present, the subtraction result WN is stored in the register A. Is written. Thereafter, when the overflow flag OV does not exist, the addresses of the temporary register (W) and the register A are exchanged, and finally, valid data is output by the address for selecting the register A.

【0090】上記の信号処理は、次のようなプログラム
により実現できる。 W ← (AB+NM)/R Store OV bit if OV then A ← W−N (正規のオーバーフロー処理とAへの書き込み) Else X ← W−N (ダミーのオーバーフロー処理とXへの書き込み) Exchange W and A Output A
The above signal processing can be realized by the following program. W ← (AB + NM) / R Store OV bit if OV then A ← WN (Regular overflow processing and writing to A) Else X ← WN (Dummy overflow processing and writing to X) Exchange W and A Output A

【0091】上記の実施例から得られる作用効果は、下
記の通りである。すなわち、 (1) 外部端子がリードライト装置と電気的に接続さ
れることによって動作電圧が供給され、かつ、暗号化処
理又は復号化処理を伴ったデータの入出力動作を含むI
Cカードにおいて、上記暗号化処理又は復号化処理に本
来の処理動作に似た攪乱目的のダミー処理動作を含ませ
て内部回路の動作タイミング及び動作電流の画一化を行
なうようにすることによって、電流波形を利用した解読
を困難にすることができるという効果が得られる。
The effects obtained from the above embodiment are as follows. That is, (1) an operation voltage is supplied by an external terminal being electrically connected to a read / write device, and an I / O operation including a data input / output operation accompanied by an encryption process or a decryption process.
In the C card, the encryption processing or the decryption processing includes a dummy processing operation for the purpose of disturbing similar to the original processing operation, so that the operation timing and operation current of the internal circuit are made uniform. An effect is obtained that decoding using the current waveform can be made difficult.

【0092】(2) 上記に加えて、上記暗号化処理又
は復号化処理は、RSA暗号法などに応用可能なべき乗
剰余乗算動作を含むようにすることにより、機密保護の
強化を実現したICカードを得ることができるという効
果が得られる。
(2) In addition to the above, the encryption or decryption processing includes an exponentiation multiplication operation applicable to RSA cryptography or the like, thereby realizing an enhanced security of an IC card. Can be obtained.

【0093】(3) 上記に加えて、上記べき乗剰余演
算動作を中央処理装置からの指示を受けて動作する暗号
処理用演算ユニットにより行わせることにより、高速な
データ処理を行なうようにすることができるという効果
が得られる。
(3) In addition to the above, high-speed data processing can be performed by performing the above-described modular exponentiation operation by an encryption processing operation unit that operates in response to an instruction from the central processing unit. The effect that it can be obtained is obtained.

【0094】(4) 上記に加えて、上記暗号化処理用
演算ユニットの動作として、入力されたX、Y及びNを
受け、A=1、B=Xとして、A=A2 modNとA=
ABmodNの演算を交互行ない、かかる演算において
Yの上位から1ビットずつみて、論理0であれば上記A
2 modNの演算結果を有効なデータとして記憶回路に
取り込み、論理1であれば上記A2 modNとABmo
dNの演算結果を有効なデータとして記憶回路に取り込
むものとし、上記論理0のときのA=ABmodNの演
算動作を上記攪乱目的のダミー処理動作とすることによ
り、暗号処理を行いつつ電流波形を利用した解読を困難
にすることができるという効果が得られる。
(4) In addition to the above, the operation of the arithmetic unit for encryption processing receives the input X, Y, and N, sets A = 1, B = X, and sets A = A 2 modN and A =
The operation of ABmodN is performed alternately. In this operation, when the upper bit of Y is viewed one bit at a time, and the logic 0, the above A
The calculation results of the 2 modN uptake in the storage circuit as valid data, the A 2 modN and ABmo is logic 1
The result of the operation of dN is taken into the storage circuit as valid data, and the operation of A = ABmodN at the time of logic 0 is used as the dummy processing operation for the purpose of the disturbance, so that the current waveform is used while performing the encryption processing. This makes it possible to make the decryption difficult.

【0095】(5) 上記に加えて、上記記憶回路をリ
ードライトバッファを通してデータの入出力が行なわれ
る複数のレジスタからなるレジスタブロックを用い、上
記Yの特定ビットei の論理1又は0によってゲート回
路を制御し、所定のレジスタに供給されるライトストロ
ーブ信号の伝達を制御して、上記演算結果のうち有効な
データのみがリードライトバッファを通して上記所定の
レジスタに格納することにより、暗号処理を行いつつ電
流波形を利用した解読を困難にすることができるという
効果が得られる。
[0095] (5) In addition to the above, using a register block including a plurality of registers data input and output is performed through the read-write buffer the memory circuit, the gate by a logical 1 or 0 of a specific bit e i of the Y A circuit is controlled to control transmission of a write strobe signal supplied to a predetermined register, and only valid data among the operation results is stored in the predetermined register through a read / write buffer, thereby performing encryption processing. In addition, it is possible to obtain an effect that the decoding using the current waveform can be made difficult.

【0096】(6) 上記に加えて、上記記憶回路をリ
ードライトバッファを通してデータの入出力が行なわれ
る複数のレジスタとからなるレジスタブロックを用い、
上記Yの特定ビットei の論理1又は0によってゲート
回路を制御し、上記リードライトバッファに供給される
ライトストローブ信号の伝達を制御して、上記演算結果
のうち有効なデータのみがリードライトバッファを通し
て上記所定のレジスタに格納することにより、暗号処理
を行いつつ電流波形を利用した解読を困難にすることが
できるという効果が得られる。
(6) In addition to the above, the storage circuit uses a register block including a plurality of registers for inputting and outputting data through a read / write buffer.
Controls the gate circuit by a logic 1 or 0 of a specific bit e i of the Y, and controls the transmission of the write strobe signal supplied to the read-write buffer, valid data only read write buffer of the calculation result By storing the data in the above-mentioned predetermined register, the decryption using the current waveform can be made difficult while performing the encryption processing.

【0097】(7) 上記に加えて、上記記憶回路をリ
ードライトバッファを通してデータの入出力が行なわれ
る複数のレジスタ及びダミーレジスタとからなるレジス
タブロックを用い、上記リードライトバッファと上記ダ
ミーレジスタ及び複数のレジスタとの間セレクタを設け
て上記Yの特定ビットei の論理1又は0によって制御
して、リードライトバッファに書き込まれた演算結果の
うち有効なデータを所定のレジスタに格納し、無効なデ
ータが上記ダミーレジスタに格納することにより、暗号
処理を行いつつ電流波形を利用した解読をよりいっそう
困難にすることができるという効果が得られる。
(7) In addition to the above, the storage circuit uses a register block including a plurality of registers and a dummy register for inputting and outputting data through a read / write buffer, and the read / write buffer, the dummy register, and the A selector is provided between the read and write buffers to store valid data among the operation results written in the read / write buffer in a predetermined register and to control the invalid data by controlling the logical 1 or 0 of the specific bit e i of Y. By storing the data in the dummy register, it is possible to obtain the effect that the decryption using the current waveform can be made more difficult while performing the encryption processing.

【0098】(8) 上記に加えて、上記暗号化処理用
演算ユニットの動作として、入力されたX、Y及びNを
受け、A=1、B=Xとして、A=A2 modNとA=
ABmodNの演算を交互行ない、かかる演算において
Yの上位から1ビットずつみて、論理0であれば上記A
2 modNの演算結果を有効なデータとしてその出力タ
イミングで記憶回路に取り込み、論理1であれば上記A
2 modNとABmodNの演算結果を有効なデータと
してその出力タイミングで記憶回路に取り込むものであ
り、上記A=A2 modNの演算結果が出力されてから
上記A=ABmodNの演算が開始されまるまでの間も
上記A=A2 modNの動作を継続し、A=ABmod
Nの演算結果が出力されてからYのビットの変更判定処
理を含めて次のビットに対応したA2 modNの演算が
開始されるまでの間も上記A=ABmodNの動作を継
続することにより、暗号処理を行いつつ電流波形を利用
した解読をよりいっそう困難にすることができるという
効果が得られる。
(8) In addition to the above, the operation of the arithmetic unit for encryption processing receives the input X, Y and N, and sets A = 1, B = X, A = A 2 mod N and A =
The operation of ABmodN is performed alternately. In this operation, when the upper bit of Y is viewed one bit at a time, and the logic 0, the above A
The operation result of 2 mod N is taken into the storage circuit as valid data at the output timing thereof.
The calculation results of 2 mod N and AB mod N are fetched into the storage circuit as valid data at the output timing, and are obtained from when the calculation result of A = A 2 mod N is output until the calculation of A = AB mod N is started. In the meantime, the operation of the above A = A 2 mod N is continued, and A = AB mod
By continuing the operation of A = ABmodN from the output of the calculation result of N to the start of the calculation of A 2 modN corresponding to the next bit including the change determination process of the bit of Y, The effect is obtained that the decryption using the current waveform can be made more difficult while performing the encryption processing.

【0099】(9) 上記に加えて、上記暗号化処理用
演算ユニットの動作として、入力されたX、Y及びNを
受け、A=1、B=Xとして、A=A2 modNとA=
ABmodNの演算とそれぞれに対してオーバーフロー
演算行ない、かかる演算においてYの上位から1ビット
ずつみて、論理0であれば上記A2 modNの演算結果
を有効なデータとして記憶回路に取り込み、論理1であ
れば上記A2 modNとABmodNの演算結果を有効
なデータとして記憶回路に取り込むものであり、上記論
理0のときのA=ABmodNの演算動作と、各演算動
作での不要なオーバーフロー演算を上記攪乱目的のダミ
ー処理動作とすることにより、暗号処理を行いつつ電流
波形を利用した解読をよりいっそう困難にすることがで
きるという効果が得られる。
(9) In addition to the above, the operation of the arithmetic unit for encryption processing receives the input X, Y, and N, sets A = 1, B = X, and sets A = A 2 modN and A =
An ABmodN operation and an overflow operation are performed on each of them. In such an operation, the upper bit of Y is examined one bit at a time, and if it is logic 0, the above A 2 modN operation result is taken into the storage circuit as valid data, For example, the operation results of A 2 mod N and AB mod N are fetched into the storage circuit as valid data, and the operation of A = AB mod N when the logic is 0 and the unnecessary overflow operation in each operation are performed by the above-mentioned disturbance object. With the dummy processing operation described above, there is an effect that the decryption using the current waveform can be made more difficult while performing the encryption processing.

【0100】(10) 外部端子がリードライト装置と
電気的に接続されることによって動作電圧が供給され、
かつ、暗号化処理又は復号化処理を伴ってデータの入出
力動作が行われるICカードに、上記暗号化処理又は復
号化処理に攪乱目的のダミー演算を含ませて内部回路の
動作タイミング及び動作電流に不規則性を持たせること
により、暗号処理を行いつつ電流波形を利用した解読を
よりいっそう困難にしたICカードを得ることができる
という効果が得られる。
(10) An operating voltage is supplied when the external terminal is electrically connected to the read / write device.
In addition, an IC card in which an input / output operation of data is performed along with an encryption process or a decryption process includes a dummy operation for the purpose of disturbance in the encryption process or the decryption process, and an operation timing and an operating current of an internal circuit. By giving the irregularities to the IC card, it is possible to obtain an effect that it is possible to obtain an IC card in which the decryption using the current waveform is more difficult while performing the encryption processing.

【0101】(11) 外部端子がリードライト装置と
電気的に接続されることによって動作電圧が供給され、
かつ、暗号化処理又は復号化処理を伴ってデータの入出
力動作が行われるICカードに、上記暗号化処理又は復
号化処理における各演算の間隔に攪乱目的のダミーサイ
クルを含ませて内部回路の動作タイミング及び動作電流
に不規則性を持たせることにより、暗号処理を行いつつ
電流波形を利用した解読をよりいっそう困難にしたIC
カードを得ることができるという効果が得られる。
(11) An operating voltage is supplied when the external terminal is electrically connected to the read / write device.
In addition, an IC card in which data input / output operation is performed along with the encryption or decryption processing includes a dummy cycle for the purpose of disturbance in the interval of each operation in the encryption or decryption processing, so that the internal circuit is An IC that makes it more difficult to decipher using current waveforms while performing cryptographic processing by providing irregularities in operation timing and operation current
The effect that a card can be obtained is obtained.

【0102】(12) 暗号化処理又は復号化処理を伴
ったデータの入出力動作を含むモジュール構成のマイク
ロコンピュータにおいて、上記暗号化処理又は復号化処
理に攪乱目的のダミー処理動作を含ませて内部回路の動
作タイミング及び動作電流の画一化を行なうようにする
ことにより、モジュール化されたマイクロコンピュータ
に対する電流波形を利用した解読を困難にすることがで
きるという効果が得られる。
(12) In a microcomputer having a module configuration including an input / output operation of data accompanied by an encryption process or a decryption process, the encryption process or the decryption process includes a dummy processing operation for the purpose of disturbance and is internally performed. By making the operation timing and the operation current of the circuit uniform, it is possible to obtain an effect that decoding using a current waveform for a modularized microcomputer can be made difficult.

【0103】(13) 上記に加えて、上記マイクロコ
ンピュータのモジュール構成を1つの半導体基板上にお
いて形成することにより、小型化を図りつつ電流波形以
外の直接的なプログラム又はデータ等の解読も防止する
ことができるという効果が得られる。
(13) In addition to the above, by forming the module configuration of the microcomputer on one semiconductor substrate, it is possible to reduce the size and to prevent the direct decoding of programs or data other than the current waveform. The effect that it can be obtained is obtained.

【0104】(14) 上記に加えて、上記マイクロコ
ンピュータの暗号化処理又は復号化処理を、RSA暗号
法などに応用可能なべき乗剰余乗算動作を含むものと
し、上記べき乗剰余乗算動作を中央処理装置からの指示
を受けて動作する暗号処理用演算ユニットにより行なう
ようにすることにより、高速な暗号処理動作を行なうよ
うにすることができるという効果が得られる。
(14) In addition to the above, the encryption or decryption processing of the microcomputer includes a power-residue multiplication operation applicable to RSA cryptography or the like, and the power-residue multiplication operation is performed by the central processing unit. Is performed by the cryptographic processing operation unit that operates in response to the above instruction, an effect is obtained that a high-speed cryptographic processing operation can be performed.

【0105】(15) 上記に加えて、上記マイクロコ
ンピュータの暗号化処理用演算ユニットの動作として、
入力されたX、Y及びNを受け、A=1、B=Xとし
て、A=A2 modNとA=ABmodNの演算を行な
い、かかる演算においてYの上位から1ビットずつみ
て、論理0であれば上記A2 modNの演算結果を有効
なデータとして記憶回路に取り込み、論理1であれば上
記A2 modNとABmodNの演算結果を有効なデー
タとして記憶回路に取り込むものとし、上記論理0のと
きのA=ABmodNの演算動作を上記攪乱目的のダミ
ー処理動作とすることにより、暗号処理を行いつつ電流
波形を利用した解読を困難にすることができるという効
果が得られる。
(15) In addition to the above, as the operation of the arithmetic processing unit for encryption processing of the microcomputer,
In response to the input X, Y and N, A = 1, B = X, and A = A 2 modN and A = ABmodN are calculated. the uptake in the memory circuit the operation result of the a 2 modN as valid data, if the logic 1 is assumed to incorporate a memory circuit the operation result of the a 2 modN and ABmodN as valid data, when the above logical 0 By setting the arithmetic operation of A = ABmodN as the dummy processing operation for the purpose of the disturbance, it is possible to obtain an effect that it is difficult to perform the decryption using the current waveform while performing the encryption processing.

【0106】(16) 上記に加えて、上記マイクロコ
ンピュータの暗号化処理用演算ユニットの動作として、
入力されたX、Y及びNを受け、A=1、B=Xとし
て、A=A2 modNとA=ABmodNの演算を行な
い、かかる演算においてYの上位から1ビットずつみ
て、論理0であれば上記A2 modNの演算結果を有効
なデータとしてその出力タイミングで記憶回路に取り込
み、論理1であれば上記A2modNとABmodNの
演算結果を有効なデータとしてその出力タイミングで記
憶回路に取り込むものであり、上記A=A2 modNの
演算結果が出力されてから上記A=ABmodNの演算
が開始されまるまでの間も上記A=A2 modNの動作
を継続し、A=ABmodNの演算結果が出力されてか
らYのビットの変更判定処理を含めて次のビットに対応
したA2 modNの演算が開始されるまでの間も上記A
=ABmodNの動作を継続することにより、暗号処理
を行いつつ電流波形を利用した解読を困難にすることが
できるという効果が得られる。 (17) 上記に加えて、上記マイクロコンピュータの
暗号化処理用演算ユニットの動作として、入力された
X、Y及びNを受け、A=1、B=Xとして、A=XY
modNとA=ABmodNの演算とそれぞれに対して
オーバーフロー演算を行ない、かかる演算においてYの
上位から1ビットずつみて、論理0であれば上記A2
odNの演算結果を有効なデータとして記憶回路に取り
込み、論理1であれば上記A2 modNとABmodN
の演算結果を有効なデータとして記憶回路に取り込むも
のであり、上記論理0のときのA=ABmodNの演算
動作と、各演算動作での不要なオーバーフロー演算を上
記攪乱目的のダミー処理動作とすることにより、暗号処
理を行いつつ電流波形を利用した解読を困難にすること
ができるという効果が得られる。
(16) In addition to the above, the operation of the arithmetic processing unit for encryption processing of the microcomputer includes:
In response to the input X, Y and N, A = 1, B = X, and A = A 2 modN and A = ABmodN are calculated. For example, the result of the A 2 modN operation is taken into the storage circuit as valid data at the output timing as valid data, and when the logic is 1, the result of the A 2 mod N and AB mod N operation is taken as valid data into the storage circuit at the output timing. , and the above a = a 2 between modN the operation result is outputted to the a = operation ABmodN is started round also continue the operation of the a = a 2 modN, a = ABmodN of the operation result Even after the output is performed and before the calculation of A 2 modN corresponding to the next bit is started, including the change determination processing of the Y bit, the above A
By continuing the operation of = ABmodN, it is possible to obtain an effect that decryption using a current waveform can be made difficult while performing encryption processing. (17) In addition to the above, as an operation of the encryption processing operation unit of the microcomputer, the input X, Y, and N are received, and A = 1, B = X, and A = X Y
performs overflow calculation on modN and A = ABmodN operations and each, as viewed by one bit from the Y level in such operations, the A 2 m is logic 0
Uptake in the memory circuit the calculation result of odN as valid data, the A 2 modN and ABmodN is logic 1
Is taken into the storage circuit as valid data. The arithmetic operation of A = ABmodN when the logic is 0 and the unnecessary overflow operation in each arithmetic operation are set as the dummy processing operation for the purpose of the disturbance. Accordingly, it is possible to obtain an effect that decryption using a current waveform can be made difficult while performing encryption processing.

【0107】(18) 上記に加えて、上記暗号化処理
用演算ユニットにより、入力されたX、Y及びNを受
け、A=1、B=Xとして、Yのビットの値に応じて、
A=A2-1modN、A=ABR-1modNの演算行
うとともに、演算結果にオーバーフローが発生した場合
にはさらに上記演算結果WからNの減算W−Nを行なう
正規動作と、各々の演算結果にオーバーフローが発生し
ない場合でも上記減算W−Nに対応した演算による無効
データを生成する攪乱目的のダミー動作を行い、上記オ
ーバーフローの有無に対応して有効なデータを出力させ
ることにより、暗号化処理用演算ユニットの簡素化及び
高速化を図りつつ、電流波形を利用した解読を困難にす
ることができるという効果が得られる。
(18) In addition to the above, the input X, Y, and N are received by the encryption processing operation unit, and A = 1, B = X, and according to the value of the Y bit,
A: A = A 2 R −1 mod N, A = ABR −1 mod N, and a normal operation of performing N subtraction W−N of N from the above calculation result W when an overflow occurs in the calculation result. Even if no overflow occurs in the operation result, a dummy operation for the purpose of disturbance for generating invalid data by the operation corresponding to the subtraction WN is performed, and valid data is output in accordance with the presence or absence of the above-mentioned overflow. The advantage is that it is possible to make it difficult to decipher using the current waveform while simplifying and increasing the speed of the arithmetic processing unit.

【0108】(19) 上記に加えて、上記A2 -1
odN又はABR-1modNの演算結果Wを第1の記憶
回路に格納し、演算器のオーバーフローフラグOVの有
無を記憶し、上記剰余乗算の後に上記第1記憶回路の演
算結果WからNの減算W−Nを行い、その演算結果を上
記オーバーフローフラグOVが有る時には上記第1の記
憶回路に格納し、オーバーフローフラグOVが無い時に
は上記第1記憶回路とは異なる第2の記憶回路に上記錯
乱目的のダミー動作として格納し、上記第1の記憶回路
の演算結果を有効なデータとして出力させることによ
り、暗号化処理用演算ユニットの簡素化及び高速化を図
りつつ、電流波形を利用した解読を困難にすることがで
きるという効果が得られる。
(19) In addition to the above, A 2 R -1 m
The operation result W of the oddN or ABR -1 modN is stored in the first storage circuit, the presence / absence of the overflow flag OV of the operation unit is stored, and N is subtracted from the operation result W of the first storage circuit after the remainder multiplication. WN is performed, and the operation result is stored in the first storage circuit when the overflow flag OV is present, and is stored in a second storage circuit different from the first storage circuit when the overflow flag OV is not present. Of the first storage circuit, and outputs the operation result of the first storage circuit as valid data, thereby simplifying and speeding up the operation unit for the encryption process and making it difficult to decipher using the current waveform. Is obtained.

【0109】(20) 上記に加えて、上記A2 -1
odN又はABR-1modNの演算結果Wを第1の記憶
回路に格納し、演算器のオーバーフローフラグOVの有
無を記憶し、上記剰余乗算の後に上記第1の記憶回路の
演算結果WからNの減算W−Nを行い、オーバーフロー
フラグOVが有るときに上記演算結果W−Nをセレクタ
により選択され、オーバーフローフラグOVが無いとき
には上記第1記憶回路の演算結果Wをセレクタにより選
択して第2の記憶回路に格納することにより、暗号化処
理用演算ユニットの簡素化及び高速化を図りつつ、電流
波形を利用した解読を困難にすることができるという効
果が得られる。
(20) In addition to the above, A 2 R -1 m
The arithmetic result W of the oddN or the ABR -1 modN is stored in the first storage circuit, the presence or absence of the overflow flag OV of the arithmetic unit is stored, and after the remainder multiplication, the N is calculated from the arithmetic result W of the first storage circuit. The subtraction WN is performed. When the overflow flag OV is present, the operation result W-N is selected by the selector. When the overflow flag OV is not present, the operation result W of the first storage circuit is selected by the selector, and the second operation result is selected by the selector. By storing it in the storage circuit, it is possible to obtain the effect that the decryption using the current waveform can be made difficult while simplifying and increasing the speed of the operation unit for encryption processing.

【0110】(21) 上記に加えて、上記A2 -1
odN又はABR-1modNの演算結果Wを第1の記憶
回路に格納し、演算器のオーバーフローフラグOVの有
無を記憶し、上記剰余乗算の後に上記第1の記憶回路の
演算結果WからNの減算W−Nを行い、オーバーフロー
フラグOVが有るときには減算W−Nを第2の記憶回路
に記憶し、オーバーフローフラグOVが無いときには減
算W−Nを第3の記憶回路に記憶し、オーバーフローフ
ラグOVが有るときには上記第2の記憶回路のデータが
有効なデータとして出力し、オーバーフローフラグOV
が無いときには上記第1の記憶回路のデータが有効なデ
ータとして出力することにより、暗号化処理用演算ユニ
ットの簡素化及び高速化を図りつつ、電流波形を利用し
た解読を困難にすることができるという効果が得られ
る。
(21) In addition to the above, A 2 R −1 m
The arithmetic result W of the oddN or the ABR -1 modN is stored in the first storage circuit, the presence or absence of the overflow flag OV of the arithmetic unit is stored, and after the remainder multiplication, the N is calculated from the arithmetic result W of the first storage circuit. The subtraction WN is performed. When the overflow flag OV is present, the subtraction WN is stored in the second storage circuit. When the overflow flag OV is not present, the subtraction WN is stored in the third storage circuit. Is present, the data in the second storage circuit is output as valid data, and the overflow flag OV
When there is no data, the data of the first storage circuit is output as valid data, so that it is possible to simplify and speed up the operation unit for the encryption process and make it difficult to decipher using the current waveform. The effect is obtained.

【0111】(22) 上記に加えて、上記A2 -1
odN又はABR-1modNの演算結果Wを第1の記憶
回路に格納し、演算器のオーバーフローフラグOVの有
無を記憶し、上記剰余乗算の後に上記第1の記憶回路の
演算結果WからNの減算結果W−Nを第2の記憶回路に
格納し、オーバーフローフラグOVが無いとき第1の記
憶回路と第2の記憶回路を選択する最下位アドレスを逆
転させて、上記第2の記憶回路を選択するアドレスによ
り第1の記憶回路を選択して有効なデータとして出力さ
せ、オーバーフローフラグOVが有るとき第1の記憶回
路と第2の記憶回路を選択する最下位アドレスをそのま
まにして第2の記憶回路の演算結果を有効なデータとし
て出力させることにより、暗号化処理用演算ユニットの
簡素化に加えてレジスタへの書き込み論理の簡素化と高
速化を図りつつ電流波形を利用した解読を困難にするこ
とができるという効果が得られる。
(22) In addition to the above, A 2 R −1 m
The arithmetic result W of the oddN or the ABR -1 modN is stored in the first storage circuit, the presence or absence of the overflow flag OV of the arithmetic unit is stored, and after the remainder multiplication, the N is calculated from the arithmetic result W of the first storage circuit. The subtraction result W-N is stored in the second storage circuit, and when there is no overflow flag OV, the lowest address for selecting the first storage circuit and the second storage circuit is inverted, and the second storage circuit is stored. The first memory circuit is selected according to the address to be selected and output as valid data, and when the overflow flag OV is present, the second address is selected without changing the lowest address for selecting the first memory circuit and the second memory circuit. By outputting the operation result of the storage circuit as valid data, in addition to simplifying the operation unit for encryption processing, power consumption is simplified while simplifying and speeding up the logic for writing to the register. An effect is obtained that decoding using the flow waveform can be made difficult.

【0112】(23) 上記に加えて、上記A2 -1
odN又はABR-1modNの演算結果Wを第1の記憶
回路に格納し、演算器のオーバーフローフラグOVの有
無を記憶し、上記剰余乗算の後に上記第1の記憶回路と
第2の記憶回路のアドレスを交換し、第2の記憶回路を
選択するアドレスにより選択される演算結果値WからN
の減算W−Nが行われて第1の記憶回路を選択するアド
レスにより選択される第2の記憶回路に減算結果W−N
を格納し、オーバーフローフラグOVが有るときにのみ
上記アドレスを再度交換し、第1の記憶回路を選択する
アドレスにより選択される第1又は第2の記憶回路のデ
ータを有効なデータとして出力させることにより、暗号
化処理用演算ユニットの簡素化に加えてレジスタへの書
き込み論理の簡素化と高速化を図りつつ電流波形を利用
した解読を困難にすることができるという効果が得られ
る。
(23) In addition to the above, A 2 R −1 m
The operation result W of the oddN or ABR -1 modN is stored in the first storage circuit, the presence / absence of the overflow flag OV of the arithmetic unit is stored, and the first storage circuit and the second storage circuit are stored after the remainder multiplication. The addresses are exchanged, and from the operation result value W selected by the address for selecting the second storage circuit to N
Is subtracted, and the subtraction result WN is stored in the second storage circuit selected by the address for selecting the first storage circuit.
And the above address is exchanged again only when the overflow flag OV is present, and the data of the first or second storage circuit selected by the address for selecting the first storage circuit is output as valid data. As a result, in addition to the simplification of the encryption processing operation unit, it is possible to simplify the logic for writing to the register and to increase the speed, thereby making it difficult to decipher using the current waveform.

【0113】(24) 上記に加えて、上記A2 -1
odN又はABR-1modNの演算結果Wを第1の記憶
回路に格納し、上記剰余乗算の後に上記第1の記憶回路
の演算結果値WからNの減算W−Nを行って第2の記憶
回路に格納し、このW−Nの減算が行われた時の演算器
のボローフラグBRを記憶し、ボローフラグBRが有る
ときには、第1の記憶回路と第2の記憶回路を選択する
最下位アドレスを逆転させて、上記第2の記憶回路を選
択するアドレスにより第1の記憶回路の演算結果Wを出
力し、ボローフラグBRが無いときには、第1の記憶回
路と第2の記憶回路を選択する最下位アドレスをそのま
まして、上記第2の記憶回路を選択するアドレスにより
第2の記憶回路の演算結果W−Nを出力させることによ
り、暗号化処理用演算ユニットの簡素化に加えてレジス
タへの書き込み論理の簡素化と高速化を図りつつ電流波
形を利用した解読を困難にすることができるという効果
が得られる。
(24) In addition to the above, A 2 R -1 m
The operation result W of the oddN or the ABR -1 modN is stored in the first storage circuit, and after the remainder multiplication, a subtraction W-N of N is performed from the operation result value W of the first storage circuit to perform the second storage. The borrow flag BR of the arithmetic unit at the time when the subtraction of WN is performed is stored. When the borrow flag BR is present, the lowest address for selecting the first storage circuit and the second storage circuit is stored. Invert, the operation result W of the first storage circuit is output according to the address for selecting the second storage circuit, and when there is no borrow flag BR, the lowest order for selecting the first storage circuit and the second storage circuit is output. By outputting the operation result WN of the second storage circuit with the address for selecting the second storage circuit while keeping the address as it is, in addition to simplifying the operation unit for encryption processing, writing to the register Argument The effect is that the decoding using the current waveform can be made difficult while simplifying the processing and increasing the speed.

【0114】(25) 上記に加えて、上記マイクロコ
ンピュータの暗号化処理用演算ユニットとして、入力さ
れたX、Y及びNを受け、A=1、B=Xとして、Yの
ビットの値に応じて、A=A2 -1modN、A=AB
-1modNの演算を行い、演算結果にオーバーフロー
が発生した場合にはさらに上記演算結果WからNの減算
W−Nを行なう正規動作と、各々の演算結果にオーバー
フローが発生しない場合でも上記減算W−Nに対応した
演算による無効データを生成する攪乱目的のダミー動作
を行い、上記オーバーフローの有無に対応して有効なデ
ータを出力させることより、暗号化処理用演算ユニット
の簡素化に加えてレジスタへの書き込み論理の簡素化と
高速化を図りつつ電流波形を利用した解読を困難にする
ことができるという効果が得られる。
(25) In addition to the above, as an arithmetic operation unit for encryption processing of the microcomputer, it receives X, Y, and N, and sets A = 1 and B = X according to the value of the Y bit. Where A = A 2 R −1 mod N, A = AB
R- 1 modN operation is performed, and when an overflow occurs in the operation result, a normal operation of further subtracting N from the operation result W is performed, and the subtraction is performed even when no overflow occurs in each operation result. By performing a dummy operation for the purpose of disturbance for generating invalid data by an operation corresponding to WN and outputting valid data in accordance with the presence or absence of the above-mentioned overflow, in addition to simplifying the arithmetic processing unit for encryption processing, The effect is obtained that the decoding using the current waveform can be made difficult while simplifying and speeding up the logic for writing to the register.

【0115】(26) 上記に加えて、上記マイクロコ
ンピュータの暗号化処理用演算ユニットにおいて、上記
2 -1modN又はABR-1modNの演算結果Wは
第1の記憶回路に格納し、演算器からのオーバーフロー
フラグOVの有無を記憶し、上記剰余乗算の後に上記第
1記憶回路の演算結果WからNの減算W−Nを行ない、
演算結果を上記オーバーフローフラグOVが有る時には
上記第1の記憶回路に格納し、オーバーフローフラグO
Vが無い時には上記第1記憶回路とは異なる第2の記憶
回路に上記錯乱目的のダミー動作として書き込み、上記
第1の記憶回路の演算結果が有効なデータとして出力さ
せることにより、暗号化処理用演算ユニットの簡素化及
び高速化を図りつつ、電流波形を利用した解読を困難に
することができるという効果が得られる。
(26) In addition to the above, in the encryption processing operation unit of the microcomputer, the operation result W of A 2 R -1 modN or ABR -1 mod N is stored in the first storage circuit, and The presence / absence of an overflow flag OV from the storage unit, and subtracting N from the operation result W of the first storage circuit after the remainder multiplication,
The operation result is stored in the first storage circuit when the overflow flag OV exists, and the overflow flag OV
When there is no V, the data is written into the second storage circuit different from the first storage circuit as the dummy operation for the purpose of the confusion, and the operation result of the first storage circuit is output as valid data, so that the encryption processing is performed. The effect is obtained that the decoding using the current waveform can be made difficult while simplifying and increasing the speed of the arithmetic unit.

【0116】(27) 上記に加えて、上記マイクロコ
ンピュータの暗号化処理用演算ユニットにおいて、上記
2 -1modN又はABR-1modNの演算結果Wを
第1の記憶回路に格納し、演算器のオーバーフローフラ
グOVの有無を記憶し、上記剰余乗算の後に上記第1の
記憶回路の演算結果WからNの減算W−Nを行ってオー
バーフローフラグOVが有るときにセレクタにより上記
演算結果W−Nを選択し、オーバーフローフラグOVが
無いときにはセレクタにより上記第1記憶回路の演算結
果Wを選択して第2の記憶回路に格納して有効なデータ
として出力することにより、暗号化処理用演算ユニット
の簡素化及び高速化を図りつつ、電流波形を利用した解
読を困難にすることができるという効果が得られる。
(27) In addition to the above, the operation unit for encryption processing of the microcomputer stores the operation result W of A 2 R -1 modN or ABR -1 mod N in the first storage circuit, and The presence / absence of the overflow flag OV of the device is stored. After the remainder multiplication, the operation result W-N is subtracted from the operation result W of the first storage circuit. N, and when there is no overflow flag OV, the selector selects the operation result W of the first storage circuit, stores it in the second storage circuit, and outputs it as valid data. The advantage is that the decoding using the current waveform can be made difficult while simplifying and speeding up the operation.

【0117】(28) 上記に加えて、上記マイクロコ
ンピュータの暗号化処理用演算ユニットにおいて、上記
2 -1modN又はABR-1modNの演算結果Wを
第1の記憶回路に格納し、演算器のオーバーフローフラ
グOVの有無を記憶し、上記剰余乗算の後に上記第1の
記憶回路の演算結果WからNの減算W−Nを行ってオー
バーフローフラグOVが有るときには減算結果W−Nを
第2の記憶回路に記憶し、オーバーフローフラグOVが
無いときには減算結果W−Nを第3の記憶回路に記憶
し、オーバーフローフラグOVが有るときには上記第2
の記憶回路のデータが有効なデータとして出力し、オー
バーフローフラグOVが無いときには上記第1の記憶回
路のデータを有効なデータとして出力することにより、
暗号化処理用演算ユニットの簡素化及び高速化を図りつ
つ、電流波形を利用した解読を困難にすることができる
という効果が得られる。
(28) In addition to the above, the arithmetic processing unit for encryption processing of the microcomputer stores the operation result W of A 2 R -1 modN or ABR -1 mod N in the first storage circuit, and The presence / absence of an overflow flag OV is stored, and after the remainder multiplication, N is subtracted from the operation result W of the first storage circuit by W-N. When the overflow flag OV is not present, the subtraction result W−N is stored in the third storage circuit. When the overflow flag OV is present, the subtraction result W−N is stored in the second storage circuit.
Is output as valid data, and when there is no overflow flag OV, the data of the first storage circuit is output as valid data.
The effect is obtained that the decryption using the current waveform can be made difficult while simplifying and increasing the speed of the arithmetic unit for encryption processing.

【0118】(29) 上記に加えて、上記マイクロコ
ンピュータの暗号化処理用演算ユニットにおいて、上記
2 -1modN又はABR-1modNの演算結果Wを
第1の記憶回路に格納し、演算器のオーバーフローフラ
グOVの有無を記憶し、上記剰余乗算の後に上記第1の
記憶回路の演算結果WからNの減算結果W−Nを第2の
記憶回路に格納し、オーバーフローフラグOVが無いと
き第1の記憶回路と第2の記憶回路を選択する最下位ア
ドレスを逆転させて、上記第2の記憶回路を選択するア
ドレスにより第1の記憶回路を選択して有効なデータと
して出力させ、オーバーフローフラグOVが有るとき第
1の記憶回路と第2の記憶回路を選択する最下位アドレ
スをそのままにして第2の記憶回路の演算結果を有効な
データとして出力させることにより、暗号化処理用演算
ユニットの簡素化に加えてレジスタへの書き込み論理の
簡素化と高速化を図りつつ電流波形を利用した解読を困
難にすることができるという効果が得られる。
(29) In addition to the above, the arithmetic processing unit for encryption processing of the microcomputer stores the operation result W of A 2 R -1 modN or ABR -1 mod N in the first storage circuit, and The presence / absence of an overflow flag OV of the detector is stored. After the remainder multiplication, the subtraction result W−N of N from the operation result W of the first storage circuit is stored in the second storage circuit, and the overflow flag OV is not present. The lowest address for selecting the first storage circuit and the second storage circuit is reversed, the first storage circuit is selected by the address for selecting the second storage circuit, and output as valid data, and overflow occurs. When the flag OV is present, the operation result of the second memory circuit is output as valid data while leaving the lowest address for selecting the first memory circuit and the second memory circuit as it is. By the effect is obtained that can be difficult to decipher using in addition to simplifying the current waveform while achieving simplification of the write logic and faster to register the encryption processing operation unit.

【0119】(30) 上記に加えて、上記マイクロコ
ンピュータの暗号化処理用演算ユニットにおいて、上記
2 -1modN又はABR-1modNの演算結果Wを
第1の記憶回路に格納し、演算器のオーバーフローフラ
グOVの有無を記憶し、上記剰余乗算の後に上記第1の
記憶回路と第2の記憶回路のアドレスを交換し、第2の
記憶回路を選択するアドレスにより選択される演算結果
値WからNの減算W−Nを行って第1の記憶回路を選択
するアドレスにより選択される第2の記憶回路に減算結
果W−Nを格納し、オーバーフローフラグOVが有ると
きにのみ上記アドレスを再度交換し、第1の記憶回路を
選択するアドレスにより選択される第1又は第2の記憶
回路のデータを有効なデータとして出力させることによ
り、暗号化処理用演算ユニットの簡素化に加えてレジス
タへの書き込み論理の簡素化と高速化を図りつつ電流波
形を利用した解読を困難にすることができるという効果
が得られる。
(30) In addition to the above, the operation unit for encryption processing of the microcomputer stores the operation result W of A 2 R -1 mod N or ABR -1 mod N in the first storage circuit, and Result value selected by the address for selecting the second storage circuit after exchanging the addresses of the first storage circuit and the second storage circuit after the remainder multiplication. The subtraction result WN is stored in the second storage circuit selected by the address for selecting the first storage circuit by performing the subtraction WN of W from N, and the above address is stored only when the overflow flag OV is present. The data is exchanged again, and the data of the first or second storage circuit selected by the address for selecting the first storage circuit is output as valid data, so that the data for encryption processing is output. Effect that decryption using the simplified addition current waveform while achieving simplification of the write logic and faster to registers calculation unit can be difficult to obtain.

【0120】(31) 上記に加えて、上記マイクロコ
ンピュータの暗号化処理用演算ユニットにおいて、上記
2 -1modN又はABR-1modNの演算結果Wを
第1の記憶回路に格納し、上記剰余乗算の後に上記第1
の記憶回路の演算結果値WからNの減算W−Nを行って
第2の記憶回路に格納し、このW−Nの減算が行われた
時の演算器からボローフラグBRを記憶し、ボローフラ
グBRが有るときには、第1の記憶回路と第2の記憶回
路を選択する最下位アドレスを逆転させて、上記第2の
記憶回路を選択するアドレスにより第1の記憶回路の演
算結果Wを出力し、ボローフラグBRが無いときには、
第1の記憶回路と第2の記憶回路を選択する最下位アド
レスをそのままして、上記第2の記憶回路を選択するア
ドレスにより第2の記憶回路の演算結果W−Nを出力さ
せることにより、暗号化処理用演算ユニットの簡素化に
加えてレジスタへの書き込み論理の簡素化と高速化を図
りつつ電流波形を利用した解読を困難にすることができ
るという効果が得られる。
(31) In addition to the above, the arithmetic processing unit for encryption processing of the microcomputer stores the arithmetic result W of A 2 R -1 modN or ABR -1 mod N in a first storage circuit, After the remainder multiplication, the first
Is subtracted N from the operation result value W of the storage circuit, and stored in the second storage circuit. When the subtraction of WN is performed, the borrow flag BR is stored from the arithmetic unit, and the borrow flag BR is stored. When there is, the least significant address for selecting the first storage circuit and the second storage circuit is inverted, and the operation result W of the first storage circuit is output by the address for selecting the second storage circuit, When there is no borrow flag BR,
By leaving the lowest address for selecting the first storage circuit and the second storage circuit as it is, and outputting the operation result W-N of the second storage circuit by the address for selecting the second storage circuit, In addition to the simplification of the encryption processing operation unit, it is possible to simplify the logic for writing to the register and to increase the speed thereof, while making it difficult to use the current waveform for decoding.

【0121】以上本発明者よりなされた発明を実施例に
基づき具体的に説明したが、本願発明は前記実施例に限
定されるものではなく、その要旨を逸脱しない範囲で種
々変更可能であることはいうまでもない。例えば、IC
カードには、1つの半導体集積回路装置を搭載するもの
他、複数の半導体集積回路装置が搭載されるものであっ
てもよい。マイクロコンピュータは、1つの半導体集積
回路装置に形成されるもの他、CPUとその周辺回路が
複数チップで構成されて、1つのモジュール基板に搭載
されてなるものであってもよい。
Although the invention made by the inventor has been specifically described based on the embodiment, the invention of the present application is not limited to the embodiment, and various modifications can be made without departing from the gist of the invention. Needless to say. For example, IC
The card may be one on which one semiconductor integrated circuit device is mounted, or one on which a plurality of semiconductor integrated circuit devices are mounted. The microcomputer may be formed on a single semiconductor integrated circuit device, or may be formed by mounting a CPU and its peripheral circuits on a plurality of chips and mounted on a single module substrate.

【0122】演算処理は前記のような暗号処理を行なう
べき乗剰余乗算法の他に、図25図に示したフロチャー
ト図のように演算Aと演算Bを持ち、演算Aの結果によ
り演算Bを行なうか否かの分岐を持つような演算処理、
あるいは演算動作てのオーバーフローの有無に対応し
て、次の演算処理が選択的に追加される場合に等に広く
利用することができる。つまり、演算Aの次に演算Bを
実行し、演算Aの結果から演算Bが不要なら、その演算
結果を無効にするような演算処理を行なえば、前記のよ
うな暗号処理以外の機密動作を必要とするデータ処理の
ハッキング対策として有益なものとなる。
The arithmetic processing includes an arithmetic operation A and an arithmetic operation B as shown in a flowchart of FIG. Arithmetic processing with a branch of whether to perform,
Alternatively, it can be widely used when the next arithmetic processing is selectively added in response to the presence or absence of overflow in the arithmetic operation. That is, if the operation A is executed after the operation A, and if the operation B is unnecessary from the result of the operation A, an operation process that invalidates the operation result is performed. This is useful as a hacking measure for required data processing.

【0123】上記マイクロコンピュータは、データ処理
装置とかかるデータ処理装置によるデータ処理手順が書
き込まれたROMを含んで記データ処理手順に従ってデ
ータの入出力動作が行われるものであれば何であっても
よい。例えば、前記のようなICカード用チップの他
に、ゲーム用等の1チップマイクロコンピュータ等のよ
うに機密保護の必要な各種マイクロコンピュータに広く
適用できるものである。この発明は、機密保護を必要と
する各種ICカード及びマイクロコンピュータに広く利
用できる。
The microcomputer may be of any type as long as it includes a data processing device and a ROM in which the data processing procedure by the data processing device is written, and performs data input / output operation in accordance with the data processing procedure. . For example, the present invention can be widely applied to various microcomputers requiring security protection, such as a one-chip microcomputer for games and the like, in addition to the IC card chip as described above. INDUSTRIAL APPLICABILITY The present invention can be widely used for various IC cards and microcomputers requiring security.

【0124】[0124]

【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば、下
記の通りである。すなわち、外部端子がリードライト装
置と電気的に接続されることによって動作電圧が供給さ
れ、かつ、暗号化処理又は復号化処理を伴ったデータの
入出力動作を含むICカードにおいて、上記暗号化処理
又は復号化処理に攪乱目的のダミー処理動作を含ませて
内部回路の動作タイミング及び動作電流の画一化を行な
うようにすることによって、電流波形を利用した解読を
困難にすることができる。
The effects obtained by typical ones of the inventions disclosed in the present application will be briefly described as follows. That is, in an IC card to which an operating voltage is supplied by an external terminal being electrically connected to a read / write device and which includes an input / output operation of data accompanied by an encryption process or a decryption process, Alternatively, by making the decoding process include a dummy processing operation for the purpose of disturbance to make the operation timing and operation current of the internal circuit uniform, decoding using the current waveform can be made difficult.

【0125】暗号化処理又は復号化処理を伴ったデータ
の入出力動作を含むモジュール構成のマイクロコンピュ
ータにおいて、上記暗号化処理又は復号化処理に攪乱目
的のダミー処理動作を含ませて内部回路の動作タイミン
グ及び動作電流の画一化を行なうようにすることによ
り、モジュール化されたマイクロコンピュータに対する
電流波形を利用した解読を困難にすることができる。
In a microcomputer having a module configuration including an input / output operation of data accompanied by an encryption process or a decryption process, the encryption process or the decryption process includes a dummy processing operation for the purpose of disturbance and operates the internal circuit. By making the timing and the operating current uniform, it is possible to make it difficult for a modular microcomputer to use a current waveform for decoding.

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

【図1】この発明が適用されるICカードの一実施例を
示す外観図である。
FIG. 1 is an external view showing an embodiment of an IC card to which the present invention is applied.

【図2】この発明に係るICカードに搭載されるICカ
ード用チップの一実施例を示す概略ブロック図である。
FIG. 2 is a schematic block diagram showing one embodiment of an IC card chip mounted on an IC card according to the present invention.

【図3】この発明に係るコプロセッサの一実施例の動作
を説明するためのタイミング図である。
FIG. 3 is a timing chart for explaining the operation of one embodiment of the coprocessor according to the present invention;

【図4】図3のコプロセッサの動作を説明するためのフ
ローチャート図である。
FIG. 4 is a flowchart for explaining the operation of the coprocessor of FIG. 3;

【図5】図3のコプロセッサの一実施例を示すブロック
図である。
FIG. 5 is a block diagram showing one embodiment of the coprocessor of FIG. 3;

【図6】図3に示したコプロセッサの動作を実現するた
めの一実施例を示すブロック図である。
FIG. 6 is a block diagram showing one embodiment for realizing the operation of the coprocessor shown in FIG. 3;

【図7】図3のコプロセッサの他の一実施例を示すブロ
ック図である。
FIG. 7 is a block diagram showing another embodiment of the coprocessor of FIG. 3;

【図8】図3のコプロセッサの他の一実施例を示すブロ
ック図である。
FIG. 8 is a block diagram showing another embodiment of the coprocessor of FIG. 3;

【図9】この発明に係るコプロセッサの他の一実施例の
動作を説明するための構成図である。
FIG. 9 is a configuration diagram for explaining the operation of another embodiment of the coprocessor according to the present invention.

【図10】図9に示したコプロセッサの動作を実現する
ための一実施例を示すブロック図である。
FIG. 10 is a block diagram showing one embodiment for realizing the operation of the coprocessor shown in FIG. 9;

【図11】この発明に係るコプロセッサの他の一実施例
の動作を説明するためのタイミング図である。
FIG. 11 is a timing chart for explaining the operation of another embodiment of the coprocessor according to the present invention.

【図12】この発明に係るコプロセッサの他の一実施例
の動作を説明するためのフローチャート図である。
FIG. 12 is a flowchart for explaining the operation of another embodiment of the coprocessor according to the present invention;

【図13】この発明に係るコプロセッサの他の一実施例
の動作の詳細を説明するためのタイミング図である。
FIG. 13 is a timing chart for explaining details of the operation of another embodiment of the coprocessor according to the present invention;

【図14】図11ないし図13に示したコプロセッサの
動作を実現するための一実施例を示すブロック図であ
る。
FIG. 14 is a block diagram showing one embodiment for realizing the operation of the coprocessor shown in FIGS. 11 to 13;

【図15】この発明に係るコプロセッサの更に他の一実
施例の動作を説明するためのタイミング図である。
FIG. 15 is a timing chart for explaining the operation of still another embodiment of the coprocessor according to the present invention.

【図16】この発明に係るコプロセッサの演算動作の他
の一実施例を示すフローチャート図である。
FIG. 16 is a flowchart showing another embodiment of the arithmetic operation of the coprocessor according to the present invention.

【図17】この発明に係るコプロセッサの他の一実施例
を示すブロック図である。
FIG. 17 is a block diagram showing another embodiment of the coprocessor according to the present invention.

【図18】この発明に係るコプロセッサの他の一実施例
を示すブロック図である。
FIG. 18 is a block diagram showing another embodiment of the coprocessor according to the present invention.

【図19】この発明に係るコプロセッサの他の一実施例
を示すブロック図である。
FIG. 19 is a block diagram showing another embodiment of the coprocessor according to the present invention.

【図20】この発明に係るICカード用チップの他の一
実施例を示す要部ブロック図である。
FIG. 20 is a main part block diagram showing another embodiment of the IC card chip according to the present invention.

【図21】図20のカウンタの一実施例を示すブロック
図である。
FIG. 21 is a block diagram showing one embodiment of the counter of FIG. 20;

【図22】図20のICカード用チップの動作の一例を
示すタイミング図である。
FIG. 22 is a timing chart showing an example of the operation of the IC card chip of FIG. 20.

【図23】この発明に係るICカード用チップの更に他
の一実施例を示す要部ブロック図である。
FIG. 23 is a main part block diagram showing still another embodiment of the IC card chip according to the present invention.

【図24】図23のICカード用チップの動作の一例を
示すタイミング図である。
24 is a timing chart showing an example of the operation of the IC card chip of FIG.

【図25】この発明が適用可能な演算動作を説明するた
めのフローチャート図である。
FIG. 25 is a flowchart for explaining an arithmetic operation to which the present invention can be applied;

【図26】この発明に用いられるコプロセッサの他の一
実施例を示すブロック図である。
FIG. 26 is a block diagram showing another embodiment of the coprocessor used in the present invention.

【図27】この発明における「R2 modN」の計算方
法を示す概念図である。
FIG. 27 is a conceptual diagram showing a method of calculating “R 2 modN” in the present invention.

【図28】この発明に係る暗号化処理用演算ユニットの
一実施例を示す要部ブロック図である。
FIG. 28 is a main part block diagram showing an embodiment of an operation unit for encryption processing according to the present invention.

【図29】この発明に係る暗号化処理用演算ユニットの
他の一実施例を示す要部ブロック図である。
FIG. 29 is a main part block diagram showing another embodiment of the arithmetic unit for encryption processing according to the present invention.

【図30】この発明に係る暗号化処理用演算ユニットの
更に他の一実施例を示す要部ブロック図である。
FIG. 30 is a main part block diagram showing still another embodiment of the encryption operation unit according to the present invention;

【符号の説明】[Explanation of symbols]

201…中央処理装置(CPU)、202…I/Oポー
ト、203…アドレスバス、204…データバス、20
5…クロック生成回路、206…ROM、207…RA
M、208…EEPROM、209…コプロセッサ(暗
号化処理用演算ユニット)、CDA、CDB、CDN、
CDW…レジスタ。33,34…積和演算器、35…テ
ンポラリレジスタ、36〜38…レジスタ、39…Mi
生成ロジック、40…Miを保持するラッチ(レジス
タ)、41…シフタ、42…RAM、43…データバ
ス。
201: central processing unit (CPU), 202: I / O port, 203: address bus, 204: data bus, 20
5. Clock generation circuit, 206 ROM, 207 RA
M, 208: EEPROM, 209: Coprocessor (operation unit for encryption processing), CDA, CDB, CDN,
CDW ... register. 33, 34: Product-sum operation unit, 35: Temporary register, 36-38: Register, 39: Mi
Generation logic, 40: latch (register) holding Mi, 41: shifter, 42: RAM, 43: data bus.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 中田 邦彦 東京都小平市上水本町五丁目20番1号 株 式会社日立製作所半導体グループ内 (72)発明者 成吉 雄一郎 東京都小平市上水本町5丁目22番1号 日 立超エル・エス・アイ・システムズ内 (72)発明者 塚元 卓 東京都小平市上水本町5丁目22番1号 日 立超エル・エス・アイ・システムズ内 (72)発明者 平林 茂雄 東京都小平市上水本町5丁目22番1号 日 立超エル・エス・アイ・システムズ内 (72)発明者 渡瀬 弘 東京都小平市上水本町5丁目22番1号 日 立超エル・エス・アイ・システムズ内 (72)発明者 ▲高▼橋 雅聡 東京都小平市上水本町5丁目22番1号 日 立超エル・エス・アイ・システムズ内 Fターム(参考) 5B035 BB09 CA38 5B062 AA07 CC01 EE01 EE02 EE10 JJ10 5J104 AA16 AA47 EA04 NA07 NA18 NA22 NA35 NA37 NA40  ──────────────────────────────────────────────────続 き Continuing from the front page (72) Kunihiko Nakata, Inventor Kunihiko Kodaira, Tokyo 5-20-1, Kamizuhoncho Within Hitachi Semiconductor Co., Ltd. (22) Inventor: Taku Tsukamoto 5-22-1, Kamimizu Honcho, Kodaira-shi, Tokyo In the Hitachi, Ltd. (72) ) Inventor Shigeo Hirabayashi 5-221-1, Josuihonmachi, Kodaira-shi, Tokyo Inside the Hitachi Super SII Systems Inc. (72) Inventor Hiroshi Watase 5-221-1, Josuihoncho, Kodaira-shi, Tokyo Sun (72) The inventor ▲ Taka ▼ Masatoshi Hashimachi 5-22-1, Kamizuhoncho, Kodaira-shi, Tokyo Nittsu-cho SII Systems F-term (reference) 5B035 BB09 CA38 5B062 AA07 CC01 EE01 EE02 EE10 JJ10 5J104 AA16 AA47 EA04 NA07 NA18 NA22 NA35 NA37 NA40

Claims (31)

【特許請求の範囲】[Claims] 【請求項1】 外部端子がリードライト装置と電気的に
接続されることによって動作電圧が供給され、かつ、暗
号化処理又は復号化処理を伴ったデータの入出力動作を
含むICカードであって、 上記暗号化処理又は復号化処理に攪乱目的のダミー処理
動作を含ませて内部回路の動作タイミング及び動作電流
の画一化を行なうことを特徴とするICカード。
1. An IC card which is supplied with an operating voltage when an external terminal is electrically connected to a read / write device, and includes an input / output operation of data accompanied by an encryption process or a decryption process. An IC card characterized in that the encryption processing or the decryption processing includes a dummy processing operation for the purpose of disturbance to make the operation timing and the operation current of the internal circuit uniform.
【請求項2】 請求項1において、 上記暗号化処理又は復号化処理は、RSA暗号法などに
応用可能なべき乗剰余乗算動作を含むものであることを
特徴とするICカード。
2. The IC card according to claim 1, wherein the encryption processing or the decryption processing includes a power-residue multiplication operation applicable to RSA encryption or the like.
【請求項3】 請求項2において、 上記べき乗剰余乗算動作は、中央処理装置からの指示を
受けて動作する暗号処理用演算ユニットにより行なわれ
るものであることを特徴とするICカード。
3. The IC card according to claim 2, wherein the power-residue multiplication operation is performed by a cryptographic processing operation unit that operates in response to an instruction from a central processing unit.
【請求項4】 請求項3において、 上記暗号化処理用演算ユニットは、入力されたX、Y及
びNを受け、A=1、B=Xとして、A=A2 modN
とA=ABmodNの演算を交互に行ない、かかる演算
においてYの上位から1ビットずつみて、論理0であれ
ば上記A2 modNの演算結果を有効なデータとして記
憶回路に取り込み、論理1であれば上記A2 modNと
ABmodNの演算結果を有効なデータとして記憶回路
に取り込むものであり、上記論理0のときのA=ABm
odNの演算動作が上記攪乱目的のダミー処理動作とさ
れることを特徴とするICカード。
4. The encryption processing unit according to claim 3, wherein the encryption processing operation unit receives the input X, Y, and N, and sets A = 1, B = X, and A = A 2 mod N
And A = ABmodN are alternately performed. In this operation, the upper bits of Y are examined one bit at a time. If the logic is 0, the result of the A 2 modN operation is taken into the storage circuit as valid data. The operation results of A 2 mod N and AB mod N are taken into the storage circuit as valid data, and A = ABm when the logic is 0
An IC card wherein the operation of oddN is the dummy processing operation for the purpose of disturbance.
【請求項5】 請求項4において、 上記記憶回路は、リードライトバッファとかかるリード
ライトバッファを通してデータの入出力が行なわれる複
数のレジスタとからなるレジスタブロックであり、 上記演算結果は、上記Yの特定ビットei の論理1又は
0によってゲート回路を制御し、所定のレジスタに供給
されるライトストローブ信号の伝達を制御して、有効な
データのみがリードライトバッファを通して上記所定の
レジスタに格納されることを特徴とするICカード。
5. The storage circuit according to claim 4, wherein the storage circuit is a register block including a read / write buffer and a plurality of registers for inputting / outputting data through the read / write buffer. controls the gate circuit by a logic 1 or 0 of a specific bit e i, and controls the transmission of the write strobe signal supplied to a predetermined register, only valid data is stored in the predetermined register through the read-write buffer An IC card, characterized in that:
【請求項6】 請求項4において、 上記記憶回路は、リードライトバッファとかかるリード
ライトバッファを通してデータの入出力が行なわれる複
数のレジスタとからなるレジスタブロックであり、 上記演算結果は、上記Yの特定ビットei の論理1又は
0によってゲート回路を制御し、上記リードライトバッ
ファに供給されるライトストローブ信号の伝達を制御し
て、有効なデータのみがリードライトバッファを通して
上記所定のレジスタに格納されることを特徴とするIC
カード。
6. The storage circuit according to claim 4, wherein the storage circuit is a register block including a read / write buffer and a plurality of registers for inputting / outputting data through the read / write buffer. controls the gate circuit by a logic 1 or 0 of a specific bit e i, and controls the transmission of the write strobe signal supplied to the read-write buffer, only valid data stored in the predetermined register through the read-write buffer IC characterized by the following:
card.
【請求項7】 請求項4において、 上記記憶回路は、リードライトバッファとかかるリード
ライトバッファを通してデータの入出力が行なわれる複
数のレジスタ及びダミーレジスタとからなるレジスタブ
ロックであり、 上記演算結果は、上記リードライトバッファと上記ダミ
ーレジスタ及び複数のレジスタとの間に設けられたセレ
クタを上記Yの特定ビットei の論理1又は0によって
制御して上記リードライトバッファに書き込まれた演算
結果のうち有効なデータが所定のレジスタに格納され、
無効なデータが上記ダミーレジスタに格納されるもので
あることを特徴とするICカード。
7. The storage circuit according to claim 4, wherein the storage circuit is a register block including a read / write buffer, a plurality of registers for inputting / outputting data through the read / write buffer, and a dummy register. A selector provided between the read / write buffer, the dummy register, and the plurality of registers is controlled by a logical 1 or 0 of the specific bit e i of Y to determine which of the operation results written in the read / write buffer is valid. Data is stored in a predetermined register,
An IC card wherein invalid data is stored in the dummy register.
【請求項8】 請求項3において、 上記暗号化処理用演算ユニットは、入力されたX、Y及
びNを受け、A=1、B=Xとして、A=A2 modN
とA=ABmodNの演算を交互に行ない、かかる演算
においてYの上位から1ビットずつみて、論理0であれ
ば上記A2 modNの演算結果を有効なデータとしてそ
の出力タイミングで記憶回路に取り込み、論理1であれ
ば上記A2 modNとABmodNの演算結果を有効な
データとしてその出力タイミングで記憶回路に取り込む
ものであり、上記A=A2 modNの演算結果が出力さ
れてから上記A=ABmodNの演算が開始されるまで
の間も上記A=A2 modNの動作を継続し、A=AB
modNの演算結果が出力されてからYのビットの変更
判定処理を含めて次のビットに対応したA2 modNの
演算が開始されるまでの間も上記A=ABmodNの動
作を継続するものであることを特徴とするICカード。
8. The encryption processing unit according to claim 3, wherein the encryption processing operation unit receives the input X, Y, and N, and sets A = 1, B = X, and A = A 2 mod N
And performed alternately calculation of A = ABmodN, as viewed by one bit from the Y level in such operations, the uptake in the memory circuit at its output timing the operation result of the A 2 modN as valid data is logic 0, logic If 1, the operation result of A 2 modN and AB mod N is taken into the storage circuit at the output timing as valid data, and after the operation result of A = A 2 mod N is output, the operation of A = AB mod N is output. The operation of A = A 2 modN is continued until A is started, and A = AB
also is intended to continue the operation of the A = ABmodN until calculation of A 2 modN corresponding to the next bit is started including the bit change determination processing Y from the calculation results of modN is outputted An IC card, characterized in that:
【請求項9】 請求項3において、 上記暗号化処理用演算ユニットは、入力されたX、Y及
びNを受け、A=1、B=Xとして、A=A2 modN
とA=ABmodNの演算とそれぞれに対してオーバー
フロー演算行ない、かかる演算においてYの上位から1
ビットずつみて、論理0であれば上記A2 modNの演
算結果を有効なデータとして記憶回路に取り込み、論理
1であれば上記A2 modNとABmodNの演算結果
を有効なデータとして記憶回路に取り込むものであり、
上記論理0のときのA=ABmodNの演算動作と、各
演算動作での不要なオーバーフロー演算が上記攪乱目的
のダミー処理動作とされることを特徴とするICカー
ド。
9. The encryption processing unit according to claim 3, wherein the encryption processing operation unit receives the input X, Y, and N, and sets A = 1, B = X, and A = A 2 mod N
, And A = ABmodN, and an overflow operation is performed on each of them.
Looking at each bit, if the logic is 0, the result of the A 2 modN operation is taken into the storage circuit as valid data, and if the logic is 1, the result of the A 2 mod N and AB mod N operation is taken as valid data in the storage circuit. And
An IC card characterized in that the operation of A = ABmodN when the logic is 0 and the unnecessary overflow operation in each operation is the dummy processing operation for the purpose of the disturbance.
【請求項10】 外部端子がリードライト装置と電気的
に接続されることによって動作電圧が供給され、かつ、
暗号化処理又は復号化処理を伴ってデータの入出力動作
が行われるICカードであって、 上記暗号化処理又は復号化処理に攪乱目的のダミー演算
を含ませて内部回路の動作タイミング及び動作電流に不
規則性を持たせてなることを特徴とするICカード。
10. An operating voltage is supplied when an external terminal is electrically connected to a read / write device, and
An IC card in which data input / output operation is performed along with an encryption process or a decryption process, wherein the encryption process or the decryption process includes a dummy operation for the purpose of disturbance, and an operation timing and an operation current of an internal circuit. IC card characterized by having irregularities.
【請求項11】 外部端子がリードライト装置と電気的
に接続されることによって動作電圧が供給され、かつ、
暗号化処理又は復号化処理を伴ってデータの入出力動作
が行われるICカードであって、 上記暗号化処理又は復号化処理における各演算の間隔に
攪乱目的のダミーサイクルを含ませて内部回路の動作タ
イミング及び動作電流に不規則性を持たせてなることを
特徴とするICカード。
11. An operating voltage is supplied by an external terminal being electrically connected to a read / write device, and
An IC card in which data input / output operation is performed along with encryption processing or decryption processing, wherein an interval of each operation in the encryption processing or decryption processing includes a dummy cycle for the purpose of disturbance, and An IC card characterized by having irregularities in operation timing and operation current.
【請求項12】 暗号化処理又は復号化処理を伴ったデ
ータの入出力動作を含むモジュール構成のマイクロコン
ピュータであって、 上記暗号化処理又は復号化処理に攪乱目的のダミー処理
動作を含ませて内部回路の動作タイミング及び動作電流
の画一化を行なうことを特徴とするマイクロコンピュー
タ。
12. A microcomputer having a module configuration including an input / output operation of data accompanied by an encryption process or a decryption process, wherein the encryption process or the decryption process includes a dummy processing operation for a disturbance purpose. A microcomputer characterized in that operation timing and operation current of an internal circuit are made uniform.
【請求項13】 請求項12において、 上記モジュール構成は、1つの半導体基板上において形
成されることによって実現されることを特徴とするマイ
クロコンピュータ。
13. The microcomputer according to claim 12, wherein the module configuration is realized by being formed on one semiconductor substrate.
【請求項14】 請求項13において、 上記暗号化処理又は復号化処理は、RSA暗号法などに
応用可能なべき乗剰余乗算動作を含み、 上記べき乗剰余乗算動作は、中央処理装置からの指示を
受けて動作する暗号処理用演算ユニットにより行なわれ
るものであることを特徴とするマイクロコンピュータ。
14. The method according to claim 13, wherein the encryption processing or the decryption processing includes a power-residue multiplication operation applicable to RSA cryptography or the like, and the power-residue multiplication operation receives an instruction from a central processing unit. A microcomputer that is operated by a cryptographic processing operation unit that operates.
【請求項15】 請求項14において、 上記暗号化処理用演算ユニットは、入力されたX、Y及
びNを受け、A=1、B=Xとして、A=A2 modN
とA=ABmodNの演算を交互に行ない、かかる演算
においてYの上位から1ビットずつみて、論理0であれ
ば上記A2 modNの演算結果を有効なデータとして記
憶回路に取り込み、論理1であれば上記A2 modNと
ABmodNの演算結果を有効なデータとして記憶回路
に取り込むものであり、上記論理0のときのA=ABm
odNの演算動作が上記攪乱目的のダミー処理動作とさ
れることを特徴とするマイクロコンピュータ。
15. The encryption processing unit according to claim 14, wherein the encryption processing operation unit receives the input X, Y, and N, and sets A = 1, B = X, and A = A 2 modN.
And A = ABmodN are alternately performed. In this operation, the upper bits of Y are examined one bit at a time. If the logic is 0, the result of the A 2 modN operation is taken into the storage circuit as valid data. The operation results of A 2 mod N and AB mod N are taken into the storage circuit as valid data, and A = ABm when the logic is 0
A microcomputer characterized in that the operation of oddN is the dummy processing operation for the purpose of the disturbance.
【請求項16】 請求項14において、 上記暗号化処理用演算ユニットは、入力されたX、Y及
びNを受け、A=1、B=Xとして、A=A2 modN
とA=ABmodNの演算を交互に行ない、かかる演算
においてYの上位から1ビットずつみて、論理0であれ
ば上記A2 modNの演算結果を有効なデータとしてそ
の出力タイミングで記憶回路に取り込み、論理1であれ
ば上記A2 modNとABmodNの演算結果を有効な
データとしてその出力タイミングで記憶回路に取り込む
ものであり、上記A=A2 modNの演算結果が出力さ
れてから上記A=ABmodNの演算が開始されまるま
での間も上記A=A2 modNの動作を継続し、A=A
BmodNの演算結果が出力されてからYのビットの変
更判定処理を含めて次のビットに対応したA2 modN
の演算が開始されるまでの間も上記A=ABmodNの
動作を継続するものであることを特徴とするマイクロコ
ンピュータ。
16. The arithmetic unit for encryption processing according to claim 14, wherein the encryption processing unit receives the input X, Y, and N, and sets A = 1, B = X, and A = A 2 modN.
And performed alternately calculation of A = ABmodN, as viewed by one bit from the Y level in such operations, the uptake in the memory circuit at its output timing the operation result of the A 2 modN as valid data is logic 0, logic If 1, the operation result of A 2 modN and AB mod N is taken into the storage circuit at the output timing as valid data, and after the operation result of A = A 2 mod N is output, the operation of A = AB mod N is output. The operation of A = A 2 modN is continued until A is started, and A = A
A 2 modN the operation result of BmodN from being output including change decision bits of Y corresponding to the next bit
The microcomputer is characterized in that the operation of A = ABmodN is continued even before the calculation of (1) is started.
【請求項17】 請求項14において、 上記暗号化処理用演算ユニットは、入力されたX、Y及
びNを受け、A=1、B=Xとして、A=A2 modN
とA=ABmodNの演算とそれぞれに対してオーバー
フロー演算行ない、かかる演算においてYの上位から1
ビットずつみて、論理0であれば上記A2 modNの演
算結果を有効なデータとして記憶回路に取り込み、論理
1であれば上記A2 modNとABmodNの演算結果
を有効なデータとして記憶回路に取り込むものであり、
上記論理0のときのA=ABmodNの演算動作と、各
演算動作での不要なオーバーフロー演算が上記攪乱目的
のダミー処理動作とされることを特徴とするマイクロコ
ンピュータ。
17. The cryptographic processing unit according to claim 14, wherein the encryption processing operation unit receives the input X, Y, and N, and sets A = 1, B = X, and A = A 2 modN.
, And A = ABmodN, and an overflow operation is performed on each of them.
Looking at each bit, if the logic is 0, the result of the A 2 modN operation is taken into the storage circuit as valid data, and if the logic is 1, the result of the A 2 mod N and AB mod N operation is taken as valid data in the storage circuit. And
A microcomputer characterized in that the arithmetic operation of A = ABmodN when the logic is 0 and the unnecessary overflow operation in each arithmetic operation is the dummy processing operation for the purpose of the disturbance.
【請求項18】 請求項3において、 上記暗号化処理用演算ユニットは、入力されたX、Y及
びNを受け、A=1、B=Xとして、Yのビットの値に
応じて、A=A2 -1modN、A=ABR-1modN
の演算を行うとともに、 演算結果にオーバーフローが発生した場合にはさらに上
記演算結果WからNの減算W−Nを行なう正規動作と、
各々の演算結果にオーバーフローが発生しない場合でも
上記減算W−Nに対応した演算による無効データを生成
する攪乱目的のダミー動作を行い、 上記オーバーフローの有無に対応して有効なデータを出
力させることを特徴とするICカード。
18. The encryption processing unit according to claim 3, wherein the encryption processing operation unit receives the input X, Y, and N, sets A = 1, B = X, and sets A = A 2 R -1 mod N, A = ABR -1 mod N
And a normal operation of subtracting N from the operation result W if the operation result overflows,
Even when overflow does not occur in each operation result, a dummy operation for the purpose of disturbance for generating invalid data by the operation corresponding to the subtraction WN is performed, and valid data is output according to the presence or absence of the overflow. Characteristic IC card.
【請求項19】 請求項18において、 上記A2 -1modN又はABR-1modNの演算結果
Wは第1の記憶回路に格納され、 演算器のオーバーフローフラグOVの有無が記憶され、 上記剰余乗算の後に上記第1記憶回路の演算結果Wから
Nの減算W−Nが行われて、その演算結果が上記オーバ
ーフローフラグOVが有る時には上記第1の記憶回路に
格納され、オーバーフローフラグOVが無い時には上記
第1記憶回路とは異なる第2の記憶回路に上記錯乱目的
のダミー動作として書き込まれ、 上記第1の記憶回路の演算結果が有効なデータとして出
力されることを特徴とするICカード。
19. The method according to claim 18, wherein the operation result W of the A 2 R −1 modN or the ABR −1 mod N is stored in a first storage circuit, and the presence or absence of an overflow flag OV of the arithmetic unit is stored. After the multiplication, a subtraction WN of N from the operation result W of the first storage circuit is performed, and the operation result is stored in the first storage circuit when the overflow flag OV exists, and the overflow flag OV does not exist. An IC card which is sometimes written in a second storage circuit different from the first storage circuit as the dummy operation for the purpose of confusion, and the operation result of the first storage circuit is output as valid data.
【請求項20】 請求項18において、 上記A2 -1modN又はABR-1modNの演算結果
Wは第1の記憶回路に格納され、 演算器のオーバーフローフラグOVの有無が記憶され、 上記剰余乗算の後に上記第1の記憶回路の演算結果Wか
らNの減算W−Nが行われて、オーバーフローフラグO
Vが有るときに上記演算結果W−Nがセレクタにより選
択され、オーバーフローフラグOVが無いときには上記
第1記憶回路の演算結果Wがセレクタにより選択されて
第2の記憶回路に格納されて有効なデータとして出力さ
れること特徴とするICカード。
20. The arithmetic unit according to claim 18, wherein the operation result W of A 2 R −1 modN or ABR −1 mod N is stored in a first storage circuit, and the presence or absence of an overflow flag OV of the arithmetic unit is stored. After the multiplication, a subtraction WN of N from the operation result W of the first storage circuit is performed, and an overflow flag O
When V is present, the operation result WN is selected by the selector, and when there is no overflow flag OV, the operation result W of the first storage circuit is selected by the selector and stored in the second storage circuit to store valid data. An IC card, which is output as a message.
【請求項21】 請求項18において、 上記A2 -1modN又はABR-1modNの演算結果
Wは第1の記憶回路に格納され、 演算器のオーバーフローフラグOVの有無が記憶され、 上記剰余乗算の後に上記第1の記憶回路の演算結果Wか
らNの減算W−Nが行われ、オーバーフローフラグOV
が有るときには減算W−Nが第2の記憶回路に記憶さ
れ、オーバーフローフラグOVが無いときには減算W−
Nが第3の記憶回路に記憶され、 オーバーフローフラグOVが有るときには上記第2の記
憶回路のデータが有効なデータとして出力され、 オーバーフローフラグOVが無いときには上記第1の記
憶回路のデータが有効なデータとして出力されること特
徴とするICカード。
21. The method according to claim 18, wherein the operation result W of the A 2 R −1 modN or the ABR −1 mod N is stored in a first storage circuit, and the presence or absence of an overflow flag OV of the arithmetic unit is stored. After the multiplication, a subtraction WN of N from the operation result W of the first storage circuit is performed, and the overflow flag OV
Is present, the subtraction W−N is stored in the second storage circuit, and if there is no overflow flag OV, the subtraction W−N is stored.
N is stored in the third storage circuit, and when the overflow flag OV is present, the data in the second storage circuit is output as valid data. When the overflow flag OV is not present, the data in the first storage circuit is valid. An IC card output as data.
【請求項22】 請求項18において、 上記A2 -1modN又はABR-1modNの演算結果
Wは第1の記憶回路に格納され、 演算器のオーバーフローフラグOVの有無が記憶され、 上記剰余乗算の後に上記第1の記憶回路の演算結果Wか
らNの減算結果W−Nが第2の記憶回路に格納され、オ
ーバーフローフラグOVが無いとき第1の記憶回路と第
2の記憶回路を選択する最下位アドレスを逆転させて、
上記第2の記憶回路を選択するアドレスにより第1の記
憶回路を選択して有効なデータとして出力させ、オーバ
ーフローフラグOVが有るとき第1の記憶回路と第2の
記憶回路を選択する最下位アドレスをそのままにして第
2の記憶回路の演算結果を有効なデータとして出力させ
ることを特徴とするICカード。
22. The arithmetic unit according to claim 18, wherein the operation result W of the A 2 R −1 modN or the ABR −1 mod N is stored in a first storage circuit, and the presence or absence of an overflow flag OV of the arithmetic unit is stored. After the multiplication, the subtraction result W-N of N from the operation result W of the first storage circuit is stored in the second storage circuit, and when there is no overflow flag OV, the first storage circuit and the second storage circuit are selected. Reverse the lowest address
The first storage circuit is selected by the address for selecting the second storage circuit and is output as valid data, and the lowest address for selecting the first storage circuit and the second storage circuit when the overflow flag OV is present. Wherein the calculation result of the second storage circuit is output as valid data while keeping the same as it is.
【請求項23】 請求項18において、 上記A2 -1modN又はABR-1modNの演算結果
Wは第1の記憶回路に格納され、 演算器のオーバーフローフラグOVの有無が記憶され、 上記剰余乗算の後に上記第1の記憶回路と第2の記憶回
路のアドレスが交換され、第2の記憶回路を選択するア
ドレスにより選択される演算結果値WからNの減算W−
Nが行われて第1の記憶回路を選択するアドレスにより
選択される第2の記憶回路に減算結果W−Nが格納さ
れ、オーバーフローフラグOVが有るときにのみ上記ア
ドレスを再度交換し、第1の記憶回路を選択するアドレ
スにより選択される第1又は第2の記憶回路のデータを
有効なデータとして出力させることを特徴とするICカ
ード。
23. The arithmetic unit according to claim 18, wherein the operation result W of A 2 R −1 modN or ABR −1 mod N is stored in a first storage circuit, and the presence or absence of an overflow flag OV of the arithmetic unit is stored. After the multiplication, the addresses of the first storage circuit and the second storage circuit are exchanged, and N is subtracted from the operation result value W selected by the address for selecting the second storage circuit.
The subtraction result W-N is stored in the second memory circuit selected by the address for selecting the first memory circuit after N is performed, and the address is exchanged again only when the overflow flag OV is present. An IC card which outputs data of the first or second storage circuit selected by an address for selecting the storage circuit as valid data.
【請求項24】 請求項18において、 上記A2 -1modN又はABR-1modNの演算結果
Wは第1の記憶回路に格納され、 上記剰余乗算の後に上記第1の記憶回路の演算結果値W
からNの減算W−Nが行われて第2の記憶回路に格納さ
れ、 このW−Nの減算が行われた時の演算器からボローフラ
グBRが記憶され、 ボローフラグBRが有るときには、第1の記憶回路と第
2の記憶回路を選択する最下位アドレスを逆転させて、
上記第2の記憶回路を選択するアドレスにより第1の記
憶回路の演算結果Wを出力し、 ボローフラグBRが無いときには、第1の記憶回路と第
2の記憶回路を選択する最下位アドレスをそのままし
て、上記第2の記憶回路を選択するアドレスにより第2
の記憶回路の演算結果W−Nを出力させることを特徴と
するICカード。
24. The operation result of the first storage circuit according to claim 18, wherein the operation result W of A 2 R −1 modN or ABR −1 mod N is stored in a first storage circuit, and the operation result of the first storage circuit after the remainder multiplication. Value W
, N is subtracted from N, and the result is stored in the second storage circuit. The borrow flag BR is stored in the arithmetic unit at the time when the WN is subtracted, and when the borrow flag BR is present, the first By inverting the lowest address for selecting the storage circuit and the second storage circuit,
The operation result W of the first storage circuit is output based on the address for selecting the second storage circuit, and when there is no borrow flag BR, the lowest address for selecting the first storage circuit and the second storage circuit is left as it is. The second address is selected by the address for selecting the second memory circuit.
Wherein the operation result of the storage circuit is output.
【請求項25】 請求項14において、 上記暗号化処理用演算ユニットは、入力されたX、Y及
びNを受け、A=1、B=Xとして、Yのビットの値に
応じて、A=A2 -1modN、A=ABR-1modN
の演算を行うとともに、 演算結果にオーバーフローが発生した場合にはさらに上
記演算結果WからNの減算W−Nを行なう正規動作と、
各々の演算結果にオーバーフローが発生しない場合でも
上記減算W−Nに対応した演算による無効データを生成
する攪乱目的のダミー動作を行い、 上記オーバーフローの有無に対応して有効なデータを出
力させることを特徴とするマイクロコンピュータ。
25. The encryption processing unit according to claim 14, wherein the encryption processing operation unit receives the input X, Y, and N, sets A = 1, B = X, and sets A = A 2 R -1 mod N, A = ABR -1 mod N
And a normal operation of subtracting N from the operation result W if the operation result overflows,
Even when overflow does not occur in each operation result, a dummy operation for the purpose of disturbance for generating invalid data by the operation corresponding to the subtraction WN is performed, and valid data is output according to the presence or absence of the overflow. Characteristic microcomputer.
【請求項26】 請求項25において、 上記A2 -1modN又はABR-1modNの演算結果
Wは第1の記憶回路に格納され、 演算器からのオーバーフローフラグOVの有無が記憶さ
れ、 上記剰余乗算の後に上記第1記憶回路の演算結果Wから
Nの減算W−Nが行われて、その演算結果が上記オーバ
ーフローフラグOVが有る時には上記第1の記憶回路に
格納され、オーバーフローフラグOVが無い時には上記
第1記憶回路とは異なる第2の記憶回路に上記錯乱目的
のダミー動作として書き込まれ、 上記第1の記憶回路の演算結果が有効なデータとして出
力されることを特徴とするマイクロコンピュータ。
26. The method according to claim 25, wherein the operation result W of A 2 R −1 modN or ABR −1 mod N is stored in a first storage circuit, and the presence or absence of an overflow flag OV from a processing unit is stored. After the remainder multiplication, a subtraction W−N of N is performed from the operation result W of the first storage circuit, and the operation result is stored in the first storage circuit when the overflow flag OV is present, and the overflow flag OV is set. When there is no microcomputer, the data is written as a dummy operation for the purpose of confusion in a second storage circuit different from the first storage circuit, and the operation result of the first storage circuit is output as valid data. .
【請求項27】 請求項25において、 上記A2 -1modN又はABR-1modNの演算結果
Wは第1の記憶回路に格納され、 演算器のオーバーフローフラグOVの有無が記憶され、 上記剰余乗算の後に上記第1の記憶回路の演算結果Wか
らNの減算W−Nが行われて、オーバーフローフラグO
Vが有るときに上記演算結果W−Nがセレクタにより選
択され、オーバーフローフラグOVが無いときには上記
第1記憶回路の演算結果Wがセレクタにより選択されて
第2の記憶回路に格納されて有効なデータとして出力さ
れること特徴とするマイクロコンピュータ。
27. The arithmetic unit according to claim 25, wherein the operation result W of the A 2 R −1 modN or the ABR −1 mod N is stored in a first storage circuit, and the presence or absence of an overflow flag OV of the arithmetic unit is stored. After the multiplication, a subtraction WN of N from the operation result W of the first storage circuit is performed, and an overflow flag O
When V is present, the operation result WN is selected by the selector, and when there is no overflow flag OV, the operation result W of the first storage circuit is selected by the selector and stored in the second storage circuit to store valid data. A microcomputer characterized by being output as a.
【請求項28】 請求項25において、 上記A2 -1modN又はABR-1modNの演算結果
Wは第1の記憶回路に格納され、 演算器のオーバーフローフラグOVの有無が記憶され、 上記剰余乗算の後に上記第1の記憶回路の演算結果Wか
らNの減算W−Nが行われ、オーバーフローフラグOV
が有るときには減算結果W−Nが第2の記憶回路に記憶
され、オーバーフローフラグOVが無いときには減算結
果W−Nが第3の記憶回路に記憶され、 オーバーフローフラグOVが有るときには上記第2の記
憶回路のデータが有効なデータとして出力され、 オーバーフローフラグOVが無いときには上記第1の記
憶回路のデータが有効なデータとして出力されること特
徴とするマイクロコンピュータ。
28. The method according to claim 25, wherein the operation result W of the A 2 R −1 modN or the ABR −1 mod N is stored in a first storage circuit, and the presence or absence of an overflow flag OV of the arithmetic unit is stored. After the multiplication, a subtraction WN of N from the operation result W of the first storage circuit is performed, and the overflow flag OV
Is present, the subtraction result W-N is stored in the second storage circuit. When there is no overflow flag OV, the subtraction result W-N is stored in the third storage circuit. When the overflow flag OV is present, the second storage is performed. A microcomputer wherein data of the circuit is output as valid data, and data of the first storage circuit is output as valid data when there is no overflow flag OV.
【請求項29】 請求項25において、 上記A2 -1modN又はABR-1modNの演算結果
Wは第1の記憶回路に格納され、 演算器のオーバーフローフラグOVの有無が記憶され、 上記剰余乗算の後に上記第1の記憶回路の演算結果Wか
らNの減算結果W−Nが第2の記憶回路に格納され、オ
ーバーフローフラグOVが無いとき第1の記憶回路と第
2の記憶回路を選択する最下位アドレスを逆転させて、
上記第2の記憶回路を選択するアドレスにより第1の記
憶回路を選択して有効なデータとして出力させ、オーバ
ーフローフラグOVが有るとき第1の記憶回路と第2の
記憶回路を選択する最下位アドレスをそのままにして第
2の記憶回路の演算結果を有効なデータとして出力させ
ることを特徴とするマイクロコンピュータ。
29. The arithmetic unit according to claim 25, wherein the operation result W of A 2 R −1 modN or ABR −1 mod N is stored in a first storage circuit, and the presence or absence of an overflow flag OV of the arithmetic unit is stored. After the multiplication, the subtraction result W-N of N from the operation result W of the first storage circuit is stored in the second storage circuit, and when there is no overflow flag OV, the first storage circuit and the second storage circuit are selected. Reverse the lowest address
The first storage circuit is selected by the address for selecting the second storage circuit and is output as valid data, and the lowest address for selecting the first storage circuit and the second storage circuit when the overflow flag OV is present. A microcomputer that outputs the operation result of the second storage circuit as valid data while keeping the same as it is.
【請求項30】 請求項25において、 上記A2 -1modN又はABR-1modNの演算結果
Wは第1の記憶回路に格納され、 演算器のオーバーフローフラグOVの有無が記憶され、 上記剰余乗算の後に上記第1の記憶回路と第2の記憶回
路のアドレスが交換され、第2の記憶回路を選択するア
ドレスにより選択される演算結果値WからNの減算W−
Nが行われて第1の記憶回路を選択するアドレスにより
選択される第2の記憶回路に減算結果W−Nが格納さ
れ、オーバーフローフラグOVが有るときにのみ上記ア
ドレスを再度交換し、第1の記憶回路を選択するアドレ
スにより選択される第1又は第2の記憶回路のデータを
有効なデータとして出力させることを特徴とするマイク
ロコンピュータ。
30. The arithmetic unit according to claim 25, wherein the operation result W of the A 2 R −1 modN or the ABR −1 mod N is stored in a first storage circuit, and the presence or absence of an overflow flag OV of the arithmetic unit is stored. After the multiplication, the addresses of the first storage circuit and the second storage circuit are exchanged, and N is subtracted from the operation result value W selected by the address for selecting the second storage circuit.
The subtraction result W-N is stored in the second memory circuit selected by the address for selecting the first memory circuit after N is performed, and the address is exchanged again only when the overflow flag OV is present. Wherein the data of the first or second storage circuit selected by the address for selecting the storage circuit is output as valid data.
【請求項31】 請求項25において、 上記A2 -1modN又はABR-1modNの演算結果
Wは第1の記憶回路に格納され、 上記剰余乗算の後に上記第1の記憶回路の演算結果値W
からNの減算W−Nが行われて第2の記憶回路に格納さ
れ、 このW−Nの減算が行われた時の演算器からボローフラ
グBRが記憶され、 ボローフラグBRが有るときには、第1の記憶回路と第
2の記憶回路を選択する最下位アドレスを逆転させて、
上記第2の記憶回路を選択するアドレスにより第1の記
憶回路の演算結果Wを出力し、 ボローフラグBRが無いときには、第1の記憶回路と第
2の記憶回路を選択する最下位アドレスをそのままし
て、上記第2の記憶回路を選択するアドレスにより第2
の記憶回路の演算結果W−Nを出力させることを特徴と
するマイクロコンピュータ。
31. The operation result of the first storage circuit according to claim 25, wherein the operation result W of A 2 R −1 modN or ABR −1 mod N is stored in a first storage circuit, and the operation result of the first storage circuit after the remainder multiplication. Value W
, N is subtracted from N, and the result is stored in the second storage circuit. The borrow flag BR is stored in the arithmetic unit at the time when the WN is subtracted, and when the borrow flag BR is present, the first By inverting the lowest address for selecting the storage circuit and the second storage circuit,
The operation result W of the first storage circuit is output based on the address for selecting the second storage circuit, and when there is no borrow flag BR, the lowest address for selecting the first storage circuit and the second storage circuit is left as it is. The second address is selected by the address for selecting the second memory circuit.
A microcomputer that outputs the operation result WN of the storage circuit.
JP2000323178A 2000-01-12 2000-10-23 Ic card and microcomputer Pending JP2001266103A (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2000323178A JP2001266103A (en) 2000-01-12 2000-10-23 Ic card and microcomputer
TW090100141A TW536672B (en) 2000-01-12 2001-01-03 IC card and microcomputer
US09/754,190 US6907526B2 (en) 2000-01-12 2001-01-05 IC card and microprocessor
US09/754,064 US20010047480A1 (en) 2000-01-12 2001-01-05 IC card and microprocessor
KR1020010001133A KR20010083099A (en) 2000-01-12 2001-01-09 IC card and microprocessor

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2000-3295 2000-01-12
JP2000003295 2000-01-12
JP2000323178A JP2001266103A (en) 2000-01-12 2000-10-23 Ic card and microcomputer

Publications (1)

Publication Number Publication Date
JP2001266103A true JP2001266103A (en) 2001-09-28

Family

ID=26583353

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000323178A Pending JP2001266103A (en) 2000-01-12 2000-10-23 Ic card and microcomputer

Country Status (1)

Country Link
JP (1) JP2001266103A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100528673B1 (en) * 2003-04-09 2005-11-16 주식회사 퓨쳐시스템 The system for removing data in case of emergency
JP2006054568A (en) * 2004-08-10 2006-02-23 Sony Corp Encryption apparatus, decryption apparatus and method, and computer program
JP2006510127A (en) * 2002-12-12 2006-03-23 エイアールエム リミテッド Instruction timing control in data processor
KR100623063B1 (en) * 2005-05-04 2006-09-13 인하대학교 산학협력단 Rfid tag and rfid system that having a forced collision function and method for protect a information of rfid tag
US7171437B2 (en) 2002-09-30 2007-01-30 Renesas Technology Corp. Residue calculating unit immune to power analysis
KR100706787B1 (en) 2004-11-29 2007-04-11 삼성전자주식회사 Smart card with improved security function
JP2007233381A (en) * 2006-02-08 2007-09-13 Nvidia Corp Graphics processing unit used for cryptographic processing
WO2008013083A1 (en) * 2006-07-25 2008-01-31 Nec Corporation Pseudo random number generator, stream encrypting device, and program
JP2010139544A (en) * 2008-12-09 2010-06-24 Renesas Electronics Corp Apparatus and method for calculating remainder
JP2010252059A (en) * 2009-04-16 2010-11-04 Hitachi Ltd Ic chip and information processing apparatus mounting the same
JP2012146004A (en) * 2011-01-07 2012-08-02 Dainippon Printing Co Ltd Portable device and method for changing storage location of dynamic data
JP2013045072A (en) * 2011-08-26 2013-03-04 Toshiba Corp Arithmetic unit
JP2013167897A (en) * 2004-06-08 2013-08-29 Hrl Lab Llc Cryptographic architecture with instruction masking and other techniques for thwarting differential power analysis

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7171437B2 (en) 2002-09-30 2007-01-30 Renesas Technology Corp. Residue calculating unit immune to power analysis
JP2006510127A (en) * 2002-12-12 2006-03-23 エイアールエム リミテッド Instruction timing control in data processor
KR100528673B1 (en) * 2003-04-09 2005-11-16 주식회사 퓨쳐시스템 The system for removing data in case of emergency
JP2013167897A (en) * 2004-06-08 2013-08-29 Hrl Lab Llc Cryptographic architecture with instruction masking and other techniques for thwarting differential power analysis
JP2006054568A (en) * 2004-08-10 2006-02-23 Sony Corp Encryption apparatus, decryption apparatus and method, and computer program
KR100706787B1 (en) 2004-11-29 2007-04-11 삼성전자주식회사 Smart card with improved security function
KR100623063B1 (en) * 2005-05-04 2006-09-13 인하대학교 산학협력단 Rfid tag and rfid system that having a forced collision function and method for protect a information of rfid tag
US7916864B2 (en) 2006-02-08 2011-03-29 Nvidia Corporation Graphics processing unit used for cryptographic processing
JP2007233381A (en) * 2006-02-08 2007-09-13 Nvidia Corp Graphics processing unit used for cryptographic processing
JP5136416B2 (en) * 2006-07-25 2013-02-06 日本電気株式会社 Pseudorandom number generator, stream cipher processor, and program
WO2008013083A1 (en) * 2006-07-25 2008-01-31 Nec Corporation Pseudo random number generator, stream encrypting device, and program
JP2010139544A (en) * 2008-12-09 2010-06-24 Renesas Electronics Corp Apparatus and method for calculating remainder
JP2010252059A (en) * 2009-04-16 2010-11-04 Hitachi Ltd Ic chip and information processing apparatus mounting the same
JP2012146004A (en) * 2011-01-07 2012-08-02 Dainippon Printing Co Ltd Portable device and method for changing storage location of dynamic data
JP2013045072A (en) * 2011-08-26 2013-03-04 Toshiba Corp Arithmetic unit
US8953783B2 (en) 2011-08-26 2015-02-10 Kabushiki Kaisha Toshiba Arithmetic device
US9389855B2 (en) 2011-08-26 2016-07-12 Kabushiki Kaisha Toshiba Arithmetic device

Similar Documents

Publication Publication Date Title
US6907526B2 (en) IC card and microprocessor
Saputra et al. Masking the energy behavior of DES encryption [smart cards]
May et al. Non-deterministic processors
US7201326B2 (en) Information processing device
JP4199937B2 (en) Anti-tamper encryption method
US7269742B2 (en) Microprocessor configuration with encryption
JP2001266103A (en) Ic card and microcomputer
EP1006492A1 (en) Information processing equipment and IC card
Joye et al. Side-Channel Analysis.
US7454017B2 (en) Information processing unit
JP2004516706A (en) Cryptographic processor
US20020065574A1 (en) Data processor, semiconductor integrated circuit and CPU
CN100583757C (en) ECC/RSA encryption/decryption coprocessor
JP4168305B2 (en) IC card and microcomputer
JP2009531725A (en) How to request data safely
JP3844116B2 (en) Encryption / decryption device and IC card
JP2004126841A (en) Method for mounting program
ES2312427T3 (en) PROCEDURE OF CONTRAMEDIDA IN A MICROCIRCUITO AND INTELLIGENT CARD THAT INCLUDES SUCH MICROCIRCUITO.
JP3999229B2 (en) Data processing circuit and data transmission method
WO2005027403A1 (en) Information processing device
KR20010032564A (en) Data processing device and operating method for preventing a differential current consumption analysis
JP6262085B2 (en) Data processing apparatus and decryption processing method
Breuer et al. The secret processor will go to the ball: Benchmark insider-proof encrypted computing
GB2424089A (en) Side channel attack prevention in data processing apparatus such as a smart card
EP4207672B1 (en) Dummy partial multiplication of zero-operands as a low-cost means for reducing the success of sca attacks against ecc

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040301

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040301

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20050315

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060601

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20061005