JP2005346373A - Arithmetic circuit, logical circuit, read-only memory, register, and semiconductor circuit - Google Patents
Arithmetic circuit, logical circuit, read-only memory, register, and semiconductor circuit Download PDFInfo
- Publication number
- JP2005346373A JP2005346373A JP2004164761A JP2004164761A JP2005346373A JP 2005346373 A JP2005346373 A JP 2005346373A JP 2004164761 A JP2004164761 A JP 2004164761A JP 2004164761 A JP2004164761 A JP 2004164761A JP 2005346373 A JP2005346373 A JP 2005346373A
- Authority
- JP
- Japan
- Prior art keywords
- register
- data
- circuit
- signal
- output
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/002—Countermeasures against attacks on cryptographic mechanisms
- H04L9/003—Countermeasures against attacks on cryptographic mechanisms for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2209/00—Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
- H04L2209/12—Details relating to cryptographic hardware or logic circuitry
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
Abstract
Description
本発明は、演算回路、論理回路、読出し専用メモリ、レジスタ、および複数個のロジックを含む半導体回路に関し、特に暗号処理に適した演算回路、論理回路、読出し専用メモリ、レジスタ、および複数個のロジックを含む半導体回路に関する。 The present invention relates to an arithmetic circuit, a logic circuit, a read-only memory, a register, and a semiconductor circuit including a plurality of logics, and more particularly to an arithmetic circuit, a logic circuit, a read-only memory, a register, and a plurality of logics suitable for cryptographic processing. The present invention relates to a semiconductor circuit including:
ICカードなどに搭載された暗号回路が暗号化処理を行なっているときの消費電力を観測して解析することにより、秘匿データの特定が可能であることが知られている。 It is known that secret data can be identified by observing and analyzing power consumption when an encryption circuit mounted on an IC card or the like is performing encryption processing.
たとえば、特許文献1では、SPA(Simple Power Analysis)またはDPA(Differential Power Analysis)のような電力解析が記載されている。すなわち、SPA法では、演算命令の違い、あるいは処理されているデータの違いにより生じる消費電流波形の違いから、暗号鍵や処理されているデータを解析する。また、DPA法では、消費電流波形を統計処理して暗号鍵を推定する。このDPA法では、たとえばDESのある部分に仮定した暗号鍵をあてはめて、平文を変化させながら消費電流波形を測定して統計する。暗号鍵をさまざまに変化させながらこの作業を繰り返し、正しい鍵のときには電流波形が大きなピークを示す。
For example,
このような、電力解析による秘匿データの傍受を防止するために、暗号回路の動作時の消費電力が秘匿データの値によって変化しないようにするための手法が提案されている。 In order to prevent such interception of secret data by power analysis, a method for preventing the power consumption during operation of the encryption circuit from changing depending on the value of the secret data has been proposed.
たとえば、特許文献1では、コプロセッサ209では、暗号化・復号化共に用いられるべき乗剰余演算XYmodNの演算を行なうに当たり撹乱目的のダミー演算が挿入される。つまり、公知のアルゴリズムによって剰余演算A2modNとABmodNの2つの形に分解するにあたり、Y=enen-1e1の値のei=0でも1でもA2modNとABmodNの両方の演算を常に行なうようにする。
For example, in
また、特許文献2では、データ機密保持のための暗号処理に用いる鍵データを、その反転データとともにE2PROM4に記憶しておき、E2PROM4より鍵データとその反転データを読出し、それらのうちの鍵データをもとに暗号回路4で暗号処理プログラムを実行し、その実行結果を用いてCPU1にて演算プログラムを実行する。また、暗号処理手段に、鍵データや処理データなどのデータを伝送するラインと、鍵データや処理データなどの反転データを伝送するラインとを持たせ、各ラインとダミー回路とを接続する。
Also, in
また、特許文献3では、処理するデータを正常処理のデータとそのビットの値を判定したデータの両方を使用する。そして、同一の命令で、正常処理のデータとビットの値を反転したデータとを処理することにより、データバス上の値などが“0”から“1”、あるいは“1”から“0”なる回数を一定にする。データバスでは、値が反転したときに電流を大きく消費するため、“1”と“0”の反転回数が一定になることにより、電流の消費する回数が一定になる。
しかしながら、特許文献1に記載の方法では、モンゴメリ法による剰余演算の一手法において、Y=enen-1e1の値のei=0のときにA2modNのみの演算が必要で、ei=1のときにA2modNとABmodNの両方の演算が必要なところ、ei=0でもABmodNの演算をダミー演算として実行したものであって、モンゴメリ法による剰余演算の一手法に特有の方法である。
However, in the method described in
また、特許文献2および特許文献3に記載の方法では、演算のたびに、正常処理データの反転データを生成または読出して、それを伝送して処理する必要があるので、暗号回路の構成が複雑、かつ大規模化する。
Further, in the methods described in
それゆえに、本発明の目的は、簡易な構成で、電力解析による秘匿データの傍受を防止することのできる、暗号回路に用いられる演算回路、論理回路、読出し専用メモリ、レジスタ、および複数個のロジックを含む半導体回路を提供することである。 Therefore, an object of the present invention is to provide an arithmetic circuit, a logic circuit, a read-only memory, a register, and a plurality of logics used in an encryption circuit that can prevent the interception of confidential data by power analysis with a simple configuration. A semiconductor circuit comprising:
上記課題を解決するために、本発明のある局面に係る演算回路は、n(n≧2)ビットのデータを伝送し、ビットの論理が正論理と負論理とが混在しているnビットのデータバスと、データバスで伝送されるデータを受けて、データバスの論理に適合した加算を行なう加算部とを備える。 In order to solve the above-described problem, an arithmetic circuit according to an aspect of the present invention transmits n (n ≧ 2) bits of data, and the bit logic is n bits in which positive logic and negative logic are mixed. A data bus; and an adder that receives data transmitted through the data bus and performs addition corresponding to the logic of the data bus.
また、本発明の別の局面に係る演算回路は、乗数と被乗数との乗算を行なう演算回路であって、乗数を記憶する第1のレジスタと、被乗数を記憶する第2のレジスタと、乗算の途中結果のデータを記憶する第3のレジスタおよび第4のレジスタと、第3のレジスタの出力と第4のレジスタの出力のいずれかを選択する選択回路と、第2のレジスタから出力される被乗数と、第3のレジスタまたは第4のレジスタから出力される乗算の途中結果のデータとを受けて、これらを加算して、加算結果のデータを出力する加算部と、加算結果のデータを構成するビットをシフトし、シフト結果のデータを出力する第1のシフト回路と、乗算の途中結果のデータを受けて、乗算の途中結果のデータを構成するビットをシフトし、シフト結果のデータを出力する第2のシフト回路とを備え、第3のレジスタは、第1のシフト回路から出力されたシフト結果のデータを受けて、乗算の途中結果のデータとして記憶し、第4のレジスタは、第2のシフト回路から出力されたシフト結果のデータを受けて、乗算の途中結果のデータとして記憶し、選択回路は、第1のレジスタから出力される乗数を構成するビットの値に基づき、第3のレジスタと第4のレジスタのうちのいずれかを選択し、選択したレジスタが記憶している乗算の途中結果のデータを加算部および第2のシフト回路へ出力させる。 An arithmetic circuit according to another aspect of the present invention is an arithmetic circuit that performs multiplication of a multiplier and a multiplicand, a first register that stores the multiplier, a second register that stores the multiplicand, and a multiplication Third register and fourth register for storing intermediate result data, selection circuit for selecting either output of third register or output of fourth register, and multiplicand output from second register And an addition unit that receives the intermediate result data of the multiplication output from the third register or the fourth register, adds them, and outputs the addition result data, and constitutes the addition result data The first shift circuit that shifts the bits and outputs the data of the shift result, receives the data of the intermediate result of the multiplication, shifts the bits constituting the data of the intermediate result of the multiplication, and outputs the data of the shift result The third register receives the data of the shift result output from the first shift circuit and stores the data as the result of the middle of the multiplication, and the fourth register The shift result data output from the shift circuit of No. 2 is received and stored as data of the intermediate result of the multiplication, and the selection circuit selects the third value based on the value of the bits constituting the multiplier output from the first register. Or the fourth register, and outputs the data in the middle of multiplication stored in the selected register to the adder and the second shift circuit.
また、本発明のさらに別の局面に係る論理回路は、正論理を出力する第1の出力端子と、負論理を出力する第2の出力端子と、制御信号の活性化によって、第1の出力端子および第2の出力端子のいずれをもハイ状態とする1個以上の第1群に属するトランジスタと、入力信号または反転入力信号を受けて、制御信号が不活性の場合に、受けた信号のレベルが所定の論理のときに、第1の出力端子をロウ状態とする1個以上の第2群に属するトランジスタと、入力信号または反転入力信号を受けて、制御信号が不活性の場合に、受けた信号のレベルが所定の論理のときに、第2の出力端子をロウ状態とする1個以上の第3群に属するトランジスタとを備える。 A logic circuit according to still another aspect of the present invention includes a first output terminal that outputs positive logic, a second output terminal that outputs negative logic, and a first output by activating a control signal. In response to an input signal or an inverted input signal and one or more transistors belonging to the first group in which both the terminal and the second output terminal are in a high state, and the control signal is inactive, the received signal When the control signal is inactive when receiving the input signal or the inverted input signal and the one or more transistors belonging to the second group that sets the first output terminal to the low state when the level is a predetermined logic, And a transistor belonging to one or more third group that sets the second output terminal to a low state when the level of the received signal is a predetermined logic.
また、本発明のさらに別の局面に係る読出し専用メモリは、正論理を出力する第1の出力端子と、負論理を出力する第2の出力端子と、制御信号の活性化によって、第1の出力端子および第2の出力端子のいずれをもハイ状態とする1個以上の第1群に属するトランジスタと、各々が、対応する入力信号を受け、第1の出力端子と接続される複数個の第2群に属するトランジスタと、各々が、対応する入力信号を受け、第2の出力端子と接続される複数個の第3群に属するトランジスタと、第2群に属するトランジスタは、制御信号が不活性のときに、それぞれに対応する入力信号が活性化されると、第1の出力端子をロウ状態にし、第3群に属するトランジスタは、制御信号が不活性のときに、対応する入力信号が活性化されると、第2の出力端子をロウ状態にする。 A read-only memory according to still another aspect of the present invention includes a first output terminal that outputs positive logic, a second output terminal that outputs negative logic, and activation of a control signal. One or more transistors belonging to the first group in which both the output terminal and the second output terminal are in a high state, and a plurality of transistors each receiving a corresponding input signal and connected to the first output terminal A transistor belonging to the second group, a plurality of transistors belonging to the third group each receiving a corresponding input signal and connected to the second output terminal, and a transistor belonging to the second group have no control signal. When the input signal corresponding to each is activated when activated, the first output terminal is set to the low state, and the transistors belonging to the third group receive the corresponding input signal when the control signal is inactive. When activated, the second The power pin to low state.
また、本発明のさらに別の局面に係るレジスタは、正論理のデータを記憶する第1のノードと、負論理のデータを記憶する第2のノードと、正論理の入力信号を受ける第1の入力端子と、負論理の反転入力信号を受ける第2の入力端子と、制御信号の活性化によって、第1のノードおよび第2のノードのいずれをもハイ状態とする1個以上の第1群のトランジスタと、書込み信号の活性化によって、第1の入力端子と第1のノードとの間を導通させる第1のトランジスタと、書込み信号の活性化によって、第2の入力端子と第2のノードとの間を導通させる第2のトランジスタとを備える。 According to still another aspect of the present invention, a register includes a first node that stores positive logic data, a second node that stores negative logic data, and a first node that receives a positive logic input signal. An input terminal, a second input terminal that receives an inverted input signal of negative logic, and one or more first groups in which both the first node and the second node are in a high state by activation of the control signal Transistors, a first transistor that conducts between the first input terminal and the first node by the activation of the write signal, and a second input terminal and the second node by the activation of the write signal. And a second transistor that conducts to each other.
また、本発明のさらに別の局面に係る半導体回路は、シリアルに接続された複数個のロジックと、対応するロジックに与える制御信号を生成する複数個の制御信号生成回路とを備え、ロジックは、論理回路、またはレジスタを含み、論理回路またはレジスタは、入力信号、反転入力信号、および制御信号とを受けて、出力信号および反転出力信号を出力し、論理回路またはレジスタは、制御信号の活性化により、出力信号および反転出力信号をともにハイ状態とし、制御信号の非活性化されているときに、入力信号および反転入力信号のレベルに応じて、出力信号および反転出力信号の一方をハイ状態とし、他方をロウ状態とし、制御信号生成回路は、制御信号を活性化した後、対応するロジックに入力される少なくとも1つの入力信号および反転入力信号のペアのうち、ともにハイ状態からいずれかがロウ状態に変化するタイミングが最も遅いペアが変化した後に、制御信号を非活性化させる。 A semiconductor circuit according to still another aspect of the present invention includes a plurality of serially connected logics and a plurality of control signal generation circuits that generate control signals to be applied to the corresponding logics. The logic circuit or register includes an input signal, an inverted input signal, and a control signal, and outputs an output signal and an inverted output signal. The logic circuit or register activates the control signal. Thus, both the output signal and the inverted output signal are set to the high state, and when the control signal is inactivated, one of the output signal and the inverted output signal is set to the high state according to the level of the input signal and the inverted input signal. The other is set to the low state, and the control signal generation circuit activates the control signal, and then activates at least one input signal and a corresponding logic. Among the inverting input signal of the pair, after the latest pair timing any changes to the low state from both the high state has changed, it deactivates the control signal.
本発明に係る演算回路、論理回路、読出し専用メモリ、レジスタ、および複数個のロジックを含む半導体回路によれば、簡易な構成で、電力解析による秘匿データの傍受を防止することができる。 According to a semiconductor circuit including an arithmetic circuit, a logic circuit, a read-only memory, a register, and a plurality of logics according to the present invention, it is possible to prevent interception of confidential data by power analysis with a simple configuration.
以下、本発明の実施の形態について図面を用いて説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[第1の実施形態]
(従来の演算回路)
図1は、従来の乗算回路の構成を示す。同図を参照して、この乗算回路20は、レジスタ群21と、Y[i]判定回路109と、加算部103と、左シフト回路105と、Pレジスタ28とを備える。レジスタ群とY[i]判定回路および加算部103との間は、データバス112で接続される。加算部103と左シフト回路105との間は、データバス24で接続される。左シフト回路105とPレジスタ27との間は、データバス26で接続される。Pレジスタ27と加算部103との間は、データバス28で接続される。すべてのデータバス112,24,26,28は、伝送されるるデータの各ビットの論理は正論理である。
[First Embodiment]
(Conventional arithmetic circuit)
FIG. 1 shows a configuration of a conventional multiplication circuit. Referring to the figure, the
レジスタ群21は、乗数Yを記憶するYレジスタ121と、被乗数Xを記憶するXレジスタ22と、全ビットが「0」である零元Kを記憶するKレジスタ23とを含む。また、Pレジスタ27は、演算の途中結果のデータPを記憶する。
The
(従来の乗算回路20の乗算のアルゴリズム)
図2は、従来の乗算回路20による乗算のアルゴリズム(1024ビットの場合)を示す。同図を参照して、このアルゴリズム51の概要を説明する。
(Multiplication algorithm of the conventional multiplication circuit 20)
FIG. 2 shows an algorithm for multiplication by the conventional multiplication circuit 20 (in the case of 1024 bits). The outline of the
乗数Yの第iビットであるY[i]が1のときには、Xレジスタ22は、被乗数Xをデータバス112に出力する。また、Pレジスタ27は、記憶しているデータPをデータバス28に出力する。
When Y [i] which is the i-th bit of the multiplier Y is 1, the
加算部103は、データバス112を通じて受けた被乗数Xと、データバス28を通じて受けたデータPとを加算して、加算結果をデータバス24に出力する。
Adder 103 adds multiplicand X received via
左シフト回路105は、データバス24を通じて加算結果を受け、加算結果を1ビットだけ右にシフトして、データバス26を通じてPレジスタ27に出力する。
The
Pレジスタ27は、デ−タバス26を通じて受けたデータをデータPとして記憶する。
The P register 27 stores the data received through the
一方、乗数Yの第iビットであるY[i]が0のときには、Kレジスタ23は、零元Kをデータバス112に出力する。また、Pレジスタ27は、記憶しているデータPをデータバス28に出力する。
On the other hand, when Y [i] which is the i-th bit of multiplier Y is 0, K register 23 outputs zero element K to
加算部103は、データバス112を通じて受けた零元Kと、データバス28を通じて受けたデータPとを加算して、加算結果をデータバス24に出力する。
左シフト回路105は、データバス24を通じて加算結果を受け、加算結果を1ビットだけ右にシフトして、データバス26を通じてPレジスタ27に出力する。
The
Pレジスタ27は、デ−タバス26を通じて受けたデータをデータPとして記憶する。
The P register 27 stores the data received through the
以上のようなアルゴリズムでは、乗数Y[i]が「0」か「1」かによって、消費電力が相違する。なぜなら、Kレジスタ23が零元Kをデータバス112に出力するときに消費する電力は、Xレジスタ22が被乗数Xをデータバス112に出力するときに消費する電力よりも小さい。また、加算部103が零元KとデータPとを加算するときに消費する電力は、加算部103が被乗数XとデータPとを加算するときに消費する電力よりも小さいからである。それゆえ、SPA(Simple Power Analysis)、またはDPA(Differential Power Analysis)などのような消費電力の解析手段を用いるすことによって、乗数Yを特定することが可能となり、それによって、暗号処理に用いられる鍵などの秘匿データを特定することができる。
In the algorithm as described above, the power consumption differs depending on whether the multiplier Y [i] is “0” or “1”. This is because the power consumed when the
(本実施の形態に係る暗号回路)
図3は、暗号回路の構成を示す図である。同図を参照して、この暗号回路11は、制御回路12と、演算回路13とを含む。制御回路12は、外部からの制御信号およびデータに基づき、演算回路13を制御する。つまり、制御回路12は、制御バス113を通じて制御信号を、データバス112を通じて被演算数などのデータを演算回路13に送り、暗号処理に必要な演算を実行させる。
(Cryptographic circuit according to this embodiment)
FIG. 3 is a diagram showing the configuration of the encryption circuit. Referring to FIG. 2, this
演算回路13は、乗算回路、除算回路、剰余演算回路、モンゴメリ乗算剰余演算回路、加算回路、および/または減算回路などを含み、制御バス113を通じて送られる制御信号およびデータバス112を通じて送られる被演算数などのデータに基づき、暗号処理に必要な乗算、除算、剰余演算、モンゴメリ乗算剰余演算、加算、および/または減算などの演算を行ない、演算結果のデータをデータバス112を通じて制御回路12に出力する。
The
(乗算回路の構成)
図4は、第1の実施形態に係る乗算回路の構成を示す。同図を参照して、この乗算回路100は、レジスタ群101と、Y[i]判定回路109と、加算部1000と、左シフト回路105と、Pレジスタ107と、バス論理変換回路150を備える。また、この乗算回路100は、n(=1024)ビットのデータを伝送し、偶数ビットが正論理で、奇数ビットが負論理である正負論理混在データバス102,104,106,108と、nビットのデータを伝送し、全ビットが正論理であるデータバス112を含む。このデータバス112は、乗算回路100の外部の制御回路12と接続する。
(Configuration of multiplication circuit)
FIG. 4 shows the configuration of the multiplication circuit according to the first embodiment. Referring to FIG. 3, this
レジスタ群101は、演算に必要なデータを記憶するもので、Yレジスタ121と、Xレジスタ122と、Kレジスタ123とからなる。
The
Yレジスタ121は、1024ビットの乗数Yを記憶する。Yレジスタ121は、乗数Yをデータバス112を通じてY[i]判定回路109に出力する。
The Y register 121 stores a 1024-bit multiplier Y. The
Xレジスタ122は、1024ビットの被乗数Xを記憶する。Xレジスタ122は、Y[i]判定回路109からの読出信号に従って、被乗数Xを正負論理混在データバス102へ出力する。
The
Kレジスタ123は、1024ビットの零元Kを記憶する。Kレジスタ123は、Y[i]判定回路109からの読出信号に従って、零元Kを正負論理混在データバス102へ出力する。
The
Y[i]判定回路109は、データバス112を通じて受けた乗数Yのiビット目(i=0〜1023)の値であるY[i]が「1」であるか、「0」であるかを判定し、Y[i]の値が「1」のときには、Xレジスタ122へ読出信号を送り、Y[i]の値が「0」のときには、Kレジスタ123に読出信号を送る。
The Y [i]
左シフト回路105は、正負論理混在データバス104を通じて加算結果を受けて、それを下位ビット(0ビット目〜1023ビット目)とし、正負論理混在データバス108を通じてPレジスタ107内のデータPの上位ビット(1024ビット目〜2047ビット目)を受けて、それを上位ビットとし、それら下位ビットと上位ビットとからなる2048ビットのデータを1ビットだけ左シフトし、左シフトされたデータを正負論理混在データバス106に出力する。
The
Pレジスタ107は、乗算の途中結果である2048ビットのデータPを記憶する。Pレジスタ107は、正負論理データバス106を通じて左シフトされた2048ビットのデータを受けて、データPとして記憶する。また、Pレジスタ107は、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1000に出力する。また、Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)は、加算する必要がないので、正負論理混在データバス108を通じて左シフト回路105の上位ビット側に出力する。Pレジスタ107は、乗算の開始時に、値が「0」であるデータPを加算器1000に与える必要があるので、正負論理混在データバス108の論理に適合した初期値、つまり、偶数ビットが「0」で奇数ビットが「1」である2048ビットのデータを記憶する。
The P register 107 stores 2048-bit data P that is a result of the multiplication. The
バス論理変換回路150は、正負論理混在データバス108から受けたデータの論理をデータバス112の論理に変換してデータバス112に出力する。また、バス論理変換回路150は、データバス112から受けたデータの論理を正負論理混在データバス108の論理に変換して、正負論理混在データバス108に出力する。
The bus
(Xレジスタ122の構成)
図5は、Xレジスタ122の出力信号の論理を示す図である。同図を参照して、被乗数Xの第0ビット目の値であるX[0]の正論理が端子Qを通じて、正負論理混在データバス102の偶数ビットである第0ビット線DB[0]に出力され、被乗数Xの第1ビット目の値であるX[1]の負論理が端子/Qを通じて、正負論理混在データバス102の奇数ビットである第1ビット線DB[1]に出力され、被乗数Xの第2ビット目の値であるX[2]の正論理が端子Qを通じて、正負論理混在データバス102の偶数ビットである第2ビット線DB[2]に出力され、被乗数Xの第3ビット目の値であるX[3]の負論理が端子/Qを通じて、正負論理混在データバス102の奇数ビットである第3ビット線DB[3]に出力される。Kレジスタ123についても、同様の構成である。
(Configuration of X register 122)
FIG. 5 is a diagram illustrating the logic of the output signal of the
Xレジスタ122およびKレジスタ123の出力をこのように構成することによって、Kレジスタ123から零元Kが正負論理混在データバス102に出力されたときに、正負論理混在データバス102上のすべてのデータが「L」となることが回避される。したがって、Xレジスタ122から被乗数Xが正負論理混在データバス102に出力されたときと、Kレジスタ123から零元Kが正負論理混在データバス102に出力されたときとで、消費電力が大きく相違することがないようにすることができる。
By configuring the outputs of the
(加算部1000の構成)
加算部1000は、正負論理混在データバス102と接続する入力端子1と、正負論理混在データバス108と接続する入力端子2とを備える。入力端子1の第iビット目(0≦i)は、正負論理混在データバス102の第iビット目と接続する。また、入力端子2の第iビット目(0≦i)は、正負論理混在データバス108の第iビット目と接続する。
(Configuration of Adder 1000)
The
加算部1000は、正負論理混在データバス102を通じて被乗数Xまたは零元Kを受け、正負論理混在データバス108を通じてPレジスタ107内のデータPの下位ビット(0ビット目〜1023ビット目)を受け、これらを正負論理混在データバス102,108の論理に適合した加算を行ない、加算結果を正負論理混在データバス104に出力する。
The
図6は、加算部1000の構成を示す。同図では、代表的に第(m−1)ビット、第mビット、および第(m+1)ビットの加算に関する部分を示している。この加算部1000は、加算回路(正論理キャリー負論理)1001、加算回路(負論理キャリー正論理)1002、および加算回路(正論理キャリー負論理)1003を含む。
FIG. 6 shows a configuration of the adding
第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1001は、正負論理混在データバス102の第(m−1)ビット目の正論理の入力in1と、正負論理混在データバス108の第(m−1)ビット目の正論理の入力in2と、図示しない第(m−2)ビット目を処理する加算回路(負論理キャリー正論理)から正論理のキャリーcoutを受けて、これらを加算する。加算回路(正論理キャリー負論理)1001は、正論理の加算結果outを正負論理混在データバス104に出力し、負論理のキャリーcoutBを第mビット目を処理する加算回路(負論理キャリー正論理)1002に出力する。
An adder circuit (positive logic carry negative logic) 1001 for processing the (m−1) th bit is a positive logic input in1 of the (m−1) th bit of the positive / negative logic
第mビット目を処理する加算回路(負論理キャリー正論理)1002は、正負論理混在データバス102の第mビット目の正論理の入力inB1と、正負論理混在データバス108の第mビット目の正論理の入力inB2と、第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1001から負論理のキャリーcoutBを受けて、これらを加算する。加算回路(負論理キャリー正論理)1002は、負論理の加算結果outBを正負論理混在データバス104に出力し、正論理のキャリーcoutを第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1003に出力する。
An adder circuit (negative logic carry positive logic) 1002 that processes the m-th bit is the m-th positive bit input inB1 of the positive / negative logic
第(m+1)ビット目を処理する加算回路(正論理キャリー正論理)1003は、正負論理混在データバス102の第(m+1)ビット目の正論理の入力in1と、正負論理混在データバス108の第(m+1)ビット目の正論理の入力in2と、第mビット目を処理する加算回路(正論理キャリー負論理)1002から正論理のキャリーcoutを受けて、これらを加算する。加算回路(正論理キャリー正論理)1003は、正論理の加算結果outを正負論理混在データバス104に出力し、負論理のキャリーcoutBを図示しない第(m+2)ビット目を処理する加算回路(負論理キャリー正論理)に出力する。
The adder circuit (positive logic carry positive logic) 1003 for processing the (m + 1) th bit is the positive logic input in1 of the (m + 1) th bit of the positive / negative logic
図7は、加算回路(正論理キャリー負論理)1001の具体的な構成を示す。加算回路(正論理キャリー負論理)1003の具体的な構成もこれと同様である。同図を参照して、加算回路(正論理キャリー負論理)1001には、正論理の入力in1と、正論理の入力in2と、正論理のキャリーcutとが入力される。排他的論理和回路XOR150は、これらの3つの入力を受けて、これらの排他的論理和を正論理の加算結果outとして出力する。論理積回路AND150,AND151,AND152は、それぞれ、3つの入力のうちの互いに異なる2つの入力の組を受けて、それらの論理積を出力する。反転論理和回路NOR150は、論理積回路AND150,AND151,AND152の出力を受けて、これらの反転論理和を負論理のキャリーcoutBとして出力する。 FIG. 7 shows a specific configuration of the addition circuit (positive logic carry negative logic) 1001. The specific configuration of the adder circuit (positive logic carry negative logic) 1003 is the same as this. Referring to the drawing, an addition circuit (positive logic carry negative logic) 1001 receives a positive logic input in1, a positive logic input in2, and a positive logic carry cut. The exclusive OR circuit XOR150 receives these three inputs and outputs these exclusive ORs as a positive logic addition result out. Each of the AND circuits AND150, AND151, and AND152 receives a set of two different inputs from the three inputs, and outputs a logical product of them. The inverting OR circuit NOR150 receives the outputs of the AND circuits AND150, AND151, and AND152, and outputs these inverted ORs as a negative logic carry coutB.
図8は、加算回路(負論理キャリー正論理)1002の具体的な構成を示す。同図を参照して、加算回路(負論理キャリー正論理)1002には、負論理の入力inB1と、負論理の入力inB2と、負論理のキャリーcutBとが入力される。排他的論理和回路XOR151は、これらの3つの入力を受けて、これらの排他的論理和を負論理の加算結果outBとして出力する。論理和回路OR150,OR151,OR152は、それぞれ、3つの入力のうちの互いに異なる2つの入力の組を受けて、それらの論理和を出力する。反転論理積回路NAND150は、論理和回路OR150,OR151,OR152の出力を受けて、これらの反転論理積を正論理のキャリーcoutとして出力する。 FIG. 8 shows a specific configuration of the adder circuit (negative logic carry positive logic) 1002. Referring to the figure, an addition circuit (negative logic carry positive logic) 1002 receives a negative logic input inB1, a negative logic input inB2, and a negative logic carry cutB. The exclusive OR circuit XOR151 receives these three inputs and outputs these exclusive ORs as a negative logic addition result outB. Each of the OR circuits OR150, OR151, and OR152 receives a set of two different inputs from the three inputs, and outputs a logical sum of them. The inverting AND circuit NAND150 receives the outputs of the OR circuits OR150, OR151, and OR152, and outputs these inverting AND products as a positive logic carry cout.
(乗算回路100の乗算のアルゴリズム)
図9は、乗算回路100による乗算のアルゴリズム(1024ビットの場合)を示す。この乗算のアルゴリズム52に基づいて、乗算回路100の動作を説明する。Y[i]判定回路109は、1023から0までのiについて、乗数Yのiビット目であるY[i]の値を判定する。
(Multiplication algorithm of multiplication circuit 100)
FIG. 9 shows an algorithm for multiplication by the multiplication circuit 100 (in the case of 1024 bits). Based on the
Y[i]判定回路109は、Y[i]=1のときには、Xレジスタ122から正負論理混在データバス102に被乗数Xを出力させる。
The Y [i]
Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて左シフト回路105の上位側へ出力し、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1000へ出力する。
The
加算部1000は、正負論理混在データバス108を通じてデータPの下位ビット(0ビット目〜1023ビット目)と、正負論理混在データバス102を通じて被乗数Xとを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて左シフト回路105の下位側に出力する。
The
左シフト回路105は、加算部1000およびPレジスタ107から受けたデータ(P+X)を1ビットだけ左にシフトし、左シフトしたデータ((P+X)≪1)を正負論理混在データバス106を通じてPレジスタ107に出力する。
The
一方、Y[i]判定回路109は、Y[i]=0のときには、Kレジスタ123から正負論理混在データバス102に零元Kを出力させる。
On the other hand, the Y [i]
Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて左シフト回路105の上位側へ出力し、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1000へ出力する。
The
加算部1000は、正負論理混在データバス108を通じてデータPの下位ビット(0ビット目〜1023ビット目)と、正負論理混在データバス102を通じて零元Kとを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて左シフト回路105の下位側に出力する。
The
左シフト回路105は、加算部1000およびPレジスタ107から受けたデータ(P+X)を1ビットだけ左にシフトし、左シフトしたデータ((P+X)≪1)を正負論理混在データバス106を通じてPレジスタ107に出力する。
The
このような処理をi=1023から0まで繰返すことによって、最終的にPレジスタ107に、乗数Yと被乗数Xとの乗算結果が格納される。
By repeating such processing from i = 1023 to 0, the multiplication result of the multiplier Y and the multiplicand X is finally stored in the
以上のように、本実施の形態に係る乗算回路によれば、零元Kの加算時に電力消費量が最小となるのを防止することができるので、暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。 As described above, according to the multiplication circuit according to the present embodiment, it is possible to prevent the power consumption from being minimized when the zero element K is added. Can be prevented.
[第1の実施形態の変形例1]
本変形例は、第1の実施形態の乗算回路のKレジスタを別の構成要素に置き換えた乗算回路に関する。
[
This modification relates to a multiplication circuit in which the K register of the multiplication circuit of the first embodiment is replaced with another component.
(乗算回路の構成)
図10は、第1の実施形態の変形例1に係る乗算回路の構成を示す。同図において、図4の乗算回路100の構成要素と同一の構成要素には、図4と同一の符号を付している。同図を参照して、この乗算回路300が、図4の乗算回路100と相違する点は、Kレジスタ123の代わりに零元出力回路320を備えた点である。
(Configuration of multiplication circuit)
FIG. 10 shows a configuration of a multiplication circuit according to the first modification of the first embodiment. In the figure, the same components as those of the
図10を参照して、零元出力回路320は、2ビット分を代表的に示すもので、インバータIV1と、PチャネルMOSトランジスタP1と、NチャネルMOSトランジスタN1とを備える。正負論理混在データバス102のビット数がnのときには、図示した回路を(n/2)個備えればよい。
Referring to FIG. 10, zero
零元出力回路320は、Y[i]判定回路109から出力される零元の出力を指示する信号が「H」レベルにアサ−トされたときに、正負論理混在データバス102の第0ビット目に「0」を出力し、正負論理混在データバス102の第1ビット目に「1」を出力する。これにより、この零元出力回路320は、零元の偶数ビットの正論理「0」を正負論理混在データバス102の偶数ビットに出力し、零元の奇数ビットの負論理「1」を正負論理混在データバス102の奇数ビットに出力する。これにより、零元の加算時には、正負論理混在バス102の各ビット線には、0と1が交互に並んだデータが伝送される。
The zero
以上のように、本変形例に係る乗算回路によれば、第1の実施形態と同様に、乗数Yのビットが「0」のときに電力消費量が最小となるのを防止することができるので、暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。また、本変形例に係る乗算回路は、Kレジスタに代えて零元出力回路310を備えることによって、乗算回路内のレジスタを1つ少なくすることができる。
As described above, according to the multiplication circuit according to the present modification, it is possible to prevent the power consumption from being minimized when the bit of the multiplier Y is “0”, as in the first embodiment. Therefore, it is possible to prevent the multiplier Y that becomes secret data from being specified in the encryption process. In addition, the multiplication circuit according to this modification can include one register in the multiplication circuit by providing the zero
[第1の実施形態の変形例2]
本変形例は、第1の実施形態の乗算回路の構成要素の処理順序を変形した乗算回路に関する。
[
This modification relates to a multiplication circuit in which the processing order of the components of the multiplication circuit of the first embodiment is modified.
(乗算回路の構成)
図11は、第1の実施形態の変形例2に係る乗算回路の構成を示す。同図において、図4の乗算回路100の構成要素と同一の構成要素には、図4と同一の符号を付している。同図を参照して、この乗算回路400が図4の乗算回路100と相違する点は、左シフト回路105とPレジスタ107の処理順序を入れ替えたことである。
(Configuration of multiplication circuit)
FIG. 11 shows a configuration of a multiplication circuit according to the second modification of the first embodiment. In the figure, the same components as those of the
(乗算回路400の乗算のアルゴリズム)
図12は、乗算回路400による乗算のアルゴリズム(1024ビットの場合)を示す。この乗算のアルゴリズム53に基づいて、乗算回路400の動作を説明する。
(Multiplication algorithm of multiplication circuit 400)
FIG. 12 shows an algorithm for multiplication by the multiplication circuit 400 (in the case of 1024 bits). Based on the
Y[i]判定回路109は、1023から0までのiについて、乗数Yのiビット目であるY[i]の値を判定する。
The Y [i]
Y[i]判定回路109は、Y[i]=1のときには、Xレジスタ122から正負論理混在データバス102に被乗数Xを出力させる。
The Y [i]
また、Pレジスタ107は、記憶しているデータPを正負論理混在データバス106を通じて左シフト回路105に出力する。
The
左シフト回路105は、正負論理混在データバス106を通じてデータPを受けて、そのデータPを1ビットだけ左シフトする。左シフト回路105は、左シフトしたデータ(P≪1)の上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じてPレジスタ107の上位側に出力し、左シフトしたデータ(P≪1)の下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1000へ出力する。
The
加算部1000は、正負論理混在データバス108を通じて左シフトされたデータ(P≪1)の下位ビット(0ビット目〜1023ビット目)と、正負論理混在データバス102を通じて被乗数Xとを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じてPレジスタ107の下位側に出力する。
The adding
一方、Y[i]判定回路109は、Y[i]=0のときには、Kレジスタ122から正負論理混在データバス102に零元Kを出力させる。
On the other hand, when Y [i] = 0, the Y [i]
また、Pレジスタ107は、記憶しているデータPを正負論理混在データバス106を通じて左シフト回路105に出力する。
The
左シフト回路105は、正負論理混在データバス106を通じてデータPを受けて、そのデータPを1ビットだけ左シフトする。左シフト回路105は、左シフトしたデータ(P≪1)の上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じてPレジスタ107の上位側に出力し、左シフトしたデータ(P≪1)の下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1000へ出力する。
The
加算部1000は、正負論理混在データバス108を通じて左シフトされたデータ(P≪1)の下位ビット(0ビット目〜1023ビット目)と、正負論理混在データバス102を通じて零元Kとを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じてPレジスタ107の下位側に出力する。
The
このような処理をi=1023から0まで繰返すことによって、最終的にPレジスタ107に、乗数Yと被乗数Xとの乗算結果が格納される。
By repeating such processing from i = 1023 to 0, the multiplication result of the multiplier Y and the multiplicand X is finally stored in the
以上のように、本変形例に係る乗算回路によれば、第1の実施形態と同様に、乗数Yのビットが「0」のときに電力消費量が最小となるのを防止することができるので、暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。 As described above, according to the multiplication circuit according to the present modification, it is possible to prevent the power consumption from being minimized when the bit of the multiplier Y is “0”, as in the first embodiment. Therefore, it is possible to prevent the multiplier Y that becomes secret data from being specified in the encryption process.
[第1の実施形態の変形例3]
本変形例は、第1の実施形態の乗算回路の左シフト回路を右シフト回路に置き換えた乗算回路に関する。
[
This modification relates to a multiplication circuit in which the left shift circuit of the multiplication circuit of the first embodiment is replaced with a right shift circuit.
(乗算回路の構成)
図13は、第1の実施形態の変形例3に係る乗算回路の構成を示す。同図において、図4の乗算回路100の構成要素と同一の構成要素には、図4と同一の符号を付している。同図を参照して、この乗算回路500が図4の乗算回路100と相違する点は、左シフト回路105の代わりに右シフト回路505を備え、加算部1000の代りに加算部1010を備えた点である。
(Configuration of multiplication circuit)
FIG. 13 shows a configuration of a multiplication circuit according to
右シフト回路505は、正負論理混在データバス104を通じて加算結果を受けて、それを上位ビット(1024ビット目〜2047ビット目)とし、正負論理混在データバス108を通じてPレジスタ107内のデータPの下位ビット(0ビット目〜1023ビット目)を受けて、それを下位ビットとし、それら下位ビットと上位ビットとからなる2048ビットのデータを1ビットだけ右シフトし、右シフトされたデータを正負論理混在データバス106に出力する。
The
加算部1010は、正負論理混在データバス102と接続する入力端子1と、正負論理混在データバス108と接続する入力端子2とを備える。入力端子1の第iビット目(1≦i)は、正負論理混在データバス102の第(i−1)ビット目と接続し、入力端子1の第0ビット目は、「0」に固定される。また、入力端子2の第iビット目(0≦i)は、正負論理混在データバス108の第iビット目と接続する。
The
加算部1010は、正負論理混在データバス102を通じて被乗数Xまたは零元Kが1ビットだけ左シフトしたデータを受け、正負論理混在データバス108を通じてPレジスタ107内のデータPの下位ビット(0ビット目〜1023ビット目)を受け、これらを正負論理混在データバス102,108の論理に適合した加算を行ない、加算結果を正負論理混在データバス104に出力する。
The
(乗算回路500の乗算のアルゴリズム)
図14は、乗算回路500による乗算のアルゴリズム(1024ビットの場合)を示す。この乗算のアルゴリズム54に基づいて、乗算回路500の動作を説明する。
(Multiplication algorithm of multiplication circuit 500)
FIG. 14 shows an algorithm for multiplication by the multiplication circuit 500 (in the case of 1024 bits). Based on the
Y[i]判定回路109は、0から1023までのiについて、乗数Yのiビット目であるY[i]の値を判定する。
The Y [i]
Y[i]判定回路109は、Y[i]=1のときには、Xレジスタ122から正負論理混在データバス102に被乗数Xを出力させる。
The Y [i]
Pレジスタ107は、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて右シフト回路505の下位側へ出力し、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて加算部1010へ出力する。
The
加算部1010は、正負論理混在データバス108を通じてデータPの上位ビット(1024ビット目〜2047ビット目)と、正負論理混在データバス102を通じて被乗数Xが1ビットだけ左にシフトしたデータ(X≪1)とを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて右シフト回路505の上位側に出力する。
The
右シフト回路505は、加算部1010およびPレジスタ107から受けたデータ(P+(X≪1))を1ビットだけ右にシフトし、右シフトしたデータ((P+(X≪1))≫1)を正負論理混在データバス106を通じてPレジスタ107に出力する。
The
一方、Y[i]判定回路109は、Y[i]=1のときには、Kレジスタ123から正負論理混在データバス102に零元Kを出力させる。
On the other hand, the Y [i]
Pレジスタ107は、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて右シフト回路505の下位側へ出力し、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて加算部1010へ出力する。
The
加算部1010は、正負論理混在データバス108を通じてデータPの上位ビット(1024ビット目〜2047ビット目)と、正負論理混在データバス102を通じて零元Kが1ビットだけ左にシフトしたデータ(K≪1)とを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて右シフト回路505の上位側に出力する。
The
右シフト回路505は、加算部1010およびPレジスタ107から受けたデータ(P+(K≪1))を1ビットだけ右にシフトし、右シフトしたデータ((P+(K≪1))≫1)を正負論理混在データバス106を通じてPレジスタ107に出力する。
The
このような処理をi=0から1023まで繰返すことによって、最終的にPレジスタ107に、乗数Yと被乗数Xとの乗算結果が格納される。
By repeating such processing from i = 0 to 1023, the multiplication result of the multiplier Y and the multiplicand X is finally stored in the
以上のように、本実施の形態に係る乗算回路によれば、第1の実施形態と同様に、乗数Yのビットが「0」のときに電力消費量が最小となるのを防止することができるので、暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。 As described above, according to the multiplication circuit according to the present embodiment, as in the first embodiment, it is possible to prevent the power consumption from being minimized when the bit of the multiplier Y is “0”. Therefore, it is possible to prevent the multiplier Y that becomes secret data from being specified in the encryption process.
[第1の実施形態の変形例4]
本変形例は、変形例3と同様に右シフト回路を備えるとともに、変形例2と同様に構成要素の処理順序を変形した乗算回路に関する。
[Modification 4 of the first embodiment]
The present modification relates to a multiplication circuit that includes a right shift circuit as in the third modification and in which the processing order of the components is modified as in the second modification.
(乗算回路の構成)
第1の実施形態の変形例4に係る乗算回路の構成は、変形例3の右シフト回路505とPレジスタ107の処理順序を、変形例2のように入れ替えたものであり、ここでは図示は省略する。
(Configuration of multiplication circuit)
The configuration of the multiplication circuit according to the fourth modification of the first embodiment is such that the processing order of the
(乗算回路500の乗算のアルゴリズム)
図15は、第1の実施形態の変形例4に係る乗算回路の乗算のアルゴリズム(1024ビットの場合)を示す。この乗算のアルゴリズム55に基づいて、本変形例の乗算回路の動作を説明する。
(Multiplication algorithm of multiplication circuit 500)
FIG. 15 shows a multiplication algorithm (in the case of 1024 bits) of the multiplication circuit according to the fourth modification of the first embodiment. Based on this
Y[i]判定回路109は、0から1023までのiについて、乗数Yのiビット目であるY[i]の値を判定する。
The Y [i]
Y[i]判定回路109は、Y[i]=1のときには、Xレジスタ122から正負論理混在データバス102に被乗数Xを出力させる。
The Y [i]
また、Pレジスタ107は、記憶しているデータPを正負論理混在データバス106を通じて右シフト回路505に出力する。
Further, the
右シフト回路505は、正負論理混在データバス106を通じてデータPを受けて、そのデータPを1ビットだけ右シフトする。右シフト回路505は、右シフトしたデータ(P≫1)の下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じてPレジスタ107の下位側に出力し、右シフトしたデータ(P≪1)の上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて加算部1010へ出力する。
The
加算部1010は、正負論理混在データバス108を通じて右シフトされたデータ(P≫1)の上位ビット(1024ビット目〜2047ビット目)と、正負論理混在データバス102を通じて被乗数Xとを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じてPレジスタ107の上位側に出力する。
The adding
一方、Y[i]判定回路109は、Y[i]=0のときには、Kレジスタ122から正負論理混在データバス102に零元Kを出力させる。
On the other hand, when Y [i] = 0, the Y [i]
また、Pレジスタ107は、記憶しているデータPを正負論理混在データバス106を通じて右シフト回路505に出力する。
Further, the
右シフト回路505は、正負論理混在データバス106を通じてデータPを受けて、そのデータPを1ビットだけ右シフトする。右シフト回路505は、右シフトしたデータ(P≫1)の下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じてPレジスタ107の下位側に出力し、右シフトしたデータ(P≪1)の上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて加算部1010へ出力する。
The
加算部1010は、正負論理混在データバス108を通じて右シフトされたデータ(P≫1)の上位ビット(1024ビット目〜2047ビット目)と、正負論理混在データバス102を通じて零元Kとを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じてPレジスタ107の上位側に出力する。
The
このような処理をi=1023から0まで繰返すことによって、最終的にPレジスタ107に、乗数Yと被乗数Xとの乗算結果が格納される。
By repeating such processing from i = 1023 to 0, the multiplication result of the multiplier Y and the multiplicand X is finally stored in the
以上のように、本実施の形態に係る乗算回路によれば、第1の実施形態と同様に、乗数Yのビットが「0」のときに電力消費量が最小となるのを防止することができるので、暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。 As described above, according to the multiplication circuit according to the present embodiment, as in the first embodiment, it is possible to prevent the power consumption from being minimized when the bit of the multiplier Y is “0”. Therefore, it is possible to prevent the multiplier Y that becomes secret data from being specified in the encryption process.
[第1の実施形態の変形例5]
本変形例は、Pレジスタの変形例であるデータ格納レジスタ群に関する。第1の実施形態では、Pレジスタ107に格納されるデータPの初期値を、零元K(全ビットが0)を正負論理混在データバス108の正負論理に適合したものにする(偶数ビットが「0」で、奇数ビットが「1」)ことによって、アルゴリズム52におけるP=0を実現したが、本変形例では、P=0を実現するための専用のレジスタを用いる。
[Modification 5 of the first embodiment]
This modification relates to a data storage register group which is a modification of the P register. In the first embodiment, the initial value of the data P stored in the
(デ−タ格納レジスタ群の構成)
図16は、第1の実施形態の変形例5に係るデータ格納レジスタ群の構成を示す。同図を参照して、データ格納レジスタ群1300は、Pレジスタ107と、Kレジスタ1302と、選択回路1303とを備える。
(Configuration of data storage register group)
FIG. 16 shows a configuration of a data storage register group according to the fifth modification of the first embodiment. Referring to FIG. 8, data
Pレジスタ107は、第1の実施形態と同様である。ただし、アルゴリズム52におけるP=0を実現するための初期値が格納されない。
The
Kレジスタ1302は、アルゴリズム52におけるP=0を実現するための専用のレジスタであり、零元Kを記憶する。また、Kレジスタ1302は、図5に示すXレジスタと同様に、正負の論理が混在した出力を正負論理混在データバス108に出力する。
The
選択回路1303は、Pの初期値の出力時(たとえばアルゴリズム52におけるP=0)に、Kレジスタ1302から零元Kを出力させ、初期値以外の出力時に、Pレジスタ107から記憶しているデータPを出力させる。
The
以上のように、本実施の形態に係る乗算回路によれば、第1の実施形態と同様に、乗数Yのビットが「0」のときに電力消費量が最小となるのを防止することができるので、暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。また、Pの初期値を与えるための専用のレジスタを備えることで、PレジスタにPの初期値を正負混在論理バス102の論理に合せたデータ(0と1が交互に並ぶ)を記憶する処理を省略することができる。
As described above, according to the multiplication circuit according to the present embodiment, as in the first embodiment, it is possible to prevent the power consumption from being minimized when the bit of the multiplier Y is “0”. Therefore, it is possible to prevent the multiplier Y that becomes secret data from being specified in the encryption process. In addition, by providing a dedicated register for giving an initial value of P, a process for storing data (0 and 1 are alternately arranged) in which the initial value of P matches the logic of the
[第2の実施形態]
本実施の形態は、乗数Yの2ビット分について同時に処理することで、乗算処理を高速化した乗算回路に関する。
[Second Embodiment]
The present embodiment relates to a multiplication circuit that speeds up the multiplication process by simultaneously processing two bits of the multiplier Y.
(乗算回路の構成)
図17は、第2の実施形態に関する乗算回路の構成を示す。同図において、図4の乗算回路100の構成要素と同一の構成要素には、図4と同一の符号を付している。同図を参照して、この乗算回路800が図4の乗算回路100と相違する点は、Y[i]判定回路109の代わりにY[2i,2i+1]判定回路809を備え、1ビットの左シフトを行なう左シフト回路105の代わりに2ビットの左シフトを行なう2ビット左シフト回路805を備え、2入力の加算部1000の代りに3入力の加算部1110を備え、1本の正負論理混在データバス102の代りに2本の正負論理混在データバス102a,102bを備え、Xレジスタ122の代わりにXレジスタ822を備え、Kレジスタ123の代りにKレジスタ823を備えたことである。
(Configuration of multiplication circuit)
FIG. 17 shows the configuration of the multiplication circuit according to the second embodiment. In the figure, the same components as those of the
正負論理混在データバス102a,102bは、n(=1024)ビットのデータを伝送し、偶数ビットが正論理で、奇数ビットが負論理である。
The positive and negative logic
Y[2i+1,2i]判定回路809は、乗数Yの(2i+1)ビット目と、2iビット目の値であるY[2i+1,2i]の値を判定し、Y[2i+1,2i]=11のときには、Xレジスタ822から正負論理混在データバス102aおよび102bに被乗数Xを出力させ、Y[2i+1,2i]=10のときには、Xレジスタ822から正負論理混在データバス102aに被乗数Xを出力させ、Kレジスタ823から正負論理混在データバス102bに零元Kを出力させ、Y[2i+1,2i]=01のときには、Kレジスタ823から正負論理混在データバス102aに零元Kを出力させ、Xレジスタ822から正負論理混在データバス102bに被乗数Xを出力させ、Y[2i+1,2i]=00のときには、Kレジスタ823から正負論理混在データバス102aに零元Kを出力させ、Kレジスタ823から正負論理混在データバス102bに零元Kを出力させる。
The Y [2i + 1, 2i]
Xレジスタ822は、1024ビットの被乗数Xを記憶する。Xレジスタ822は、Y[2i+1,2i]判定回路809からの読出信号により、正負論理混在データバス102aおよび/または102bに被乗数Xを出力する。
The
Kレジスタ823は、1024ビットの零元Kを記憶する。Kレジスタ823は、Y[2i+1,2i]判定回路809からの読出信号により、正負論理混在データバス102aおよび/または102bに零元Kを出力する。
The
Xレジスタ822およびKレジスタ823の出力信号の論理は、図5に示すXレジスタ122の出力信号の論理と同様である。
The logic of the output signal of the
(加算部1100)
加算部1100は、正負論理混在データバス102aと接続する入力端子1と、正負論理混在データバス102bと接続する入力端子2と、正負論理混在データバス108と接続する入力端子3を備える。加算部1100の入力端子1の第iビット目(0≦i)は、正負論理混在データバス102aの第iビット目と接続する。また、加算部1100の入力端子2の第iビット目(1≦i)は、正負論理混在データバス102bの第(i−1)ビット目と接続し、入力端子2の第0ビット目は、「0」に固定される。また、加算部1100の入力端子3の第iビット目(0≦i)は、正負論理混在データバス108の第iビット目と接続する。
(Adder 1100)
The
加算部1100は、正負論理混在データバス102aを通じて被乗数Xまたは零元Kを受け、正負論理混在データバス102bを通じて被乗数Xまたは零元Kを1ビットだけ左にシフトされたデータを受け、正負論理混在データバス108を通じてPレジスタ107内のデータPの下位ビット(0ビット目〜1023ビット目)を受け、これらを正負論理混在データバス102a,102b,108の論理に適合した加算を行ない、加算結果を正負論理混在データバス104に出力する。
The
図18は、加算部1100の構成を示す。同図では、代表的に第(m−1)ビット、第mビット、および第(m+1)ビットの加算に関する部分を示している。この加算部1100は、前段に加算回路(正論理キャリー負論理)1101、加算回路(負論理キャリー正論理)1102、および加算回路(正論理キャリー負論理)1103を含み、後段に加算回路(正論理キャリー負論理)1104、加算回路(負論理キャリー正論理)1105、および加算回路(正論理キャリー負論理)1106を含む。
FIG. 18 shows a configuration of the adding
前段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1101は、正負論理混在データバス102aの第(m−1)ビット目の正論理の入力in1と、正負論理混在データバス102bの第(m−1)ビット目の正論理の入力in2と、正負論理混在データバス108の第(m−1)ビット目の正論理の入力in3とを受けて、これらを加算する。加算回路(正論理キャリー負論理)1101は、正論理の加算結果outを後段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1104に出力し、負論理のキャリーcoutBを後段の第mビット目を処理する加算回路(負論理キャリー正論理)1105に出力する。
The adder circuit (positive logic carry negative logic) 1101 for processing the (m−1) th bit in the previous stage is connected to the positive logic input in1 of the (m−1) th bit of the
前段の第mビット目を処理する加算回路(負論理キャリー正論理)1102は、正負論理混在データバス102aの第mビット目の負論理の入力inB1と、正負論理混在データバス102bの第mビット目の負論理の入力inB2と、正負論理混在データバス108の第mビット目の負論理の入力inB3とを受けて、これらを加算する。加算回路(負論理キャリー正論理)1102は、負論理の加算結果outBを後段の第mビット目を処理する加算回路(負論理キャリー正論理)1105に出力し、正論理のキャリーcoutを後段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1106に出力する。
An adder circuit (negative logic carry positive logic) 1102 that processes the m-th bit in the previous stage is the m-th negative logic input inB1 of the positive / negative logic
前段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1103は、正負論理混在データバス102aの第(m+1)ビット目の正論理の入力in1と、正負論理混在データバス102bの第(m+1)ビット目の正論理の入力in2と、正負論理混在データバス108の第(m+1)ビット目の正論理の入力in3とを受けて、これらを加算する。加算回路(正論理キャリー負論理)1103は、正論理の加算結果outを後段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1106に出力し、負論理のキャリーcoutBを、図示しない後段の第(m+2)ビット目を処理する加算回路(負論理キャリー正論理)に出力する。
The adder circuit (positive logic carry negative logic) 1103 for processing the (m + 1) -th bit in the preceding stage has a positive logic input in1 of the (m + 1) -th bit of the positive / negative logic
後段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1104は、前段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1101から正論理の加算結果outを受け、図示しない前段の第(m−2)ビット目を処理する加算回路(負論理キャリー正論理)から正論理のキャリーcoutを受け、図示しない後段の第(m−2)ビット目を処理する加算回路(負論理キャリー正論理)から正論理のキャリーcoutを受けて、これらを加算する。加算回路(正論理キャリー負論理)1104は、正論理の加算結果outを正負論理混在データバス104に出力し、負論理のキャリーcoutBを後段の第mビット目を処理する加算回路(負論理キャリー正論理)1105に出力する。
An adder circuit (positive logic carry negative logic) 1104 that processes the (m−1) -th bit in the subsequent stage is positive from the adder circuit (positive logic carry negative logic) 1101 that processes the (m−1) -th bit in the preceding stage. A logic addition result out is received, a positive logic carry cout is received from an addition circuit (negative logic carry positive logic) that processes the (m-2) -th bit of the preceding stage (not shown), and the (m-2) of the subsequent stage (not shown) is received. ) A positive logic carry cout is received from an adder circuit (negative logic carry positive logic) for processing the bit, and these are added. An adder circuit (positive logic carry negative logic) 1104 outputs a positive logic addition result out to the positive / negative logic
後段の第mビット目を処理する加算回路(負論理キャリー正論理)1105は、前段の第mビット目を処理する加算回路(負論理キャリー正論理)1102から負論理の加算結果outBを受け、前段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1101から負論理のキャリーcoutBを受け、後段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1104から負論理のキャリーcoutBを受けて、これらを加算する。加算回路(負論理キャリー正論理)1105は、負論理の加算結果outBを正負論理混在データバス104に出力し、正論理のキャリーcoutを後段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1106に出力する。
An adder circuit (negative logic carry positive logic) 1105 that processes the m-th bit in the subsequent stage receives an addition result outB of negative logic from the adder circuit (negative logic carry positive logic) 1102 that processes the m-th bit in the previous stage. An adder circuit (positive logic) that receives a negative logic carry coutB from the adder circuit (positive logic carry negative logic) 1101 for processing the (m−1) th bit in the preceding stage and processes the (m−1) th bit in the subsequent stage. Carry negative logic) 1104 receives negative logic carry coutB and adds them. An adder circuit (negative logic carry positive logic) 1105 outputs a negative logic addition result outB to the mixed positive and negative
後段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1106は、前段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1103から正論理の加算結果outを受け、前段の第mビット目を処理する加算回路(負論理キャリー正論理)1102から正論理のキャリーcoutを受け、後段の第mビット目を処理する加算回路(負論理キャリー正論理)1105から正論理のキャリーcoutを受けて、これらを加算する。加算回路(正論理キャリー負論理)1106は、正論理の加算結果outを正負論理混在データバス104に出力し、負論理のキャリーcoutBを図示しない後段の第(m+2)ビット目を処理する加算回路(負論理キャリー正論理)に出力する。
An adder circuit (positive logic carry negative logic) 1106 for processing the (m + 1) th bit in the subsequent stage is an addition result of positive logic from the adder circuit (positive logic carry negative logic) 1103 for processing the (m + 1) th bit in the previous stage. An adder circuit (negative logic carry positive logic) that receives the positive m carry bit cout from the adder circuit (negative logic carry positive logic) 1102 that receives out and processes the m th bit in the previous stage. The positive logic carry cout is received from 1105, and these are added. An adder circuit (positive logic carry negative logic) 1106 outputs a positive logic addition result out to the positive / negative logic
加算回路(正論理キャリー負論理)1101,1103,1104,1106の具体的な構成は、図7の加算回路(正論理キャリー負論理)1001と同一なので、ここでは説明を繰返さない。また、加算回路(負論理キャリー正論理)1102,1105の具体的な構成は、図8の加算回路(負論理キャリー正論理)1002と同一なので、ここでは説明を繰返さない。 The specific configuration of adder circuits (positive logic carry negative logic) 1101, 1103, 1104, and 1106 is the same as that of adder circuit (positive logic carry negative logic) 1001 in FIG. 7, and therefore description thereof will not be repeated here. The specific configuration of the adder circuits (negative logic carry positive logic) 1102 and 1105 is the same as that of the adder circuit (negative logic carry positive logic) 1002 of FIG. 8, and therefore description thereof will not be repeated here.
2ビット左シフト回路805は、加算部1100およびPレジスタ107から受けたデータを2ビットだけ左にシフトし、2ビットだけ左シフトしたデータを正負論理混在データバス106を通じてPレジスタ107に出力する。
The 2-bit
(乗算回路800の乗算のアルゴリズム)
図19は、乗算回路800による乗算のアルゴリズム(1024ビットの場合)を示す。この乗算のアルゴリズム56に基づいて、乗算回路800の動作を説明する。
(Multiplication algorithm of multiplication circuit 800)
FIG. 19 shows an algorithm for multiplication by the multiplication circuit 800 (in the case of 1024 bits). Based on the
Y[2i+1,2i]判定回路809は、511から0までのiについて、乗数Yの(2i+1)ビット目と、2iビット目の値であるY[2i+1,2i]の値を判定する。
The Y [2i + 1, 2i]
Y[2i+1,2i]判定回路809は、Y[2i+1,2i]=11のときには、Xレジスタ822に読出信号を送り、Xレジスタ822から正負論理混在データバス102aおよび102bに被乗数Xを出力させる。
When Y [2i + 1, 2i] = 11, the Y [2i + 1, 2i]
Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて2ビット左シフト回路105の上位側へ出力し、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1100へ出力する。
The
加算部1100は、正負論理混在データバス108を通じてデータPの下位ビット(0ビット目〜1023ビット目)を受け、正負論理混在データバス102aを通じて被乗数Xを受け、正負論理混在データバス102bを通じて被乗数Xが1ビットだけ左にシフトしたデータ(X≪1)を受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて2ビット左シフト回路805の下位側に出力する。
The
2ビット左シフト回路805は、加算部1100およびPレジスタ107から受けたデータ(P+X+(X≪1))を2ビットだけ左にシフトし、2ビットだけ左シフトしたデータ((P+X+(X≪1))≪2))を正負論理混在データバス106を通じてPレジスタ107に出力する。
The 2-bit
また、Y[2i+1,2i]判定回路809は、Y[2i+1,2i]=10のときには、Xレジスタ822に読出信号を送り、Xレジスタ822から正負論理混在データバス102aに被乗数Xを出力させ、Kレジスタ823に読出信号を送り、Kレジスタ823から正負論理混在データバス102bに零元Kを出力させる。
The Y [2i + 1, 2i]
Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて2ビット左シフト回路805の上位側へ出力し、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1100へ出力する。
The
加算部1110は、正負論理混在データバス108を通じてデータPの下位ビット(0ビット目〜1023ビット目)を受け、正負論理混在データバス102aを通じて被乗数Xを受け、正負論理混在データバス102bを通じて零元Kが1ビットだけ左にシフトしたデータ(K≪1)を受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて2ビット左シフト回路805の下位側に出力する。
The adder 1110 receives the lower bits (0th to 1023th bits) of the data P through the positive / negative logic
2ビット左シフト回路805は、加算部1100およびPレジスタ107から受けたデータ(P+X+(K≪1))を2ビットだけ左にシフトし、2ビットだけ左シフトしたデータ((P+X+(K≪1))≪2))を正負論理混在データバス106を通じてPレジスタ107に出力する。
The 2-bit
また、Y[2i+1,2i]判定回路809は、Y[2i+1,2i]=01のときには、Kレジスタ823に読出信号を送り、Kレジスタ823から正負論理混在データバス102aに零元Kを出力させ、Xレジスタ822に読出信号を送り、Xレジスタ822から正負論理混在データバス102bに被乗数Xを出力させる。
Further, when Y [2i + 1, 2i] = 01, the Y [2i + 1, 2i]
Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて2ビット左シフト回路805の上位側へ出力し、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1100へ出力する。
The
加算部1110は、正負論理混在データバス108を通じてデータPの下位ビット(0ビット目〜1023ビット目)を受け、正負論理混在データバス102aを通じて零元Kを受け、正負論理混在データバス102bを通じて被乗数Xが1ビットだけ左にシフトしたデータ(X≪1)を受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて2ビット左シフト回路805の下位側に出力する。
The adder 1110 receives the lower bits (0th to 1023th bits) of the data P through the positive / negative logic
2ビット左シフト回路805は、加算部1100およびPレジスタ107から受けたデータ(P+K+(X≪1))を2ビットだけ左にシフトし、2ビットだけ左シフトしたデータ((P+K+(X≪1))≪2))を正負論理混在データバス106を通じてPレジスタ107に出力する。
The 2-bit
また、Y[2i+1,2i]判定回路809は、Y[2i+1,2i]=00のときには、Kレジスタ823に読出信号を送り、Kレジスタ823から正負論理混在データバス102aおよび102bに零元Kを出力させる。
The Y [2i + 1, 2i]
Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて2ビット左シフト回路805の上位側へ出力し、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1100へ出力する。
The
加算部1100は、正負論理混在データバス108を通じてデータPの下位ビット(0ビット目〜1023ビット目)を受け、正負論理混在データバス102aを通じて零元Kを受け、正負論理混在データバス102bを通じて零元Kが1ビットだけ左にシフトしたデータ(K≪1)を受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて2ビット左シフト回路805の下位側に出力する。
The
2ビット左シフト回路805は、加算部1100およびPレジスタ107から受けたデータ(P+K+(K≪1))を2ビットだけ左にシフトし、2ビットだけ左シフトしたデータ((P+K+(K≪1))≪2))を正負論理混在データバス106を通じてPレジスタ107に出力する。
The 2-bit
このような処理をi=511から0まで繰返すことによって、最終的にPレジスタ107に、乗数Yと被乗数Xとの乗算結果が格納される。
By repeating such processing from i = 511 to 0, the multiplication result of the multiplier Y and the multiplicand X is finally stored in the
以上のように、本実施の形態に係る乗算回路によれば、第1の実施形態と同様に、乗数Yのビットが「0」のときに電力消費量が最小となるのを防止することができるので、暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。また、乗数Yの2ビット分について、同時に加算処理を行なうので、乗算処理を高速化することができる。 As described above, according to the multiplication circuit according to the present embodiment, as in the first embodiment, it is possible to prevent the power consumption from being minimized when the bit of the multiplier Y is “0”. Therefore, it is possible to prevent the multiplier Y that becomes secret data from being specified in the encryption process. Further, since the addition process is simultaneously performed for 2 bits of the multiplier Y, the multiplication process can be speeded up.
なお、本実施の形態に係る乗算回路においても、第1の実施形態の変形例のように、左シフト回路の代わりに右シフト回路を備えるように変形してもよく、Pレジスタの代りにデータ格納レジスタ群を備えるように変形してもよく、左または右シフトとPレジスタへの格納の順序を逆になるように変形してもよく、Kレジスタの代わりに零元出力回路を備えるように変形するものとしてもよい。 Note that the multiplication circuit according to the present embodiment may be modified so as to include a right shift circuit instead of the left shift circuit, as in the modification of the first embodiment. The storage register group may be modified so that the order of the left or right shift and the storage in the P register may be reversed, and a zero element output circuit is provided instead of the K register. It may be deformed.
[第3の実施形態]
本実施の形態は、被乗数Xおよび零元Kのいずれについても演算を同時に行ない、乗数Yに応じて、いずれかの加算結果を選択する乗算回路に関する。
[Third Embodiment]
The present embodiment relates to a multiplication circuit that performs an operation on both the multiplicand X and the zero element K at the same time and selects one of the addition results according to the multiplier Y.
(乗算回路1500の構成)
図20は、第3の実施形態に係る乗算回路の構成を示す。同図を参照して、この乗算回路1500は、レジスタ群1501と、Y[i]選択回路1510と、加算部1503と、右シフト回路505aと、Pレジスタ107と、右シフト回路505bと、Qレジスタ1517と、選択回路1512とを備える。また、この乗算回路150は、n(=1024)ビットのデータを伝送し、全ビットが正論理であるデータバス112,1504,1506,1507,1508U,1508Lを含む。データバス112は、乗算回路150の外部の制御回路12と接続する。
(Configuration of Multiplier Circuit 1500)
FIG. 20 shows a configuration of a multiplication circuit according to the third embodiment. Referring to the figure, this
また、レジスタ群1501は、Yレジスタ1521と、Xレジスタ1522と、Aレジスタ1523とを含む。
The
Yレジスタ1521は、1024ビットの乗数Yを記憶する。Yレジスタ1521は、乗数Yをデータバス112を通じてY[i]選択回路1510に出力する。
The
Xレジスタ1522は、1024ビットの被乗数Xを記憶する。Xレジスタ1523は、被乗数Xをデータバス112を通じて加算部1503に出力する。
The
Aレジスタ1523は、乗算処理の終了後に、乗数Yと被乗数Xとの乗算結果A(2048ビット)を記憶する。
The
Y[i]選択回路1510は、乗数Yのiビット目であるY[i]の値に応じた選択信号Sをデータバス1511を通じて選択回路1512に出力する。Y[i]が1のときに選択信号S(=1)が出力され、Y[i]が0のときに選択信号S(=0)が出力される。
The Y [i]
加算部1503は、データバス1508Uと接続する入力端子1と、データバス112と接続する入力端子2とを備える。加算部1503の入力端子1の第iビット目(0≦i)は、データバス1508の第iビット目と接続する。加算部1503の入力端子2の第iビット目(1≦i)は、データバス112の第(i−1)ビット目と接続し、入力端子2の第0ビット目は、「0」に固定される。加算部1503は、入力端子1からデータAの上位ビット(1024ビット目〜2047ビット目)を受け、入力端子2から被乗数Xが1ビットだけ左にシフトしたデータ(X≪1)とを受けて、これらを加算する。加算部1503は、加算結果(A+(X≪1))をデータバス1504を通じて右シフト回路505aの上位側に出力する。
The
右シフト回路505aは、上位側にデータバス1504を通じて加算結果(A+(X≪1)を受けて、下位側にデータバス1508Lを通じてデータAの下位ビット(0ビット目〜1023ビット目)を受けて、これらを1ビットだけ右にシフトし、右シフトしたデータ((A+(X≪1))≫1)をデータバス1506を通じてPレジスタ107に出力する。
The
右シフト回路505bは、上位側にデータバス1508Uを通じてデータAの上位ビット(1024ビット目〜2047ビット目)を受けて、下位側にデータバス1508Lを通じてデータAの下位ビット(0ビット目〜1023ビット目)を受けて、これらを1ビットだけ右にシフトし、右シフトしたデータ(A≫1)をデータバス1506を通じてQレジスタ1517に出力する。
The
加算部1503および右シフト回路505aによる処理と、右シフト回路505bによる処理とは、同時に並行して実行される。
The processing by the
Pレジスタ107は、乗算の途中結果である2048ビットのデータPを記憶する。Pレジスタ107は、データバス1506を通じて右シフト回路505aから出力されたデータ((A+(X≪1)))≫1)を受けて、これをデータPとして記憶する。
The P register 107 stores 2048-bit data P that is a result of the multiplication. The
Qレジスタ1517は、乗算の途中結果である2048ビットのデータQを記憶する。Qレジスタ1517は、データバス1506を通じて右シフト回路505bから出力されたデータ(A≫1)を受けて、これをデータQとして記憶する。
The
選択回路1512は、選択信号Sの初期値「1」を記憶する。また、選択回路1512は、Y[i]選択回路1510から選択信号Sを受ける。選択回路1512は、選択信号Sが「1」のときには、Pレジスタ107から出力されたデータPをデータAとして、データAの上位ビットをデータバス1508Uに出力し、データAの下位ビットをデータバス1508Lに出力する。選択回路1512は、選択信号Sが「0」のときには、Qレジスタ1517から出力されたデータQをデータAとして、データAの上位ビットをデータバス1508Uに出力し、データAの下位ビットをデータバス1508Lに出力する。
The
(乗算回路1500の乗算のアルゴリズム)
図21は、乗算回路1500による乗算のアルゴリズム(1024ビットの場合)を示す。この乗算のアルゴリズム57に基づいて、乗算回路1500の動作を説明する。
(Multiplication algorithm of multiplication circuit 1500)
FIG. 21 shows an algorithm for multiplication by the multiplication circuit 1500 (in the case of 1024 bits). Based on the
i=0〜1023までについて、以下の処理が実行される。 The following processing is executed for i = 0 to 1023.
選択信号Sの初期値が「1」とする。 The initial value of the selection signal S is “1”.
選択回路1512は、Pレジスタ107からデータバス1507を通じてデータPを受け、Qレジスタ1517からデータバス1507を通じてデータQを受ける。
The
選択回路1512は、データバス1511を通じて受けた選択信号Sが「1」のときには、データPを選択してデータAとし、データバス1511を通じて受けた選択信号Sが「0」のときには、データQを選択してデータAとする。選択回路1512は、データバス1508Uを通じて加算部1503および右シフト回路505bの上位側にデータAの上位ビット(1024ビット目〜2047ビット目)を出力し、データバス1508Lを通じて右シフト回路505aの下位側および右シフト回路505bの下位側にデータAの下位ビット(0ビット目〜1023ビット目)を出力する。
The
Xレジスタ1522は、データバス122に被乗数Xを出力する。
X register 1522 outputs multiplicand X to
加算部1503は、データバス1508Uを通じてデータAの上位ビット(1024ビット目〜2047ビット目)と、データバス112を通じて被乗数Xが1ビットだけ左にシフトしたデータ(X≪1)とを受けて、これらを加算し、加算結果をデータバス1504を通じて右シフト回路505aの上位側に出力する。
The
右シフト回路505aは、加算部1503および選択回路1512から受けたデータ(A+(X≪1))を1ビットだけ右にシフトし、右シフトしたデータ((A+(X≪1))≫1)をデータバス1506を通じてPレジスタ107に出力する。
The
また、上述の加算部1503および右シフト回路505aの処理と同時並行して、右シフト回路505aは、データバス1508Uを通じてデータAの上位ビット(1024ビット目〜2047ビット目)と、データバス1508Lを通じてデータAの下位ビット(0ビット目〜1023ビット目)とを受けて、データAを1ビットだけ右にシフトし、右シフトしたデータA≫1をデータバス1506を通じてQレジスタ1517に出力する。
In parallel with the processing of the
Y[i]選択回路1510は、乗数Yのiビット目であるY[i]の値に応じた選択信号Sをデータバス1511を通じて選択回路1512に出力する。Y[i]が「1」のときに選択信号S(=1)が出力され、Y[i]が「0」のときに選択信号S(=0)が出力される。
The Y [i]
このような処理をi=0から1023まで繰返した後、選択回路1512は、選択信号Sの値、つまりY「1023]の値が「1」のときには、データPを選択してデータAとし、選択信号Sが「0」のときには、データQを選択してデータAとする。選択回路1512は、データバス1508Uおよびデータバス112を通じて、データAの上位ビット(1024ビット目〜2047ビット目)をAレジスタ1523に出力し、データバス1508Lおよびデータバス112を通じてデータAの下位ビット(0ビット目〜1023ビット目)をAレジスタ1523に出力する。
After repeating such processing from i = 0 to 1023, the
以上のような処理によって、最終的にAレジスタ1523に乗数Yと被乗数Xとの乗算結果が格納される。
Through the above processing, the multiplication result of the multiplier Y and the multiplicand X is finally stored in the
以上のように、本実施の形態に係る乗算回路によれば、乗数Yのビットが「0」のときに電力消費量が最小となるのを防止することができるので、暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。 As described above, according to the multiplication circuit according to the present embodiment, it is possible to prevent the power consumption from being minimized when the bit of the multiplier Y is “0”. It is possible to prevent the specified multiplier Y from being specified.
なお、本実施の形態に係る乗算回路においても、第1の実施形態またはその変形例のように、右シフト回路の代わりに左シフト回路を備えるように変形してもよく、左または右シフトとPレジスタおよびQレジスタへの格納の順序を逆になるように変形してもよく、正論理のデータバスの代りに正負論理混在データバスを備えるように変形するものとしてもよい。 Note that the multiplication circuit according to the present embodiment may be modified so as to include a left shift circuit instead of the right shift circuit, as in the first embodiment or a modification example thereof. The order of storage in the P register and the Q register may be reversed, or may be modified so that a positive / negative logic mixed data bus is provided instead of the positive logic data bus.
また、本実施の形態では、Aレジスタ1523に乗算結果が格納されるものとしたが、これに限定するものではなく、Xレジスタ1522とYレジスタ1521のいずれかに乗算結果を格納するものとしてもよく、この場合、Aレジスタ1523は不要となる。
In this embodiment, the multiplication result is stored in the
[第3の実施形態の変形例]
本変形例は、第3の実施形態と同様に、被乗数Xおよび零元Kのいずれについても演算を行なうが、同時に演算を行なうのではなく、片方ずつ順番に演算を行なうような乗算回路に関する。
[Modification of Third Embodiment]
As in the third embodiment, the present modification relates to a multiplication circuit that performs an operation on both the multiplicand X and the zero element K, but does not perform the operation at the same time but performs the operation one by one in turn.
(乗算回路の構成)
図22は、第3の実施形態の変形例に係る乗算回路の構成を示す。同図において、図20の乗算回路1500の構成要素と同一の構成要素には、図20と同一の符号を付している。同図を参照して、この乗算回路1600が図20の乗算回路1500と相違する点は、Kレジスタ1623とレジスタ選択回路1609とを備えた点と、2個の右シフト回路505a,505bの代わりに1個の右シフト回路505を備え、加算部1503の代わりに加算部1603を備えた点である。
(Configuration of multiplication circuit)
FIG. 22 shows a configuration of a multiplication circuit according to a modification of the third embodiment. In FIG. 20, the same components as those of the
Kレジスタ1623は、1024ビットの零元Kを記憶する。Kレジスタ1623は、零元Kをデータバス112を通じて加算部1603に出力する。
The
レジスタ選択回路1609は、Xレジスタ1522およびKレジスタ1623に交互に制御バス1531,1532を通じて読出信号を送り、データバス112に被乗数Xまたは零元Kを出力させる。
The
加算部1603は、データバス1508Uと接続する入力端子1と、データバス112と接続する入力端子2とを備える。加算部1603の入力端子1の第iビット目(0≦i)は、データバス1508の第iビット目と接続する。加算部1603の入力端子2の第iビット目(1≦i)は、データバス112の第(i−1)ビット目と接続し、入力端子2の第0ビット目は、「0」に固定される。
The adding
加算部1603は、入力端子1からデータAの上位ビット(1024ビット目〜2047ビット目)を受け、入力端子2から被乗数Xが1ビットだけ左にシフトしたデータ(X≪1)を受けて、これらを加算する。加算部1603は、加算結果(A+(X≪1))をデータバス1504を通じて右シフト回路505の上位側に出力する。
The
また、加算部1603は、入力端子1からデータAの上位ビット(1024ビット目〜2047ビット目)を受け、入力端子2から零元Kを1ビットだけ左にシフトしたデータ(K≪1)を受けて、これらを加算する。加算部1603は、加算結果(A+(K≪1))をデータバス1504を通じて右シフト回路505の上位側に出力する。
The
右シフト回路505は、上位側にデータバス1504を通じて加算結果(A+(X≪1))を受けて、下位側にデータバス1508Lを通じてデータAの下位ビット(0ビット目〜1023ビット目)を受けて、これらを1ビットだけ右にシフトし、右シフトしたデータ((A+(X≪1))≫1)をデータバス1506を通じてPレジスタ107に出力する。
The
また、右シフト回路505は、上位側にデータバス1504を通じて加算結果(A+(K≪1))を受けて、下位側にデータバス1508Lを通じてデータAの下位ビット(0ビット目〜1023ビット目)を受けて、これらを1ビットだけ右にシフトし、右シフトしたデータ((A+(K≪1))≫1)をデータバス1506を通じてQレジスタ1507に出力する。
The
レジスタ選択回路1609により、被乗数Xと零元が交互にレジスタ群1601からデータバス112に出力されるので、加算部1603および右シフト回路505は、被乗数Xについての処理と、零元Kとの処理を交互に実行する。
Since the
(乗算回路1600の乗算のアルゴリズム)
図23は、乗算回路1600による乗算のアルゴリズム(1024ビットの場合)を示す。この乗算のアルゴリズム58に基づいて、乗算回路1600の動作を説明する。
(Multiplication algorithm of multiplication circuit 1600)
FIG. 23 shows an algorithm for multiplication by the multiplication circuit 1600 (in the case of 1024 bits). Based on the
i=0〜1023までについて、以下の処理が実行される。 The following processing is executed for i = 0 to 1023.
選択信号Sの初期値が「1」とする。 The initial value of the selection signal S is “1”.
選択回路1512は、Pレジスタ107からデータバス1507を通じてデータPを受け、Qレジスタ1517からデータバス1507を通じてデータQを受ける。
The
選択回路1512は、データバス1511を通じて受けた選択信号Sが「1」のときには、データPを選択してデータAとし、データバス1511を通じて受けた選択信号Sが「0」のときには、データQを選択してデータAとする。選択回路1512は、データバス1508Uを通じて加算部1603にデータAの上位ビット(1024ビット目〜2047ビット目)を出力し、データバス1508Lを通じて右シフト回路505の下位側にデータAの下位ビット(0ビット目〜1023ビット目)を出力する。
The
レジスタ選択回路1609は、Xレジスタ1522に制御バス1531を通じて読出信号を送り、Xレジスタ1522からからデータバス112に被乗数Xを出力させる。
The
加算部1603は、データバス1508Uを通じてデータAの上位ビット(1024ビット目〜2047ビット目)を受け、データバス112を通じて被乗数Xが1ビットだけ左にシフトしたデータ(X≪1)を受けて、これらを加算し、加算結果をデータバス1504を通じて右シフト回路505の上位側に出力する。
The adding
右シフト回路505は、加算部1603および選択回路1512から受けたデータ(A+(X≪1))を1ビットだけ右にシフトし、右シフトしたデータ((A+(X≪1))≫1)をデータバス1506を通じてPレジスタ107に出力する。
The
上述の加算部1603および右シフト回路505の処理が終了後、レジスタ選択回路1609は、Kレジスタ1623に制御バス1532を通じて読出信号を送り、Kレジスタ1623からデータバス122に零元Kを出力させる。
After the processing of the
加算部1603は、データバス1508Uを通じてデータAの上位ビット(1024ビット目〜2047ビット目)を受け、データバス112を通じて零元Kが1ビットだけ左にシフトしたデータ(K≪1)を受けて、これらを加算し、加算結果をデータバス1504を通じて右シフト回路505の上位側に出力する。
The
右シフト回路505は、加算部1603および選択回路1512から受けたデータ(A+(K≪1))を1ビットだけ右にシフトし、右シフトしたデータ((A+(K≪1))≫1)をデータバス1506を通じてQレジスタ1517に出力する。
The
Y[i]選択回路1510は、乗数Yのiビット目であるY[i]の値に応じた選択信号Sをデータバス1511を通じて選択回路1512に出力する。Y[i]が「1」のときに選択信号S(=1)が出力され、Y[i]が「0」のときに選択信号S(=0)が出力される。
The Y [i]
このような処理をi=0から1023まで繰返した後、選択回路1512は、選択信号Sの値、つまりY「1023]の値が「1」のときには、データPを選択してデータAとし、選択信号Sが「0」のときには、データQを選択してデータAとする。選択回路1512は、データバス1508Uおよびデータバス112を通じて、データAの上位ビット(1024ビット目〜2047ビット目)をAレジスタ1523に出力し、データバス1508Lおよびデータバス112を通じてデータAの下位ビット(0ビット目〜1023ビット目)をAレジスタ1523に出力する。
After repeating such processing from i = 0 to 1023, the
以上のような処理によって、最終的にAレジスタ1523に乗数Yと被乗数Xとの乗算結果が格納される。
Through the above processing, the multiplication result of the multiplier Y and the multiplicand X is finally stored in the
以上のように、本変形例に係る乗算回路によれば、第3の実施形態と同様に、乗数Yのビットが「0」のときに電力消費量が最小となるのを防止することができるので、暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。また、本変形例に係る乗算回路によれば、第3の実施形態の乗算回路のように2個の左シフト回路を備えるのではなく、1個の左シフト回路を備えればよいので、乗算回路の構成を簡易にすることができる。 As described above, according to the multiplication circuit according to the present modification, it is possible to prevent the power consumption from being minimized when the bit of the multiplier Y is “0”, as in the third embodiment. Therefore, it is possible to prevent the multiplier Y that becomes secret data from being specified in the encryption process. In addition, according to the multiplication circuit according to this modification, it is sufficient to provide one left shift circuit instead of two left shift circuits as in the multiplication circuit of the third embodiment. The circuit configuration can be simplified.
なお、本変形例に係る乗算回路においても、第1の実施形態またはその変形例のように、右シフト回路の代わりに左シフト回路を備えるように変形してもよく、左または右シフトとPレジスタおよびQレジスタへの格納の順序を逆になるように変形してもよく、正論理のデータバスの代りに正負論理混在データバスを備えるように変形するものとしてもよく、Kレジスタの代わりに零元出力回路を備えるように変形するものとしてもよい。 Note that the multiplication circuit according to the present modification may also be modified to include a left shift circuit instead of the right shift circuit as in the first embodiment or a modification thereof. The storage order in the register and the Q register may be changed so as to be reversed, or may be changed so as to have a mixed positive / negative logic data bus instead of the positive logic data bus, instead of the K register. It may be modified to include a zero element output circuit.
[第4の実施形態]
本実施の形態は、剰余演算の途中結果の符合によって加算と減算とを切替えることなく、加算と減算の両方を実行する剰余演算回路に関する。
[Fourth Embodiment]
The present embodiment relates to a remainder calculation circuit that executes both addition and subtraction without switching between addition and subtraction according to the sign of the intermediate result of the remainder calculation.
(従来の剰余演算回路の剰余演算のアルゴリズム)
図24は、従来の剰余演算回路の剰余演算のアルゴリズムを示す。同図を参照して、演算の途中結果であるデータPの値が0以上のときには、{(P≪1)+Y[i]}からNを減算する処理が行なわれ、演算の途中結果であるデータPの値が0未満のときには、{(P≪1)+Y[i]}とNとを加算する処理が行なわれる。加算と減算の電力消費量が異なるので、従来の剰余演算回路の剰余演算のアルゴリズムでは、電力消費量を調べることで、加算と減算のいずれが行なわれたかを特定することができ、それによって、演算の途中結果のデータPの符号、ひいては暗号処理において秘匿データとなる乗数Yの特定が可能となる。
(Residue calculation algorithm of conventional remainder calculation circuit)
FIG. 24 shows an algorithm for residue calculation of a conventional residue calculation circuit. Referring to the figure, when the value of data P, which is an intermediate result of the calculation, is 0 or more, a process of subtracting N from {(P << 1) + Y [i]} is performed, which is the intermediate result of the calculation. When the value of data P is less than 0, a process of adding {(P << 1) + Y [i]} and N is performed. Since the power consumption of addition and subtraction is different, the remainder calculation algorithm of the conventional remainder calculation circuit can determine whether the addition or subtraction has been performed by examining the power consumption, thereby It is possible to specify the sign of the data P that is the result of the computation, and thus the multiplier Y that becomes secret data in the encryption process.
(剰余演算回路1400の構成)
図25は、第4の実施形態に係る剰余演算回路の構成を示す。同図を参照して、この剰余演算回路1400は、レジスタ群1401と、レジスタ選択回路1409と、Y[i]選択回路1410と、加減算器1403と、Pレジスタ1407と、Qレジスタ1418と、左シフト回路1405と、加減算/レジスタ選択回路1412とを備える。
(Configuration of remainder calculation circuit 1400)
FIG. 25 shows a configuration of a remainder arithmetic circuit according to the fourth embodiment. Referring to the figure, the
また、この乗算回路1400は、n(=1024)ビットのデータを伝送し、全ビットが正論理であるデータバス112,1404,1406,1408を含む。データバス112は、剰余演算回路1400の外部の制御回路12と接続する。
The
レジスタ群1401は、演算に必要なデータを記憶するもので、Yレジスタ1421と、Nレジスタ1422と、Kレジスタ1423と、Aレジスタ1523とからなる。
The
Yレジスタ1421は、1024ビットの被除数Yを記憶する。Yレジスタ1421は、被除数Yをデータバス112を通じてY[i]選択回路1410に出力する。
The
Nレジスタ1422は、1024ビットの除数Nを記憶する。Nレジスタ1422は、除数Nをデータバス112を通じて加算部1403に出力する。
The
Kレジスタ1423は、1024ビットの零元Kを記憶する。Kレジスタ1423は、零元Kをデータバス112を通じて加算部1403に出力する。
The
Aレジスタ1523は、剰余演算処理の終了後に、乗数Yと被乗数Xとの剰余演算結果A(1024ビット)を記憶する。
The
レジスタ選択回路1409は、剰余演算時には、制御バス1437を通じて読出信号をNレジスタ1422に送り、Nレジスタ1422から除数Nをデータバス112に出力させる。レジスタ選択回路1409は、補正演算における第1の加算時に、制御バス1437を通じて読出信号をNレジスタ1422に送り、Nレジスタ1422から除数Nをデータバス112に出力させる。レジスタ選択回路1409は、補正演算における第2の加算時に、制御バス1436を通じて読出信号をKレジスタ1423に送り、Kレジスタ1423から零元Kをデータバス112に出力させる。
The
Y[i]選択回路1410は、被除数Yのiビット目であるY[i]を制御バス1411を通じて左シフト回路1405に出力する。
The Y [i]
左シフト回路1405は、データバス1406を通じて受けたデータAを1ビットだけ左にシフトするとともに、制御バス1411を通じて受けたY[i]の値を第0ビット目の値とする。左シフト回路1405は、データ((A≪1)+Y[i])をデータバス1408に出力する。
The
加減算/レジスタ選択回路1412は、制御バス1431を通じて加減算選択信号を加減算器1403に出力する。加減算/レジスタ選択回路1412は、制御バス1432を通じてP読出信号およびP書込信号をPレジスタ1407に出力する。加減算/レジスタ選択回路1412は、制御バス1433を通じてQ読出信号およびQ書込信号をQレジスタ1418に出力する。
The addition / subtraction /
加減算/レジスタ選択回路1412は、剰余演算における読出し時に、記憶している符号データSが「0」(Aの符号が正を示す)のときには、Q読出信号を活性化し、記憶している符号データSが「1」(Aの符号が負を示す)のときには、P読出信号を活性化する。
The addition / subtraction /
加減算/レジスタ選択回路1412は、剰余演算における第1の加減算時には、記憶している符号データSが「0」(Aの符号が正を示す)のときには、加減算選択信号を活性化し、P書込信号を活性化し、Q書込信号を非活性化し、記憶している符号データSが「1」(Aの符号が負を示す)のときには、加減算選択信号を非活性化し、P書込信号を非活性化し、Q書込信号を活性化する。
The addition / subtraction /
加減算/レジスタ選択回路1412は、剰余演算における第2の加減算時には、記憶している符号データが「0」(Aの符号が正を示す)のときには、加減算選択信号を非活性化し、P書込信号を非活性化し、Q書込信号を活性化し、記憶している符号データが「1」(Aの符号が負を示す)のときには、加減算選択信号を活性化し、P書込信号を活性化し、Q書込信号を非活性化する。
At the time of the second addition / subtraction in the remainder operation, the addition / subtraction /
加減算/レジスタ選択回路1412は、補正演算における第1の読出し時に、記憶している符号データSが「1」(Aの符号が負を示す)ときには、Q読出信号を活性化し、記憶している符号データSが「0」(Aの符号が正を示す)のときには、P読出信号を活性化する。
The addition / subtraction /
加減算/レジスタ選択回路1412は、補正演算における第1の加算時に、加減算選択信号を活性化し、P書込信号を活性化し、Q書込信号を非活性化する。加減算/レジスタ選択回路1412は、補正演算における第2の加算時に、加減算選択信号を活性化し、P書込信号を非活性化し、Q書込信号を活性化する。
The addition / subtraction /
加減算/レジスタ選択回路1412は、補正演算における第2の読出時に、記憶している符号データSが「1」(Aの符号が負を示す)ときには、P読出信号を活性化し、記憶している符号データSが「0」(Aの符号が正を示す)ときには、Q読出信号を活性化する。
The addition / subtraction /
加減算/レジスタ選択回路1412は、データバス1406またはデータバス1408を通じてデータAを受け、データAの最上位ビットであり、Aの符号を表わすA[1023]を新たな符号データSとして記憶する。
The addition / subtraction /
加減算器1403は、データバス1408と接続する入力端子1と、データバス112と接続する入力端子2とを備える。加減算器1403の入力端子1の第iビット目(0≦i)は、データバス1408の第iビット目と接続し、入力端子2の第iビット目(0≦i)は、データバス112の第iビット目と接続する。
The adder /
加減算器1403は、入力端子1からデータ{(A≪1)+Y[i]}またはデータAを受け、入力端子2から除数Nまたは零元Kとを受けて、加減算選択信号が活性化されているときにこれらを加算し、加減算選択信号が非活性化されているときにこれらを減算する。加減算器1403は、演算結果をデータバス1404に出力する。
The adder /
Pレジスタ1407は、剰余演算の途中結果のデータPを記憶する。Pレジスタ1407は、P書込信号が活性化されているときには、データバス1404を通じて受けたデータをデータPとして記憶する。また、Pレジスタ1407は、P読出信号が活性化されているときには、記憶しているデータPをデータAとしてデータバス1406またはデータバス1408に出力する。
The
Qレジスタ1418は、Q書込信号が活性化されているときには、データバス1404を通じて受けたデータをデータQとして記憶する。また、Qレジスタ1418は、Q読出信号が活性化されているときには、記憶しているデータQをデータAとしてデータバス1406またはデータバス1408に出力する。
(剰余演算回路1400の剰余演算のアルゴリズム)
図26は、剰余演算回路1400による剰余演算のアルゴリズム(1024ビットの場合)を示す。この剰余演算のアルゴリズム60に基づいて、剰余演算回路1400の動作を説明する。同図を参照して、加減算/レジスタ選択回路1412に記憶されている符号データSの初期値が減算を指示する値である「1」とする。
(Algorithm of remainder operation of remainder operation circuit 1400)
FIG. 26 shows an algorithm for remainder calculation by the remainder calculation circuit 1400 (in the case of 1024 bits). Based on the
0から1023までのiについて、以下のような剰余演算処理が行なわれる。 The following remainder calculation processing is performed for i from 0 to 1023.
Y[i]選択回路1410は、被除数Yのiビット目であるY[i]を制御バス1411を通じて左シフト回路1405に出力する。
The Y [i]
加減算/レジスタ選択回路1412は、剰余演算における読出し時に、記憶している符号データSが「0」(Aの符号が正を示す)のときには、Q読出信号を活性化する。Qレジスタ1418は、Q読出信号が活性化により、記憶しているデータQをデータAとしてデータバス1406を通じて左シフト回路1405および加減算/レジスタ選択回路1412に出力する。加減算/レジスタ選択回路1412は、データバス1406を通じてデータAを受け、データAの最上位ビットであり、Aの符号を表わすA[1023]を新たな符号データSとして記憶する。
The addition / subtraction /
左シフト回路1405は、データバス1406を通じて受けたデータAを1ビットだけ左にシフトするとともに、制御バス1411を通じて受けたY[i]の値を第0ビット目の値とする。左シフト回路1405は、データ((A≪1)+Y[i])をデータバス1408に出力する。
The
レジスタ選択回路1409は、剰余演算時には、Nレジスタ1422から除数Nをデータバス112に出力させる。
The
次に、剰余演算における第1の加減算のための処理が行なわれる。 Next, processing for the first addition / subtraction in the remainder calculation is performed.
加減算/レジスタ選択回路1412は、剰余演算における第1の加減算時には、記憶している符号データSが「0」(Aの符号が正を示す)のときには、加減算選択信号を活性化し、P書込信号を活性化し、Q書込信号を非活性化する。
The addition / subtraction /
加減算器1403は、第1の加減算を行なう。すなわち、加減算器1403は、データバス1408を通じてデータ((A≪1)+Y[i])と、データバス112を通じて除数Nとを受けて、加減算選択信号が活性化により、これらを加算し、加算結果((A≪1)+Y[i]+N)をデータバス1404に出力する。
The adder /
Pレジスタ1407は、P書込信号が活性化により、データバス1404を通じて受けた加算結果((A≪1)+Y[i]+N)をデータPとして記憶する。Qレジスタ1418は、Q書込信号が非活性化により、データバス1404を通じて受けた加算結果((A≪1)+Y[i]+N)をデータQとして記憶しない。
The
次に、剰余演算における第2の加減算のための処理が行なわれる。 Next, processing for the second addition / subtraction in the remainder calculation is performed.
加減算/レジスタ選択回路1412は、剰余演算における第2の加減算時には、記憶している符号データが「0」(Aの符号が正を示す)のときには、加減算選択信号を非活性化し、P書込信号を非活性化し、Q書込信号を活性化する。
At the time of the second addition / subtraction in the remainder operation, the addition / subtraction /
加減算器1403は、第2の加減算を行なう。すなわち、加減算器1403は、データバス1408を通じてデータ((A≪1)+Y[i])と、データバス112を通じて除数Nとを受けて、加減算選択信号が非活性化により、これらを減算し、減算結果((A≪1)+Y[i]−N)をデータバス1404に出力する。
The adder /
Pレジスタ1407は、P書込信号が非活性化により、データバス1404を通じて受けた減算結果((A≪1)+Y[i]−N)をデータPとして記憶しない。Qレジスタ1418は、Q書込信号が活性化により、データバス1404を通じて受けた減算結果((A≪1)+Y[i]−N)をデータQとして記憶する。
The
一方、加減算/レジスタ選択回路1412は、剰余演算時における読出時に、記憶している符号データSが「1」(Aの符号が負を示す)のときには、P読出信号を活性化する。Pレジスタ1407は、P読出信号が活性化により、記憶しているデータPをデータAとしてデータバス1406を通じて左シフト回路1405および加減算/レジスタ選択回路1412に出力する。加減算/レジスタ選択回路1412は、データバス1406を通じてデータAを受け、データAの最上位ビットであり、Aの符号を表わすA[1023]を新たな符号データSとして記憶する。
On the other hand, the addition / subtraction /
左シフト回路1405は、受けたデータAを1ビットだけ左にシフトするとともに、制御バス1411を通じて受けたY[i]の値を第0ビット目の値とする。左シフト回路1405は、データ((A≪1)+Y[i])をデータバス1408に出力する。
The
レジスタ選択回路1409は、剰余演算時には、Nレジスタ1422から除数Nをデータバス112に出力させる。
The
次に、剰余演算における第1の加減算のための処理が行なわれる。 Next, processing for the first addition / subtraction in the remainder calculation is performed.
加減算/レジスタ選択回路1412は、剰余演算における第1の加減算時に、記憶している符号データSが「1」(Aの符号が負を示す)のときには、加減算選択信号を非活性化し、P書込信号を非活性化し、Q書込信号を活性化する。
The addition / subtraction /
加減算器1403は、第1の加減算を行なう。すなわち、加減算器1403は、データバス1408を通じてデータ((A≪1)+Y[i])と、データバス112を通じて除数Nとを受けて、加減算選択信号が非活性化により、これらを減算し、減算結果((A≪1)+Y[i]−N)をデータバス1404に出力する。
The adder /
Pレジスタ1407は、P書込信号が非活性化により、データバス1404を通じて受けた減算結果((A≪1)+Y[i]−N)をデータPとして記憶しない。Qレジスタ1418は、Q書込信号が活性化により、データバス1404を通じて受けた減算結果((A≪1)+Y[i]−N)をデータQとして記憶する。
The
次に、剰余演算における第2の加減算のための処理が行なわれる。 Next, processing for the second addition / subtraction in the remainder calculation is performed.
加減算/レジスタ選択回路1412は、剰余演算における第2の加減算時に、記憶している符号データが「1」(Aの符号が負を示す)のときには、加減算選択信号を活性化し、P書込信号を活性化し、Q書込信号を非活性化する。
The addition / subtraction /
加減算器1403は、第2の加減算を行なう。加減算器1403は、データバス1408を通じてデータ((A≪1)+Y[i])と、データバス112を通じて除数Nとを受けて、加減算選択信号が活性化により、これらを加算し、加算結果((A≪1)+Y[i]+N)をデータバス1404に出力する。
The adder /
Pレジスタ1407は、P書込信号が活性化により、データバス1404を通じて受けた加算結果((A≪1)+Y[i]+N)をデータPとして記憶する。Qレジスタ1418は、Q書込信号が非活性化により、データバス1404を通じて受けた加算結果((A≪1)+Y[i]+N)をデータQとして記憶しない。
The
以上のような処理を0から1023までのiについて行なった後、以下のような補正演算が行なわれる。 After the above processing is performed for i from 0 to 1023, the following correction calculation is performed.
加減算/レジスタ選択回路1412は、補正演算における第1の読出し時に、記憶している符号データSが「1」(Aの符号が負を示す)ときには、Q読出信号を活性化する。Qレジスタ1418は、Q読出信号が活性化により、記憶しているデータQをデータAとしてデータバス1408を通じて加減算器1403に出力する。また、Qレジスタ1418は、データAの符号(最上位ビット)をデータバス1406を通じて加減算/レジスタ選択回路1412に出力する。加減算/レジスタ選択回路1412は、データAの符号(最上位ビット)を符号データSとして記憶する。
The addition / subtraction /
一方、加減算/レジスタ選択回路1412は、補正演算における第1の読出し時に、記憶している符号データSが「1」(Aの符号が正を示す)のときには、P読出信号を活性化する。Pレジスタ1407は、P読出信号が活性化により、記憶しているデータPをデータAとしてデータバス1408を通じて加減算器1403に出力する。また、Pレジスタ1407は、データAの符号(最上位ビット)をデータバス1406を通じて加減算/レジスタ選択回路1412に出力する。加減算/レジスタ選択回路1412は、データAの符号(最上位ビット)を符号データSとして記憶する。
On the other hand, the addition / subtraction /
レジスタ選択回路1409は、補正演算における第1の加算時に、Nレジスタ1422から除数Nをデータバス112に出力させる。
The
加減算/レジスタ選択回路1412は、補正演算における第1の加算時に、加減算選択信号を活性化し、P書込信号を活性化し、Q書込信号を非活性化する。
The addition / subtraction /
加減算器1403は、データバス1408を通じてデータAと、データバス112を通じて除数Nとを受けて、加減算選択信号が活性化により、これらを加算し、加算結果(A+N)をデータバス1404に出力する。
The adder /
Pレジスタ1407は、P書込信号が活性化により、データバス1404を通じて受けた加算結果(A+N)をデータPとして記憶する。Qレジスタ1418は、Q書込信号が非活性化により、データバス1404を通じて受けた加算結果(A+N)をデータQとして記憶しない。
The
さらに、レジスタ選択回路1409は、補正演算における第2の加算時に、Kレジスタ1423から零元Kをデータバス112に出力させる。
Further, the
加減算/レジスタ選択回路1412は、補正演算における第2の加算時に、加減算選択信号を活性化し、P書込信号を非活性化し、Q書込信号を活性化する。
The addition / subtraction /
次に、加減算器1403は、データバス1408を通じてデータAと、データバス112を通じて零元Kとを受けて、加減算選択信号が活性化により、これらを加算し、加算結果(A+K)をデータバス1404に出力する。
Next, the adder /
Pレジスタ1407は、P書込信号が非活性化により、データバス1404を通じて受けた加算結果(A+K)をデータPとして記憶しない。Qレジスタ1418は、Q書込信号が活性化により、データバス1404を通じて受けた加算結果(A+K)をデータQとして記憶する。
The
さらに、加減算/レジスタ選択回路1412は、補正演算における第2の読出時に、記憶している符号データSが「1」(Aの符号が負を示す)ときには、P読出信号を活性化する。Pレジスタ1407は、P読出信号が活性化により、記憶しているデータPをデータAとしてデータバス1406およびデータバス112を通じてAレジスタ1523に出力する。
Further, the addition / subtraction /
一方、加減算/レジスタ選択回路1412は、補正演算における第2の読出時に、記憶している符号データSが「0」(Aの符号が正を示す)ときには、Q読出信号を活性化する。Qレジスタ1418は、Q読出信号が活性化により、記憶しているデータQをデータAとしてデータバス1406およびデータバス112を通じてAレジスタ1523に出力する。
On the other hand, the addition / subtraction /
以上のような処理によって、最終的にAレジスタ1523に除数Nと被除数Yとの剰余演算結果が格納される。
Through the above processing, the remainder calculation result of the divisor N and the dividend Y is finally stored in the
なお、本実施の形態では、Aレジスタ1523に剰余演算結果が格納されるものとしたが、これに限定するものではなく、Yレジスタ1421、Nレジスタ1422、およびKレジスタ1423のいずれかに乗算結果を格納するものとしてもよく、この場合、Aレジスタ1523は不要となる。
In this embodiment, the remainder calculation result is stored in the
以上のように、本実施の形態に係る剰余演算回路によれば、演算の途中結果であるPの値に係らず、加算と減算のいずれをも実行するので、電力消費量に基づいて暗号処理において秘匿データとなる被除数Yが特定されるのを防止することができる。 As described above, according to the remainder calculation circuit according to the present embodiment, both addition and subtraction are executed regardless of the value of P which is an intermediate result of the calculation. It is possible to prevent the dividend Y to be confidential data from being specified.
なお、本実施の形態に係る剰余演算回路においても、第1の実施形態またはその変形例のように正論理のデータバスの代りに正負論理混在データバスを備えるように変形するものとしてもよい。 Note that the remainder arithmetic circuit according to the present embodiment may be modified so as to include a positive / negative logic mixed data bus instead of the positive logic data bus as in the first embodiment or its modification.
[第5の実施形態]
本実施の形態は、正負論理混在データによりモンゴメリ乗算剰余演算を行なうモンゴメリ乗算剰余演算回路に関する。
[Fifth Embodiment]
The present embodiment relates to a Montgomery multiplication remainder operation circuit that performs Montgomery multiplication remainder operation using positive and negative logic mixed data.
(モンゴメリ乗算剰余演算回路の構成)
図27は、第5の実施形態に係るモンゴメリ乗算剰余演算回路の構成を示す。同図を参照して、このモンゴメリ乗算剰余演算回路600は、モンゴメリのアルゴリズムによって乗算剰余演算を行なう回路であり、レジスタ群601と、Y[i]評価部609と、加算部603と、右シフト回路605と、Pレジスタ607と、バス論理変換回路150とを備える。
(Configuration of Montgomery multiplication remainder arithmetic circuit)
FIG. 27 shows a configuration of a Montgomery modular multiplication circuit according to the fifth embodiment. Referring to the figure, this Montgomery modular
また、このモンゴメリ乗算剰余回路600は、n(=1024)ビットのデータを伝送し、偶数ビットが正論理で、奇数ビットが負論理である正負論理混在データバス102,104,106,108と、nビットのデータを伝送し、全ビットが正論理であるデータバス112を含む。データバス112は、モンゴメリ乗算剰余回路600の外部の制御回路12と接続する。
The Montgomery
レジスタ群601は、演算に必要なデータを記憶するもので、Yレジスタ621と、Xレジスタ622と、Kレジスタ623と、Nレジスタ624と、(X+N)レジスタ625とからなる。
The
Yレジスタ621は、1024ビットの乗数Yを記憶する。Yレジスタ621は、データバス112を通じてY[i]評価部609に乗数Yを出力する。
The Y register 621 stores a 1024-bit multiplier Y. The
Xレジスタ622は、1024ビットの被乗数Xを記憶する。Xレジスタ622は、Y[i]評価部609から制御バス634を通じて読出信号を受けると、被乗数Xを正負論理混在データバス102に出力する。また、Xレジスタ622は、被乗数Xの第0ビット目であるX[0]を制御バス611を通じてY[i]評価部609に出力する。
The
Kレジスタ623は、1024ビットの零元Kを記憶する。Kレジスタ623は、Y[i]評価部609から制御バス633を通じて読出信号を受けると、零元Kを正負論理混在データバス102に出力する。
The
Nレジスタ624は、1024ビットの除数Nを記憶する。Nレジスタ624は、Y[i]評価部609から制御バス632を通じて読出信号を受けると、除数Nを正負論理混在データバス102に出力する。
The N register 624 stores a divisor N of 1024 bits. When the
(X+N)レジスタ625は、1024ビットのデータ(X+N)を記憶する。(X+N)レジスタ625は、Y[i]評価部609から制御バス631を通じて読出信号を受けると、除数Nを正負論理混在データバス102に出力する。
The (X + N) register 625 stores 1024-bit data (X + N). When the (X + N) register 625 receives a read signal from the Y [i]
Xレジスタ622、Kレジスタ623、Nレジスタ624、(X+N)レジスタ625の出力信号の論理は、図5に示すXレジスタ122の出力信号の論理と同様である。
The logic of the output signal of the
Y[i]評価部609は、データバスを通じて乗数Yを受け、制御バス611を通じてX[0]を受け、制御バス610を通じてP[0]を受けて、これらの値よりデータM=P[0]^(Y[i]・X[0])を算出する。Y[i]評価部609は、Y[i]=0、かつM=0のときには、Kレジスタ623に制御バス633を通じて読出信号を送り、Y[i]=0、かつM=1のときには、Nレジスタ624に制御バス632を通じて読出信号を送り、Y[i]=1、かつM=0のときには、Xレジスタ622に制御バス634を通じて読出信号を送り、Y[i]=1、かつM=1のときには、(X+N)レジスタ625に制御バス631を通じて読出信号を送る。
The Y [i]
加算部603は、正負論理混在データバス108と接続する入力端子1と、正負論理混在データバス102と接続する入力端子2とを備える。入力端子1の第iビット目(0≦i)は、正負論理混在データバス108の第iビット目と接続する。また、入力端子2の第iビット目(0≦i)は、正負論理混在データバス102の第iビット目と接続する。
The
加算部603は、入力端子1からデータPを受け、入力端子2からK、N、X、または(X+N)を受けて、これらを加算する。加算部603は、加算結果をデータバス104を通じて右シフト回路605に出力する。加算部603の加算処理の論理は、加算部1000と同一なので、ここでは説明を繰返さない。
The
右シフト回路605は、正負論理混在データバス104を通じて受けたデータを1ビットだけ右にシフトし、右シフトしたデータを正負論理混在データバス106を通じてPレジスタ607に出力する。
The
Pレジスタ607は、正負論理混在データバス106を通じて受けた右シフトしたデータをデータPとして記憶する。また、Pレジスタ607は、記憶しているデータPを正負論理混在データバス108を通じて加算部603へ出力する。また、Pレジスタ607は、記憶しているデータPの第0ビット目であるP[0]を制御バス610を通じてY[i]評価部609に出力する。
The P register 607 stores the right-shifted data received through the positive / negative logic
バス論理変換回路150は、正負論理混在データバス108から受けたデータの論理をデータバス112の論理に変換してデータバス112に出力する。また、バス論理変換回路150は、データバス112から受けたデータの論理を正負論理混在データバス108の論理に変換して、正負論理混在データバス108に出力する。
The bus
(モンゴメリ乗算剰余演算回路600のモンゴメリ乗算剰余演算のアルゴリズム)
図28は、モンゴメリ乗算剰余演算回路600によるモンゴメリ乗算剰余演算のアルゴリズム(1024ビットの場合)を示す。このモンゴメリ乗算剰余演算のアルゴリズム61に基づいて、モンゴメリ乗算剰余演算回路600の動作を説明する。
(Montgomery modular multiplication algorithm of Montgomery modular multiplication circuit 600)
FIG. 28 shows a Montgomery modular multiplication algorithm (in the case of 1024 bits) by the Montgomery
0〜1023までのiについて以下の処理が行なわれる。 The following processing is performed for i from 0 to 1023.
Yレジスタ621は、データバス112を通じてY[i]評価部609に乗数Yを出力する。
The
Xレジスタ622は、被乗数Xの第0ビット目であるX[0]を制御バス611に出力し、Pレジスタ607は、記憶しているデータPの第0ビット目であるP[0]を制御バス610を通じてY[i]評価部609に出力する。
The
Y[i]評価部609は、データバスを通じて乗数Yを受け、制御バス611を通じてX[0]を受け、制御バス610を通じてP[0]を受けて、これらの値よりデータM=P[0]^(Y[i]・X[0])を算出する。
The Y [i]
Y[i]評価部609は、Y[i]=0、かつM=0のときには、Kレジスタ623に制御バス633を通じて読出信号を送り、零元Kを正負論理混在データバス102に出力させる。
When Y [i] = 0 and M = 0, the Y [i]
Y[i]評価部609は、Y[i]=0、かつM=1のときには、Nレジスタ624に制御バス632を通じて読出信号を送り、除数Nを正負論理混在データバス102に出力させる。
When Y [i] = 0 and M = 1, the Y [i]
Y[i]評価部609は、Y[i]=1、かつM=0のときには、Xレジスタ622に制御バス634を通じて読出信号を送り、被乗数Xを正負論理混在データバス102に出力させる。
When Y [i] = 1 and M = 0, the Y [i]
Y[i]評価部609は、Y[i]=1、かつM=1のときには、(X+N)レジスタ625に制御バス631を通じて読出信号を送り、データ(X+N)を正負論理混在データバス102に出力させる。
When Y [i] = 1 and M = 1, the Y [i]
Pレジスタ607は、記憶しているデータPを正負論理混在データバス108を通じて加算部603へ出力する。
The
加算部603は、正負論理混在データバス108を通じてデータPを受け、正負論理混在データバス102を通じてK、N、X、または(X+N)を受けて、受けたデータを加算し、加算結果を正負論理混在データバス104を通じて右シフト回路605に出力する。
The
右シフト回路605は、加算部603から受けたデータを1ビットだけ右にシフトし、右シフトしたデータを正負論理混在データバス106を通じてPレジスタ607に出力する。
The
Pレジスタ607は、正負論理混在データバス106を通じて受けた右シフトしたデータをデータPとして記憶する。
The P register 607 stores the right-shifted data received through the positive / negative logic
このような処理をi=0から1023まで繰返すことによって、最終的にPレジスタ607に、モンゴメリ乗算剰余演算結果が格納される。
By repeating such processing from i = 0 to 1023, the Montgomery multiplication residue calculation result is finally stored in the
以上のように、本変形例に係るモンゴメリ乗算剰余演算回路によれば、乗数Yのビットが「0」のときに、電力消費量が最小となるのを防止することができるので、暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。 As described above, according to the Montgomery multiplication remainder operation circuit according to the present modification, it is possible to prevent the power consumption from being minimized when the bit of the multiplier Y is “0”. It is possible to prevent the multiplier Y that becomes secret data from being specified.
なお、本実施の形態に係るモンゴメリ乗算剰余回路においても、第1の実施形態またはその変形例のように、右シフトとPレジスタへの格納の順序を逆になるように変形してもよい。 Note that the Montgomery multiplication remainder circuit according to the present embodiment may also be modified so that the order of right shift and storage in the P register is reversed, as in the first embodiment or a modification thereof.
[第5の実施形態の変形例]
本変形例は、レジスタの使用に汎用を持たせたモンゴメリ乗算剰余演算回路に関する。
[Modification of Fifth Embodiment]
The present modification relates to a Montgomery multiplication remainder arithmetic circuit which has a general purpose for using a register.
(モンゴメリ乗算剰余演算回路の構成)
図29は、第5の実施形態の変形例に係るモンゴメリ乗算剰余演算回路の構成を示す。同図において、図27のモンゴメリ乗算剰余演算回路600における構成要素と同一の構成要素には、図27と同一の符号を付している。同図を参照して、このモンゴメリ乗算剰余演算回路700が図27のモンゴメリ乗算剰余演算回路600と相違する点は、セレクタ721を備え、専用のレジスタであるXレジスタ622、Kレジスタ623、Nレジスタ624、および(X+N)レジスタ625の代りに、汎用のレジスタであるG1レジスタ722、G2レジスタ723、G3レジスタ724、およびG4レジスタ725を備えた点である。
(Configuration of Montgomery multiplication remainder arithmetic circuit)
FIG. 29 shows a configuration of a Montgomery modular multiplication circuit according to a modification of the fifth embodiment. In this figure, the same components as those in the Montgomery
G1レジスタ722、G2レジスタ723、G3レジスタ724、およびG4レジスタ725は、1024ビットの被乗数K、零元K、除数N、およびデータ(X+N)のうちのそれぞれ互いに異なるデータを記憶する。
The
G1レジスタ722、G2レジスタ723、G3レジスタ724、およびG4レジスタ725の出力信号の論理は、図5に示すXレジスタ122の出力信号の論理と同様である。
The logic of the output signals of the
セレクタ721は、G1レジスタ722、G2レジスタ723、G3レジスタ724、およびG4レジスタ725から、保存しているデータの第0ビット目を受ける。セレクタ721は、これらの第0ビット目のデータのうち、被乗数Xを保存しているレジスタから出力された第0ビット目のデータを選択して、制御バス711を通じてY[i]評価部609に出力する。
The
また、セレクタ721は、Y[i]評価部609から制御バス734を通じて被乗数Xを保存しているレジスタの読出信号を受けると、被乗数Xを保存しているレジスタへその読出信号を送る。また、セクレク701は、Y[i]評価部609から制御バス733を通じて零元Kを保存しているレジスタの読出信号を受けると、零元Kを保存しているレジスタへその読出信号を送る。また、セクレク701は、Y[i]評価部609から制御バス732を通じて除数Nを保存しているレジスタの読出信号を受けると、除数Nを保存しているレジスタへその読出信号を送る。また、セクレク701は、Y[i]評価部609から制御バス731を通じてデータ(X+N)を保存しているレジスタの読出信号を受けると、データ(X+N)を保存しているレジスタへその読出し信号を送る。
Further, when the
以上のように、本変形例に係るモンゴメリ乗算剰余演算回路によれば、第5の実施形態と同様に、乗数Yのビットが「0」のときに、電力消費量が最小となるのを防止することができるので、暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。また、本変形例では、第5の実施形態のように、被乗数Xを記憶するレジスタをY[i]評価部609へ出力を送るXレジスタ722に固定されないので、どのレジスタにどのようなデータを記憶するかというレジスタの使用に汎用性を持たせることができる。
As described above, according to the Montgomery modular multiplication circuit according to the present modification, when the multiplier Y bit is “0”, the power consumption is prevented from being minimized, as in the fifth embodiment. Therefore, it is possible to prevent the multiplier Y that becomes secret data from being specified in the encryption process. In the present modification, the register for storing the multiplicand X is not fixed to the
[第6の実施形態]
本実施の形態は、乗数Yの2ビット分を同時に処理することで、モンゴメリ乗算剰余演算処理を高速化したモンゴメリ乗算剰余演算回路に関する。
[Sixth Embodiment]
The present embodiment relates to a Montgomery modular multiplication circuit that speeds up Montgomery modular multiplication processing by simultaneously processing two bits of the multiplier Y.
(モンゴメリ乗算剰余演算回路の構成)
図30は、第6の実施形態に係るモンゴメリ乗算剰余演算回路の構成を示す。同図を参照して、このモンゴメリ乗算剰余演算回路900は、レジスタ群901と、Y[i+1,i]評価部909と、加算部1200と、2ビット右シフト回路905と、Pレジスタ907とを備える。
(Configuration of Montgomery multiplication remainder arithmetic circuit)
FIG. 30 shows a configuration of a Montgomery modular multiplication circuit according to the sixth embodiment. Referring to FIG. 9, Montgomery
また、このモンゴメリ乗算剰余回路900は、n(=1024)ビットのデータを伝送し、偶数ビットが正論理で、奇数ビットが負論理である正負論理混在データバス102a102b,102c,104,106,108と、nビットのデータを伝送し、全ビットが正論理であるデータバス112を含む。データバス112は、モンゴメリ乗算剰余回路900の外部の制御回路12と接続する。
The Montgomery
レジスタ群901は、演算に必要なデータを記憶するもので、Yレジスタ621と、Xレジスタ922と、Kレジスタ923と、Nレジスタ924と、(X+N)レジスタ925とからなる。
The
Yレジスタ621は、1024ビットの乗数Yを記憶する。Yレジスタ621は、データバス112を通じてY[i+1,i]評価部909に乗数Yを出力する。
The Y register 621 stores a 1024-bit multiplier Y. The
Xレジスタ922は、1024ビットの被乗数Xを記憶する。Xレジスタ922は、Y[i+1,i]評価部909から制御バス634を通じて3ビットの読出信号を受ける。Xレジスタ922は、読出信号の第2ビットが「1」のとき被乗数Xを正負論理混在データバス102aに出力し、読出信号の第1ビットが「1」のとき被乗数Xを正負論理混在データバス102bに出力し、読出信号の第0ビットが「1」のとき被乗数Xを正負論理混在データバス102cに出力する。また、Xレジスタ922は、被乗数Xの第0ビット目および第1ビット目であるX[1,0]を制御バス911を通じてY[i+1,i]評価部909に出力する。
The
Kレジスタ923は、1024ビットの零元Kを記憶する。Kレジスタ923は、Y[i+1,i]評価部909から制御バス933を通じて3ビットの読出信号を受ける。Kレジスタ923は、読出信号の第2ビットが「1」のとき零元Kを正負論理混在データバス102aに出力し、読出信号の第1ビットが「1」のとき零元Kを正負論理混在データバス102bに出力し、読出信号の第0ビットが「1」のとき零元Kを正負論理混在データバス102cに出力する。
The
Nレジスタ924は、1024ビットの除数Nを記憶する。Nレジスタ924は、Y[i+1,i]評価部909から制御バス932を通じて3ビットの読出信号を受ける。Nレジスタ924は、読出信号の第2ビットが「1」のとき除数Nを正負論理混在データバス102aに出力し、読出信号の第1ビットが「1」のとき除数Nを正負論理混在データバス102bに出力し、読出信号の第0ビットが「1」のとき除数Nを正負論理混在データバス102cに出力する。
The N register 924 stores a 1024-bit divisor N. The
(X+N)レジスタ925は、1024ビットのデータ(X+N)を記憶する。(X+N)レジスタ925は、Y[i+1,i]評価部909から制御バス931を通じて3ビットの読出信号を受ける。(X+N)レジスタ925は、読出信号の第2ビットが「1」のときデータ(X+N)を正負論理混在データバス102aに出力し、読出信号の第1ビットが「1」のときデータ(X+N)を正負論理混在データバス102bに出力し、読出信号の第0ビットが「1」のときデータ(X+N)を正負論理混在データバス102cに出力する。
The (X + N) register 925 stores 1024-bit data (X + N). The (X + N) register 925 receives a 3-bit read signal from the Y [i + 1, i]
Xレジスタ922、Kレジスタ923、Nレジスタ924、および(X+N)レジスタ925の出力信号の論理は、図5に示すXレジスタ122の出力信号の論理と同様である。
The logic of the output signals of the
Y[i+1,i]評価部909は、データバス112を通じて乗数Yを受け、制御バス911を通じてX[1,0]を受け、制御バス910を通じてP[1,0]を受けて、これらの値よりデータM[0]=P[0]^(Y[i]・X[0])と、データMC=P[0]・Y[i]・X[0]と、データM[1]=P[1]^(Y[i]・X[1])^(Y[i+1]・X[0])^MC^M[0]^(M[0]・X[1])とを算出する。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=00、M[0]=0、かつM[1]=0のときには、Kレジスタ923に読出信号(「111」)を送る。Y[i+1,i]評価部909は、Y[i+1,i]=00、M[0]=0、かつM[1]=1のときには、Kレジスタ923に読出信号(“101”)を送り、Nレジスタ924に読出信号(“010”)を送る。Y[i+1,i]評価部909は、Y[i+1,i]=00、M[0]=1、かつM[1]=0のときには、Nレジスタ924に読出信号(“100”)を送り、Kレジスタ923に読出信号(“011”)を送る。Y[i+1,i]評価部909は、Y[i+1,i]=00、M[0]=1、かつM[1]=1のときには、Nレジスタ924に読出信号(“110”)を送り、Kレジスタ923に読出信号(“001”)を送る。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=01、M[0]=0、かつM[1]=0のときには、Xレジスタ922に読出信号(“100”)を送り、Kレジスタ923に読出信号(“011”)を送る。Y[i+1,i]評価部909は、Y[i+1,i]=01、M[0]=0、かつM[1]=1のときには、Xレジスタ922に読出信号(“100”)を送り、Nレジスタ924に読出信号(“010”)を送り、Kレジスタ923に読出信号(“001”)を送る。Y[i+1,i]評価部909は、Y[i+1,i]=01、M[0]=1、かつM[1]=0のときには、(X+N)レジスタ925に読出信号(“100”)を送り、Kレジスタ923に読出信号(“011”)を送る。Y[i+1,i]評価部909は、Y[i+1,i]=01、M[0]=1、かつM[1]=1のときには、(X+N)レジスタ925に読出信号(“100”)を送り、Nレジスタ924に読出信号(“010”)を送り、Kレジスタ923に読出信号(“001”)を送る。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=10、M[0]=0、かつM[1]=0のときには、Kレジスタ923に読出信号(“110”)を送り、Xレジスタ922に読出信号(“001”)を送る。Y[i+1,i]評価部909は、Y[i+1,i]=10、M[0]=0、かつM[1]=1のときには、Kレジスタ923に読出信号(“100”)を送り、Nレジスタ924に読出信号(“010”)を送り、Xレジスタ922に読出信号(“001”)を送る。Y[i+1,i]評価部909は、Y[i+1,i]=10、M[0]=1、かつM[1]=0のときには、Nレジスタ924に読出信号(“100”)を送り、Kレジスタ923に読出信号(“010”)を送り、Xレジスタ922に読出信号(“001”)を送る。Y[i+1,i]評価部909は、Y[i+1,i]=10、M[0]=1、かつM[1]=1のときには、Nレジスタ924に読出信号(“110”)を送り、Xレジスタ922に読出信号(“001”)を送る。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=11、M[0]=0、かつM[1]=0のときには、Xレジスタ922に読出信号(“101”)を送り、Kレジスタ923に読出信号(“010”)を送る。Y[i+1,i]評価部909は、Y[i+1,i]=11、M[0]=0、かつM[1]=1のときには、Xレジスタ922に読出信号(“101”)を送り、Nレジスタ924に読出信号(“010”)を送る。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=11、M[0]=1、かつM[1]=0のときには、(X+N)レジスタ925に読出信号(“100”)を送り、Kレジスタ923に読出信号(“010”)を送り、Xレジスタ922に読出信号(“001”)を送る。Y[i+1,i]評価部909は、Y[i+1,i]=11、M[0]=1、かつM[1]=1のときには、(X+N)レジスタ925に読出信号(“100”)を送り、Nレジスタ924に読出信号(“010”)を送り、Xレジスタ922に読出信号(“001”)を送る。
When Y [i + 1, i] = 11, M [0] = 1, and M [1] = 0, the Y [i + 1, i]
加算部1200は、正負論理混在データバス108と接続する入力端子1と、正負論理混在データバス102aと接続する入力端子2と、正負論理混在データバス102bと接続する入力端子3と、正負論理混在データバス102cと接続する入力端子4とを備える。入力端子1の第iビット目(0≦i)は、正負論理混在データバス108の第iビット目と接続する。入力端子2の第iビット目(0≦i)は、正負論理混在データバス102aの第iビット目と接続する。また、入力端子3の第iビット目(1≦i)は、正負論理混在データバス102bの第(i−1)ビット目と接続し、入力端子3の第0ビット目は、「0」に固定される。また、入力端子4の第iビット目(1≦i)は、正負論理混在データバス102cの第(i−1)ビット目と接続し、入力端子4の第0ビット目は、「0」に固定される。
The
加算部1200は、正負論理混在データバス102aを通じて被乗数X、零元K、除数N、またはデータ(X+N)を受け、正負論理混在データバス102bを通じて被乗数X、零元K、除数N、またはデータ(X+N)を1ビットだけ左にシフトされたデータを受け、正負論理混在データバス102cを通じて被乗数X、零元K、除数N、またはデータ(X+N)を1ビットだけ左にシフトされたデータを受け、正負論理混在データバス108を通じてPレジスタ907内のデータの上位ビット(1024ビット目〜2048ビット目)を受け、正負論理混在データバス102a,102b,102c,108の論理に適合した加算を行ない、加算結果を正論理混在データバス104に出力する。
The
(加算部1200)
図31は、加算部1200の構成を示す。同図では、代表的に第(m−1)ビット、第mビット、および第(m+1)ビットの加算に関する部分を示している。この加算部1200は、前段に加算回路(正論理キャリー負論理)1201、加算回路(負論理キャリー正論理)1202、および加算回路(正論理キャリー負論理)1203を含み、中段に加算回路(正論理キャリー負論理)1204、加算回路(負論理キャリー正論理)1205、および加算回路(正論理キャリー負論理)1206を含み、後段に加算回路(正論理キャリー負論理)1207、加算回路(負論理キャリー正論理)1208、および加算回路(正論理キャリー負論理)1209を含む。
(Adding unit 1200)
FIG. 31 shows the configuration of the adding
前段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1201は、正負論理混在データバス102aの第(m−1)ビット目の正論理の入力in2と、正負論理混在データバス102bの第(m−1)ビット目の正論理の入力in3と、正負論理混在データバス102cの第(m−1)ビット目の正論理の入力in4とを受けて、これらを加算する。加算回路(正論理キャリー負論理)1201は、正論理の加算結果outを中段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1204に出力し、負論理のキャリーcoutBを中段の第mビット目を処理する加算回路(負論理キャリー正論理)1205に出力する。
An adder circuit (positive logic carry negative logic) 1201 for processing the (m−1) th bit in the previous stage is connected to the positive logic input in2 of the (m−1) th bit of the
前段の第mビット目を処理する加算回路(負論理キャリー正論理)1202は、正負論理混在データバス102aの第mビット目の負論理の入力inB2と、正負論理混在データバス102bの第mビット目の負論理の入力inB3と、正負論理混在データバス102cの第mビット目の負論理の入力inB4とを受けて、これらを加算する。加算回路(負論理キャリー正論理)1202は、負論理の加算結果outBを中段の第mビット目を処理する加算回路(負論理キャリー正論理)1205に出力し、正論理のキャリーcoutを中段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1206に出力する。
An adder circuit (negative logic carry positive logic) 1202 that processes the m-th bit in the preceding stage is the m-th negative logic input inB2 of the positive / negative logic
前段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1203は、正負論理混在データバス102aの第(m+1)ビット目の正論理の入力in2と、正負論理混在データバス102bの第(m+1)ビット目の正論理の入力in3と、正負論理混在データバス102cの第(m+1)ビット目の正論理の入力in4とを受けて、これらを加算する。加算回路(正論理キャリー負論理)1203は、正論理の加算結果outを中段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1206に出力し、負論理のキャリーcoutBを図示しない中段の第(m+2)ビット目を処理する加算回路(負論理キャリー正論理)に出力する。
An adder circuit (positive logic carry negative logic) 1203 for processing the (m + 1) -th bit in the previous stage is connected to the positive logic input in2 of the (m + 1) -th bit of the positive / negative logic
中段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1204は、正負論理混在データバス108の第(m−1)ビット目の正論理の入力in1と、前段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1201から正論理の加算結果outを受け、図示しない前段の第(m−2)ビット目を処理する加算回路(負論理キャリー正論理)から正論理のキャリーcoutを受けて、これらを加算する。加算回路(正論理キャリー負論理)1204は、正論理の加算結果outを後段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1207に出力し、負論理のキャリーcoutBを後段の第mビット目を処理する加算回路(負論理キャリー正論理)1208に出力する。
The adder circuit (positive logic carry negative logic) 1204 for processing the (m−1) th bit in the middle stage is connected to the positive logic input in1 of the (m−1) th bit of the mixed positive / negative
中段の第mビット目を処理する加算回路(負論理キャリー正論理)1205は、正負論理混在データバス108の第mビット目の負論理の入力inB1と、前段の第mビット目を処理する加算回路(負論理キャリー正論理)1202から負論理の加算結果outBを受け、前段の第(m−1)ビット目を処理する加算回路(負論理キャリー正論理)1202から負論理のキャリーcoutBを受けて、これらを加算する。加算回路(負論理キャリー正論理)1205は、負論理の加算結果outBを後段の第mビット目を処理する加算回路(負論理キャリー正論理)1208に出力し、正論理のキャリーcoutを後段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1209に出力する。
An adder circuit (negative logic carry positive logic) 1205 that processes the m-th bit in the middle stage is an addition that processes the m-th bit negative logic input inB1 of the positive / negative logic
中段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1206は、正負論理混在データバス108の第(m+1)ビット目の正論理の入力in1と、前段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1203から正論理の加算結果outを受け、前段の第mビット目を処理する加算回路(正論理キャリー負論理)1203から正論理のキャリーcoutを受けて、これらを加算する。加算回路(正論理キャリー負論理)1206は、正論理の加算結果outを後段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1209に出力し、負論理のキャリーcoutBを図示しない後段の第(m+2)ビット目を処理する加算回路(負論理キャリー正論理)に出力する。
An adder circuit (positive logic carry negative logic) 1206 for processing the (m + 1) th bit in the middle stage is connected to the positive logic input in1 of the (m + 1) th bit of the
後段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1207は、中段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1204から正論理の加算結果outを受け、図示しない中段の第(m−2)ビット目を処理する加算回路(負論理キャリー正論理)から正論理のキャリーcoutを受け、図示しない後段の第(m−2)ビット目を処理する加算回路(負論理キャリー正論理)から正論理のキャリーcoutを受けて、これらを加算する。加算回路(正論理キャリー負論理)1207は、正論理の加算結果outを正負論理混在データバス104に出力し、負論理のキャリーcoutBを後段の第mビット目を処理する加算回路(負論理キャリー正論理)1208に出力する。
An adder circuit (positive logic carry negative logic) 1207 that processes the (m−1) -th bit of the subsequent stage is positive from the adder circuit (positive logic carry negative logic) 1204 that processes the (m−1) -th bit of the middle stage. A positive logic carry cout is received from an adder circuit (negative logic carry positive logic) that receives the logic addition result out and processes the (m-2) -th bit of the middle stage (not shown), and the (m-2) of the subsequent stage (not shown). ) A positive logic carry cout is received from an adder circuit (negative logic carry positive logic) for processing the bit, and these are added. An adder circuit (positive logic carry negative logic) 1207 outputs a positive logic addition result out to the positive / negative logic
後段の第mビット目を処理する加算回路(負論理キャリー正論理)1208は、中段の第mビット目を処理する加算回路(負論理キャリー正論理)1205から負論理の加算結果outBを受け、中段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1204から負論理のキャリーcoutBを受け、後段の第(m−1)ビット目を処理する加算回路(正論理キャリー負論理)1207から負論理のキャリーcoutBを受けて、これらを加算する。加算回路(負論理キャリー正論理)1208は、負論理の加算結果outを正負論理混在データバス104に出力し、正論理のキャリーcoutを後段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1209に出力する。
An adder circuit (negative logic carry positive logic) 1208 that processes the m-th bit in the subsequent stage receives an addition result outB of negative logic from an adder circuit (negative logic carry positive logic) 1205 that processes the m-th bit in the middle stage. An adder circuit (positive logic) that receives a negative logic carry coutB from the adder circuit (positive logic carry negative logic) 1204 that processes the middle (m-1) th bit and processes the (m-1) th bit in the subsequent stage. Carry negative logic) 1207 receives negative logic carry coutB and adds them. An adder circuit (negative logic carry positive logic) 1208 outputs a negative logic addition result out to the positive / negative logic
後段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1209は、中段の第(m+1)ビット目を処理する加算回路(正論理キャリー負論理)1206から正論理の加算結果outを受け、中段の第mビット目を処理する加算回路(負論理キャリー正論理)1205から正論理のキャリーcoutを受け、後段の第(m+1)ビット目を処理する加算回路(負論理キャリー正論理)1209から正論理のキャリーcoutを受けて、これらを加算する。加算回路(正論理キャリー負論理)1209は、正論理の加算結果outを正負論理混在データバス104に出力し、負論理のキャリーcoutBを図示しない後段の第(m+2)ビット目を処理する加算回路(負論理キャリー正論理)に出力する。
An adder circuit (positive logic carry negative logic) 1209 that processes the (m + 1) th bit in the subsequent stage is a positive logic addition result from an adder circuit (positive logic carry negative logic) 1206 that processes the (m + 1) th bit in the middle stage. An adder circuit (negative logic carry positive logic) 1205 that receives out and receives a positive logic carry cout from the middle stage mth bit (negative logic carry positive logic) 1205 and processes the (m + 1) th bit in the subsequent stage (negative logic carry positive) (Logic) Receives positive logic carry cout from 1209 and adds them. An adder circuit (positive logic carry negative logic) 1209 outputs an addition result out of positive logic to the
2ビット右シフト回路905は、正負論理混在データバス104を通じて加算部1200から受けたデータを2ビットだけ右にシフトし、右シフトしたデータを正負論理混在データバス106を通じてPレジスタ907に出力する。
The 2-bit right shift circuit 905 shifts the data received from the
Pレジスタ907は、正負論理混在データバス106を通じて受けた右シフトしたデータをデータPとして記憶する。また、Pレジスタ907は、記憶しているデータPを正負論理混在データバス108を通じて加算部1200へ出力する。また、Pレジスタ907は、記憶しているデータPの第0ビット目および第1ビット目の反転データであるP[1,0]を制御バス910を通じてY[i+1,i]評価部909に出力する。
The P register 907 stores right-shifted data received through the positive / negative logic
バス論理変換回路150は、正負論理混在データバス108から受けたデータの論理をデータバス112の論理に変換してデータバス112に出力する。また、バス論理変換回路150は、データバス112から受けたデータの論理を正負論理混在データバス108の論理に変換して、正負論理混在データバス108に出力する。
The bus
(モンゴメリ乗算剰余演算回路900のモンゴメリ乗算剰余演算のアルゴリズム)
図32は、モンゴメリ乗算剰余演算回路900によるモンゴメリ乗算剰余演算のアルゴリズム(1024ビットの場合)を示す。このモンゴメリ乗算剰余演算のアルゴリズム62に基づいて、モンゴメリ乗算剰余演算回路900の動作を説明する。
(Algorithm of Montgomery modular multiplication operation of Montgomery modular multiplication circuit 900)
FIG. 32 shows an algorithm of Montgomery modular multiplication by the Montgomery modular multiplication circuit 900 (in the case of 1024 bits). The operation of the Montgomery
0〜1023までのiについて以下の処理が行なわれる。 The following processing is performed for i from 0 to 1023.
Yレジスタ621は、データバス112に乗数Yを出力する。
The
Xレジスタ922は、被乗数Xの第0ビット目と第1ビット目であるX[1,0]を制御バス911に出力し、Pレジスタ907は、記憶しているデータPの第0ビット目と第1ビット目であるP[1,0]を制御バス910に出力する。
The
Y[i+1,i]評価部909は、データバス112を通じてYを受け、制御バス911を通じてX[1,0]を受け、制御バス910を通じてP[1,0]を受けて、これらの値よりデータM[0]=P[0]^(Y[i]・X[0])と、データMC=P[0]・Y[i]・X[0]と、データM[1]=P[1]^(Y[i]・X[1])^(Y[i+1]・X[0])^MC^M[0]^(M[0]・X[1])とを算出する。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=00、M[0]=0、かつM[1]=0のときには、Kレジスタ923に読出信号(「111」)を送り、零元Kを正負論理混在データバス102a、102b、および102cに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=00、M[0]=0、かつM[1]=1のときには、Kレジスタ923に読出信号(“101”)を送り零元Kを正負論理混在データバス102aおよび102cに出力させ、Nレジスタ924に読出信号(“010”)を送り除数Nを正負論理混在データバス102bに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=00、M[0]=1、かつM[1]=0のときには、Nレジスタ924に読出信号(“100”)を送り除数Nを正負論理混在データバス102aに出力させ、Kレジスタ923に読出信号(“011”)を送り零元Kを正負論理混在データバス102bおよび102cに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=00、M[0]=1、かつM[1]=1のときには、Nレジスタ924に読出信号(“110”)を送り除数Nを正負論理混在データバス102aおよび102bに出力させ、Kレジスタ923に読出信号(“001”)を送り零元Kを正負論理混在データバス102cに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=01、M[0]=0、かつM[1]=0のときには、Xレジスタ922に読出信号(“100”)を送り被乗数Xを正負論理混在データバス102aに出力させ、Kレジスタ923に読出信号(“011”)を送り零元Kを正負論理混在データバス102bおよび102cに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=01、M[0]=0、かつM[1]=1のときには、Xレジスタ922に読出信号(“100”)を送り被乗数Xを正負論理混在データバス102aに出力させ、Nレジスタ924に読出信号(“010”)を送り除数Nを正負論理混在データバス102bに出力させ、Kレジスタ923に読出信号(“001”)を送り零元Kを正負論理混在データバス102cに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=01、M[0]=1、かつM[1]=0のときには、(X+N)レジスタ925に読出信号(“100”)を送りデータ(X+N)を正負論理混在データバス102aに出力させ、Kレジスタ923に読出信号(“011”)を送り零元Kを正負論理混在データバス102bおよび102cに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=01、M[0]=1、かつM[1]=1のときには、(X+N)レジスタ925に読出信号(“100”)を送りデータ(X+N)を正負論理混在データバス102aに出力させ、Nレジスタ924に読出信号(“010”)を送り除数Nを正負論理混在データバス102bに出力させ、Kレジスタ923に読出信号(“001”)を送り零元Kを正負論理混在データバス102cに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=10、M[0]=0、かつM[1]=0のときには、Kレジスタ923に読出信号(“110”)を送り零元Kを正負論理混在データバス102aおよび102bに出力させ、Xレジスタ922に読出信号(“001”)を送り被乗数Xを正負論理混在データバス102cに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=10、M[0]=0、かつM[1]=1のときには、Kレジスタ923に読出信号(“100”)を送り零元Kを正負論理混在データバス102aに出力させ、Nレジスタ924に読出信号(“010”)を送り除数Nを正負論理混在データバス102bに出力させ、Xレジスタ922に読出信号(“001”)を送り被乗数Xを正負論理混在データバス102cに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=10、M[0]=1、かつM[1]=0のときには、Nレジスタ924に読出信号(“100”)を送り除数Nを正負論理混在データバス102aに出力させ、Kレジスタ923に読出信号(“010”)を送り零元Kを正負論理混在データバス102bに出力させ、Xレジスタ922に読出信号(“001”)を送り被乗数Xを正負論理混在データバス102cに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=10、M[0]=1、かつM[1]=1のときには、Nレジスタ924に読出信号(“110”)を送り除数Nを正負論理混在データバス102aおよび102bに出力させ、Xレジスタ922に読出信号(“001”)を送り被乗数Xを正負論理混在データバス102cに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=11、M[0]=0、かつM[1]=0のときには、Xレジスタ922に読出信号(“101”)を送り被乗数Xを正負論理混在データバス102aおよび102cに出力させ、Kレジスタ923に読出信号(“010”)を送り零元Kを正負論理混在データバス102bに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=11、M[0]=0、かつM[1]=1のときには、Xレジスタ922に読出信号(“101”)を送り被乗数Xを正負論理混在データバス102aおよび102cに出力させ、Nレジスタ924に読出信号(“010”)を送り除数Nを正負論理混在データバス102bに出力させる。
The Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=11、M[0]=1、かつM[1]=0のときには、(X+N)レジスタ925に読出信号(“100”)を送りデータ(X+N)を正負論理混在データバス102aに出力させ、Kレジスタ923に読出信号(“010”)を送り零元Kを正負論理混在データバス102bに出力させ、Xレジスタ922に読出信号(“001”)を送り被乗数Xを正負論理混在データバス102cに出力させる。
When Y [i + 1, i] = 11, M [0] = 1, and M [1] = 0, the Y [i + 1, i]
Y[i+1,i]評価部909は、Y[i+1,i]=11、M[0]=1、かつM[1]=1のときには、(X+N)レジスタ925に読出信号(“100”)を送りデータ(X+N)を正負論理混在データバス102aに出力させ、Nレジスタ924に読出信号(“010”)を送り除数Nを正負論理混在データバス102bに出力させ、Xレジスタ922に読出信号(“001”)を送り被乗数Xを正負論理混在データバス102cに出力させる。
When Y [i + 1, i] = 11, M [0] = 1, and M [1] = 1, the Y [i + 1, i]
Pレジスタ907は、記憶しているデータPを正負論理混在データバス108を通じて加算部1200へ出力する。
The
加算部1200は、正負論理混在データバス108を通じてデータPの上位ビット(1024ビット目〜2047ビット目)を受け、正負論理混在データバス102a,102b,102cを通じてK、N、X、または(X+N)を受けて、受けたデータを加算し、加算結果を正負論理混在データバス104を通じて、2ビット右シフト回路905に出力する。
The adding
2ビット右シフト回路905は、加算部1200から受けたデータを2ビットだけ右にシフトし、右シフトしたデータを正負論理混在データバス106を通じてPレジスタ907に出力する。
The 2-bit right shift circuit 905 shifts the data received from the
Pレジスタ907は、正負論理混在データバス106を通じて受けた右シフトしたデータをデータPとして記憶する。
The P register 907 stores right-shifted data received through the positive / negative logic
このような処理をi=0から1023まで繰返すことによって、最終的にPレジスタ607に、モンゴメリ乗算剰余演算結果が格納される。
By repeating such processing from i = 0 to 1023, the Montgomery multiplication residue calculation result is finally stored in the
以上のように、本変形例に係るモンゴメリ乗算剰余演算回路によれば、乗数Yのビットが「0」のときに、電力消費量が最小となるのを防止することができるので、暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。また、乗数Yの2ビット分について、同時に加算処理を行なうので、乗算処理を高速化することができる。 As described above, according to the Montgomery multiplication remainder operation circuit according to the present modification, it is possible to prevent the power consumption from being minimized when the bit of the multiplier Y is “0”. It is possible to prevent the multiplier Y that becomes secret data from being specified. Further, since the addition process is simultaneously performed for 2 bits of the multiplier Y, the multiplication process can be speeded up.
なお、本実施の形態に係るモンゴメリ乗算剰余回路においても、第1の実施形態またはその変形例のように、初期値P=0のためにPレジスタの代りにデータ格納レジスタ群を備えるように変形してもよく、2ビット右シフトとPレジスタへの格納の順序を逆になるように変形してもよい。 Note that the Montgomery multiplication remainder circuit according to the present embodiment is also modified to include a data storage register group instead of the P register for the initial value P = 0, as in the first embodiment or its modification. Alternatively, the order of 2-bit right shift and storage in the P register may be reversed.
[第7の実施形態]
本実施の形態は、2通りの演算を実行し、演算の途中結果のデータに基づいて、いずれかの演算の結果のみを選択するモンゴメリ乗算剰余演算回路に関する。
[Seventh Embodiment]
The present embodiment relates to a Montgomery multiplication remainder arithmetic circuit that executes two kinds of arithmetic operations and selects only the result of one of the arithmetic operations based on the data of the intermediate result of the arithmetic operation.
(モンゴメリ乗算剰余演算回路の構成)
図33は、第7の実施形態に係るモンゴメリ乗算剰余演算回路の構成を示す。同図を参照して、このモンゴメリ乗算剰余演算回路1700は、レジスタ群1701と、Y[i]選択回路1410と、加算部1703と、右シフト回路1705と、シフト選択回路1712と、Pレジスタ1707と、Qレジスタ1718と、レジスタ選択回路(SQ)1714とを備える。
(Configuration of Montgomery multiplication remainder arithmetic circuit)
FIG. 33 shows a configuration of a Montgomery modular multiplication circuit according to the seventh embodiment. Referring to the figure, this Montgomery
また、このモンゴメリ乗算剰余回路1700は、n(=1024)ビットのデータを伝送し、全ビットが正論理であるデータバス112,1704,1706,1718,1713とを含む。データバス112は、モンゴメリ乗算剰余回路1700の外部の制御回路12と接続する。
The Montgomery
レジスタ群1701は、演算に必要なデータを記憶するもので、Yレジスタ621と、Xレジスタ622と、Kレジスタ623と、Nレジスタ624と、Rレジスタ1723とからなる。
The
Yレジスタ621は、1024ビットの乗数Yを記憶する。Yレジスタ621は、データバス112を通じてY[i]選択回路1410に乗数Yを出力する。
The Y register 621 stores a 1024-bit multiplier Y. The
Xレジスタ622は、1024ビットの被乗数Xを記憶する。Xレジスタ622は、レジスタ選択回路1709から制御バス1731を通じて読出信号を受けると、被乗数Xをデータバス112に出力する。
The
Kレジスタ623は、1024ビットの零元Kを記憶する。Kレジスタ623は、レジスタ選択回路1709から制御バス1733を通じて読出信号を受けると、零元Kをデータバス112に出力する。
The
Nレジスタ624は、1024ビットの除数Nを記憶する。Nレジスタ624は、レジスタ選択回路1709から制御バス1732を通じて読出信号を受けると、除数Nをデータバス112に出力する。
The N register 624 stores a divisor N of 1024 bits. When the
Rレジスタ1723は、モンゴメリ乗算剰余演算処理の終了後に、演算結果Rを記憶する。 The R register 1723 stores the calculation result R after the Montgomery multiplication remainder calculation process is completed.
レジスタ選択回路1709は、後述の第1段階の演算における第1の加算時、後述の第2段階の演算時における第1の加算、および後述の補正演算における第1の加算時に、Kレジスタ623に読出信号を送り、後述の第1段階の演算における第2の加算時に、Xレジスタ622に読出信号を送り、後述の第2段階の演算における第2の加算時、および後述の補正演算における第2の加算時に、Nレジスタ624に読出信号を送る。
The
Y[i]選択回路1410は、データバス112を通じて乗数Yを受け、制御バス1411を通じてレジスタ選択回路(SQ)1714に乗数Yのiビット目の値であるY[i]を出力する。
The Y [i]
レジスタ選択回路(SQ)1714は、制御バス1734を通じてP読出信号およびP書込信号をPレジスタ1707に出力し、制御バス1735を通じてQ読出信号およびQ書込信号をQレジスタ1718に出力する。
Register select circuit (SQ) 1714 outputs a P read signal and a P write signal to
レジスタ選択回路(SQ)1714は、後述する第1段階の演算における読出し時に、記憶しているデータSQが「1」のときには、Q読出信号を活性化し、記憶しているデータSQが「0」のときには、P読出信号を活性化する。 The register selection circuit (SQ) 1714 activates the Q read signal when the stored data SQ is “1” at the time of reading in the first-stage calculation described later, and the stored data SQ is “0”. In this case, the P read signal is activated.
レジスタ選択回路(SQ)1714は、後述する第2段階の演算における読出し時に、記憶しているデータSQが「1」のときには、P読出信号を活性化し、記憶しているデータSQが「0」のときには、Q読出信号を活性化する。 The register selection circuit (SQ) 1714 activates the P read signal when the stored data SQ is “1” at the time of reading in a second-stage operation described later, and the stored data SQ is “0”. In the case of Q, the Q read signal is activated.
レジスタ選択回路(SQ)1714は、後述する補正演算における第1の読出し時には、記憶しているデータSQが「1」のときには、Q読出信号を活性化し、記憶しているデータSQが「0」のときには、P読出信号を活性化する。レジスタ選択回路(SQ)1714は、後述する補正演算における第2の読出し時に、記憶しているデータSQが「0」のときには、Q読出信号を活性化し、記憶しているデータSQが「1」のときには、P読出信号を活性化する。 The register selection circuit (SQ) 1714 activates the Q read signal when the stored data SQ is “1” at the time of the first reading in the correction calculation described later, and the stored data SQ is “0”. In this case, the P read signal is activated. The register selection circuit (SQ) 1714 activates the Q read signal when the stored data SQ is “0” at the time of the second read in the correction calculation described later, and the stored data SQ is “1”. In this case, the P read signal is activated.
レジスタ選択回路(SQ)1714は、後述する第1段階の演算における第1の加算時に、記憶しているデータSQが「1」のときには、P書込信号を活性化し、記憶しているデータSQが「0」のときには、Q書込信号を活性化する。レジスタ選択回路(SQ)1714は、後述する第1段階の演算における第2の加算時に、記憶しているデータSQが「1」のときには、Q書込信号を活性化し、記憶しているデータSQが「0」のときには、P書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the P write signal and stores the stored data SQ when the stored data SQ is “1” at the time of the first addition in the first-stage operation described later. When “0” is “0”, the Q write signal is activated. The register selection circuit (SQ) 1714 activates the Q write signal and stores the stored data SQ when the stored data SQ is “1” at the time of the second addition in the first-stage operation described later. When “0” is “0”, the P write signal is activated.
レジスタ選択回路(SQ)1714は、後述する第2段階の演算における第1の加算時に、記憶しているデータSQが「1」のときには、Q書込信号を活性化し、記憶しているデータSQが「0」のときには、P書込信号を活性化する。レジスタ選択回路(SQ)1714は、後述する第2段階の演算における第2の加算時に、記憶しているデータSQが「1」のときには、P書込信号を活性化し、記憶しているデータSQが「0」のときには、Q書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the Q write signal and stores the stored data SQ when the stored data SQ is “1” during the first addition in the second-stage operation described later. When “0” is “0”, the P write signal is activated. The register selection circuit (SQ) 1714 activates the P write signal and stores the stored data SQ when the stored data SQ is “1” during the second addition in the second-stage operation described later. When “0” is “0”, the Q write signal is activated.
レジスタ選択回路(SQ)1714は、後述する補正演算における第1の加算時に、Q書込信号を活性化し、後述する補正演算における第2の加算時に、P書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the Q write signal during a first addition in a correction operation described later, and activates a P write signal during a second addition in a correction operation described later.
レジスタ選択回路1712に記憶されるデータSQの初期値は「0」とする。レジスタ選択回路(SQ)1714は、第1段階の演算の終了前に、Y[i]選択回路1410から制御バス1411を通じてY[i]を受けて、SQ^Y[i]の値を新たなデータSQとして記憶する。^は、排他的論理和(Exclusive−OR)を示す。レジスタ選択回路(SQ)1714は、後述する第2段階の演算の終了前に、データバス1708と接続するデータバス1713を通じてデータRを受けて、SQ^R[0]の値を新たなデータSQとして記憶する。レジスタ選択回路(SQ)1714は、後述する補正演算における第1の読出しの終了前に、データバス1708と接続するデータバス1713を通じてデータRを受けて、Rの最上位ビットであり、Rの符号を表わすR[1023]を新たなデータSQとして記憶する。
The initial value of the data SQ stored in the
加算部1703は、データバス1708と接続する入力端子1と、データバス112と接続する入力端子2とを備える。入力端子1の第iビット目(0≦i)は、データバス1708の第iビット目と接続する。また、入力端子2の第iビット目(0≦i)は、データバス112の第iビット目と接続する。
The adding
加算部1703は、入力端子1からデータRを受け、入力端子2からK、N、またはXを受けて、これらを加算する。加算部1703は、加算結果をデータバス1704を通じて右シフト回路1705に出力する。加算部1703の加算処理の論理は、加算部1000と同一なので、ここでは説明を繰返さない。
The
シフト選択回路1712は、制御バス1736を通じてシフト選択信号を右シフト回路1705に出力する。
The
シフト選択回路1712は、後述する第2段階の演算時には、シフト選択信号を活性化し、後述する第1段階の演算時および補正演算時には、シフト選択信号を非活性化する。右シフト回路1705は、シフト選択信号が活性化のときには、データバス1704を通じて受けたデータを1ビットだけ右にシフトし、右シフトしたデータをデータバス1706に出力する。右シフト回路1705は、シフト選択信号が非活性化のときには、データバス1704を通じて受けたデータをそのままデータバス1706に出力する。
The
Pレジスタ1707は、P読出信号が活性化されると、記憶しているデータPをデータRとしてデータバス1708に出力する。また、Pレジスタ1707は、P書込信号が活性化により、データバス1706を通じて受けたデータをデータPとして記憶する。
Qレジスタ1718は、Q読出信号が活性化されると、記憶しているデータQをデータRとしてデータバス1708に出力する。Qレジスタ1718は、Q書込信号が活性化により、データバス1706を通じて受けたデータをデータQとして記憶する。
(モンゴメリ乗算剰余演算回路1700のモンゴメリ乗算剰余演算のアルゴリズム)
図34は、モンゴメリ乗算剰余演算回路1700によるモンゴメリ乗算剰余演算のアルゴリズム(1024ビットの場合)を示す。このモンゴメリ乗算剰余演算のアルゴリズム63に基づいて、モンゴメリ乗算剰余演算回路1700の動作を説明する。
(Algorithm of Montgomery modular multiplication operation of Montgomery modular multiplication circuit 1700)
FIG. 34 shows a Montgomery modular multiplication algorithm (in the case of 1024 bits) by the Montgomery
まず、レジスタ選択回路1712に記憶されるデータSQの初期値は「0」とする。
First, the initial value of the data SQ stored in the
0〜1023までのiについて以下の処理が行なわれる。 The following processing is performed for i from 0 to 1023.
まず、第1段階の演算が行なわれる。 First, a first stage calculation is performed.
シフト選択回路1712は、第1段階の演算時には、シフト選択信号を非活性化する。
The
レジスタ選択回路(SQ)1714は、第1段階の演算における読出し時に、記憶しているデータSQが「1」のときには、Q読出信号を活性化する。Qレジスタ1718は、Q読出信号が活性化されると、記憶しているデータQをデータRとしてデータバス1708に出力する。レジスタ選択回路(SQ)1714は、データQの出力後、Q読出信号を非活性化する。
The register selection circuit (SQ) 1714 activates the Q read signal when the stored data SQ is “1” during reading in the first-stage operation.
レジスタ選択回路1709は、第1段階の演算における第1の加算時に、Kレジスタ623に読出信号を送り、Kレジスタ623は、零元Kをデータバス112に出力する。加算部1703は、第1段階の第1の加算を行なう。すなわち、加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて零元Kを受けて、受けたデータを加算し、加算結果(R+K)をデータバス1704に出力する。
The
右シフト回路1705は、シフト選択信号が非活性化により、データバス1704を通じて受けた加算結果(R+K)をそのままデータバス1706に出力する。
The
レジスタ選択回路(SQ)1714は、第1段階の演算における第1の加算時に、記憶しているデータSQが「1」のときには、P書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the P write signal when the stored data SQ is “1” during the first addition in the first-stage operation.
Pレジスタ1707は、P書込信号が活性化により、データバス1706を通じて受けたデータ(R+K)をデータPとして記憶する。レジスタ選択回路(SQ)1714は、データPの書込み後、P書込信号を非活性化する。
P register 1707 stores data (R + K) received through
次に、レジスタ選択回路1709は、第1段階の演算における第2の加算時に、Xレジスタ622に読出信号を送り、Xレジスタ622は、被乗数Xをデータバス112に出力する。加算部1703は、第1段階の第2の加算を行なう。すなわち、加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて被乗数Xを受けて、受けたデータを加算し、加算結果(R+X)をデータバス1704に出力する。
Next, the
右シフト回路1705は、シフト選択信号が非活性化により、データバス1704を通じて受けた加算結果(R+X)をそのままデータバス1706に出力する。
The
レジスタ選択回路(SQ)1714は、第1段階の演算における第2の加算時に、記憶しているデータSQが「1」のときには、Q書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the Q write signal when the stored data SQ is “1” during the second addition in the first-stage operation.
Qレジスタ1718は、Q書込信号が活性化により、データバス1706を通じて受けたデータ(R+X)をデータQとして記憶する。レジスタ選択回路(SQ)1714は、データQの書込み後、Q書込信号を非活性化する。
The
一方、レジスタ選択回路(SQ)1714は、第1段階の演算における読出し時に、記憶しているデータSQが「0」のときには、P読出信号を活性化する。Pレジスタ1707は、P読出信号が活性化されると、記憶しているデータPをデータRとしてデータバス1708に出力する。レジスタ選択回路(SQ)1714は、データPの出力後、P読出信号を非活性化する。
On the other hand, the register selection circuit (SQ) 1714 activates the P read signal when the stored data SQ is “0” at the time of reading in the first stage operation.
レジスタ選択回路1709は、第1段階の演算における第1の加算時に、Kレジスタ623に読出信号を送り、Kレジスタ623は、零元Kをデータバス112に出力する。加算部1703は、第1段階の第1の加算を行なう。加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて零元Kを受けて、受けたデータを加算し、加算結果(R+K)をデータバス1704に出力する。
The
右シフト回路1705は、シフト選択信号が非活性化により、データバス1704を通じて受けた加算結果(R+K)をそのままデータバス1706に出力する。
The
レジスタ選択回路(SQ)1714は、第1段階の演算における第1の加算時に、記憶しているデータSQが「0」のときには、Q書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the Q write signal when the stored data SQ is “0” during the first addition in the first-stage operation.
Qレジスタ1718は、Q書込信号が活性化により、データバス1706を通じて受けたデータ(R+K)をデータQとして記憶する。レジスタ選択回路(SQ)1714は、データQの書込み後、Q書込信号を非活性化する。
次に、レジスタ選択回路1709は、第1段階の演算における第2の加算時に、Xレジスタ622に読出信号を送り、Xレジスタ622は、被乗数Xをデータバス112に出力する。加算部1703は、第1段階の第2の加算を行なう。すなわち、加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて被乗数Xを受けて、受けたデータを加算し、加算結果(R+X)をデータバス1704に出力する。
Next, the
右シフト回路1705は、シフト選択信号が非活性化により、データバス1704を通じて受けた加算結果(R+X)をそのままデータバス1706に出力する。
The
レジスタ選択回路(SQ)1714は、第1段階の演算における第2の加算時に、記憶しているデータSQが「0」のときには、P書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the P write signal when the stored data SQ is “0” during the second addition in the first-stage operation.
Pレジスタ1707は、P書込信号が活性化により、データバス1706を通じて受けたデータ(R+X)をデータPとして記憶する。レジスタ選択回路(SQ)1714は、データPの書込み後、P書込信号を非活性化する。
The
次に、レジスタ選択回路(SQ)1714は、第1段階の演算の終了前に、Y[i]選択回路1410から制御バス1411を通じてY[i]を受けて、SQ^Y[i]の値を新たなデータSQとして記憶する。
Next, the register selection circuit (SQ) 1714 receives Y [i] from the Y [i]
以上により、第1段階の演算が終了し、第2段階の演算が行なわれる。シフト選択回路1712は、第2段階の演算時には、シフト選択信号を活性化する。
Thus, the first stage of computation is completed, and the second stage of computation is performed. The
レジスタ選択回路(SQ)1714は、第2段階の演算における読出し時に、記憶しているデータSQが「1」のときには、P読出信号を活性化する。Pレジスタ1707は、P読出信号が活性化されると、記憶しているデータPをデータRとしてデータバス1708に出力する。レジスタ選択回路(SQ)1714は、データPの出力後、P読出信号を非活性化する。
The register selection circuit (SQ) 1714 activates the P read signal when the stored data SQ is “1” at the time of reading in the second stage operation.
レジスタ選択回路1709は、第2段階の演算における第1の加算時に、Kレジスタ623に読出信号を送り、Kレジスタ623は、零元Kをデータバス112に出力する。加算部1703は、第2段階の第1の加算を行なう。すなわち、加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて零元Kを受けて、受けたデータを加算し、加算結果(R+K)をデータバス1704に出力する。
The
右シフト回路1705は、シフト選択信号が活性化により、データバス1704を通じて受けた加算結果(R+K)を1ビットだけ右にシフトしたデータ((R+K)≫1)をデータバス1706に出力する。
The
レジスタ選択回路(SQ)1714は、第2段階の演算における第1の加算時に、記憶しているデータSQが「1」のときには、Q書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the Q write signal when the stored data SQ is “1” during the first addition in the second-stage operation.
Qレジスタ1718は、Q書込信号が活性化により、データバス1706を通じて受けたデータ((R+K)≫1)をデータQとして記憶する。レジスタ選択回路(SQ)1714は、データQの書込み後、Q書込信号を非活性化する。
The
次に、レジスタ選択回路1709は、第2段階の演算における第2の加算時に、Nレジスタ624に読出信号を送り、Nレジスタ624は、除数Nをデータバス112に出力する。加算部1703は、第2段階の第2の加算を行なう。加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて乗数Nを受けて、受けたデータを加算し、加算結果(R+N)をデータバス1704に出力する。
Next, the
右シフト回路1705は、シフト選択信号が活性化により、データバス1704を通じて受けた加算結果(R+N)を1ビットだけ右にシフトしたデータ((R+N)≫1)をデータバス1706に出力する。
The
レジスタ選択回路(SQ)1714は、第2段階の演算における第2の加算時に、記憶しているデータSQが「1」のときには、P書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the P write signal when the stored data SQ is “1” during the second addition in the second-stage operation.
Pレジスタ1707は、P書込信号が活性化により、データバス1706を通じて受けたデータ((R+N)≫1)をデータPとして記憶する。レジスタ選択回路(SQ)1714は、データQP書込み後、P書込信号を非活性化する。
The
一方、レジスタ選択回路(SQ)1714は、第2段階の演算における読出し時に、記憶しているデータSQが「0」のときには、Q読出信号を活性化する。Qレジスタ1718は、Q読出信号が活性化されると、記憶しているデータQをデータRとしてデータバス1708に出力する。レジスタ選択回路(SQ)1714は、データQの出力後、Q読出信号を非活性化する。
On the other hand, the register selection circuit (SQ) 1714 activates the Q read signal when the stored data SQ is “0” at the time of reading in the second stage operation.
レジスタ選択回路1709は、第2段階の演算における第1の加算時に、Kレジスタ623に読出信号を送り、Kレジスタ623は、零元Kをデータバス112に出力する。加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて零元Kを受けて、受けたデータを加算し、加算結果(R+K)をデータバス1704に出力する。
The
右シフト回路1705は、シフト選択信号が活性化のときには、データバス1704を通じて受けた加算結果(R+K)を1ビットだけ右にシフトしたデータ((R+K)≫1)をデータバス1706に出力する。
When the shift selection signal is activated, the
レジスタ選択回路(SQ)1714は、第2段階の演算における第1の加算時に、記憶しているデータSQが「0」のときには、P書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the P write signal when the stored data SQ is “0” during the first addition in the second-stage operation.
Pレジスタ1707は、P書込信号が活性化により、データバス1706を通じて受けたデータ((R+K)≫1)をデータPとして記憶する。レジスタ選択回路(SQ)1714は、データPの書込み後、P書込信号を非活性化する。
The
次に、レジスタ選択回路1709は、第2段階の演算における第2の加算時に、Nレジスタ624に読出信号を送り、Nレジスタ624は、除数Nをデータバス112に出力する。加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて乗数Nを受けて、受けたデータを加算し、加算結果(R+N)をデータバス1704に出力する。
Next, the
右シフト回路1705は、シフト選択信号が活性化により、データバス1704を通じて受けた加算結果(R+N)を1ビットだけ右にシフトしたデータ((R+N)≫1)をデータバス1706に出力する。
The
レジスタ選択回路(SQ)1714は、第2段階の演算における第2の加算時に、記憶しているデータSQが「0」のときには、Q書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the Q write signal when the stored data SQ is “0” during the second addition in the second-stage operation.
Qレジスタ1718は、Q書込信号が活性化により、データバス1706を通じて受けたデータ((R+N)≫1)をデータQとして記憶する。レジスタ選択回路(SQ)1714は、データQの書込み後、Q書込信号を非活性化する。
次に、レジスタ選択回路(SQ)1714は、第2段階の演算の終了前に、データバス1708と接続するデータバス1713を通じてデータRを受けて、SQ^R[0]の値を新たなデータSQとして記憶する。
Next, the register selection circuit (SQ) 1714 receives the data R through the
以上により、第2段階の演算が終了する。このような第1段階および第2段階の演算処理をi=0から1023まで繰返した後、以下のような補正演算が行なわれる。シフト選択回路1712は、補正演算時には、シフト選択信号を非活性化する。
Thus, the second stage calculation is completed. After repeating the first stage and second stage calculation processes from i = 0 to 1023, the following correction calculation is performed. The
レジスタ選択回路(SQ)1714は、補正演算における第1の読出し時には、記憶しているデータSQが「1」のときには、Q読出信号を活性化する。Qレジスタ1718は、Q読出信号が活性化されると、記憶しているデータQをデータRとしてデータバス1708に出力する。レジスタ選択回路(SQ)1714は、データQの出力後、Q読出信号を非活性化する。
The register selection circuit (SQ) 1714 activates the Q read signal when the stored data SQ is “1” during the first reading in the correction operation.
一方、レジスタ選択回路(SQ)1714は、補正演算における第1の読出し時には、記憶しているデータSQが「0」のときには、P読出信号を活性化する。Pレジスタ1707は、P読出信号が活性化されると、記憶しているデータPをデータRとしてデータバス1708に出力する。レジスタ選択回路(SQ)1714は、データPの出力後、P読出信号を非活性化する。
On the other hand, the register selection circuit (SQ) 1714 activates the P read signal when the stored data SQ is “0” during the first read in the correction operation.
レジスタ選択回路(SQ)1714は、補正演算における第1の読出しの終了前に、データバス1708と接続するデータバス1713を通じてデータRを受けて、Rの最上位ビットであり、Rの符号を表わすR[1023]を新たなデータSQとして記憶する。
The register selection circuit (SQ) 1714 receives the data R through the
レジスタ選択回路1709は、補正演算における第1の加算時には、Kレジスタ622に読出信号を送り、Kレジスタ623は、零元Kをデータバス112に出力する。加算部1703は、補正演算における第1の加算を行なう。すなわち、加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて零元Kを受けて、受けたデータを加算し、加算結果(R+K)をデータバス1704に出力する。
The
右シフト回路1705は、シフト選択信号が非活性化により、データバス1704を通じて受けた加算結果(R+K)をそのままデータバス1706に出力する。
The
レジスタ選択回路(SQ)1714は、補正演算における第1の加算時に、Q書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the Q write signal during the first addition in the correction operation.
Qレジスタ1718は、Q書込信号が活性化により、データバス1706を通じて受けたデータ(R+K)をデータQとして記憶する。レジスタ選択回路(SQ)1714は、データQの書込み後、Q書込信号を非活性化する。
次に、レジスタ選択回路1709は、補正演算における第2の加算時に、Nレジスタ624に読出信号を送り、Nレジスタ624は、除数Nをデータバス112に出力する。加算部1703は、補正演算における第2の加算を行なう。すなわち、加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて乗数Nを受けて、受けたデータを加算し、加算結果(R+N)をデータバス1704に出力する。
Next, the
右シフト回路1705は、シフト選択信号が非活性化により、データバス1704を通じて受けた加算結果(R+N)をそのままデータバス1706に出力する。
The
レジスタ選択回路(SQ)1714は、補正演算における第2の加算時に、P書込信号を活性化する。 The register selection circuit (SQ) 1714 activates the P write signal during the second addition in the correction operation.
Pレジスタ1707は、P書込信号が活性化により、データバス1706を通じて受けたデータ(R+N)をデータPとして記憶する。
P register 1707 stores data (R + N) received through
次に、レジスタ選択回路(SQ)1714は、補正演算における第2の読出し時に、記憶しているデータSQが「0」のときには、Q読出信号を活性化する。Qレジスタ1718は、Q読出信号が活性化されると、記憶しているデータQをデータRとしてデータバス1708およびデ−タバス112を通じてRレジスタ1723に出力する。レジスタ選択回路(SQ)1714は、データQの出力後、Q読出信号を非活性化する。
Next, the register selection circuit (SQ) 1714 activates the Q read signal when the stored data SQ is “0” during the second read in the correction operation. When the Q read signal is activated, the
一方、レジスタ選択回路(SQ)1714は、補正演算における第2の読出し時に、記憶しているデータSQが「1」のときには、P読出信号を活性化する。Pレジスタ1707は、P読出信号が活性化されると、記憶しているデータPをデータRとしてデータバス1708およびデータバス112を通じてRレジスタ1723に出力する。レジスタ選択回路(SQ)1714は、データPの出力後、P読出信号を非活性化する。
On the other hand, the register selection circuit (SQ) 1714 activates the P read signal when the stored data SQ is “1” during the second read in the correction operation. When the P read signal is activated,
以上のような処理によって、最終的にRレジスタ1723にモンゴメリ乗算剰余演算の結果が格納される。
Through the processing as described above, the Montgomery modular multiplication result is finally stored in the
以上のように、本実施の形態に係るモンゴメリ乗算剰余演算回路によれば、演算の途中結果のデータの値に係らず、2通りの演算のいずれをも実行するので、電力消費量に基づいて暗号処理において秘匿データとなる乗数Yが特定されるのを防止することができる。 As described above, according to the Montgomery modular multiplication circuit according to the present embodiment, both of the two calculations are executed regardless of the data value of the intermediate result of the calculation. It is possible to prevent the multiplier Y that becomes secret data from being specified in the encryption process.
なお、本実施の形態に係るモンゴメリ乗算剰余回路においても、第1の実施形態またはその変形例のように、右シフトとPレジスタまたはQレジスタへの格納の順序を逆になるように変形してもよく、正論理のデータバスの代りに正負論理混在データバスを備えるように変形するものとしてもよい。 Note that the Montgomery multiplication remainder circuit according to the present embodiment is also modified so that the order of the right shift and the storage in the P register or Q register is reversed as in the first embodiment or its modification. Alternatively, a modification may be made so that a positive and negative logic mixed data bus is provided instead of the positive logic data bus.
また、本実施の形態では、Rレジスタ1723にモンゴメリ乗算剰余演算結果が格納されるものとしたが、これに限定するものではなく、Yレジスタ621、Xレジスタ622、Nレジスタ622、およびKレジスタ623のいずれかにモンゴメリ乗算剰余演算結果を格納するものとしてもよく、この場合、Rレジスタ1723は不要となる。
In this embodiment, the Montgomery modular multiplication result is stored in the
[第8の実施形態]
本実施の形態は、正負論理混在データを用いて加算を行なう加算回路に関する。
[Eighth Embodiment]
The present embodiment relates to an adder circuit that performs addition using positive / negative logic mixed data.
(加算回路の構成)
図35は、第8の実施形態に係る加算回路の構成を示す。同図を参照して、この加算回路1900は、レジスタ群1901と、加算部1903とを備える。
(Configuration of addition circuit)
FIG. 35 shows a configuration of an adder circuit according to the eighth embodiment. Referring to FIG. 9, this
レジスタ群1901は、演算に必要なデータを記憶するもので、X1レジスタ1911と、X2レジスタ1912と、Aレジスタ1914とからなる。
The
X1レジスタ1911は、1024ビットの被加算数X1を記憶する。X1レジスタ1911は、第1の実施形態のXレジスタ22と同様に、被加算数X1を正負論理混在データバス102に出力する。
The X1 register 1911 stores a 1024-bit addend number X1. Similar to the
X2レジスタ1912は、1024ビットの被加算数X2を記憶する。X2レジスタ1912は、第1の実施形態のXレジスタ22と同様に、被加算数X2を正負論理混在データバス102に出力する。
The X2 register 1912 stores a 1024-bit addend number X2. Similar to the
加算部1903は、第1の実施形態の加算部1000と同様に、正負論理混在データバス102aを通じて1024ビットの被加算数X1を受け、正負論理混在データバス102bを通じて1024ビットの被加算数X2を受け、これらの受けたデータを加算し、加算結果(X1+X2)を正負論理混在データバス108に出力する。
Similar to the adding
変換器150は、正負論理混在データバス108の加算結果(X1+X2)を、正論理に変換して、データバス112を通じてAレジスタ1914に出力する。
The
このようにして、Aレジスタに、被加算数X1と被加算数X2との加算結果が格納される。 In this way, the addition result of the added number X1 and the added number X2 is stored in the A register.
以上のように、本実施の形態に係る加算回路によれば、被加算数X1またはX2が零のときに電力消費量が小さくなるのを防止することができるので、暗号処理において秘匿データとなる被加算数X1またはX2が特定されるのを防止することができる。 As described above, according to the adder circuit according to the present embodiment, it is possible to prevent the power consumption from becoming small when the addend number X1 or X2 is zero. It is possible to prevent the addend number X1 or X2 from being specified.
なお、本実施の形態では、Aレジスタ1914に加算結果が格納されるものとしたが、これに限定するものではなく、X1レジスタ1911とX2レジスタ1912のいずれかに加算結果を格納するものとしてもよく、この場合、Aレジスタ1914は不要となる。
In this embodiment, the addition result is stored in the
[第9の実施形態]
本実施の形態は、入力信号の変化の相違によって消費電力が変化しない、論理回路の一種であるインバータ回路に関する。
[Ninth Embodiment]
The present embodiment relates to an inverter circuit which is a kind of logic circuit in which power consumption does not change due to a difference in change of an input signal.
(従来のインバータ回路の構成)
図36は、従来のインバータ回路の構成を示す図である。同図を参照して、従来のインバータ回路949では、入力信号in1が「H」から「L」に変化すると、NチャネルMOSトランジスタNT2がオフとなり、PチャネルMOSトランジスタPT1がオンとなる。これにより、電源から出力端子に電流が供給され、出力信号out1が「H」となる。したがって、この場合には、電力が消費される。
(Conventional inverter circuit configuration)
FIG. 36 is a diagram showing a configuration of a conventional inverter circuit. Referring to the figure, in
一方、入力信号in1が「L」から「H」に変化すると、NチャネルMOSトランジスタNT2がオンとなり、PチャネルMOSトランジスタPT1がオフとなる。これにより、出力端子から電流がグランドに流れ、出力信号out1は「L」となる。したがって、この場合には、電力が消費されない。 On the other hand, when input signal in1 changes from “L” to “H”, N-channel MOS transistor NT2 is turned on and P-channel MOS transistor PT1 is turned off. As a result, a current flows from the output terminal to the ground, and the output signal out1 becomes “L”. Therefore, in this case, power is not consumed.
このように、従来のインバータ回路では、入力信号がどのように変化するかに応じて、消費する電力が相違する。それゆえ、DPAなどによって消費電力を解析することによって、インバータ回路に入力される信号がどのように変化したかの特定が可能となり、それによって、暗号処理に用いられる鍵などの秘匿データを傍受することができる。 Thus, in the conventional inverter circuit, the consumed electric power differs depending on how the input signal changes. Therefore, by analyzing the power consumption using DPA or the like, it becomes possible to specify how the signal input to the inverter circuit has changed, thereby intercepting secret data such as keys used for cryptographic processing. be able to.
(本実施の形態のインバータ回路の構成)
図37は、第9の実施形態に係るインバータ回路の構成を示す図である。同図を参照して、このインバータ回路950は、PチャネルMOSトランジスタPT1,PT2,PT3,PT4と、NチャネルMOSトランジスタNT1,NT2,NT3とを含む。
(Configuration of the inverter circuit of the present embodiment)
FIG. 37 is a diagram showing the configuration of the inverter circuit according to the ninth embodiment. Referring to FIG. 8,
PチャネルMOSトランジスタPT1は、そのソースが電源に接続され、そのドレインがノードN1に接続し、そのゲートには制御信号ctrl1が入力される。 P-channel MOS transistor PT1 has a source connected to the power supply, a drain connected to node N1, and a gate to which control signal ctrl1 is input.
PチャネルMOSトランジスタPT2は、そのソースが電源に接続され、そのドレインがノードN2に接続し、そのゲートには制御信号ctrl1が入力される。 P-channel MOS transistor PT2 has its source connected to the power supply, its drain connected to node N2, and its gate receiving control signal ctrl1.
PチャネルMOSトランジスタPT3は、そのソースが電源に接続され、そのドレインがPチャネルMOSトランジスタPT4のゲートおよびノードN2に接続され、そのゲートがPチャネルMOSトランジスタPT4のドレインおよびノードN1に接続される。 P channel MOS transistor PT3 has its source connected to the power supply, its drain connected to the gate of P channel MOS transistor PT4 and node N2, and its gate connected to the drain of P channel MOS transistor PT4 and node N1.
PチャネルMOSトランジスタPT4は、そのソースが電源に接続され、そのドレインがPチャネルMOSトランジスタPT3のゲートおよびノードN1に接続され、そのゲートがPチャネルMOSトランジスタPT3のドレインおよびノードN2に接続される。 P channel MOS transistor PT4 has its source connected to the power supply, its drain connected to the gate of P channel MOS transistor PT3 and node N1, and its gate connected to the drain of P channel MOS transistor PT3 and node N2.
NチャネルMOSトランジスタNT3は、そのソースが接地され、そのドレインがノードN3に接続され、そのゲートには制御信号ctrl1が入力される。 N-channel MOS transistor NT3 has a source grounded, a drain connected to node N3, and a control signal ctrl1 input to the gate.
NチャネルMOSトランジスタNT1は、そのソースがノードN3に接続され、そのドレインがノードN1に接続され、そのゲートには入力信号in1が入力される。 N channel MOS transistor NT1 has its source connected to node N3, its drain connected to node N1, and its gate receiving input signal in1.
NチャネルMOSトランジスタNT2は、そのソースがノードN3に接続され、そのドレインがノードN2に接続され、そのゲートには反転入力信号inB1が入力される。 N channel MOS transistor NT2 has its source connected to node N3, its drain connected to node N2, and its gate receiving inverted input signal inB1.
PチャネルMOSトランジスタPT1,PT2、およびNチャネルMOSトランジスタNT3は、第1群に属し、制御信号ctrl1の活性化、つまり「L」になると、ノードN1およびN2を「H」にする。 P-channel MOS transistors PT1, PT2 and N-channel MOS transistor NT3 belong to the first group, and when control signal ctrl1 is activated, that is, “L”, nodes N1 and N2 are set to “H”.
NチャネルMOSトランジスタNT1は、第2群に属し、制御信号ctrl1が非活性、つまり「H」のときに、入力信号in1が「H」になると、ノードN1を「L」にする。 N-channel MOS transistor NT1 belongs to the second group, and when control signal ctrl1 is inactive, that is, “H”, when input signal in1 becomes “H”, node N1 is set to “L”.
NチャネルMOSトランジスタNT2は、第3群に属し、制御信号ctrl1が非活性、つまり「H」のときに、反転入力信号inB1が「H」になると、ノードN2を「L」にする。 The N-channel MOS transistor NT2 belongs to the third group, and when the control signal ctrl1 is inactive, that is, “H”, when the inverted input signal inB1 becomes “H”, the node N2 is set to “L”.
ノードN1は、正論理の出力端子と接続され、正論理の出力端子から、出力信号out1が出力される。ノードN2は、負論理の出力端子と接続され、負論理の出力端子から反転出力信号outB1が出力される。 The node N1 is connected to a positive logic output terminal, and an output signal out1 is output from the positive logic output terminal. The node N2 is connected to a negative logic output terminal, and an inverted output signal outB1 is output from the negative logic output terminal.
(動作1)
次に、このインバータ回路950の動作を説明する。図38は、インバータ回路950に入力および出力される信号の時間的な変化の一例を示す図である。同図を参照して、期間1では、制御信号ctrl1が「H」となる。これにより、NチャネルMOSトランジスタNT3がオンとなり、PチャネルMOSトランジスタPT1,PT2がオフとなる。期間1では、入力信号in1を「H」とし、反転入力信号inB1を「L」とする。これにより、NチャネルMOSトランジスタNT1がオン、NチャネルMOSトランジスタNT2がオフとなる。NチャネルMOSトランジスタNT3,NT1がオンにより、出力信号out1は「L」となる。また、出力信号out1(=「L」)がPチャネルMOSトランジスタPT3のゲートに入力されることによって、PチャネルMOSトランジスタPT3がオンとなり、反転出力信号outB1は「H」となる。
(Operation 1)
Next, the operation of the
次に、期間2では、制御信号ctrl1が「L」となる。これにより、NチャネルMOSトランジスタNT3がオフとなり、PチャネルMOSトランジスタPT1,PT2がオンとなる。期間2の途中で、入力信号in1が「L」に変化し、反転入力信号inB1が「H」に変化し、それにより、NチャネルMOSトランジスタNT1がオフに変化し、NチャネルMOSトランジスタNT2がオンに変化する。しかし、NチャネルMOSトランジスタNT1、NT2のオン/オフ状態に係らず、NチャネルMOSトランジスタNT3がオフ、およびPチャネルMOSトランジスタPT1,PT2がオンによって、出力信号out1および反転出力信号outB1のいずれもが「H」となる。したがって、出力信号out1は、期間2では常に「H」となる。
Next, in the
次に、期間3では、制御信号ctrl1が「H」となる。これにより、NチャネルMOSトランジスタNT3がオンとなり、PチャネルMOSトランジスタPT1,PT2がオフとなる。また、NチャネルMOSトランジスタNT1はオフであり、NチャネルMOSトランジスタNT2はオンである。NチャネルMOSトランジスタNT3,NT2がオンにより、反転出力信号outB1は「L」となる。また、反転出力信号outB1(=「L」)がPチャネルMOSトランジスタPT4のゲートに入力されることによって、PチャネルMOSトランジスタPT4がオンとなり、出力信号out1は「H」となる。
Next, in the
(動作2)
図39は、インバータ回路950に入力および出力される信号の時間的な変化の別の例を示す図である。同図を参照して、期間1では、制御信号ctrl1が「H」となる。これにより、NチャネルMOSトランジスタNT3がオンとなり、PチャネルMOSトランジスタPT1,PT2がオフとなる。期間1では、入力信号in1を「L」とし、反転入力信号inB1を「H」とする。これにより、NチャネルMOSトランジスタNT1がオフ、NチャネルMOSトランジスタNT2がオンとなる。NチャネルMOSトランジスタNT3,NT2がオンにより、反転出力信号outB1は「L」となる。また、反転出力信号outB1(=「L」)がPチャネルMOSトランジスタPT4のゲートに入力されることによって、PチャネルMOSトランジスタPT4がオンとなり、出力信号out1は「H」となる。
(Operation 2)
FIG. 39 is a diagram illustrating another example of a temporal change in a signal input to and output from the
次に、期間2では、制御信号ctrl1が「L」となる。これにより、NチャネルMOSトランジスタNT3がオフとなり、PチャネルMOSトランジスタPT1,PT2がオンとなる。期間2の途中では、入力信号in1が「H」に変化し、反転入力信号inB1が「L」に変化し、それにより、NチャネルMOSトランジスタNT1がオンに変化し、NチャネルMOSトランジスタNT2がオフに変化する。しかし、NチャネルMOSトランジスタNT1、NT2のオン/オフ状態に係らず、NチャネルMOSトランジスタNT3がオフ、およびPチャネルMOSトランジスタPT1,PT2がオンによって、出力信号out1および反転出力信号outB1のいずれもが「H」となる。したがって、出力信号out1は、期間2では常に「H」となる。
Next, in the
次に、期間3では、制御信号ctrl1が「H」となる。これにより、NチャネルMOSトランジスタNT3がオンとなり、PチャネルMOSトランジスタPT1,PT2がオフとなる。また、NチャネルMOSトランジスタNT1はオンであり、NチャネルMOSトランジスタNT2はオフである。NチャネルMOSトランジスタNT3,NT1がオンにより、出力信号out1は「L」となる。また、出力信号out1(=「L」)がPチャネルMOSトランジスタPT3のゲートに入力されることによって、PチャネルMOSトランジスタPT3がオンとなり、反転出力信号outB1は「H」となる。
Next, in the
図40は、インバータ回路950の入出力関係をまとめた図である。同図を参照して、制御信号ctrl1が非活性化、つまり「1」(=「H」)となる期間1および期間3では、出力信号out1および反転出力信号outB1のいずれかが「1」(=「H」)となり、他方が「0」(=「L」)となる。また、制御信号ctrl1が活性化、つまり「0」(=「L」)となる期間2では、出力信号out1および反転出力信号outB1のいずれもが「1」(=「H」)となる。
FIG. 40 is a diagram summarizing the input / output relationships of the
以上のように、本実施の形態に係るインバータ回路によれば、期間2において入力信号in1および反転出力信号inB1がどのように変化したかに係らず、期間1で出力信号out1と反転出力信号outB1のうちの「L」レベルにある一方が期間2において「H」に変化し(充電)、さらに期間3において他方が「L」に変化する(放電)ので、入力信号の変化の相違によって、消費電力が変化しないようにすることができる。それゆえ、電力解析によって暗号処理に用いられる鍵などの秘匿データの傍受を防止することができる。
As described above, according to the inverter circuit of the present embodiment, the output signal out1 and the inverted output signal outB1 in the
[第10の実施形態]
本実施の形態は、入力信号の変化の相違によって消費電力が変化しない、論理回路の一種であるNAND回路に関する。
[Tenth embodiment]
The present embodiment relates to a NAND circuit which is a kind of logic circuit in which power consumption does not change due to a difference in change of input signals.
(NAND回路の構成)
図41は、第10の実施形態に係るNAND回路の構成を示す。同図を参照して、このNAND回路951は、PチャネルMOSトランジスタPT1,PT2,PT3,PT4と、NチャネルMOSトランジスタNT1,NT2,NT3,NT4,NT5,NT6とを含む。
(Configuration of NAND circuit)
FIG. 41 shows the configuration of the NAND circuit according to the tenth embodiment. Referring to FIG. 8,
PチャネルMOSトランジスタPT1は、そのソースが電源に接続され、そのドレインがノードN1に接続し、そのゲートには制御信号ctrl1が入力される。 P-channel MOS transistor PT1 has a source connected to the power supply, a drain connected to node N1, and a gate to which control signal ctrl1 is input.
PチャネルMOSトランジスタPT2は、そのソースが電源に接続され、そのドレインがノードN2に接続し、そのゲートには制御信号ctrl1が入力される。 P-channel MOS transistor PT2 has its source connected to the power supply, its drain connected to node N2, and its gate receiving control signal ctrl1.
PチャネルMOSトランジスタPT3は、そのソースが電源に接続され、そのドレインがPチャネルMOSトランジスタPT4のゲートおよびノードN2に接続され、そのゲートがPチャネルMOSトランジスタPT4のドレインおよびノードN1に接続される。 P channel MOS transistor PT3 has its source connected to the power supply, its drain connected to the gate of P channel MOS transistor PT4 and node N2, and its gate connected to the drain of P channel MOS transistor PT4 and node N1.
PチャネルMOSトランジスタPT4は、そのソースが電源に接続され、そのドレインがPチャネルMOSトランジスタPT3のゲートおよびノードN1に接続され、そのゲートがPチャネルMOSトランジスタPT3のドレインおよびノードN2に接続される。 P channel MOS transistor PT4 has its source connected to the power supply, its drain connected to the gate of P channel MOS transistor PT3 and node N1, and its gate connected to the drain of P channel MOS transistor PT3 and node N2.
NチャネルMOSトランジスタNT5は、そのソースが接地され、そのドレインがノードN3に接続され、そのゲートには制御信号ctrl1が入力される。 N-channel MOS transistor NT5 has a source grounded, a drain connected to node N3, and a control signal ctrl1 input to the gate.
NチャネルMOSトランジスタNT1は、そのソースがノードN4に接続され、そのドレインがノードN1に接続され、そのゲートには入力信号in1が入力される。 N channel MOS transistor NT1 has its source connected to node N4, its drain connected to node N1, and its gate receiving input signal in1.
NチャネルMOSトランジスタNT6は、そのソースがノードN5に接続され、そのドレインがノードN2に接続され、そのゲートには電源が入力される。 N channel MOS transistor NT6 has its source connected to node N5, its drain connected to node N2, and its gate supplied with power.
NチャネルMOSトランジスタNT7は、そのソースがノードN3に接続され、そのドレインがノードN4に接続され、そのゲートは接地される。 N channel MOS transistor NT7 has its source connected to node N3, its drain connected to node N4, and its gate grounded.
NチャネルMOSトランジスタNT2は、そのソースがノードN3に接続され、そのドレインがノードN4に接続され、そのゲートには入力信号in2が入力される。 N channel MOS transistor NT2 has its source connected to node N3, its drain connected to node N4, and its gate receiving input signal in2.
NチャネルMOSトランジスタNT3は、そのソースがノードN3に接続され、そのドレインがノードN5に接続され、そのゲートには反転入力信号inB1が入力される。 N-channel MOS transistor NT3 has its source connected to node N3, its drain connected to node N5, and its gate receiving inverted input signal inB1.
NチャネルMOSトランジスタNT4は、そのソースがノードN3に接続され、そのドレインがノードN5に接続され、そのゲートには反転入力信号inB2が入力される。 N-channel MOS transistor NT4 has its source connected to node N3, its drain connected to node N5, and its gate receiving inverted input signal inB2.
PチャネルMOSトランジスタPT1,PT2、およびNチャネルMOSトランジスタNT5は、第1群に属し、制御信号ctrl1の活性化、つまり「L」になると、ノードN1およびN2を「H」にする。 P-channel MOS transistors PT1, PT2 and N-channel MOS transistor NT5 belong to the first group, and when control signal ctrl1 is activated, that is, “L”, nodes N1 and N2 are set to “H”.
NチャネルMOSトランジスタNT1,NT7,NT2は、第2群に属し、制御信号ctrl1が非活性、つまり「H」のときに、入力信号in1,in2が「H」になると、ノードN1を「L」にする。 N-channel MOS transistors NT1, NT7, NT2 belong to the second group, and when input signal in1, in2 becomes “H” when control signal ctrl1 is inactive, that is, “H”, node N1 is set to “L”. To.
NチャネルMOSトランジスタNT6,NT3,NT4は、第3群に属し、制御信号ctrl1が非活性、つまり「H」のときに、反転入力信号inB1またはinB2が「H」になると、ノードN2を「L」にする。 N-channel MOS transistors NT6, NT3 and NT4 belong to the third group. When the inverted input signal inB1 or inB2 becomes “H” when the control signal ctrl1 is inactive, that is, “H”, the node N2 becomes “L”. "
ノードN1は、正論理の出力端子と接続され、正論理の出力端子から、出力信号out1が出力される。ノードN2は、負論理の出力端子と接続され、負論理の出力端子から反転出力信号outB1が出力される。 The node N1 is connected to a positive logic output terminal, and an output signal out1 is output from the positive logic output terminal. The node N2 is connected to a negative logic output terminal, and an inverted output signal outB1 is output from the negative logic output terminal.
(動作)
次に、このNAND回路951に入力される信号と出力される信号の関係を説明する。図42は、NAND回路951の入出力関係をまとめた図である。同図の期間1、期間2、期間3は、第9の実施形態と同様に、この順序で変化し、入力信号in1,in2、および反転入力信号inB1,inB2のレベルが変化するのは、期間2に限定される。
(Operation)
Next, the relationship between the signal input to the
同図を参照して、期間1および期間3では、制御信号ctrl1が「H」となる。これにより、NチャネルMOSトランジスタNT5がオン、PチャネルMOSトランジスタPT1,PT2がオフとなる。
Referring to FIG. 8, in
期間1および期間3で、入力信号in1が「H」、入力信号in2が「H」、反転入力信号inB1が「L」、かつ反転入力信号inB2が「L」のとき、NチャネルMOSトランジスタNT1がオン、NチャネルMOSトランジスタNT2がオン、NチャネルMOSトランジスタNT3がオフ、かつNチャネルMOSトランジスタNT4がオフとなる。
In
NチャネルMOSトランジスタNT1,NT2,NT5がオンにより、出力信号out1は、「L」となる。また、NチャネルMOSトランジスタNT3,NT4がオフであり、出力信号out1(=「L」)がPチャネルMOSトランジスタPT3のゲートに入力されることによって、PチャネルMOSトランジスタPT3がオンとなり、反転出力信号outB1は「H」となる。 When N channel MOS transistors NT1, NT2 and NT5 are turned on, output signal out1 becomes "L". Further, the N-channel MOS transistors NT3 and NT4 are off, and the output signal out1 (= “L”) is input to the gate of the P-channel MOS transistor PT3, whereby the P-channel MOS transistor PT3 is turned on and the inverted output signal outB1 becomes “H”.
期間1および期間3で、入力信号in1が「H」、入力信号in2が「H」、反転入力信号inB1が「L」、かつ反転入力信号inB2が「L」以外のときには、NチャネルMOSトランジスタNT1とNT2の一方がオンとなり、他方がオフとなる。また、NチャネルMOSトランジスタNT3とNT4の一方がオンとなり、他方がオフとなる。NチャネルMOSトランジスタNT5と、NT3またはNT4とがオンにより、反転出力信号outB1は「L」となる。また、NチャネルMOSトランジスタNT1またはNT2がオフであり、反転出力信号outB1(=「L」)がPチャネルMOSトランジスタPT4のゲートに入力されることによって、PチャネルMOSトランジスタPT4がオンとなり、出力信号out1は「H」となる。
In
一方、期間2では、制御信号ctrl1が「L」となる。これにより、NチャネルMOSトランジスタNT5がオフ、PチャネルMOSトランジスタPT1,PT2がオンとなる。
On the other hand, in the
このときには、入力信号in1,in2、および反転入力信号inB1,inB2のレベルに係らず、出力信号out1および反転出力信号outB1は、いずれも「H」となる。したがって、第9の実施形態のインバータ回路と同様に、期間2において、入力信号in1,in2、反転出力信号inB1,inB2のレベルを変化させることができる。
At this time, the output signal out1 and the inverted output signal outB1 are both “H” regardless of the levels of the input signals in1 and in2 and the inverted input signals inB1 and inB2. Therefore, similarly to the inverter circuit of the ninth embodiment, the levels of the input signals in1, in2 and the inverted output signals inB1, inB2 can be changed in the
以上のように、本実施の形態に係るNAND回路によれば、期間2において、入力信号in1,in2、反転入力信号inB1,inB2がどのように変化したかに係らず、期間1で出力信号out1と反転出力信号outB1のうちの「L」レベルにある方が期間2において「H」に変化し(充電)、さらに期間3において出力信号out1と反転出力信号outB1のうちのいずれかが「L」に変化する(放電)ので、入力信号の変化の相違によって消費電力が変化しないようにすることができる。それゆえ、電力解析によって暗号処理に用いられる鍵などの秘匿データの傍受を防止することができる。
As described above, according to the NAND circuit according to the present embodiment, the output signal out1 in the
[第11の実施形態]
本実施の形態は、入力信号の変化の相違によって消費電力が変化しない、論理回路の一種である加算回路に関する。
[Eleventh embodiment]
The present embodiment relates to an adder circuit, which is a kind of logic circuit, in which power consumption does not change due to a difference in change of input signals.
(加算回路の構成)
図43は、第11の実施形態に係る加算回路の構成を示す図である。同図を参照して、この加算回路は、PチャネルMOSトランジスタPT1〜PT8と、NチャネルMOSトランジスタNT1〜NT32とを備える。
(Configuration of addition circuit)
FIG. 43 is a diagram showing the configuration of the adder circuit according to the eleventh embodiment. Referring to FIG. 6, this adder circuit includes P channel MOS transistors PT1 to PT8 and N channel MOS transistors NT1 to NT32.
PチャネルMOSトランジスタPT1は、そのソースが電源に接続され、そのドレインがノードN1に接続し、そのゲートには制御信号ctrl1が入力される。 P-channel MOS transistor PT1 has a source connected to the power supply, a drain connected to node N1, and a gate to which control signal ctrl1 is input.
PチャネルMOSトランジスタPT2は、そのソースが電源に接続され、そのドレインがノードN2に接続し、そのゲートには制御信号ctrl1が入力される。 P-channel MOS transistor PT2 has its source connected to the power supply, its drain connected to node N2, and its gate receiving control signal ctrl1.
PチャネルMOSトランジスタPT3は、そのソースが電源に接続され、そのドレインがPチャネルMOSトランジスタPT4のゲートおよびノードN2に接続され、そのゲートがPチャネルMOSトランジスタPT4のドレインおよびノードN1に接続される。 P channel MOS transistor PT3 has its source connected to the power supply, its drain connected to the gate of P channel MOS transistor PT4 and node N2, and its gate connected to the drain of P channel MOS transistor PT4 and node N1.
PチャネルMOSトランジスタPT4は、そのソースが電源に接続され、そのドレインがPチャネルMOSトランジスタPT3のゲートおよびノードN1に接続され、そのゲートがPチャネルMOSトランジスタPT3のドレインおよびノードN2に接続される。 P channel MOS transistor PT4 has its source connected to the power supply, its drain connected to the gate of P channel MOS transistor PT3 and node N1, and its gate connected to the drain of P channel MOS transistor PT3 and node N2.
NチャネルMOSトランジスタNT21は、そのソースが接地され、そのドレインがノードN3に接続され、そのゲートには制御信号ctrl1が入力される。 N-channel MOS transistor NT21 has a source grounded, a drain connected to node N3, and a control signal ctrl1 input to the gate.
NチャネルMOSトランジスタNT1は、そのソースがノードN4に接続され、そのドレインがノードN1に接続され、そのゲートには反転キャリー入力信号cinB1が入力される。 N channel MOS transistor NT1 has its source connected to node N4, its drain connected to node N1, and its gate receiving inverted carry input signal cinB1.
NチャネルMOSトランジスタNT2は、そのソースがノードN5に接続され、そのドレインがノードN1に接続され、そのゲートにはキャリー入力信号cin1が入力される。 N channel MOS transistor NT2 has its source connected to node N5, its drain connected to node N1, and its gate receiving carry input signal cin1.
NチャネルMOSトランジスタNT11は、そのソースがノードN6に接続され、そのドレインがノードN2に接続され、そのゲートには反転キャリー入力信号cinB1が入力される。 N channel MOS transistor NT11 has its source connected to node N6, its drain connected to node N2, and its gate receiving inverted carry input signal cinB1.
NチャネルMOSトランジスタNT12は、そのソースがノードN7に接続され、そのドレインがノードN2に接続され、そのゲートにはキャリー入力信号cin1が入力される。 N channel MOS transistor NT12 has its source connected to node N7, its drain connected to node N2, and its gate receiving carry input signal cin1.
ノードN4とノードN3との間には、直列に接続されたNチャネルMOSトランジスタNT3およびNT4と、直列に接続されたNチャネルMOSトランジスタNT5およびNT6とが設けられる。NチャネルMOSトランジスタNT3のゲートには、入力信号in1が入力され、NチャネルMOSトランジスタNT4のゲートには、入力信号in2が入力され、NチャネルMOSトランジスタNT5のゲートには、反転入力信号inB1が入力され、NチャネルMOSトランジスタNT6のゲートには、反転入力信号inB2が入力される。 Between node N4 and node N3, N-channel MOS transistors NT3 and NT4 connected in series and N-channel MOS transistors NT5 and NT6 connected in series are provided. Input signal in1 is input to the gate of N channel MOS transistor NT3, input signal in2 is input to the gate of N channel MOS transistor NT4, and inverted input signal inB1 is input to the gate of N channel MOS transistor NT5. The inverted input signal inB2 is input to the gate of the N-channel MOS transistor NT6.
ノードN5とノードN3との間には、直列に接続されたNチャネルMOSトランジスタNT7およびNT8と、直列に接続されたNチャネルMOSトランジスタNT9およびNT10とが設けられる。NチャネルMOSトランジスタNT7のゲートには、入力信号in1が入力され、NチャネルMOSトランジスタNT8のゲートには、反転入力信号inB2が入力され、NチャネルMOSトランジスタNT9のゲートには、反転入力信号inB1が入力され、NチャネルMOSトランジスタNT10のゲートには、入力信号in2が入力される。 Between node N5 and node N3, N-channel MOS transistors NT7 and NT8 connected in series and N-channel MOS transistors NT9 and NT10 connected in series are provided. Input signal in1 is input to the gate of N channel MOS transistor NT7, inverted input signal inB2 is input to the gate of N channel MOS transistor NT8, and inverted input signal inB1 is input to the gate of N channel MOS transistor NT9. The input signal in2 is input to the gate of the N-channel MOS transistor NT10.
ノードN6とノードN3との間には、直列に接続されたNチャネルMOSトランジスタNT13およびNT14と、直列に接続されたNチャネルMOSトランジスタNT15およびNT16とが設けられる。NチャネルMOSトランジスタNT13のゲートには、入力信号in1が入力され、NチャネルMOSトランジスタNT14のゲートには、反転入力信号inB2が入力され、NチャネルMOSトランジスタNT15のゲートには、反転入力信号inB1が入力され、NチャネルMOSトランジスタNT16のゲートには、入力信号in2が入力される。 Between node N6 and node N3, N-channel MOS transistors NT13 and NT14 connected in series and N-channel MOS transistors NT15 and NT16 connected in series are provided. An input signal in1 is input to the gate of N channel MOS transistor NT13, an inverted input signal inB2 is input to the gate of N channel MOS transistor NT14, and an inverted input signal inB1 is input to the gate of N channel MOS transistor NT15. The input signal in2 is input to the gate of the N channel MOS transistor NT16.
ノードN7とノードN3との間には、直列に接続されたNチャネルMOSトランジスタNT17およびNT18と、直列に接続されたNチャネルMOSトランジスタNT19およびNT20とが設けられる。NチャネルMOSトランジスタNT17のゲートには、入力信号in1が入力され、NチャネルMOSトランジスタNT18のゲートには、入力信号in2が入力され、NチャネルMOSトランジスタNT19のゲートには、反転入力信号inB1が入力され、NチャネルMOSトランジスタNT20のゲートには、反転入力信号inB2が入力される。 Between node N7 and node N3, N-channel MOS transistors NT17 and NT18 connected in series and N-channel MOS transistors NT19 and NT20 connected in series are provided. The input signal in1 is input to the gate of the N channel MOS transistor NT17, the input signal in2 is input to the gate of the N channel MOS transistor NT18, and the inverted input signal inB1 is input to the gate of the N channel MOS transistor NT19. The inverted input signal inB2 is input to the gate of the N channel MOS transistor NT20.
PチャネルMOSトランジスタPT5は、そのソースが電源に接続され、そのドレインがノードN8に接続し、そのゲートには制御信号ctrl1が入力される。 P channel MOS transistor PT5 has its source connected to the power supply, its drain connected to node N8, and its gate to which control signal ctrl1 is input.
PチャネルMOSトランジスタPT6は、そのソースが電源に接続され、そのドレインがノードN9に接続し、そのゲートには制御信号ctrl1が入力される。 P channel MOS transistor PT6 has its source connected to the power supply, its drain connected to node N9, and its gate receiving control signal ctrl1.
PチャネルMOSトランジスタPT7は、そのソースが電源に接続され、そのドレインがPチャネルMOSトランジスタPT8のゲートおよびノードN9に接続され、そのゲートがPチャネルMOSトランジスタPT8のドレインおよびノードN8に接続される。 P channel MOS transistor PT7 has its source connected to the power supply, its drain connected to the gate of P channel MOS transistor PT8 and node N9, and its gate connected to the drain of P channel MOS transistor PT8 and node N8.
PチャネルMOSトランジスタPT8は、そのソースが電源に接続され、そのドレインがPチャネルMOSトランジスタPT7のゲートおよびノードN8に接続され、そのゲートがPチャネルMOSトランジスタPT7のドレインおよびノードN9に接続される。 P channel MOS transistor PT8 has its source connected to the power supply, its drain connected to the gate of P channel MOS transistor PT7 and node N8, and its gate connected to the drain of P channel MOS transistor PT7 and node N9.
NチャネルMOSトランジスタNT32は、そのソースが接地され、そのドレインがノードN10に接続され、そのゲートには制御信号ctrl1が入力される。 N-channel MOS transistor NT32 has a source grounded, a drain connected to node N10, and a gate to which control signal ctrl1 is input.
NチャネルMOSトランジスタNT22は、そのソースがノードN11に接続され、そのドレインがノードN8に接続され、そのゲートには反転キャリー入力信号cinB1が入力される。 N channel MOS transistor NT22 has a source connected to node N11, a drain connected to node N8, and an inverted carry input signal cinB1 input to the gate.
NチャネルMOSトランジスタNT27は、そのソースがノードN12に接続され、そのドレインがノードN9に接続され、そのゲートにはキャリー入力信号cin1が入力される。 N-channel MOS transistor NT27 has a source connected to node N12, a drain connected to node N9, and a gate to which carry input signal cin1 is input.
ノードN11とノードN10との間には、並列接続されたNチャネルMOSトランジスタNT23と、NチャネルMOSトランジスタNT24とが設けられる。NチャネルMOSトランジスタNT23のゲートには、反転入力信号inB1が入力され、NチャネルMOSトランジスタNT24のゲートには、反転入力信号inB2が入力される。 N-channel MOS transistor NT23 and N-channel MOS transistor NT24 connected in parallel are provided between nodes N11 and N10. The inverted input signal inB1 is input to the gate of the N-channel MOS transistor NT23, and the inverted input signal inB2 is input to the gate of the N-channel MOS transistor NT24.
ノードN12とノードN10との間には、並列接続されたNチャネルMOSトランジスタNT28と、NチャネルMOSトランジスタNT29とが設けられる。NチャネルMOSトランジスタNT28のゲートには、入力信号in1が入力され、NチャネルMOSトランジスタNT29のゲートには、入力信号in2が入力される。 N-channel MOS transistor NT28 and N-channel MOS transistor NT29 connected in parallel are provided between nodes N12 and N10. Input signal in1 is input to the gate of N channel MOS transistor NT28, and input signal in2 is input to the gate of N channel MOS transistor NT29.
ノードN8とノードN10との間には、直列接続されたNチャネルMOSトランジスタNT25と、NチャネルMOSトランジスタNT26とが設けられる。NチャネルMOSトランジスタNT25のゲートには、反転入力信号inB1が入力され、NチャネルMOSトランジスタNT26のゲートには、反転入力信号inB2が入力される。 An N channel MOS transistor NT25 and an N channel MOS transistor NT26 connected in series are provided between node N8 and node N10. An inverted input signal inB1 is input to the gate of N channel MOS transistor NT25, and an inverted input signal inB2 is input to the gate of N channel MOS transistor NT26.
ノードN9とノードN10との間には、直列接続されたNチャネルMOSトランジスタNT30と、NチャネルMOSトランジスタNT31とが設けられる。NチャネルMOSトランジスタNT30のゲートには、入力信号in1が入力され、NチャネルMOSトランジスタNT31のゲートには、入力信号in2が入力される。 Between node N9 and node N10, an N channel MOS transistor NT30 and an N channel MOS transistor NT31 connected in series are provided. Input signal in1 is input to the gate of N channel MOS transistor NT30, and input signal in2 is input to the gate of N channel MOS transistor NT31.
PチャネルMOSトランジスタPT1,PT2、およびNチャネルMOSトランジスタNT21は、第1群に属し、制御信号ctrl1の活性化、つまり「L」になると、ノードN1およびN2を「H」にする。 P-channel MOS transistors PT1, PT2 and N-channel MOS transistor NT21 belong to the first group, and when control signal ctrl1 is activated, that is, “L”, nodes N1 and N2 are set to “H”.
NチャネルMOSトランジスタNT1〜NT10は、第2群に属し、制御信号ctrl1が非活性、つまり「H」のときに、入力信号in1,in2、反転入力信号inB1,inB2、キャリー入力信号cin1、反転キャリー入力信号cinB1が所定のレベルになると、ノードN1を「L」にする。 N-channel MOS transistors NT1 to NT10 belong to the second group, and when control signal ctrl1 is inactive, that is, “H”, input signals in1, in2, inverted input signals inB1, inB2, carry input signal cin1, inverted carry When the input signal cinB1 becomes a predetermined level, the node N1 is set to “L”.
NチャネルMOSトランジスタNT2は、第3群に属し、制御信号ctrl1が非活性、つまり「H」のときに、入力信号in1,in2、反転入力信号inB1,inB2、キャリー入力信号cin1、反転キャリー入力信号cinB1が所定のレベルになると、ノードN1を「L」にする。 N-channel MOS transistor NT2 belongs to the third group, and when control signal ctrl1 is inactive, that is, “H”, input signals in1, in2, inverted input signals inB1, inB2, carry input signal cin1, inverted carry input signal When cinB1 reaches a predetermined level, the node N1 is set to “L”.
PチャネルMOSトランジスタPT5,PT6、およびNチャネルMOSトランジスタNT32は、第1´群に属し、制御信号ctrl1の活性化、つまり「L」になると、ノードN8およびN9を「H」にする。 P-channel MOS transistors PT5 and PT6 and N-channel MOS transistor NT32 belong to the first ′ group, and when control signal ctrl1 is activated, that is, “L”, nodes N8 and N9 are set to “H”.
NチャネルMOSトランジスタNT22〜NT26は、第2´群に属し、制御信号ctrl1が非活性、つまり「H」のときに、反転入力信号inB1,inB2、および反転キャリー入力信号cinB1が所定のレベルになると、ノードN8を「L」にする。 N-channel MOS transistors NT22 to NT26 belong to the second 'group. When control signal ctrl1 is inactive, that is, "H", inverted input signals inB1 and inB2 and inverted carry input signal cinB1 are at a predetermined level. Node N8 is set to “L”.
NチャネルMOSトランジスタNT2は、第3´群に属し、制御信号ctrl1が非活性、つまり「H」のときに、入力信号in1,in2、およびキャリー入力信号cin1が所定のレベルになると、ノードN9を「L」にする。 The N-channel MOS transistor NT2 belongs to the third group, and when the control signal ctrl1 is inactive, that is, “H”, when the input signals in1 and in2 and the carry input signal cin1 become a predetermined level, the node N9 is Set to “L”.
ノードN1は、正論理の出力端子と接続され、正論理の出力端子から、出力信号out1が出力される。ノードN2は、負論理の出力端子と接続され、負論理の出力端子から反転出力信号outB1が出力される。また、ノードN8は、正論理のキャリー出力端子と接続され、正論理のキャリー出力端子から、キャリー出力信号cout1が出力される。ノードN9は、負論理のキャリー出力端子と接続され、負論理のキャリー出力端子から反転キャリー出力信号coutB1が出力される。 The node N1 is connected to a positive logic output terminal, and an output signal out1 is output from the positive logic output terminal. The node N2 is connected to a negative logic output terminal, and an inverted output signal outB1 is output from the negative logic output terminal. The node N8 is connected to a positive logic carry output terminal, and a carry output signal cout1 is output from the positive logic carry output terminal. The node N9 is connected to a negative logic carry output terminal, and an inverted carry output signal coutB1 is output from the negative logic carry output terminal.
(動作)
次に、この加算回路952に入力される信号と出力される信号の関係を説明する。図44は、加算回路952の入出力関係をまとめた図である。同図の期間1、期間2、期間3は、第9の実施形態と同様に、この順序で変化し、入力信号in1,in2、反転入力信号inB1,inB2、キャリー入力信号cin1、および反転キャリー入力信号cinB1のレベルが変化するのは、期間2に限定される。
(Operation)
Next, the relationship between the signal input to the
同図を参照して、期間1および期間3では、制御信号ctrl1が「H」となる。これにより、NチャネルMOSトランジスタNT21がオン、PチャネルMOSトランジスタPT1,PT2がオフとなる。また、NチャネルMOSトランジスタNT32がオン、PチャネルMOSトランジスタPT5,PT6がオフとなる。
Referring to FIG. 8, in
期間1および期間3の信号のレベルは、以下のようになる。
The signal levels in
(1) キャリー入力信号cin1が「L」、反転キャリー入力信号cinB1が「H」、入力信号in1が「L」、反転入力信号inB1が「H」、入力信号in2が「L」、かつ反転入力信号inB2が「H」のときに、NチャネルMOSトランジスタNT1,NT5,NT6がオンとなり、出力信号out1は「L」となる。 (1) Carry input signal cin1 is “L”, inverted carry input signal cinB1 is “H”, input signal in1 is “L”, inverted input signal inB1 is “H”, input signal in2 is “L”, and inverted input When the signal inB2 is “H”, the N-channel MOS transistors NT1, NT5, NT6 are turned on, and the output signal out1 is “L”.
また、NチャネルMOSトランジスタNT12,NT13,NT16,NT17,NT18がオフであり、出力信号out1(=「L」)がPチャネルMOSトランジスタPT3のゲートに入力されることによって、PチャネルMOSトランジスタPT3がオンとなり、反転出力信号outB1は「H」となる。 Further, N channel MOS transistors NT12, NT13, NT16, NT17, NT18 are off, and output signal out1 (= “L”) is input to the gate of P channel MOS transistor PT3, so that P channel MOS transistor PT3 The inverted output signal outB1 becomes “H”.
また、このときに、NチャネルMOSトランジスタNT22,NT23,NT24,NT25,NT26がオンとなり、キャリー出力信号cout1は「L」となる。 At this time, the N-channel MOS transistors NT22, NT23, NT24, NT25, NT26 are turned on, and the carry output signal cout1 becomes “L”.
また、NチャネルMOSトランジスタNT27,NT28,NT29,NT30,NT31がオフであり、キャリー出力信号cout1(=「L」)がPチャネルMOSトランジスタPT7のゲートに入力されることによって、PチャネルMOSトランジスタPT7がオンとなり、反転キャリー出力信号coutB1は「H」となる。 Further, N channel MOS transistors NT27, NT28, NT29, NT30, NT31 are off, and carry output signal cout1 (= “L”) is input to the gate of P channel MOS transistor PT7, thereby causing P channel MOS transistor PT7. Is turned on, and the inverted carry output signal coutB1 becomes “H”.
(2) キャリー入力信号cin1が「L」、反転キャリー入力信号cinB1が「H」、入力信号in1が「L」、反転入力信号inB1が「H」、入力信号in2が「H」、かつ反転入力信号inB2が「L」のときに、NチャネルMOSトランジスタNT11,NT15,NT16がオンとなり、反転出力信号outB1は「L」となる。 (2) Carry input signal cin1 is “L”, inverted carry input signal cinB1 is “H”, input signal in1 is “L”, inverted input signal inB1 is “H”, input signal in2 is “H”, and inverted input When the signal inB2 is “L”, the N-channel MOS transistors NT11, NT15, NT16 are turned on, and the inverted output signal outB1 is “L”.
また、NチャネルMOSトランジスタNT2,NT3,NT6,NT7,NT8がオフであり、出力信号outB1(=「L」)がPチャネルMOSトランジスタPT4のゲートに入力されることによって、PチャネルMOSトランジスタPT4がオンとなり、出力信号out1は「H」となる。 N channel MOS transistors NT2, NT3, NT6, NT7, NT8 are off, and output signal outB1 (= “L”) is input to the gate of P channel MOS transistor PT4, so that P channel MOS transistor PT4 becomes The output signal out1 becomes “H”.
また、このときに、NチャネルMOSトランジスタNT22,NT23がオンとなり、キャリー出力信号cout1は「L」となる。 At this time, the N-channel MOS transistors NT22 and NT23 are turned on, and the carry output signal cout1 becomes “L”.
また、NチャネルMOSトランジスタNT27,NT28,NT30がオフであり、キャリー出力信号cout1(=「L」)がPチャネルMOSトランジスタPT7のゲートに入力されることによって、PチャネルMOSトランジスタPT7がオンとなり、反転キャリー出力信号coutB1は「H」となる。 Further, N channel MOS transistors NT27, NT28, NT30 are off, and carry output signal cout1 (= “L”) is input to the gate of P channel MOS transistor PT7, whereby P channel MOS transistor PT7 is turned on, The inverted carry output signal coutB1 becomes “H”.
(3) キャリー入力信号cin1が「L」、反転キャリー入力信号cinB1が「H」、入力信号in1が「H」、反転入力信号inB1が「L」、入力信号in2が「L」、かつ反転入力信号inB2が「H」のときに、NチャネルMOSトランジスタNT11,NT13,NT14がオンとなり、反転出力信号outB1は「L」となる。 (3) Carry input signal cin1 is “L”, inverted carry input signal cinB1 is “H”, input signal in1 is “H”, inverted input signal inB1 is “L”, input signal in2 is “L”, and inverted input When the signal inB2 is “H”, the N-channel MOS transistors NT11, NT13, NT14 are turned on, and the inverted output signal outB1 is “L”.
また、NチャネルMOSトランジスタNT2,NT4,NT5,NT9,NT10がオフであり、出力信号outB1(=「L」)がPチャネルMOSトランジスタPT4のゲートに入力されることによって、PチャネルMOSトランジスタPT4がオンとなり、出力信号out1は「H」となる。 N channel MOS transistors NT2, NT4, NT5, NT9, NT10 are off, and output signal outB1 (= “L”) is input to the gate of P channel MOS transistor PT4, so that P channel MOS transistor PT4 becomes The output signal out1 becomes “H”.
また、このときに、NチャネルMOSトランジスタNT22,NT24がオンとなり、キャリー出力信号cout1は「L」となる。 At this time, the N-channel MOS transistors NT22 and NT24 are turned on, and the carry output signal cout1 becomes “L”.
また、NチャネルMOSトランジスタNT27,NT29,NT31がオフであり、キャリー出力信号cout1(=「L」)がPチャネルMOSトランジスタPT7のゲートに入力されることによって、PチャネルMOSトランジスタPT7がオンとなり、反転キャリー出力信号coutB1は「H」となる。 Further, N channel MOS transistors NT27, NT29, NT31 are off, and carry output signal cout1 (= “L”) is input to the gate of P channel MOS transistor PT7, whereby P channel MOS transistor PT7 is turned on, The inverted carry output signal coutB1 becomes “H”.
(4) キャリー入力信号cin1が「L」、反転キャリー入力信号cinB1が「H」、入力信号in1が「H」、反転入力信号inB1が「L」、入力信号in2が「H」、かつ反転入力信号inB2が「L」のときに、NチャネルMOSトランジスタNT1,N35,NT4がオンとなり、出力信号out1は、「L」となる。 (4) Carry input signal cin1 is “L”, inverted carry input signal cinB1 is “H”, input signal in1 is “H”, inverted input signal inB1 is “L”, input signal in2 is “H”, and inverted input When the signal inB2 is “L”, the N-channel MOS transistors NT1, N35, NT4 are turned on, and the output signal out1 is “L”.
また、NチャネルMOSトランジスタNT12,NT14,NT15,NT19,NT20がオフであり、出力信号out1(=「L」)がPチャネルMOSトランジスタPT3のゲートに入力されることによって、PチャネルMOSトランジスタPT3がオンとなり、反転出力信号outB1は「H」となる。 Further, N channel MOS transistors NT12, NT14, NT15, NT19, NT20 are off, and output signal out1 (= “L”) is input to the gate of P channel MOS transistor PT3, so that P channel MOS transistor PT3 becomes The inverted output signal outB1 becomes “H”.
また、このときに、NチャネルMOSトランジスタNT30,NT31がオンとなり、反転キャリー出力信号coutB1は「L」となる。 At this time, the N-channel MOS transistors NT30 and NT31 are turned on, and the inverted carry output signal coutB1 becomes “L”.
また、NチャネルMOSトランジスタNT23,NT24,NT25,NT26がオフであり、キャリー出力信号coutB1(=「L」)がPチャネルMOSトランジスタPT8のゲートに入力されることによって、PチャネルMOSトランジスタPT8がオンとなり、キャリー出力信号cout1は「H」となる。 Further, N channel MOS transistors NT23, NT24, NT25, NT26 are off, and carry output signal coutB1 (= “L”) is input to the gate of P channel MOS transistor PT8, whereby P channel MOS transistor PT8 is turned on. Thus, the carry output signal cout1 becomes “H”.
(5) キャリー入力信号cin1が「H」、反転キャリー入力信号cinB1が「L」、入力信号in1が「L」、反転入力信号inB1が「H」、入力信号in2が「L」、かつ反転入力信号inB2が「H」のときに、NチャネルMOSトランジスタNT12,NT19,NT20がオンとなり、反転出力信号out1は「L」となる。 (5) Carry input signal cin1 is “H”, inverted carry input signal cinB1 is “L”, input signal in1 is “L”, inverted input signal inB1 is “H”, input signal in2 is “L”, and inverted input When the signal inB2 is “H”, the N-channel MOS transistors NT12, NT19, NT20 are turned on, and the inverted output signal out1 is “L”.
また、NチャネルMOSトランジスタNT1,NT3,NT4,NT7,NT10がオフであり、出力信号outB1(=「L」)がPチャネルMOSトランジスタPT4のゲートに入力されることによって、PチャネルMOSトランジスタPT4がオンとなり、出力信号out1は「H」となる。 N channel MOS transistors NT1, NT3, NT4, NT7, NT10 are off, and output signal outB1 (= “L”) is input to the gate of P channel MOS transistor PT4, so that P channel MOS transistor PT4 becomes The output signal out1 becomes “H”.
また、このときに、NチャネルMOSトランジスタNT25,NT26がオンとなり、キャリー出力信号cout1は「L」となる。 At this time, the N-channel MOS transistors NT25 and NT26 are turned on, and the carry output signal cout1 becomes “L”.
また、NチャネルMOSトランジスタNT28,NT29,NT30,NT31がオフであり、キャリー出力信号cout1(=「L」)がPチャネルMOSトランジスタPT7のゲートに入力されることによって、PチャネルMOSトランジスタPT7がオンとなり、反転キャリー出力信号coutB1は「H」となる。 Further, N channel MOS transistors NT28, NT29, NT30, NT31 are off, and carry output signal cout1 (= “L”) is input to the gate of P channel MOS transistor PT7, so that P channel MOS transistor PT7 is turned on. Thus, the inverted carry output signal coutB1 becomes “H”.
(6) キャリー入力信号cin1が「H」、反転キャリー入力信号cinB1が「L」、入力信号in1が「L」、反転入力信号inB1が「H」、入力信号in2が「H」、かつ反転入力信号inB2が「L」のときに、NチャネルMOSトランジスタNT2,NT19,NT10がオンとなり、出力信号outB1は「L」となる。 (6) Carry input signal cin1 is “H”, inverted carry input signal cinB1 is “L”, input signal in1 is “L”, inverted input signal inB1 is “H”, input signal in2 is “H”, and inverted input When the signal inB2 is “L”, the N-channel MOS transistors NT2, NT19, NT10 are turned on, and the output signal outB1 is “L”.
また、NチャネルMOSトランジスタNT11,NT13,NT14,NT17,NT20がオフであり、出力信号out1(=「L」)がPチャネルMOSトランジスタPT3のゲートに入力されることによって、PチャネルMOSトランジスタPT3がオンとなり、反転出力信号outB1は「H」となる。 Further, N channel MOS transistors NT11, NT13, NT14, NT17, NT20 are off, and output signal out1 (= “L”) is input to the gate of P channel MOS transistor PT3, so that P channel MOS transistor PT3 becomes The inverted output signal outB1 becomes “H”.
また、このときに、NチャネルMOSトランジスタNT27,NT29がオンとなり、反転キャリー出力信号coutB1は「L」となる。 At this time, the N-channel MOS transistors NT27 and NT29 are turned on, and the inverted carry output signal coutB1 becomes “L”.
また、NチャネルMOSトランジスタNT22,NT24,NT26がオフであり、キャリー出力信号coutB1(=「L」)がPチャネルMOSトランジスタPT8のゲートに入力されることによって、PチャネルMOSトランジスタPT8がオンとなり、キャリー出力信号cout1は「H」となる。 Further, N channel MOS transistors NT22, NT24, NT26 are off, and carry output signal coutB1 (= “L”) is input to the gate of P channel MOS transistor PT8, whereby P channel MOS transistor PT8 is turned on, Carry output signal cout1 is “H”.
(7) キャリー入力信号cin1が「H」、反転キャリー入力信号cinB1が「L」、入力信号in1が「H」、反転入力信号inB1が「L」、入力信号in2が「L」、かつ反転入力信号inB2が「H」のときに、NチャネルMOSトランジスタNT2,NT7,NT8がオンとなり、出力信号out1は「L」となる。 (7) Carry input signal cin1 is “H”, inverted carry input signal cinB1 is “L”, input signal in1 is “H”, inverted input signal inB1 is “L”, input signal in2 is “L”, and inverted input When the signal inB2 is “H”, the N-channel MOS transistors NT2, NT7, NT8 are turned on, and the output signal out1 is “L”.
また、NチャネルMOSトランジスタNT11,NT15,NT16,NT18,NT19がオフであり、出力信号out1(=「L」)がPチャネルMOSトランジスタPT3のゲートに入力されることによって、PチャネルMOSトランジスタPT3がオンとなり、反転出力信号outB1は「H」となる。 Further, N channel MOS transistors NT11, NT15, NT16, NT18, NT19 are off, and output signal out1 (= “L”) is input to the gate of P channel MOS transistor PT3, so that P channel MOS transistor PT3 becomes The inverted output signal outB1 becomes “H”.
また、このときに、NチャネルMOSトランジスタNT27,NT28がオンとなり、反転キャリー出力信号coutB1は「L」となる。 At this time, the N-channel MOS transistors NT27 and NT28 are turned on, and the inverted carry output signal coutB1 becomes “L”.
また、NチャネルMOSトランジスタNT22,NT23,NT25がオフであり、キャリー出力信号coutB1(=「L」)がPチャネルMOSトランジスタPT8のゲートに入力されることによって、PチャネルMOSトランジスタPT8がオンとなり、キャリー出力信号cout1は「H」となる。 Further, N channel MOS transistors NT22, NT23, NT25 are off, and carry output signal coutB1 (= “L”) is input to the gate of P channel MOS transistor PT8, whereby P channel MOS transistor PT8 is turned on, Carry output signal cout1 is “H”.
(8) キャリー入力信号cin1が「H」、反転キャリー入力信号cinB1が「L」、入力信号in1が「H」、反転入力信号inB1が「L」、入力信号in2が「H」、かつ反転入力信号inB2が「L」のときに、NチャネルMOSトランジスタNT12,N17,NT18がオンとなり、反転出力信号outB1は、「L」となる。 (8) Carry input signal cin1 is “H”, inverted carry input signal cinB1 is “L”, input signal in1 is “H”, inverted input signal inB1 is “L”, input signal in2 is “H”, and inverted input When the signal inB2 is “L”, the N-channel MOS transistors NT12, N17, NT18 are turned on, and the inverted output signal outB1 is “L”.
また、NチャネルMOSトランジスタNT1,NT5,NT6,NT8,NT9がオフであり、出力信号outB1(=「L」)がPチャネルMOSトランジスタPT4のゲートに入力されることによって、PチャネルMOSトランジスタPT4がオンとなり、出力信号out1は「H」となる。 N channel MOS transistors NT1, NT5, NT6, NT8, NT9 are off, and output signal outB1 (= “L”) is input to the gate of P channel MOS transistor PT4, so that P channel MOS transistor PT4 becomes The output signal out1 becomes “H”.
また、このときに、NチャネルMOSトランジスタNT30,NT31がオンとなり、反転キャリー出力信号coutB1は「L」となる。 At this time, the N-channel MOS transistors NT30 and NT31 are turned on, and the inverted carry output signal coutB1 becomes “L”.
また、NチャネルMOSトランジスタNT22,NT23,NT24,NT25,NT26がオフであり、キャリー出力信号coutB1(=「L」)がPチャネルMOSトランジスタPT8のゲートに入力されることによって、PチャネルMOSトランジスタPT8がオンとなり、キャリー出力信号cout1は「H」となる。 Further, N channel MOS transistors NT22, NT23, NT24, NT25, NT26 are off, and carry output signal coutB1 (= “L”) is input to the gate of P channel MOS transistor PT8, thereby causing P channel MOS transistor PT8. Is turned on, and the carry output signal cout1 becomes “H”.
以上のように、制御信号ctrl1が「H」となる期間1および期間3では、キャリー入力信号cin1、反転キャリー入力信号cinB1、入力信号in1、入力信号in2、反転入力信号inB1、および反転入力信号inB2のレベルに応じて、出力信号out1および反転出力信号outB1の一方が「H」で、他方が「L」となり、キャリー出力信号cout1および反転キャリー出力信号coutB1の一方が「H」で、他方が「L」となる。
As described above, in the
一方、期間2では、制御信号ctrl1が「L」となる。これにより、NチャネルMOSトランジスタNT21がオフ、PチャネルMOSトランジスタPT1,PT2がオンとなる。また、NチャネルMOSトランジスタNT32がオフ、PチャネルMOSトランジスタPT5,PT6がオンとなる。
On the other hand, in the
このときには、キャリー入力信号cin1、反転キャリー入力信号cinB1、入力信号in1、入力信号in2、反転入力信号inB1、および反転入力信号inB2のレベルに係らず、出力信号out1および反転出力信号outB1はともに「H」となり、キャリー出力信号cout1および反転キャリー出力信号coutB1はともに「H」となる。したがって、第9の実施形態のインバータ回路と同様に、期間2において、入力信号in1,in2、反転出力信号inB1,inB2、キャリー入力信号cin1、および反転キャリー入力信号cinB1のレベルを変化させることができる。
At this time, the output signal out1 and the inverted output signal outB1 are both “H” regardless of the levels of the carry input signal cin1, the inverted carry input signal cinB1, the input signal in1, the input signal in2, the inverted input signal inB1, and the inverted input signal inB2. The carry output signal cout1 and the inverted carry output signal coutB1 both become “H”. Therefore, as in the inverter circuit of the ninth embodiment, the levels of the input signals in1, in2, the inverted output signals inB1, inB2, the carry input signal cin1, and the inverted carry input signal cinB1 can be changed in the
以上のように、本実施の形態に係る加算回路によれば、期間2において、入力信号in1,in2、反転入力信号inB1,inB2がどのように変化したかに係らず、期間1で出力信号out1と反転出力信号outB1のうちの「L」レベルにある方、およびキャリー出力信号cout1と反転キャリー出力信号coutB1のうちの「L」レベルにある方が期間2において「H」に変化し(充電)、さらに期間3において出力信号out1と反転出力信号outB1のうちのいずれか、およびキャリー出力信号cout1と反転キャリー出力信号coutB1のうちのいずれかが「L」レベルに変化する(放電)ので、入力信号の変化の相違によって、消費電力が変化しないようにすることができる。それゆえ、電力解析によって暗号処理に用いられる鍵などの秘匿データの傍受を防止することができる。
As described above, according to the adder circuit of this embodiment, the output signal out1 is output in
[第12の実施形態]
本実施の形態は、入力信号の相違によって消費電力が変化しないROM(Read Only Memory)に関する。
[Twelfth embodiment]
The present embodiment relates to a ROM (Read Only Memory) in which power consumption does not change due to a difference in input signals.
(ROMの構成)
図45は、第12の実施形態に係るROMの構成を示す。同図を参照して、このROM953は、PチャネルMOSトランジスタPT1,PT2,PT3,PT4と、NチャネルMOSトランジスタNT1〜NT129,NT130とを備える。
(Configuration of ROM)
FIG. 45 shows a configuration of a ROM according to the twelfth embodiment. Referring to FIG. 9,
PチャネルMOSトランジスタPT1は、そのソースが電源に接続され、そのドレインがノードN1に接続し、そのゲートには制御信号ctrl1が入力される。 P-channel MOS transistor PT1 has a source connected to the power supply, a drain connected to node N1, and a gate to which control signal ctrl1 is input.
PチャネルMOSトランジスタPT2は、そのソースが電源に接続され、そのドレインがノードN2に接続し、そのゲートには制御信号ctrl1が入力される。 P-channel MOS transistor PT2 has its source connected to the power supply, its drain connected to node N2, and its gate receiving control signal ctrl1.
PチャネルMOSトランジスタPT3は、そのソースが電源に接続され、そのドレインがPチャネルMOSトランジスタPT4のゲートおよびノードN2に接続され、そのゲートがPチャネルMOSトランジスタPT4のドレインおよびノードN1に接続される。 P channel MOS transistor PT3 has its source connected to the power supply, its drain connected to the gate of P channel MOS transistor PT4 and node N2, and its gate connected to the drain of P channel MOS transistor PT4 and node N1.
PチャネルMOSトランジスタPT4は、そのソースが電源に接続され、そのドレインがPチャネルMOSトランジスタPT3のゲートおよびノードN1に接続され、そのゲートがPチャネルMOSトランジスタPT3のドレインおよびノードN2に接続される。 P channel MOS transistor PT4 has its source connected to the power supply, its drain connected to the gate of P channel MOS transistor PT3 and node N1, and its gate connected to the drain of P channel MOS transistor PT3 and node N2.
NチャネルMOSトランジスタNT130は、そのソースが接地され、そのドレインがノードN3に接続され、そのゲートには制御信号ctrl1が入力される。 N-channel MOS transistor NT130 has a source grounded, a drain connected to node N3, and a control signal ctrl1 input to the gate.
また、このROM953は、第1、3、5、・・・129行に「L」レベルを記憶し。第2、4、・・・128行に「H」レベルを記憶する。
The
第1列であるノードN1とノードN3との間に、並列にNチャネルMOSトランジスタNT1,NT3,・・・NT129が配置され、第2列であるノードN2とノードN3との間に、並列にNチャネルMOSトランジスタNT2,NT4,・・・NT128が配置する。 N-channel MOS transistors NT1, NT3,..., NT129 are arranged in parallel between the node N1 and the node N3 in the first column, and in parallel between the node N2 and the node N3 in the second column. N channel MOS transistors NT2, NT4,... NT128 are arranged.
また、第k行にあるNチャネルMOSトランジスタNTk(k=1〜128)のゲートには、入力信号inKが入力される。 The input signal inK is input to the gate of the N-channel MOS transistor NTk (k = 1 to 128) in the k-th row.
PチャネルMOSトランジスタPT1,PT2、およびNチャネルMOSトランジスタNT130は、第1群に属し、制御信号ctrl1の活性化、つまり「L」になると、ノードN1およびN2を「H」にする。 P-channel MOS transistors PT1, PT2 and N-channel MOS transistor NT130 belong to the first group, and when control signal ctrl1 is activated, that is, “L”, nodes N1 and N2 are set to “H”.
NチャネルMOSトランジスタNT1、NT3、・・・NT129は、第2群に属し、制御信号ctrl1が非活性、つまり「H」のときに、入力信号in1、in3、・・・in129のいずれかが「H」になると、ノードN1を「L」にする。 N-channel MOS transistors NT1, NT3,... NT129 belong to the second group, and when the control signal ctrl1 is inactive, that is, “H”, any of the input signals in1, in3,. When it becomes “H”, the node N1 is set to “L”.
NチャネルMOSトランジスタNT2、NT4、・・・NT128は、第3群に属し、制御信号ctrl1が非活性、つまり「H」のときに、入力信号in2、in4、・・・in128のいずれかが「H」になると、ノードN2を「L」にする。 N-channel MOS transistors NT2, NT4,... NT128 belong to the third group, and when the control signal ctrl1 is inactive, that is, “H”, any of the input signals in2, in4,. When it becomes “H”, the node N2 is set to “L”.
ノードN1は、正論理の出力端子と接続され、正論理の出力端子から、出力信号out1が出力される。ノードN2は、負論理の出力端子と接続され、負論理の出力端子から反転出力信号outB1が出力される。 The node N1 is connected to a positive logic output terminal, and an output signal out1 is output from the positive logic output terminal. The node N2 is connected to a negative logic output terminal, and an inverted output signal outB1 is output from the negative logic output terminal.
(動作)
次に、このROM953に入力される信号と出力される信号の関係を説明する。図46は、ROM953の入出力関係をまとめた図である。同図の期間1、期間2、期間3は、第9の実施形態と同様に、この順序で変化し、入力信号in1〜in129のレベルが変化するのは、期間2に限定される。
(Operation)
Next, the relationship between the signal input to the
同図を参照して、期間1および期間3では、制御信号ctrl1が「H」となる。これにより、NチャネルMOSトランジスタNT130がオンとなり、PチャネルMOSトランジスタPT1,PT2がオフとなる。このとき、入力信号in1〜in129のいずれかが「H」となるので、「H」となった入力信号が入力されるNチャネルMOSトランスタがオンとなる。
Referring to FIG. 8, in
オンとなったNチャネルMOSトランジスタがNチャネルMOSトランジスタNTj(j=1、3、・・・129のいずれか)のとき、つまりノードN1とノードN3の間にある場合には、出力信号out1が「L」となる。また、このときには、ノードN2とノードN3の間にあるすべてのトランジスタ、つまりNチャネルMOSトランジスタNTi(i=2、4、・・・128のすべて)がオフであり、出力信号out1(=「L」)がPチャネルMOSトランジスタPT4のゲートに入力されることによって、PチャネルMOSトランジスタPT4がオンとなり、反転出力信号outB1は「H」となる。 When the turned-on N-channel MOS transistor is an N-channel MOS transistor NTj (j = 1, 3,... 129), that is, between the node N1 and the node N3, the output signal out1 is “L”. At this time, all the transistors between the node N2 and the node N3, that is, the N-channel MOS transistors NTi (all of i = 2, 4,... 128) are off, and the output signal out1 (= “L” ”) Is input to the gate of the P-channel MOS transistor PT4, the P-channel MOS transistor PT4 is turned on, and the inverted output signal outB1 becomes“ H ”.
オンとなったNチャネルMOSトランジスタがNチャネルMOSトランジスタNTj(j=2、4、・・・128のいずれか)のとき、つまりノードN2とノードN3の間にある場合には、反転出力信号outB1が「L」となる。また、このときには、ノードN1とノードN3の間にあるすべてのトランジスタ、つまりNチャネルMOSトランジスタNTi(i=1、3、・・・129のすべて)がオフであり、反転出力信号outB1(=「L」)がPチャネルMOSトランジスタPT3のゲートに入力されることによって、PチャネルMOSトランジスタPT3がオンとなり、出力信号out1は「H」となる。 When the turned-on N-channel MOS transistor is an N-channel MOS transistor NTj (j = 2, 4,... 128), that is, between the node N2 and the node N3, the inverted output signal outB1 Becomes “L”. At this time, all the transistors between the node N1 and the node N3, that is, the N-channel MOS transistors NTi (all of i = 1, 3,... 129) are off, and the inverted output signal outB1 (= “ L ") is input to the gate of the P-channel MOS transistor PT3, whereby the P-channel MOS transistor PT3 is turned on and the output signal out1 is set to" H ".
一方、期間2において、制御信号ctrl1が「L」となる。これにより、NチャネルMOSトランジスタNT130がオフとなり、PチャネルMOSトランジスタPT1,PT2がオンとなる。これにより、入力信号in1〜in129にレベルに係らず、出力信号out1および反転出力信号outB1のいずれもが「H」となる。
On the other hand, in the
したがって、第9の実施形態のインバータ回路と同様に、期間2において、入力信号in1〜in129のレベルを変化させることができる。
Therefore, similarly to the inverter circuit of the ninth embodiment, the level of the input signals in1 to in129 can be changed in the
以上のように、本実施の形態に係るROMによれば、期間2において入力信号in1〜in129がどのように変化したかに係らず、期間1で出力信号out1と反転出力信号outB1のうちの「L」レベルにある方が期間2において「H」に変化し(充電)、さらに期間3において出力信号out1と反転出力信号outB1のうちのいずれかが「L」に変化する(放電)するので、入力信号in1〜in129の変化の相違によって、消費電力が変化しないようにすることができる。それゆえ、電力解析によって暗号処理に用いられる鍵などの秘匿データの傍受を防止することができる。
As described above, according to the ROM according to the present embodiment, regardless of how the input signals in1 to in129 have changed in the
[第12の実施形態の変形例1]
本変形例は、第12の実施形態と同様に、入力信号の相違によって消費電力が変化しないのに加えて、より簡易な構成のROMに関する。
[
As in the twelfth embodiment, the present modification relates to a ROM having a simpler configuration in addition to the fact that power consumption does not change due to a difference in input signals.
(ROMの構成)
図47は、第12の実施形態の変形例1に係るROMの構成を示す。同図において、図45のROMにおける構成要素と同一の構成要素には、図45と同一の符号を付している。同図を参照して、このROM954が図45のROM953と相違する点は、NチャネルMOSトランジスタNT130を含まず、NチャネルMOSトランジスタNW1〜NW129と、NチャネルMOSトランジスタNE1〜NE129とを含む点である。
(Configuration of ROM)
FIG. 47 shows a configuration of a ROM according to the first modification of the twelfth embodiment. In this figure, the same components as those in the ROM of FIG. 45 are denoted by the same reference numerals as in FIG. 45,
第1列第k行(k=1〜129)には、NチャネルMOSトランジスタNWkが配置される。第2列第k行(k=1〜129)には、NチャネルMOSトランジスタNEkが配置される。 An N channel MOS transistor NWk is arranged in the first column and the kth row (k = 1 to 129). In the second column and kth row (k = 1 to 129), an N-channel MOS transistor NEk is arranged.
NチャネルMOSトランジスタNWkおよびNEk(k=1〜128)のソースが接地される。 The sources of N channel MOS transistors NWk and NEk (k = 1 to 128) are grounded.
また、第1列第i行(i=1、3、5、・・・129)のNチャネルMOSトランジスタNWiは、そのドレインには、NチャネルMOSトランジスタNTiのソースが接続され、そのゲートに制御信号ctrl1が入力される。 The N-channel MOS transistor NWi in the first column i-th row (i = 1, 3, 5,... 129) is connected to the source of the N-channel MOS transistor NTi at its drain and controlled at its gate. The signal ctrl1 is input.
また、第2列第j行(j=2、4、6、・・・128)のNチャネルMOSトランジスタNWjは、そのドレインには、NチャネルMOSトランジスタNTjのソースが接続され、そのゲートに制御信号ctrl1が入力される。 The N-channel MOS transistor NWj in the second column, j-th row (j = 2, 4, 6,... 128) has its drain connected to the source of the N-channel MOS transistor NTj and its gate controlled. The signal ctrl1 is input.
PチャネルMOSトランジスタPT1,PT2、およびNチャネルMOSトランジスタNW1〜NW129、NE1〜NE129は、第1群に属し、制御信号ctrl1の活性化、つまり「L」になると、ノードN1およびN2を「H」にする。 P-channel MOS transistors PT1 and PT2 and N-channel MOS transistors NW1 to NW129 and NE1 to NE129 belong to the first group. When the control signal ctrl1 is activated, that is, becomes “L”, the nodes N1 and N2 are set to “H”. To.
NチャネルMOSトランジスタNT1、NT3、・・・NT129は、第2群に属し、制御信号ctrl1が非活性、つまり「H」のときに、入力信号in1、in3、・・・in129のいずれかが「H」になると、ノードN1を「L」にする。 N-channel MOS transistors NT1, NT3,... NT129 belong to the second group, and when the control signal ctrl1 is inactive, that is, “H”, any of the input signals in1, in3,. When it becomes “H”, the node N1 is set to “L”.
NチャネルMOSトランジスタNT2、NT4、・・・NT128は、第3群に属し、制御信号ctrl1が非活性、つまり「H」のときに、入力信号in2、in4、・・・in128のいずれかが「H」になると、ノードN2を「L」にする。 N-channel MOS transistors NT2, NT4,... NT128 belong to the third group, and when the control signal ctrl1 is inactive, that is, “H”, any of the input signals in2, in4,. When it becomes “H”, the node N2 is set to “L”.
ノードN1は、正論理の出力端子と接続され、正論理の出力端子から、出力信号out1が出力される。ノードN2は、負論理の出力端子と接続され、負論理の出力端子から反転出力信号outB1が出力される。 The node N1 is connected to a positive logic output terminal, and an output signal out1 is output from the positive logic output terminal. The node N2 is connected to a negative logic output terminal, and an inverted output signal outB1 is output from the negative logic output terminal.
(動作)
次に、このROM954に入力される信号と出力される信号の関係を説明する。ROM954の入出力関係は、図46に示すROM953の入出力関係と同様である。同図の期間1、期間2、期間3は、第9の実施形態と同様に、この順序で変化し、入力信号in1〜in129のレベルが変化するのは、期間2に限定される。
(Operation)
Next, the relationship between the signal input to the
同図を参照して、期間1および期間3において、制御信号ctrl1が「H」となる。これにより、NチャネルMOSトランジスタNW1〜NW129がオンとなり、NチャネルMOSトランジスタNE1〜NE129がオンとなり、PチャネルMOSトランジスタPT1,PT2がオフとなる。このとき、入力信号in1〜in129のいずれかが「H」となるので、「H」となった入力信号が入力されるNチャネルMOSトランスタがオンとなる。
Referring to the figure, in
オンとなったNチャネルMOSトランジスタがNチャネルMOSトランジスタNTj(j=1、3、・・・129のいずれか)のとき、つまりノードN1とノードN3の間にある場合には、出力信号out1が「L」となる。また、このときには、ノードN2とノードN3の間にあるすべてのトランジスタ、つまりNチャネルMOSトランジスタNTi(i=2、4、・・・128のすべて)がオフであり、出力信号out1(=「L」)がPチャネルMOSトランジスタPT4のゲートに入力されることによって、PチャネルMOSトランジスタPT4がオンとなり、反転出力信号outB1は「H」となる。 When the turned-on N-channel MOS transistor is an N-channel MOS transistor NTj (j = 1, 3,... 129), that is, between the node N1 and the node N3, the output signal out1 is “L”. At this time, all the transistors between the node N2 and the node N3, that is, the N-channel MOS transistors NTi (all of i = 2, 4,... 128) are off, and the output signal out1 (= “L” ”) Is input to the gate of the P-channel MOS transistor PT4, the P-channel MOS transistor PT4 is turned on, and the inverted output signal outB1 becomes“ H ”.
一方、オンとなったNチャネルMOSトランジスタがNチャネルMOSトランジスタNTj(j=2、4、・・・128のいずれか)のとき、つまりノードN2とノードN3の間にある場合には、反転出力信号outB1が「L」となる。また、このときには、ノードN1とノードN3の間にあるすべてのトランジスタ、つまりNチャネルMOSトランジスタNTi(i=1、3、・・・129のすべて)がオフであり、反転出力信号outB1(=「L」)がPチャネルMOSトランジスタPT3のゲートに入力されることによって、PチャネルMOSトランジスタPT3がオンとなり、出力信号out1は「H」となる。 On the other hand, when the turned-on N-channel MOS transistor is an N-channel MOS transistor NTj (j = 2, 4,..., 128), that is, between the node N2 and the node N3, the inverted output The signal outB1 becomes “L”. At this time, all the transistors between the node N1 and the node N3, that is, the N-channel MOS transistors NTi (all of i = 1, 3,... 129) are off, and the inverted output signal outB1 (= “ L ") is input to the gate of the P-channel MOS transistor PT3, whereby the P-channel MOS transistor PT3 is turned on and the output signal out1 is set to" H ".
期間2において、制御信号ctrl1が「L」となる。これにより、NチャネルMOSトランジスタNW1〜NW129、およびNE1〜NE129がオフとなり、PチャネルMOSトランジスタPT1,PT2がオンとなる。これにより、入力信号in1〜in129にレベルに係らず、出力信号out1および反転出力信号outB1のいずれもが「H」となる。
In the
したがって、第9の実施形態のインバータ回路と同様に、期間2において、入力信号in1〜in129のレベルを変化させることができる。
Therefore, similarly to the inverter circuit of the ninth embodiment, the level of the input signals in1 to in129 can be changed in the
以上のように、本変形例に係るROMによれば、期間2において、入力信号in1〜in129がどのように変化したかに係らず、期間1で出力信号out1と反転出力信号outB1のうちの「L」レベルにある方が期間2において「H」に変化し(充電)、さらに期間3において出力信号out1と反転出力信号outB1のうちのいずれかが「L」に変化する(放電)するので、入力信号in1〜in129の変化の相違によって、消費電力が変化しないようにすることができる。それゆえ、電力解析によって暗号処理に用いられる鍵などの秘匿データの傍受を防止することができる。また、第12の実施形態のROMでは、NチャネルMOSトランジスタNT1〜NT129の129個に対して接地電位を供給するために、NチャネルMOSトランジスタNT130は、抵抗値の小さなサイズの大きなものを使用する必要があったが、本変形例のROMでは、NチャネルMOSトランジスタNT130の代りに、サイズの小さなNチャネルMOSトランジスタNW1〜NW129、およびNE1〜NE129を用いるので、回路の規模を小さくすることができる。
As described above, according to the ROM according to the present modification, regardless of how the input signals in1 to in129 have changed in the
[第12の実施形態の変形例2]
本変形例は、第12の実施形態と同様に、入力信号の変化の相違によって消費電力が変化しないことに加えて、より簡易な構成のROMに関する。
[
As in the twelfth embodiment, this modification relates to a ROM having a simpler configuration in addition to the fact that the power consumption does not change due to the difference in the change of the input signal.
(ROMの構成)
図48は、第12の実施形態の変形例2に係るROMの構成を示す。同図において、図45のROMにおける構成要素と同一の構成要素には、図45と同一の符号を付している。同図を参照して、このROM955が、図45のROM953と相違する点は、NチャネルMOSトランジスタNT130を含まず、第k行(k=1〜129)に、論理積回路ANDkを備えた点である。
(Configuration of ROM)
FIG. 48 shows a configuration of a ROM according to the second modification of the twelfth embodiment. In this figure, the same components as those in the ROM of FIG. 45 are denoted by the same reference numerals as in FIG. Referring to this figure, this
論理積回路ANDk(k=1〜129)は、入力信号inkと、制御信号ctrl1とを受けて、それらの論理積をNチャネルMOSトランジスタNTkのゲートに出力する。 The AND circuit ANDk (k = 1 to 129) receives the input signal ink and the control signal ctrl1 and outputs a logical product of these to the gate of the N-channel MOS transistor NTk.
PチャネルMOSトランジスタPT1,PT2は、第1群に属し、制御信号ctrl1の活性化、つまり「L」になると、ノードN1およびN2を「H」にする。 P-channel MOS transistors PT1 and PT2 belong to the first group, and when control signal ctrl1 is activated, that is, “L”, nodes N1 and N2 are set to “H”.
NチャネルMOSトランジスタNT1、NT3、・・・NT129は、第2群に属し、制御信号ctrl1が非活性、つまり「H」のときに、入力信号in1、in3、・・・in129のいずれかが「H」になると、ノードN1を「L」にする。 N-channel MOS transistors NT1, NT3,... NT129 belong to the second group, and when the control signal ctrl1 is inactive, that is, “H”, any of the input signals in1, in3,. When it becomes “H”, the node N1 is set to “L”.
NチャネルMOSトランジスタNT2、NT4、・・・NT128は、第3群に属し、制御信号ctrl1が非活性、つまり「H」のときに、入力信号in2、in4、・・・in128のいずれかが「H」になると、ノードN2を「L」にする。 N-channel MOS transistors NT2, NT4,... NT128 belong to the third group, and when the control signal ctrl1 is inactive, that is, “H”, any of the input signals in2, in4,. When it becomes “H”, the node N2 is set to “L”.
ノードN1は、正論理の出力端子と接続され、正論理の出力端子から、出力信号out1が出力される。ノードN2は、負論理の出力端子と接続され、負論理の出力端子から反転出力信号outB1が出力される。 The node N1 is connected to a positive logic output terminal, and an output signal out1 is output from the positive logic output terminal. The node N2 is connected to a negative logic output terminal, and an inverted output signal outB1 is output from the negative logic output terminal.
(動作)
次に、このROM955に入力される信号と出力される信号の関係を説明する。ROM955の入出力関係は、図46に示すROM953の入出力関係と同様である。同図の期間1、期間2、期間3は、第9の実施形態と同様に、この順序で変化し、入力信号in1〜in129のレベルが変化するのは、期間2に限定される。
(Operation)
Next, the relationship between the signal input to the
同図を参照して、期間1および期間3において、制御信号ctrl1が「H」となる。これにより、論理積回路ANDk(k=1〜129)の入力端子の1つに「H」レベルが入力され、PチャネルMOSトランジスタPT1,PT2がオフとなる。
Referring to the figure, in
このとき、入力信号in1〜in129のいずれかが「H」となるので、「H」となった入力信号が入力される論理積回路の出力が「H」レベルを出力する。 At this time, since any of the input signals in1 to in129 is "H", the output of the AND circuit to which the input signal that has become "H" is input outputs the "H" level.
「H」レベルを出力した論理積回路が論理積回路ANDj(j=1、3、・・・129のいずれか)のとき、つまりノードN1とノードN3の間にあるNチャネルMOSトランジスタと接続している場合には、そのNチャネルMOSトランジスタがオンとなり、出力信号out1が「L」となる。また、このときには、論理積回路ANDi(i=2、4、・・・128のすべて)が「L」レベルを出力するので、これらの論理積回路ANDiと接続しているノードN2とノードN3の間にあるすべてのトランジスタ、つまりNチャネルMOSトランジスタNTi(i=2、4、・・・128のすべて)がオフとなり、出力信号out1(=「L」)がPチャネルMOSトランジスタPT4のゲートに入力されることによって、PチャネルMOSトランジスタPT4がオンとなり、反転出力信号outB1は「H」となる。 When the AND circuit that outputs the “H” level is the AND circuit ANDj (any of j = 1, 3,... 129), that is, connected to the N-channel MOS transistor between the node N1 and the node N3. If so, the N-channel MOS transistor is turned on, and the output signal out1 becomes "L". At this time, since the AND circuit ANDi (all i = 2, 4,... 128) outputs the “L” level, the nodes N2 and N3 connected to these AND circuits ANDi are connected to each other. All the transistors in between, that is, the N channel MOS transistor NTi (i = 2, 4,... 128) are turned off, and the output signal out1 (= “L”) is input to the gate of the P channel MOS transistor PT4. As a result, the P-channel MOS transistor PT4 is turned on, and the inverted output signal outB1 becomes “H”.
一方、「H」レベルを出力した論理積回路が論理積回路ANDj(j=2、4、・・・129のいずれか)のとき、つまりノードN2とノードN3の間にあるNチャネルMOSトランジスタと接続している場合には、そのNチャネルMOSトランジスタがオンとなり、反転出力信号outB1が「L」となる。また、このときには、論理積回路ANDi(i=1、3、・・・129のすべて)が「L」レベルを出力するので、これらの論理積回路ANDiと接続しているノードN1とノードN3の間にあるすべてのトランジスタ、つまりNチャネルMOSトランジスタNTi(i=1、3、・・・129のすべて)がオフとなり、反転出力信号outB1(=「L」)がPチャネルMOSトランジスタPT3のゲートに入力されることによって、PチャネルMOSトランジスタPT3がオンとなり、出力信号out1は「H」となる。 On the other hand, when the logical product circuit that outputs the “H” level is the logical product circuit ANDj (any of j = 2, 4,... 129), that is, the N channel MOS transistor between the node N2 and the node N3. If they are connected, the N-channel MOS transistor is turned on, and the inverted output signal outB1 becomes “L”. At this time, since the AND circuit ANDi (all of i = 1, 3,... 129) outputs the “L” level, the nodes N1 and N3 connected to these AND circuits ANDi All the transistors in between, that is, the N-channel MOS transistor NTi (all of i = 1, 3,... 129) are turned off, and the inverted output signal outB1 (= “L”) is applied to the gate of the P-channel MOS transistor PT3. By being input, the P-channel MOS transistor PT3 is turned on, and the output signal out1 becomes “H”.
期間2において、制御信号ctrl1が「L」となる。これにより、論理積回路ANDk(k=1〜129)の入力端子の1つに「L」レベルが入力され、PチャネルMOSトランジスタPT1,PT2がオンとなる。これにより、入力信号in1〜in129にレベルに係らず、出力信号out1および反転出力信号outB1のいずれもが「H」となる。
In the
したがって、第9の実施形態のインバータ回路と同様に、期間2において、入力信号in1〜in129のレベルを変化させることができる。
Therefore, similarly to the inverter circuit of the ninth embodiment, the level of the input signals in1 to in129 can be changed in the
以上のように、本変形例に係るROMによれば、期間2において、入力信号in1〜in129がどのように変化したかに係らず、期間1で出力信号out1と反転出力信号outB1のうちの「L」レベルにある方が期間2において「H」に変化し(充電)、さらに期間3において出力信号out1と反転出力信号outB1のうちのいずれかが「L」に変化する(放電)するので、入力信号in1〜in129の変化の相違によって、消費電力が変化しないようにすることができる。それゆえ、電力解析によって暗号処理に用いられる鍵などの秘匿データの傍受を防止することができる。また、本変形例のROMでは、第12の実施形態のROMにおけるNチャネルMOSトランジスタNT130の代りに、論理積回路AND1〜AND129を用いるので、回路の規模を小さくすることができる。
As described above, according to the ROM according to the present modification, regardless of how the input signals in1 to in129 have changed in the
[第13の実施形態]
本実施の形態は、入力信号の変化の相違によって消費電力が変化しないレジスタに関する。
[Thirteenth embodiment]
The present embodiment relates to a register whose power consumption does not change due to a difference in change of an input signal.
(レジスタの構成)
図49は、第13の実施形態に係るレジスタの構成を示す。同図を参照して、このレジスタ956は、PチャネルMOSトランジスタPT1〜PT6と、NチャネルMOSトランジスタNT1〜NT7とを備える。
(Register configuration)
FIG. 49 shows a configuration of a register according to the thirteenth embodiment. Referring to FIG. 11, register 956 includes P channel MOS transistors PT1 to PT6 and N channel MOS transistors NT1 to NT7.
PチャネルMOSトランジスタPT1は、そのソースが電源に接続され、そのドレインが正論理のノードreg1に接続され、そのゲートには制御信号ctrl1が入力される。 P-channel MOS transistor PT1 has its source connected to the power supply, its drain connected to positive logic node reg1, and its gate receiving control signal ctrl1.
PチャネルMOSトランジスタPT2は、そのソースが電源に接続され、そのドレインが負論理のノードregB1に接続され、そのゲートには制御信号ctrl1が入力される。 P channel MOS transistor PT2 has its source connected to the power supply, its drain connected to negative logic node regB1, and its gate receiving control signal ctrl1.
NチャネルMOSトランジスタNT1は、入力信号in1が入力される正論理の入力端子IN1と正論理のノードreg1との間に配置され、そのゲートには書込み指示信号write1が入力される。 The N-channel MOS transistor NT1 is arranged between the positive logic input terminal IN1 to which the input signal in1 is input and the positive logic node reg1, and the write instruction signal write1 is input to the gate thereof.
NチャネルMOSトランジスタNT2は、反転入力信号inB1が入力される負論理の入力端子IB1と負論理のノードregB1との間に配置され、そのゲートには書込み指示信号write1が入力される。 The N-channel MOS transistor NT2 is arranged between the negative logic input terminal IB1 to which the inverted input signal inB1 is input and the negative logic node regB1, and the write instruction signal write1 is input to the gate thereof.
NチャネルMOSトランジスタNT5は、出力信号out1が出力される正論理の出力端子O1と正論理のノードreg1との間に配置され、そのゲートには読出し指示信号read1が入力される。 The N-channel MOS transistor NT5 is arranged between the positive logic output terminal O1 from which the output signal out1 is output and the positive logic node reg1, and the read instruction signal read1 is input to the gate thereof.
NチャネルMOSトランジスタNT6は、反転出力信号outB1が出力される負論理の出力端子OB1と負論理のノードregB1との間に配置され、そのゲートには読出し指示信号read1が入力される。 The N-channel MOS transistor NT6 is disposed between the negative logic output terminal OB1 from which the inverted output signal outB1 is output and the negative logic node regB1, and the read instruction signal read1 is input to the gate thereof.
PチャネルMOSトランジスタPT5は、そのソースが電源に接続され、そのドレインが出力信号out1が出力される正論理の出力端子O1に接続され、そのゲートには制御信号ctrl2が入力される。 The P-channel MOS transistor PT5 has its source connected to the power supply, its drain connected to the positive logic output terminal O1 from which the output signal out1 is output, and its gate receiving the control signal ctrl2.
PチャネルMOSトランジスタPT6は、そのソースが電源に接続され、そのドレインが反転出力信号outB1が出力される負論理の出力端子OB1に接続され、そのゲートには制御信号ctrl2が入力される。 The P-channel MOS transistor PT6 has its source connected to the power supply, its drain connected to the negative logic output terminal OB1 from which the inverted output signal outB1 is output, and its gate receiving the control signal ctrl2.
PチャネルMOSトランジスタPT3は、そのソースが電源に接続され、そのドレインが正論理のノードreg1に接続され、そのゲートが負論理のノードregB1に接続される。 P channel MOS transistor PT3 has its source connected to the power supply, its drain connected to positive logic node reg1, and its gate connected to negative logic node regB1.
PチャネルMOSトランジスタPT4は、そのソースが電源に接続され、そのドレインが負論理のノードregB1に接続され、そのゲートが正論理のノードreg1に接続される。 P channel MOS transistor PT4 has its source connected to the power supply, its drain connected to negative logic node regB1, and its gate connected to positive logic node reg1.
NチャネルMOSトランジスタNT3は、そのソースがNチャネルMOSトランジスタNT7のドレインに接続され、そのドレインが正論理のノードreg1に接続され、そのゲートが負論理のノードregB1に接続される。 N channel MOS transistor NT3 has its source connected to the drain of N channel MOS transistor NT7, its drain connected to positive logic node reg1, and its gate connected to negative logic node regB1.
NチャネルMOSトランジスタNT4は、そのソースがNチャネルMOSトランジスタNT7のドレインに接続され、そのドレインが負論理のノードregB1に接続され、そのゲートが正論理のノードreg1に接続される。 N channel MOS transistor NT4 has its source connected to the drain of N channel MOS transistor NT7, its drain connected to negative logic node regB1, and its gate connected to positive logic node reg1.
NチャネルMOSトランジスタNT7は、そのソースが接地され、そのドレインがNチャネルMOSトランジスタNT3およびNT4のソースに接続され、そのゲートに制御信号ctrl1が入力される。 N channel MOS transistor NT7 has its source grounded, its drain connected to the sources of N channel MOS transistors NT3 and NT4, and control signal ctrl1 input to its gate.
PチャネルMOSトランジスタPT1,PT2、およびNチャネルMOSトランジスタNT7は、第1群に属し、制御信号ctrl1の活性化、つまり「L」になると、正論理のノードreg1、および負論理のノードregB1を「H」にする。 The P-channel MOS transistors PT1, PT2 and the N-channel MOS transistor NT7 belong to the first group. When the control signal ctrl1 is activated, that is, “L”, the positive logic node reg1 and the negative logic node regB1 are changed to “ H ”.
PチャネルMOSトランジスタPT5,PT6は、第1´群に属し、制御信号ctrl2の活性化、つまり「L」になると、正論理の出力端子O1、および負論理の出力端子OB1を「H」にする。 The P-channel MOS transistors PT5 and PT6 belong to the first group, and when the control signal ctrl2 is activated, that is, becomes “L”, the positive logic output terminal O1 and the negative logic output terminal OB1 are set to “H”. .
(動作)
次に、このレジスタ956の動作を説明する。図50は、レジスタ956に入力および出力される信号の時間的な変化の例を示す図である。同図を参照して、期間1では、制御信号ctrl1が「H」で、制御信号ctrl2が「H」で、読出し指示信号read1が「L」で、書込み指示信号write1が「L」である。
(Operation)
Next, the operation of the
制御信号ctrl1が「H」によって、PチャネルMOSトランジスタPT1,PT2がオフとなり、NチャネルMOSトランジスタNT7はオンとなる。制御信号ctrl2が「H」によって、PチャネルMOSトランジスタPT5,PT6がオフとなる。読出し指示信号read1が「L」によって、NチャネルMOSトランジスタNT5,NT6がオフとなる。書込み指示信号write1が「L」によって、NチャネルMOSトランジスタNT1,NT2がオフとなる。 When control signal ctrl1 is “H”, P-channel MOS transistors PT1 and PT2 are turned off, and N-channel MOS transistor NT7 is turned on. When control signal ctrl2 is “H”, P-channel MOS transistors PT5 and PT6 are turned off. When read instruction signal read1 is “L”, N-channel MOS transistors NT5 and NT6 are turned off. When the write instruction signal write1 is “L”, the N-channel MOS transistors NT1 and NT2 are turned off.
期間1では、入力信号in1が「H」とし、反転入力信号inB1が「L」とし、せい論理のノードreg1「L」とし、負論理のノードregB1が「H」とする。
In
期間2では、制御信号ctrl1が「L」となる。制御信号ctrl1が「L」となると、PチャネルMOSトランジスタPT1,PT2がオンとなり、NチャネルMOSトランジスタNT7がオフとなる。
In the
期間2では、入力信号in1が「L」に変化し、反転入力信号inB1が「H」に変化するが、PチャネルMOSトランジスタPT1,PT2がオン、NチャネルMOSトランジスタNT7がオフ、およびNチャネルMOSトランジスタNT1,NT2がオフより、
これらの変化に係りなく、正論理のノードreg1、および負論理のノードregB1がともに「H」となる。
In
Regardless of these changes, both the positive logic node reg1 and the negative logic node regB1 become “H”.
期間3では、制御信号ctrl1が「H」となるとともに、書込み指示信号write1が「H」となる。制御信号ctrl1が「H」となると、PチャネルMOSトランジスタPT1,PT2がオフとなり、NチャネルMOSトランジスタNT7がオンとなる。
書込み指示信号write1が「H」となると、NチャネルMOSトランジスタNT1,NT2がオンとなる。これにより、reg1は、入力信号in1の値(つまり、「L」)、regB1は、反転入力信号inB1の値(つまり、「H」)となる。
In
When write instruction signal write1 attains "H", N channel MOS transistors NT1 and NT2 are turned on. Accordingly, reg1 becomes the value of the input signal in1 (ie, “L”), and regB1 becomes the value of the inverted input signal inB1 (ie, “H”).
さらに、期間4では、制御信号ctrl2が「L」となる。制御信号ctrl2が「L」となると、PチャネルMOSトランジスタPT5,PT6がオンとなる。これにより、出力信号out1および反転出力信号outB1は、ともに「H」となる。 Further, in the period 4, the control signal ctrl2 becomes “L”. When the control signal ctrl2 becomes “L”, the P-channel MOS transistors PT5 and PT6 are turned on. As a result, both the output signal out1 and the inverted output signal outB1 become “H”.
そして、期間5で、制御信号ctrl2が「H」となる。制御信号ctrl2が「H」となると、PチャネルMOSトランジスタPT5,PT6がオフとなる。 Then, in period 5, the control signal ctrl2 becomes “H”. When control signal ctrl2 becomes “H”, P-channel MOS transistors PT5 and PT6 are turned off.
期間5の途中で、読出し指示信号read1が「H」となる。読出し指示信号read1が「H」になると、NチャネルMOSトランジスタNT5,NT6がオンとなる。これにより、出力信号out1は、正論理のノードreg1の値となり、反転出力信号outB1は、負論理のノードregB1の値となる。 In the middle of the period 5, the read instruction signal read1 becomes “H”. When read instruction signal read1 becomes “H”, N-channel MOS transistors NT5 and NT6 are turned on. As a result, the output signal out1 becomes the value of the positive logic node reg1, and the inverted output signal outB1 becomes the value of the negative logic node regB1.
以上のように、本実施の形態に係るレジスタによれば、書込み時に、期間2において、入力信号in1および反転入力信号inB1がどのように変化したかに係らず、期間1でノードreg1およびノードregB1のうちの「L」レベルにある方が、制御信号ctrl1が「L」となる期間2において「H」に変化し(充電)、さらに書込み指示信号write1が「H」となる期間3において、ノードreg1およびノードregB1のうちのいずれかが「L」に変化する(放電)ので、入力信号の変化の相違によって、消費電力が変化しないようにすることができる。また、読出し時に、ノードregおよびノードregBが記憶しているデータのレベルに係らず、期間3で出力信号out1および反転出力信号outB1のうちの「L」レベルにある方が、制御信号ctrl2が「L」となる期間4において「H」に変化し(充電)、さらに読出し指示信号read1が「H」となる期間5の途中からにおいて、出力信号out1および反転出力信号outB1のうちのいずれかが「L」に変化する(放電)ので、ノードregおよびノードregB1の記憶データの相違によって、消費電力が変化しないようにすることができる。それゆえ、電力解析によって暗号処理に用いられる鍵などの秘匿データの傍受を防止することができる。
As described above, according to the register according to the present embodiment, the node reg1 and the node regB1 in the
[第14の実施形態]
本実施の形態は、第9〜第11、および第13の実施形態におけるインバータ回路、NAND回路、加算回路、またはレジスタなどが含まれるロジックの動作タイミングを制御する制御信号ctrl1を生成する制御信号生成回路を含む半導体回路に関する。
[Fourteenth embodiment]
In the present embodiment, control signal generation for generating a control signal ctrl1 for controlling the operation timing of logic including the inverter circuit, NAND circuit, adder circuit, or register in the ninth to eleventh and thirteenth embodiments The present invention relates to a semiconductor circuit including a circuit.
(半導体回路の構成)
図51は、第14の実施形態に係る複数個のロジックを含む半導体回路を示す。同図を参照して、ロジック1からロジック2へ複数個のバスを介して、信号01,01B、02,02Bが入力される。信号01は、正論理の第1の信号であり、信号01Bは、信号01を反転した負論理の第1の信号であり、信号02は、正論理の第2の信号であり、信号02Bは、信号02を反転した負論理の第2の信号である。信号02および信号02Bのペアは、ロジック1からロジック2へ送られる信号のうち、遅延量が最大の信号であるとする。
(Configuration of semiconductor circuit)
FIG. 51 shows a semiconductor circuit including a plurality of logics according to the fourteenth embodiment. Referring to the figure, signals 01, 01B, 02, and 02B are input from
ロジック2の動作タイミングを制御する制御信号を生成する制御信号生成回路290は、論理積回路AND2および反転論理和回路NOR2とからなる。この制御信号生成回路290は、遅延量が最大の信号のペア02,02Bと、すべてのロジック群の制御の基準タイミングを定める基準制御信号05(たとえば、クロック信号)を受けて、ロジック2の制御信号04(すなわち、第9〜第11、および第13の実施形態において、ロジック2を制御対象としたときの制御信号ctrl1に相当する)を出力する。
A control
制御信号生成回路290は、遅延量が最大である信号02および信号02のいずれかが「L」、かつ信号05が「L」のときに、信号04を「H」にする。
The control
PチャネルMOSトランジスタPX2は、制御信号04(つまり、制御信号ctrl1に相当する)が「L」になるとオンになるトランジスタを代表的に示したものであり、図37のインバータ回路950におけるPチャネルMOSトランジスタPT1,PT2、図41のNAND回路951におけるPチャネルMOSトランジスタPT1,PT2、図43の加算回路952におけるPチャネルMOSトランジスタPT1,PT2,PT5,PT6、および図49のレジスタ956におけるPチャネルMOSトランジスタPT1,PT2に相当する。
P-channel MOS transistor PX2 is a representative transistor that is turned on when control signal 04 (that is, corresponding to control signal ctrl1) becomes “L”. P-channel MOS transistor PX2 in
同様に、NチャネルMOSトランジスタNX2は、信号04(つまり、制御信号ctrl1に相当する)が「H」になるとオンになるトランジスタを代表的に示したものであり、図37のインバータ回路950におけるNチャネルMOSトランジスタNT3、図41のNAND回路951におけるNチャネルMOSトランジスタNT5、図43の加算回路952におけるNチャネルMOSトランジスタNT21,NT32、および図49のレジスタ956におけるNチャネルMOSトランジスタNT7に相当する。
Similarly, N channel MOS transistor NX2 representatively shows a transistor that is turned on when signal 04 (ie, corresponding to control signal ctrl1) becomes “H”, and N channel MOS transistor NX2 in
(動作)
次に、この半導体回路の動作を説明する。図52は、ロジック2に入力および出力される信号の時間的な変化の例を示す図である。同図において、期間1、期間2、および期間3は、それぞれ、第9〜第11、および第13の実施形態における期間1、期間2、および期間3に相当する。
(Operation)
Next, the operation of this semiconductor circuit will be described. FIG. 52 is a diagram illustrating an example of a temporal change in a signal input to and output from the
期間1では、信号05が「L」である。信号01は「L」、信号01Bは「H」、信号02は「H」、信号02Bは「L」とする。制御信号生成回路290は、信号02、信号02B、および信号05の上記レベルに従い、制御信号04を「H」とする。制御信号04が「H」によって、PチャネルMOSトランジスタPX2はオフとなり、NチャネルMOSトランジスタNX2はオンとなる。
In the
期間2では、まず、信号05が「H」となる。これにより、ロジック1が出力する信号01,01B,02,02Bのレベルは、すべて「H」に変化する。制御信号生成回路290は、信号02、信号02B、および信号05がすべて「H」になると、制御信号04を「L」にする。制御信号04が「L」によって、PチャネルMOSトランジスタPX2はオンとなり、NチャネルMOSトランジスタNX2はオフとなる。
In the
期間2では、その後、信号05が「L」になると、信号01および信号01Bのいずれかが「L」に変化し、信号02および信号02Bのいずれかが「L」に変化する。ここでは、信号01Bが「L」に変化し、信号02が「L」に変化するものとする。制御信号生成回路290は、信号02Bが「L」に変化すると、制御信号04を「H」に変化させ、期間3に移行する。
In
期間3では、制御信号04が「H」によって、PチャネルMOSトランジスタPX2はオフとなり、NチャネルMOSトランジスタNX2はオンとなる。
In
以上のように、本実施の形態に係る制御信号生成回路によれば、ロジック2に入力されるすべての信号が変化するタイミングを、ロジック2の動作を制御する制御信号04が「L」となる期間2に限定することができる。
As described above, according to the control signal generation circuit according to the present embodiment, the
[第14の実施形態の変形例1]
本変形例は、第14の実施形態と同様に、ロジックの動作タイミングを制御する制御信号ctrl1を生成することに加えて、遅延量が最大の信号のペアが予め定まっていない場合にでも対応できる制御信号生成回路を含む半導体回路に関する。
[
Similar to the fourteenth embodiment, the present modification can generate a control signal ctrl1 for controlling the operation timing of the logic, and can cope with a case where a pair of signals having the maximum delay amount is not determined in advance. The present invention relates to a semiconductor circuit including a control signal generation circuit.
(半導体回路の構成)
図53は、第14の実施形態の変形例1に係る複数個のロジックを含む半導体回路を示す。同図を参照して、ロジック1からロジック2へ複数個のバスを介して、信号01,01B、02,02Bが入力される。信号01は、正論理の第1の信号であり、信号01Bは、信号01を反転した負論理の第1の信号であり、信号02は、正論理の第2の信号であり、信号02Bは、信号02を反転した負論理の第2の信号である。
(Configuration of semiconductor circuit)
FIG. 53 shows a semiconductor circuit including a plurality of logics according to the first modification of the fourteenth embodiment. Referring to the figure, signals 01, 01B, 02, and 02B are input from
ロジック2の動作を制御する制御信号を生成する制御信号生成回路310は、論理積回路AND1、論理積回路AND2、および反転論理和回路NOR3とからなる。この制御信号生成回路310は、ペアの信号01,01Bと、ペアの信号02,02B、およびすべてのロジック群の制御の基準タイミングを定める基準制御信号05(たとえば、外部から与えられるクロック信号)を受けて、ロジック2の制御信号04(すなわち、制御信号ctrl1)を出力する。
A control
制御信号生成回路310は、信号01および信号01のいずれかが「L」、信号02および信号02のいずれかが「L」、かつ信号05が「L」のときに、制御信号04を「H」にする。
The control
(動作)
次に、この半導体回路の動作を説明する。図54は、ロジック2に入力および出力される信号の時間的な変化の例を示す図である。同図において、期間1、期間2、および期間3は、それぞれ、第9〜第11、および第13の実施形態における期間1、期間2、および期間3に相当する。
(Operation)
Next, the operation of this semiconductor circuit will be described. FIG. 54 is a diagram illustrating an example of temporal changes in signals input to and output from the
期間1では、信号05が「L」である。信号01は「L」、信号01Bは「H」、信号02は「H」、信号02Bは「L」とする。制御信号生成回路310は、信号01、信号01B、信号02、信号02B、および信号05の上記レベルに従い、信号04を「H」とする。信号04が「H」によって、PチャネルMOSトランジスタPX2はオフとなり、NチャネルMOSトランジスタNX2はオンとなる。
In the
期間2では、まず、信号05が「H」となる。これにより、ロジック1が出力する信号01,01B,02,02Bのレベルは、すべて「H」に変化する。
In the
制御信号生成回路290は、信号01、信号01B、信号02、信号02B、および信号05がすべて「H」になると、制御信号04を「L」にする。制御信号04が「L」によって、PチャネルMOSトランジスタPX2はオンとなり、NチャネルMOSトランジスタNX2はオフとなる。その後、信号05が「L」になると、信号01および信号01Bのいずれかが「L」に変化し、信号02および信号02Bのいずれかが「L」に変化する。ここでは、信号01Bが「L」に変化し、その後、信号02が「L」に変化するものとする。制御信号生成回路310は、信号01が「L」に変化し、かつ信号02が「L」に変化すると、制御信号04を「H」に変化させ、期間3に移行する。
When all of
期間3では、制御信号04が「H」によって、PチャネルMOSトランジスタPX2はオフとなり、NチャネルMOSトランジスタNX2はオンとなる。
In
以上のように、本変形例に係る制御信号生成回路によれば、第14の実施形態と同様に、ロジック2に入力されるすべての信号が変化するタイミングを、ロジック2の動作を制御する制御信号04が「L」となる期間2に限定することができる。また、第14の実施形態の制御信号生成回路は、遅延量が最大の信号のペアが02,02Bのときにのみ対応するものであったのに対して、本変形例に係る制御信号生成回路は、遅延量が最大の信号のペアが01,01Bのときと、02,02Bときのいずれにも対応することができる。
As described above, according to the control signal generation circuit according to the present modification, the control for controlling the operation of the
[第14の実施形態の変形例2]
本変形例は、第14の実施形態の制御信号生成回路とは別の構成で、第14の実施形態と同様に、ロジックの動作タイミングを制御する制御信号ctrl1を生成する制御信号生成回路を含む半導体回路に関する。
[
This modification has a configuration different from the control signal generation circuit of the fourteenth embodiment, and includes a control signal generation circuit that generates the control signal ctrl1 for controlling the operation timing of the logic, as in the fourteenth embodiment. The present invention relates to a semiconductor circuit.
(半導体回路の構成)
図55は、第14の実施形態の変形例2に係る複数個のロジックを含む半導体回路を示す。同図を参照して、ロジック1からロジック2へ複数個のバスを介して、信号01,01B、02,02Bが入力される。信号01は、正論理の第1の信号であり、信号01Bは、信号01を反転した負論理の第1の信号であり、信号02は、正論理の第2の信号であり、信号02Bは、信号02を反転した負論理の第2の信号である。
(Configuration of semiconductor circuit)
FIG. 55 shows a semiconductor circuit including a plurality of logics according to the second modification of the fourteenth embodiment. Referring to the figure, signals 01, 01B, 02, and 02B are input from
ロジック2の動作を制御する制御信号を生成する制御信号生成回路330は、遅延回路(delay)D2と、論理和回路OR2と、インバータIV2とからなる。この制御信号生成回路330は、すべてのロジック群の制御の基準タイミングを定める基準制御信号07(たとえば、外部から与えられるクロック信号)と、前段から信号04を受けて、ロジック2の制御信号06(すなわち、制御信号ctrl1)を出力する。
The control
遅延回路(delay)D2は、前段から信号04を受けて、信号04をαだけ遅延させた信号05を出力する。そして、信号05と、基準制御信号07とに応じて、論理和回路OR2およびインバータIV2によって、制御信号06が生成される。
The delay circuit (delay) D2 receives the
遅延回路(delay)D2の遅延量αは、期間2において、ロジック2に入力される信号のペアのうちの遅延量が最大である信号02および信号02のペアのいずれかが「L」になるタイミングよりも後のタイミングで制御信号06が「H」になるように設定されている。
The delay amount α of the delay circuit (delay) D2 is “L” in the
(動作)
次に、この半導体回路の動作を説明する。図54は、ロジック2に入力および出力される信号の時間的な変化の例を示す図である。同図において、期間1、期間2、および期間3は、それぞれ、第9〜第11、および第13の実施形態における期間1、期間2、および期間3に相当する。
(Operation)
Next, the operation of this semiconductor circuit will be described. FIG. 54 is a diagram illustrating an example of temporal changes in signals input to and output from the
期間1では、信号07が「L」である。信号01は「L」、信号01Bは「H」、信号02は「H」、信号02Bは「L」、信号04は「L」、および信号05は「L」とする。制御信号生成回路330は、信号04、信号05、および信号07の上記レベルに従い、制御信号06を「H」にする。制御信号06が「H」によって、PチャネルMOSトランジスタPX2はオフとなり、NチャネルMOSトランジスタNX2はオンとなる。
In the
期間2では、まず、信号07が「H」となる。これにより、ロジック1が出力する信号01,01B,02,02Bのレベルは、すべて「H」に変化する。また、信号07が「H」へ変化した時から、ロジック1の前段にある図示しない遅延回路での遅延の後、信号04が「H」に変化する。信号04が「H」に変化してから、遅延回路(delay)D2による遅延量αだけ遅延の後、信号05が「H」に変化する。
In the
一方、信号07が「H」となると(信号05のレベルに係らず)、論理和回路OR2およびインバータIV2によって、制御信号06は「L」に変化する。制御信号06が「L」になると、PチャネルMOSトランジスタPX2はオンとなり、NチャネルMOSトランジスタNX2はオフとなる。
On the other hand, when the
その後、信号07が「L」になると、信号01および信号01Bのいずれかが「L」に変化し、信号02および信号02Bのいずれかが「L」に変化する。ここでは、信号01Bが「L」に変化し、その後、信号02が「L」に変化するものとする。信号07が「L」への変化した時から、ロジック1の前段にある遅延回路での遅延の後、信号04が「L」に変化する。信号04が「L」に変化してから、遅延回路(delay)D2による遅延量αだけ遅延の後、信号05が「L」に変化する。
Thereafter, when the
信号07が「L」、および信号05が「L」となると、論理和回路OR2およびインバータIV2によって、制御信号06は「H」に変化し、期間3に移行する。
When the
期間3では、制御信号06が「H」によって、PチャネルMOSトランジスタPX2はオフとなり、NチャネルMOSトランジスタNX2はオンとなる。
In
以上のように、本変形例に係る制御信号生成回路によれば、第14の実施形態と同様に、ロジック2に入力されるすべての信号が変化するタイミングを、ロジック2の動作を制御する制御信号06が「L」となる期間2に限定することができる。
As described above, according to the control signal generation circuit according to the present modification, the control for controlling the operation of the
[第14の実施形態の変形例3]
本変形例は、第14の実施形態の制御信号生成回路とは別の構成で、第14の実施形態と同様に、ロジックの動作タイミングを制御する制御信号ctrl1を生成する制御信号生成回路を含む半導体回路に関する。
[
This modification has a configuration different from the control signal generation circuit of the fourteenth embodiment, and includes a control signal generation circuit that generates the control signal ctrl1 for controlling the operation timing of the logic, as in the fourteenth embodiment. The present invention relates to a semiconductor circuit.
(構成)
図57は、第14の実施形態の変形例3に係る複数個のロジックを含む半導体回路を示す。同図を参照して、ロジック1からロジック2へ複数個のバスを介して、信号01,01B、02,02Bが入力される。信号01は、正論理の第1の信号であり、信号01Bは、信号01を反転した負論理の第1の信号であり、信号02は、正論理の第2の信号であり、信号02Bは、信号02を反転した負論理の第2の信号である。信号02および信号02Bのペアは、ロジック1からロジック2へ送られる信号のうち、遅延量が最大の信号であるとする。
(Constitution)
FIG. 57 shows a semiconductor circuit including a plurality of logics according to
ロジック2の動作を制御する制御信号を生成する制御信号生成回路350は、遅延回路(delay)D2と、反転論理和回路NOR2とからなる。この制御信号生成回路350は、すべてのロジック群の制御の基準タイミングを定める基準制御信号07(たとえば、外部から与えられるクロック信号)と、前段から信号04を受けて、ロジック2の制御信号06(すなわち、制御信号ctrl1)を出力する。
The control
遅延回路(delay)D2は、前段から信号04を受けて、信号04をαだけ遅延させた信号05を出力する。そして、信号05と、基準制御信号07とに応じて、反転論理和回路NOR2によって、制御信号06が生成される。
The delay circuit (delay) D2 receives the
遅延回路(delay)D2の遅延量αは、期間2において、ロジック2に入力される信号のペアのうちの遅延量が最大である信号02および信号02のペアのいずれかが「L」になるタイミングよりも後のタイミングで制御信号06が「H」になるように設定されている。
The delay amount α of the delay circuit (delay) D2 is “L” in the
(動作)
次に、この半導体回路の動作を説明する。図58は、ロジック2に入力および出力される信号の時間的な変化の例を示す。同図において、期間1、期間2、および期間3は、それぞれ、第9〜第11、および第13の実施形態における期間1、期間2、および期間3に相当する。
(Operation)
Next, the operation of this semiconductor circuit will be described. FIG. 58 shows an example of temporal changes in signals input to and output from the
期間1では、信号07が「L」である。信号01は「L」、信号01Bは「H」、信号02は「H」、信号02Bは「L」、信号04は「L」、および信号05は「L」とする。制御信号生成回路350は、信号04、信号05、および信号07の上記レベルに従い、制御信号06を「H」にする。制御信号06が「H」によって、PチャネルMOSトランジスタPX2はオフとなり、NチャネルMOSトランジスタNX2はオンとなる。
In the
期間2では、まず、信号07が「H」となる。これにより、ロジック1が出力する信号01,01B,02,02Bのレベルは、すべて「H」に変化する。また、信号07が「H」へ変化した時から、ロジック1の前段にある図示しない遅延回路での遅延の後、信号04が「H」に変化する。信号04が「H」に変化してから、遅延回路(delay)D2による遅延量αだけ遅延の後、信号05が「H」に変化する。
In the
一方、信号07が「H」となると(信号05のレベルに係らず)、反転論理和回路NOR2によって、制御信号06は「L」に変化する。制御信号06が「L」になると、PチャネルMOSトランジスタPX2はオンとなり、NチャネルMOSトランジスタNX2はオフとなる。
On the other hand, when the
その後、信号07が「L」になると、信号01および信号01Bのいずれかが「L」に変化し、信号02および信号02Bのいずれかが「L」に変化する。ここでは、信号01Bが「L」に変化し、その後、信号02が「L」に変化するものとする。信号07が「L」への変化した時から、ロジック1の前段にある遅延回路での遅延の後、信号04が「L」に変化する。信号04が「L」に変化してから、遅延回路(delay)D2による遅延量αだけ遅延の後、信号05が「L」に変化する。
Thereafter, when the
信号07が「L」、および信号05が「L」となると、反転論理和回路NOR2によって、制御信号06は「H」に変化し、期間3に移行する。
When the
期間3では、制御信号06が「H」によって、PチャネルMOSトランジスタPX2はオフとなり、NチャネルMOSトランジスタNX2はオンとなる。
In
以上のように、本変形例に係る制御信号生成回路によれば、第14の実施形態と同様に、ロジック2に入力されるすべての信号が変化するタイミングを、ロジック2の動作を制御する制御信号06が「L」となる期間2に限定することができる。
As described above, according to the control signal generation circuit according to the present modification, the control for controlling the operation of the
[第14の実施形態の変形例4]
本変形例は、第14の実施形態の変形例3の基準制御信号を内部で自発的に生成するようにした半導体回路に関する。
[Fourth Modification of Fourteenth Embodiment]
This modification relates to a semiconductor circuit in which the reference control signal of
(半導体回路の構成)
図59は、第14の実施形態の変形例3に係る複数個のロジックを含む半導体回路を示す。同図を参照して、この半導体回路は、ロジック1の動作を制御する制御信号を生成する制御信号生成回路3501と、ロジック2の動作を制御する制御信号を生成する制御信号生成回路3502と、ロジック3の動作を制御する制御信号を生成する制御信号生成回路3503と、ロジック4の動作を制御する制御信号を生成する制御信号生成回路3504とを備える。
(Configuration of semiconductor circuit)
FIG. 59 shows a semiconductor circuit including a plurality of logics according to
制御信号生成回路3501,3502,3503,3504は、変形例3の制御信号生成回路350と同様に、遅延回路(delay)と、反転論理和回路とを備え、前段からの信号と、すべてのロジック群の制御の基準タイミングを定める基準制御信号とを受けて、対応するロジックに制御信号を出力する。
The control
すべてのロジック群の制御の基準タイミングを定める基準制御信号は、第14の実施形態、およびその変形例1〜3のように外部から与えられるのではなく、以下に説明するように、この半導体回路内部で自発的に生成される。
The reference control signal for determining the reference timing for the control of all the logic groups is not given from the outside as in the fourteenth embodiment and its
遅延回路(delay)D1〜D4は、ループを形成し、最後段のロジック4に対応する制御信号生成回路3504の遅延回路(delay)D4から出力された信号をインバータIV1を介して反転させた信号が最前段のロジック1に対応する制御信号生成回路3501の遅延回路(delay)D4に送られる。
The delay circuits (delays) D1 to D4 form a loop and are signals obtained by inverting the signal output from the delay circuit (delay) D4 of the control
そして、このループを流れる信号で、遅延回路(delay)D4から出力された信号をインバータIV1を介して反転させた信号が基準制御信号となる。 A signal obtained by inverting the signal output from the delay circuit (delay) D4 via the inverter IV1 among the signals flowing through this loop becomes the reference control signal.
以上のように、本変形例に係る半導体回路によれば、基準制御信号を内部で自発的に発生させることができる。基準制御信号が外部から与えられるクロック信号のような場合には、外部から意図的にクロック信号の周波数を高くしたり、クロック信号の電圧を下げたりする操作をすることによって、半導体回路を誤動作させることが可能なのに対して、本変形例の半導体回路は、基準制御信号が内部で自発的に生成されるので、このような攻撃を不可能とすることができる。 As described above, according to the semiconductor circuit according to this modification, the reference control signal can be spontaneously generated inside. When the reference control signal is an externally supplied clock signal, the semiconductor circuit malfunctions by intentionally increasing the frequency of the clock signal or decreasing the voltage of the clock signal from the outside. On the other hand, in the semiconductor circuit of this modification, the reference control signal is spontaneously generated inside, and thus such an attack can be made impossible.
本発明は、上記の実施形態に限定するものではなく、たとえば、以下のような変形例も含む。 The present invention is not limited to the above embodiment, and includes, for example, the following modifications.
(1) 正負論理混在データバス
本発明の実施形態では、正負論理混在データバスの一例として、n(=1024)ビットのデータを伝送し、偶数ビットが正論理で、奇数ビットが負論理である正負論理混在データバスについて説明したが、これに限定するものではない。正負論理混在データバスは、すべてのビットが正論理、または負論理でないデータバスであれば、どのようなものであってもよい。
(1) Positive / Negative Logic Mixed Data Bus In the embodiment of the present invention, as an example of a positive / negative logic mixed data bus, n (= 1024) bits of data are transmitted, even bits are positive logic, and odd bits are negative logic. Although the positive / negative logic mixed data bus has been described, the present invention is not limited to this. The mixed positive / negative logic data bus may be any data bus as long as all bits are not positive logic or negative logic.
(2) 乗数Yを伝送するバス
本発明の実施形態では、乗数Yは、常に正論理であるデータバスにより伝送されたが、これに限定するものではない。乗数Yを伝送するバスも正負論理混在データバスにしてもよい。これにより、電力解析によって、Yレジスタから出力される値の傍受を防止することができる。
(2) Bus for Transmitting Multiplier Y In the embodiment of the present invention, the multiplier Y is always transmitted through a data bus that is positive logic. However, the present invention is not limited to this. The bus for transmitting the multiplier Y may also be a positive / negative logic mixed data bus. Thereby, interception of the value output from the Y register can be prevented by power analysis.
(3) 正負論理混在データバス102a,102b,102c
本発明の第2の実施形態では、レジスタ群に属するレジスタから2本の正負論理混在データバス102a,102bにデータを出力することによって、乗数Yの2ビット分についての処理を同時行なうことができたが、これに限定するものではなく。たとえば、n(≧3)本の正負論理混在データバスにデータを出力することによって、乗数Yのnビット分について処理を同時に行なうようにしてもよい。本発明の第6の実施形態についても同様である。
(3) Positive / negative logic
In the second embodiment of the present invention, the processing for two bits of the multiplier Y can be performed simultaneously by outputting data from the registers belonging to the register group to the two
今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
11 暗号回路、12 制御回路、13 演算回路、20,100,300,400,500,800,1500,1600 乗算回路、21,101,301,401,501,601,701,801,901,1401,1501,1601,1701,1901 レジスタ群、22,122,622,822,922,1522 Xレジスタ、23,123,623,823,923,1302,1423,1623 Kレジスタ、24,26,28,112,1404,1406,1408,1504,1506,1507,1508L,1508U,1704,1706,1708,1713 データバス、27,107,607,907,1407,1707 Pレジスタ、51〜58 乗算のアルゴリズム、59,60 剰余演算のアルゴリズム、61〜63 モンゴメリ乗算剰余演算のアルゴリズム、102,102a,102b,102c,104,106,108 正負論理混在データバス、103,603,1000,1010,1100,1200,1503,1703,1903 加算部、105,1405 左シフト回路、109 Y[i]判定回路、121,621,1421,1521 Yレジスタ、150 バス論理変換回路、290,310,330,350 制御信号生成回路、320 零元出力回路、505,505a,505b,605,1705 右シフト回路、600,700,900,1700 モンゴメリ乗算剰余演算回路、609 Y[i]評価部、610,611,631,632,633,634,711,731,732,733,734,910,911,931,932,933,934,1411,1431,1432,1433,1436,1437,1531,1532,1731,1732,1733,1734,1735,1736 制御バス、624,1422 Nレジスタ、625,925 (X+N)レジスタ、722 G1レジスタ、723 G2レジスタ、724 G3レジスタ、725 G4レジスタ、805 2ビット左シフト回路、809 Y[2i+1,2i]判定回路、905 2ビット右シフト回路、909 Y[i+1,i]評価部、924,1410,1510 Y[i]選択回路、949,950 インバータ回路、951 NAND回路、952 加算回路、953,954,955 ROM、1001,1003,1101,1103,1104,1106,1201,1203,1204,1206,1207,1209 加算回路(正論理キャリー負論理)、1002,1102,1105,1202,1205,1208 加算回路(負論理キャリー正論理)、1300 データ格納レジスタ群、1303 選択回路、1400 剰余演算回路、1403 加減算部、1418,1517,1718 Qレジスタ、1409,1609,1709, レジスタ選択回路、1412 加減算選択レジスタ、1511 制御バス、1512 選択回路、1523,1914 Aレジスタ、1712 シフト選択回路、1714 レジスタ選択回路(SQ)、1723 Rレジスタ、1900 加算回路、1911 X1レジスタ、1912 X2レジスタ、P1,N1,PT1〜PT8,PX1〜PX4 PチャネルMOSトランジスタ、NT1〜NT130,NW1〜NW129,NE1〜NE129,NX1〜NX4 NチャネルMOSトランジスタ、AND1〜AND129,AND150〜AND152 論理積回路、NOR1〜NOR4,NOR150 反転論理和回路、OR1〜OR2,OR150〜OR152 論理和回路、NAND150 反転論理積回路、XOR150,XOR151 排他的論理和回路、D1〜D4 遅延回路、IV1,IV2 インバータ。 DESCRIPTION OF SYMBOLS 11 Encryption circuit, 12 Control circuit, 13 Arithmetic circuit, 20, 100, 300, 400, 500, 800, 1500, 1600 Multiplier circuit, 21, 101, 301, 401, 501, 601, 701, 801, 901, 1401, 1501, 1601, 1701, 1901 register group, 22, 122, 622, 822, 922, 1522 X register, 23, 123, 623, 823, 923, 1302, 1423, 1623 K register, 24, 26, 28, 112, 1404, 1406, 1408, 1504, 1506, 1507, 1508L, 1508U, 1704, 1706, 1708, 1713 Data bus, 27, 107, 607, 907, 1407, 1707 P register, 51-58 Multiplication algorithm, 59, 60 Remainder operation Algorithm, 61-63 Montgomery modular multiplication algorithm, 102, 102a, 102b, 102c, 104, 106, 108 Positive / negative logic mixed data bus, 103, 603, 1000, 1010, 1100, 1200, 1503, 1703, 1903 105, 1405 Left shift circuit, 109 Y [i] determination circuit, 121, 621, 1421, 1521 Y register, 150 bus logic conversion circuit, 290, 310, 330, 350 Control signal generation circuit, 320 Zero element output circuit, 505, 505a, 505b, 605, 1705 Right shift circuit, 600, 700, 900, 1700 Montgomery modular multiplication circuit, 609 Y [i] evaluation unit, 610, 611, 631, 632, 633, 634, 711, 731 732, 733 34, 910, 911, 931, 932, 933, 934, 1411, 1431, 1432, 1433, 1436, 1437, 1531, 1532, 1731, 1732, 1733, 1734, 1735, 1736 Control bus, 624, 1422 N register, 625,925 (X + N) register, 722 G1 register, 723 G2 register, 724 G3 register, 725 G4 register, 805 2-bit left shift circuit, 809 Y [2i + 1, 2i] determination circuit, 905 2-bit right shift circuit, 909 Y [I + 1, i] evaluation unit, 924, 1410, 1510 Y [i] selection circuit, 949, 950 inverter circuit, 951 NAND circuit, 952 addition circuit, 953, 954, 955 ROM, 1001, 1003, 1101, 1103 , 1104, 1106, 1201, 1203, 1204, 1206, 1207, 1209 Adder circuit (positive logic carry negative logic), 1002, 1102, 1105, 1202, 1205, 1208 Adder circuit (negative logic carry positive logic), 1300 data storage Register group, 1303 selection circuit, 1400 remainder operation circuit, 1403 addition / subtraction unit, 1418, 1517, 1718 Q register, 1409, 1609, 1709, register selection circuit, 1412 addition / subtraction selection register, 1511 control bus, 1512 selection circuit, 1523, 1914 A register, 1712 shift selection circuit, 1714 register selection circuit (SQ), 1723 R register, 1900 addition circuit, 1911 X1 register, 1912 X2 register, P1, N1, PT1 to PT8 PX1 to PX4 P channel MOS transistors, NT1 to NT130, NW1 to NW129, NE1 to NE129, NX1 to NX4 N channel MOS transistors, AND1 to AND129, AND150 to AND152 AND circuits, NOR1 to NOR4, NOR150 inverted OR circuit, OR1 OR2, OR150 to OR152 OR circuit, NAND150 inverted AND circuit, XOR150, XOR151 exclusive OR circuit, D1 to D4 delay circuit, IV1, IV2 inverter.
Claims (20)
前記データバスで伝送されるデータを受けて、前記データバスの論理に適合した加算を行なう加算部とを備えた演算回路。 an n-bit data bus that transmits n (n ≧ 2) bits of data and in which the logic of the bits is a mixture of positive logic and negative logic;
An arithmetic circuit comprising: an adder that receives data transmitted through the data bus and performs addition corresponding to the logic of the data bus.
被演算数を記憶し、nビットのデータを伝送し、ビットの論理が正論理と負論理とが混在しているnビットの第1のデータバスと接続する第1のレジスタと、
零元を記憶し、nビットのデータを伝送し、ビットの論理が正論理と負論理とが混在しているn(n≧2)ビットの第1のデータバスと接続する第2のレジスタと、
前記第1のレジスタから前記被演算数を前記第1のデータバスの各ビットの論理に適合させて前記第1のデータバスに出力させるか、前記第2のレジスタから前記零元を前記第1のデータバスの各ビットの論理に適合させて前記第1のデータバスに出力されるかを選択する選択回路と、
演算の途中結果のデータを記憶し、前記第1のデータバスと同一の論理の第2のデータバスと接続し、前記演算の途中結果のデータを前記第2のデータバスに出力する第3のレジスタと、
前記加算部から加算結果のデータを受けて、前記加算結果のデータを構成するビットのシフトを行ない、シフト結果のデータを前記演算の途中結果のデータとして前記第3のレジスタに出力するシフト回路とを備え、
前記加算部は、前記第1のデータバスから前記被演算数または前記零元を受け、前記第2のデータバスから前記演算の途中結果のデータを受けて、前記第1のデータバスおよび前記第2のデータバスの論理に適合した加算を行ない、加算結果のデータを前記シフト回路に出力する、請求項1記載の演算回路。 The arithmetic circuit further includes:
A first register for storing an operand, transmitting n-bit data, and connecting to a first n-bit data bus in which bit logic is a mixture of positive logic and negative logic;
A second register for storing a zero element, transmitting n-bit data, and connecting to a first data bus of n (n ≧ 2) bits in which bit logic is a mixture of positive logic and negative logic; ,
The operand is output from the first register to the first data bus in accordance with the logic of each bit of the first data bus, or the zero element is output from the second register to the first register. A selection circuit that selects whether to output to the first data bus in conformity with the logic of each bit of the data bus;
The third result data is stored in the middle of the operation, connected to the second data bus having the same logic as the first data bus, and the third result data is output to the second data bus. Registers,
A shift circuit that receives data of the addition result from the adder, shifts the bits constituting the data of the addition result, and outputs the data of the shift result to the third register as data of an intermediate result of the calculation; With
The adder receives the operand or the zero element from the first data bus, receives data of an intermediate result of the calculation from the second data bus, and receives the first data bus and the first data bus. 2. The arithmetic circuit according to claim 1, wherein an addition adapted to the logic of the data bus of 2 is performed and data of the addition result is output to the shift circuit.
前記第1のレジスタおよび前記第2のレジスタは、前記N個の第1のデータバスに接続し、
前記選択回路は、各前記第1のデータバスに、前記第1のレジスタから前記被演算数を出力させるか、前記第2のレジスタから前記零元を出力させるかを選択し、
前記加算部は、前記N個の第1のデータバスから前記被演算数または前記零元を受け、前記第2のデ−タバスから前記演算の途中結果のデータとを受けて、前記第1のデータバスおよび前記第2のデータバスの論理に適合した加算を行ない、加算結果のデータを前記シフト回路に出力し、
前記シフト回路は、前記加算結果のデータを受けて、前記加算結果のデータのNビットシフトを行なって、シフト結果のデータを前記演算の途中結果のデータとして前記第3のレジスタに出力する、請求項2記載の演算回路。 N first data buses (N ≧ 2) are provided,
The first register and the second register are connected to the N first data buses,
The selection circuit selects whether to output the operand from the first register or to output the zero element from the second register to each of the first data buses;
The adder receives the operand or the zero element from the N first data buses, receives the intermediate result data from the second data bus, and receives the first data bus. Addition conforming to the logic of the data bus and the second data bus is performed, and data of the addition result is output to the shift circuit,
The shift circuit receives the addition result data, performs N-bit shift of the addition result data, and outputs the shift result data to the third register as intermediate result data of the calculation. Item 3. The arithmetic circuit according to Item 2.
第1段目の各加算回路は、対応するビットの論理に合せたキャリー入力と、(N+1)個の入力のうちの2個の入力とを受けて、対応するビットの論理に適合した加算結果のデータを次段の対応するビットの加算回路に出力し、対応するビットの1つ上のビットの論理に適合したキャリーを次段の対応するビットの1つ上のビットの加算回路に出力し、
N≧3の場合に、第2段目〜第(N−1)段目の各加算回路は、前段の対応するビットの加算回路から対応するビットの論理に適合した加算結果のデータと、前段の対応するビットの1つ下のビットの加算回路から対応するビットの論理に適合したキャリーと、前記(N+1)個の入力のうちの未加算の1個の入力とを受けて、対応するビットの論理に適合した加算結果のデータを次段の対応するビットの加算回路に出力し、対応するビットの1つ上のビットの論理に適合したキャリーを次段の対応するビットの1つ上のビットの加算回路に出力し、
第N段目の各加算回路は、前段の対応するビットの加算回路から対応するビットの論理に適合した加算結果のデータと、前段の対応するビットの1つ下のビットの加算回路から対応するビットの論理に適合したキャリーと、第N段の1つ下のビットの加算回路から対応するビットの論理に適合したキャリーとを受けて、対応するビットの論理に適合した加算結果のデータを前記シフト回路に出力し、対応するビットの1つ上のビットの論理に適合したキャリーを第N段の対応するビットの1つ上のビットの加算回路に出力する、請求項3記載の演算回路。 The adder includes n stages of adder circuits for each stage when the number of bits of the multiplicand is n;
Each addition circuit in the first stage receives a carry input that matches the logic of the corresponding bit and two of the (N + 1) inputs, and an addition result that conforms to the logic of the corresponding bit Is output to the adder circuit for the corresponding bit in the next stage, and a carry conforming to the logic of the bit one bit above the corresponding bit is output to the adder circuit for the bit one bit above the corresponding bit in the next stage. ,
When N ≧ 3, the second to (N−1) -th stage adder circuits add the data of the addition result suitable for the logic of the corresponding bit from the corresponding bit adder circuit of the previous stage, and the previous stage The carry bit adapted to the logic of the corresponding bit from the adder circuit of the bit one bit lower than the corresponding bit and one unadded input of the (N + 1) inputs are received, and the corresponding bit The addition result data that conforms to the logic of the next stage is output to the adder circuit of the corresponding bit in the next stage, and the carry that conforms to the logic of the bit that is one bit higher than the corresponding bit is one above the corresponding bit of the next stage Output to the bit adder circuit,
Each adder circuit in the N-th stage corresponds to the addition result data that conforms to the logic of the corresponding bit from the corresponding bit adder circuit in the previous stage and the adder circuit in the bit one bit lower than the corresponding bit in the previous stage. The carry that conforms to the logic of the bit and the carry that conforms to the logic of the corresponding bit from the addition circuit of the bit one bit lower than the Nth stage receive the data of the addition result that conforms to the logic of the corresponding bit. 4. The arithmetic circuit according to claim 3, wherein the arithmetic circuit outputs to the shift circuit, and outputs a carry adapted to the logic of the bit one bit higher than the corresponding bit to a bit addition circuit one bit higher than the corresponding bit of the Nth stage.
零元を記憶し、前記第2のデータバスの各ビットの論理に合せて前記第2のデータバスに前記零元を出力する第5のレジスタと、
前記加算部が、演算の途中結果のデータの初期値と前記被演算数または前記零元とを加算するときには、前記第3のレジスタからの前記演算の途中結果のデータの出力に代えて、前記第5のレジスタから前記零元を出力させる選択回路とを備えた請求項2記載の演算回路。 The arithmetic circuit further includes:
A fifth register for storing a zero element and outputting the zero element to the second data bus in accordance with the logic of each bit of the second data bus;
When the addition unit adds the initial value of the result data during the operation and the operand or the zero element, instead of outputting the result data during the operation from the third register, The arithmetic circuit according to claim 2, further comprising: a selection circuit that outputs the zero element from a fifth register.
乗数を記憶する第1のレジスタと、
被乗数を記憶する第2のレジスタと、
乗算の途中結果のデータを記憶する第3のレジスタおよび第4のレジスタと、
前記第3のレジスタの出力と前記第4のレジスタの出力のいずれかを選択する選択回路と、
前記第2のレジスタから出力される被乗数と、前記第3のレジスタまたは前記第4のレジスタから出力される前記乗算の途中結果のデータとを受けて、これらを加算して、加算結果のデータを出力する加算部と、
加算結果のデータを構成するビットをシフトし、シフト結果のデータを出力する第1のシフト回路と、
前記乗算の途中結果のデータを受けて、前記乗算の途中結果のデータを構成するビットをシフトし、シフト結果のデータを出力する第2のシフト回路とを備え、
前記第3のレジスタは、前記第1のシフト回路から出力されたシフト結果のデータを受けて、前記乗算の途中結果のデータとして記憶し、
前記第4のレジスタは、前記第2のシフト回路から出力されたシフト結果のデータを受けて、前記乗算の途中結果のデータとして記憶し、
前記選択回路は、前記第1のレジスタから出力される前記乗数を構成するビットの値に基づき、前記第3のレジスタと前記第4のレジスタのうちのいずれかを選択し、選択したレジスタが記憶している前記乗算の途中結果のデータを前記加算部および前記第2のシフト回路へ出力させる、演算回路。 An arithmetic circuit for multiplying a multiplier and a multiplicand,
A first register for storing a multiplier;
A second register for storing a multiplicand;
A third register and a fourth register for storing data of the result of the multiplication;
A selection circuit for selecting one of the output of the third register and the output of the fourth register;
The multiplicand output from the second register and the intermediate result data output from the third register or the fourth register are received, added together, and the addition result data is obtained. An adder to output;
A first shift circuit for shifting the bits constituting the data of the addition result and outputting the data of the shift result;
A second shift circuit that receives the data of the intermediate result of the multiplication, shifts the bits constituting the data of the intermediate result of the multiplication, and outputs the data of the shift result;
The third register receives the data of the shift result output from the first shift circuit and stores it as the data of the intermediate result of the multiplication,
The fourth register receives the data of the shift result output from the second shift circuit and stores it as data of the intermediate result of the multiplication,
The selection circuit selects one of the third register and the fourth register based on a value of a bit constituting the multiplier output from the first register, and the selected register stores the selected register An arithmetic circuit that outputs data of the intermediate result of the multiplication being performed to the adder and the second shift circuit.
乗数を記憶する第1のレジスタと、
被乗数を記憶する第2のレジスタと、
零元を記憶する第3のレジスタと、
乗算の途中結果のデータを記憶する第4のレジスタおよび第5のレジスタと、
前記第4のレジスタの出力と前記第5のレジスタの出力のいずれかを選択する選択回路と、
前記第2のレジスタから出力される前記被乗数、または前記第3のレジスタから出力される前記零元と、前記第4のレジスタまたは前記第5のレジスタから出力される前記乗算の途中結果のデータとを受けて、これらを加算して、加算結果のデータを出力する加算部と、
加算結果のデータを構成するビットをシフトし、シフト結果のデータを出力するシフト回路と、
前記第4のレジスタは、前記シフト回路から、前記被乗数についての加算結果のデータを構成するビットをシフトしたデータを受けて、前記乗算の途中結果のデータとして記憶し、
前記第5のレジスタは、前記シフト回路から、前記零元についての加算結果のデータを構成するビットをシフトしたデ−タを受けて、前記乗算の途中結果のデータとして記憶し、
前記選択回路は、前記第1のレジスタから出力される前記乗数を構成するビットの値に基づき、前記第4のレジスタと前記第5のレジスタのうちのいずれかを選択し、選択したレジスタが記憶している前記乗算の途中結果のデータを前記加算部へ出力させる、演算回路。 An arithmetic circuit for multiplying a multiplier and a multiplicand,
A first register for storing a multiplier;
A second register for storing a multiplicand;
A third register storing zero elements;
A fourth register and a fifth register for storing data of the result of the multiplication;
A selection circuit for selecting one of the output of the fourth register and the output of the fifth register;
The multiplicand output from the second register or the zero element output from the third register; and the data of the intermediate result of the multiplication output from the fourth register or the fifth register; Receiving, adding these, and outputting the data of the addition result,
A shift circuit for shifting the bits constituting the data of the addition result and outputting the data of the shift result;
The fourth register receives, from the shift circuit, data obtained by shifting the bits constituting the addition result data for the multiplicand, and stores the data as intermediate result data of the multiplication,
The fifth register receives, from the shift circuit, data obtained by shifting the bits constituting the addition result data for the zero element, and stores the data as the intermediate result data of the multiplication,
The selection circuit selects one of the fourth register and the fifth register based on a value of a bit constituting the multiplier output from the first register, and the selected register stores An arithmetic circuit for outputting data of the halfway result of the multiplication to the adder.
被除数を記憶し、前記被除数を構成するビットを出力する第1のレジスタと、
除数を記憶する第2のレジスタと、
零元を記憶する第3のレジスタと、
剰余演算の途中結果のデータを記憶する第4のレジスタおよび第5のレジスタと、
前記第4のレジスタまたは前記第5のレジスタから出力される前記剰余演算の途中結果のデータと、前記第1のレジスタから出力される前記被除数のビットとを受けて、前記剰余演算の途中結果のデータを構成するビットを1ビットだけシフトするとともに、第0ビット目を前記第1のレジスタから出力される前記被除数を構成するビットの値とするシフト回路と、
前記シフト回路から出力されるデータ、前記第3のレジスタから出力される前記剰余演算の途中結果のデータ、または前記第4レジスタから出力される前記剰余演算の途中結果のデータと、前記第2のレジスタから出力される除数、または前記第3のレジスタから出力される零元とを受けて、加算選択信号が活性化されているときには、これらを加算し、加算選択信号が非活性のときには、これらを減算して、加算結果または減算結果を出力する加減算部と、
前記第4のレジスタまたは前記第5のレジスタから出力される前記剰余演算の途中結果のデータの符号、および/または剰余演算処理の実行段階に基づいて、第1の読出信号、第1の書込信号、第2の読出信号、第2の書込信号、および前記加算選択信号の活性化を制御する選択回路とを備え、
前記第4のレジスタは、前記加減算部から加算結果のデータを受けて、前記第1の書込信号が活性化されているときに、前記加算結果のデータを前記剰余演算の途中結果のデータとして記憶し、前記第1の読出信号が活性化されているときに、前記記憶している前記剰余演算の途中結果のデータを出力し、
前記第5のレジスタは、前記加減算部から減算結果のデータを受けて、前記第2の書込信号が活性化されているときに、前記減算結果のデータを前記剰余演算の途中結果のデータとして記憶し、前記第2の読出信号が活性化されているときに、前記記憶している前記剰余演算の途中結果のデータを出力する、演算回路。 An arithmetic circuit that performs a remainder operation using a divisor and a dividend,
A first register for storing a dividend and outputting bits constituting the dividend;
A second register for storing the divisor;
A third register storing zero elements;
A fourth register and a fifth register for storing intermediate result data of the remainder operation;
In response to the data of the intermediate result of the remainder operation output from the fourth register or the fifth register and the bits of the dividend output from the first register, the intermediate result of the remainder operation is obtained. A shift circuit that shifts the bits constituting the data by 1 bit and uses the 0th bit as the value of the bits constituting the dividend output from the first register;
Data output from the shift circuit, data of an intermediate result of the remainder operation output from the third register, or data of an intermediate result of the remainder operation output from the fourth register, and the second In response to the divisor output from the register or the zero element output from the third register, when the addition selection signal is activated, these are added, and when the addition selection signal is inactive, these And an addition / subtraction unit that outputs the addition result or the subtraction result,
Based on the sign of the intermediate result data of the remainder operation output from the fourth register or the fifth register and / or the execution stage of the remainder operation processing, the first read signal, the first write A selection circuit for controlling activation of the signal, the second read signal, the second write signal, and the addition selection signal;
The fourth register receives the addition result data from the adder / subtractor, and when the first write signal is activated, the addition result data is used as the intermediate result data of the remainder calculation. Storing, when the first read signal is activated, outputting the stored intermediate result data of the remainder operation;
The fifth register receives data of a subtraction result from the adder / subtractor, and uses the data of the subtraction result as data of an intermediate result of the remainder operation when the second write signal is activated. An arithmetic circuit for storing and outputting the data of the stored intermediate result of the remainder operation when the second read signal is activated.
乗数を記憶し、前記乗数を構成するビットを出力する第1のレジスタと、
被乗数を記憶する第2のレジスタと、
零元を記憶する第3のレジスタと、
除数を記憶する第4のレジスタと、
モンゴメリ乗算剰余の途中結果のデータを記憶する第5のレジスタおよび第6のレジスタと、
前記第2のレジスタから出力される前記被乗数、前記第3のレジスタから出力される前記零元、または前記第4のレジスタから出力される除数と、前記第5のレジスタまたは前記第6のレジスタから出力される前記モンゴメリ乗算剰余演算の途中結果のデータとを受けて、これらを加算して、加算結果のデータを出力する加算部と、
前記加算結果のデータを受けて、シフト選択信号が活性化されているときに、前記加算結果のデータを構成するビットをシフトして、シフト結果のデータを出力し、シフト選択信号が非活性のときに、前記加算結果のデータをそのまま出力するシフト回路と、
前記第1のレジスタから出力される前記乗数を構成するビットの値、前記第5のレジスタまたは前記第6のレジスタから出力される前記モンゴメリ乗算剰余演算の途中結果のデータの第0ビット目の値、前記第5のレジスタまたは前記第6のレジスタから出力される前記モンゴメリ乗算剰余演算の途中結果のデータの符号、および/またはモンゴメリ乗算剰余演算処理の実行段階に基づいて、第1の読出信号、第1の書込信号、第2の読出信号、第2の書込信号、および前記シフト選択信号の活性化を制御する選択回路とを備え、
前記第5のレジスタは、前記シフト回路からシフト結果のデータを受けて、前記第1の書込信号が活性化されているときに、前記シフト結果のデータを前記モンゴメリ乗算剰余演算の途中結果のデータとして記憶し、前記第1の読出信号が活性化されているときに、前記記憶している前記モンゴメリ乗算剰余演算の途中結果のデータを出力し、
前記第6のレジスタは、前記シフト回路からシフト結果のデータを受けて、前記第2の書込信号が活性化されているときに、前記シフト結果のデータを前記モンゴメリ乗算剰余演算の途中結果のデータとして記憶し、前記第2の読出信号が活性化されているときに、前記記憶している前記モンゴメリ乗算剰余演算の途中結果のデータを出力する、演算回路。 An arithmetic circuit for calculating a Montgomery multiplication remainder by a multiplier, a multiplicand, and a divisor,
A first register for storing a multiplier and outputting bits constituting the multiplier;
A second register for storing a multiplicand;
A third register storing zero elements;
A fourth register for storing the divisor;
A fifth register and a sixth register for storing intermediate result data of the Montgomery multiplication remainder;
From the multiplicand output from the second register, the zero element output from the third register, or the divisor output from the fourth register, and from the fifth register or the sixth register An output unit that receives the intermediate result data of the Montgomery multiplication operation that is output, adds them, and outputs the addition result data; and
When the shift selection signal is activated in response to the addition result data, the bits constituting the addition result data are shifted, the shift result data is output, and the shift selection signal is inactive. Sometimes, the shift circuit that outputs the data of the addition result as it is,
The value of the bit constituting the multiplier output from the first register, the value of the 0th bit of the data of the intermediate result of the Montgomery multiplication remainder output from the fifth register or the sixth register The first read signal based on the sign of the intermediate result data of the Montgomery multiplication remainder operation output from the fifth register or the sixth register, and / or the execution stage of the Montgomery multiplication remainder operation process, A selection circuit that controls activation of the first write signal, the second read signal, the second write signal, and the shift selection signal;
The fifth register receives data of a shift result from the shift circuit, and when the first write signal is activated, converts the data of the shift result to an intermediate result of the Montgomery multiplication remainder operation. Storing as data, and when the first read signal is activated, outputting the data of the intermediate result of the stored Montgomery multiplication residue operation,
The sixth register receives data of a shift result from the shift circuit, and when the second write signal is activated, the sixth register converts the data of the shift result to an intermediate result of the Montgomery modular multiplication operation. An arithmetic circuit which stores as data and outputs data of the stored intermediate result of the Montgomery modular multiplication when the second read signal is activated.
負論理を出力する第2の出力端子と、
制御信号の活性化によって、前記第1の出力端子および前記第2の出力端子のいずれをもハイ状態とする1個以上の第1群に属するトランジスタと、
入力信号または反転入力信号を受けて、前記制御信号が不活性の場合に、前記受けた信号のレベルが所定の論理のときに、前記第1の出力端子をロウ状態とする1個以上の第2群に属するトランジスタと、
入力信号または反転入力信号を受けて、前記制御信号が不活性の場合に、前記受けた信号のレベルが所定の論理のときに、前記第2の出力端子をロウ状態とする1個以上の第3群に属するトランジスタとを備えた論理回路。 A first output terminal that outputs positive logic;
A second output terminal for outputting negative logic;
One or more transistors belonging to the first group that bring both the first output terminal and the second output terminal into a high state by the activation of the control signal;
In response to an input signal or an inverted input signal, when the control signal is inactive, when the level of the received signal is a predetermined logic, the one or more first output terminals that set the first output terminal to a low state Transistors belonging to two groups;
In response to an input signal or an inverted input signal, when the control signal is inactive, when the level of the received signal is a predetermined logic, the one or more second output terminals are set to a low state. A logic circuit including transistors belonging to Group 3.
負論理を出力する第2の出力端子と、
制御信号の活性化によって、前記第1の出力端子および前記第2の出力端子のいずれをもハイ状態とする1個以上の第1群に属するトランジスタと、
各々が、対応する入力信号を受け、前記第1の出力端子と接続される複数個の第2群に属するトランジスタと、
各々が、対応する入力信号を受け、前記第2の出力端子と接続される複数個の第3群に属するトランジスタと、
前記第2群に属するトランジスタは、前記制御信号が不活性のときに、それぞれに対応する入力信号が活性化されると、前記第1の出力端子をロウ状態にし、
前記第3群に属するトランジスタは、前記制御信号が不活性のときに、対応する入力信号が活性化されると、前記第2の出力端子をロウ状態にする、読出し専用メモリ。 A first output terminal that outputs positive logic;
A second output terminal for outputting negative logic;
One or more transistors belonging to the first group that bring both the first output terminal and the second output terminal into a high state by the activation of the control signal;
A plurality of transistors belonging to a plurality of second groups, each receiving a corresponding input signal and connected to the first output terminal;
A plurality of transistors belonging to a plurality of third groups each receiving a corresponding input signal and connected to the second output terminal;
The transistors belonging to the second group, when the control signal is inactive, and when the corresponding input signal is activated, the first output terminal is set to the low state,
The transistor belonging to the third group is a read only memory in which when the corresponding input signal is activated when the control signal is inactive, the second output terminal is set to a low state.
負論理のデータを記憶する第2のノードと、
正論理の入力信号を受ける第1の入力端子と、
負論理の反転入力信号を受ける第2の入力端子と、
制御信号の活性化によって、前記第1のノードおよび前記第2のノードのいずれをもハイ状態とする1個以上の第1群のトランジスタと、
書込み信号の活性化によって、前記第1の入力端子と前記第1のノードとの間を導通させる第1のトランジスタと、
前記書込み信号の活性化によって、前記第2の入力端子と前記第2のノードとの間を導通させる第2のトランジスタとを備えたレジスタ。 A first node for storing positive logic data;
A second node for storing negative logic data;
A first input terminal for receiving a positive logic input signal;
A second input terminal receiving a negative logic inverted input signal;
One or more first group of transistors that bring both the first node and the second node to a high state by activation of a control signal;
A first transistor that conducts between the first input terminal and the first node by activation of a write signal;
A register comprising: a second transistor that conducts between the second input terminal and the second node by the activation of the write signal.
負論理のデータを記憶する第2のノードと、
正論理の出力信号を出力する第1の出力端子と、
負論理の反転出力信号を出力する第2の出力端子と、
制御信号の活性化によって、前記第1の出力端子と前記第2の出力端子のいずれをもハイ状態とする1個以上の第1群に属するトランジスタと、
読出信号の活性化によって、前記第1の出力端子と前記第1のノードとの間を導通させる第1のトランジスタと、
前記読出し信号の活性化によって、前記第2の出力端子と前記第2のノードとの間を導通させる第2のトランジスタとを備えたレジスタ。 A first node for storing positive logic data;
A second node for storing negative logic data;
A first output terminal for outputting a positive logic output signal;
A second output terminal for outputting a negative logic inverted output signal;
One or more transistors belonging to the first group that bring both the first output terminal and the second output terminal into a high state by activation of a control signal;
A first transistor that conducts between the first output terminal and the first node by activation of a read signal;
A register comprising: a second transistor that conducts between the second output terminal and the second node by the activation of the read signal.
対応するロジックに与える制御信号を生成する複数個の制御信号生成回路とを備え、
前記ロジックは、論理回路、またはレジスタを含み、
前記論理回路またはレジスタは、入力信号、反転入力信号、および制御信号とを受けて、出力信号および反転出力信号を出力し、
前記論理回路または前記レジスタは、前記制御信号の活性化により、前記出力信号および前記反転出力信号をともにハイ状態とし、
前記制御信号の非活性化されているときに、前記入力信号および前記反転入力信号のレベルに応じて、前記出力信号および前記反転出力信号の一方をハイ状態とし、他方をロウ状態とし、
前記制御信号生成回路は、前記制御信号を活性化した後、前記対応するロジックに入力される少なくとも1つの入力信号および反転入力信号のペアのうち、ともにハイ状態からいずれかがロウ状態に変化するタイミングが最も遅いペアが変化した後に、前記制御信号を非活性化させる、半導体回路。 A plurality of serially connected logic and
A plurality of control signal generation circuits for generating control signals to be applied to corresponding logic;
The logic includes a logic circuit or a register,
The logic circuit or register receives an input signal, an inverted input signal, and a control signal, and outputs an output signal and an inverted output signal;
The logic circuit or the register sets both the output signal and the inverted output signal to a high state by activating the control signal,
When the control signal is inactivated, one of the output signal and the inverted output signal is set to a high state and the other is set to a low state according to the levels of the input signal and the inverted input signal.
After activating the control signal, the control signal generation circuit changes from a high state to a low state in at least one input signal and inverted input signal pair input to the corresponding logic. A semiconductor circuit which deactivates the control signal after a pair having the latest timing changes.
前記遅延回路の出力と、すべてのブロックに共通の基準信号とを受けて、前記制御信号を生成するとともに、後段の制御信号生成回路の制御入力信号を生成する論理回路を含む、請求項17記載の半導体回路。 The control signal generation circuit includes a delay circuit that receives a control input signal;
18. A logic circuit that receives the output of the delay circuit and a reference signal common to all the blocks, generates the control signal, and generates a control input signal for a control signal generation circuit at a subsequent stage. Semiconductor circuit.
前記インバータの出力は、前記すべてのブロックに共通の基準信号として、各ブロックの制御信号生成回路に送られるとともに、前記制御入力信号として、最前段の制御信号生成回路に送られる、請求項19記載の半導体回路。 An inverter that inverts the signal output from the last-stage control signal generation circuit;
The output of the inverter is sent to the control signal generation circuit of each block as a reference signal common to all the blocks, and is also sent to the control signal generation circuit at the front stage as the control input signal. Semiconductor circuit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004164761A JP2005346373A (en) | 2004-06-02 | 2004-06-02 | Arithmetic circuit, logical circuit, read-only memory, register, and semiconductor circuit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004164761A JP2005346373A (en) | 2004-06-02 | 2004-06-02 | Arithmetic circuit, logical circuit, read-only memory, register, and semiconductor circuit |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2005346373A true JP2005346373A (en) | 2005-12-15 |
JP2005346373A5 JP2005346373A5 (en) | 2007-06-14 |
Family
ID=35498693
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004164761A Pending JP2005346373A (en) | 2004-06-02 | 2004-06-02 | Arithmetic circuit, logical circuit, read-only memory, register, and semiconductor circuit |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005346373A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2008056461A1 (en) * | 2006-11-09 | 2008-05-15 | Panasonic Corporation | Cryptographic calculation processing circuit |
JP2010008883A (en) * | 2008-06-30 | 2010-01-14 | Toshiba Corp | Arithmetic device for cipher, arithmetic method for cipher, and program |
KR102196891B1 (en) * | 2020-01-31 | 2020-12-30 | 연세대학교 산학협력단 | Ferroelectric FET-based Full Adder |
-
2004
- 2004-06-02 JP JP2004164761A patent/JP2005346373A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2008056461A1 (en) * | 2006-11-09 | 2008-05-15 | Panasonic Corporation | Cryptographic calculation processing circuit |
JP2010008883A (en) * | 2008-06-30 | 2010-01-14 | Toshiba Corp | Arithmetic device for cipher, arithmetic method for cipher, and program |
KR102196891B1 (en) * | 2020-01-31 | 2020-12-30 | 연세대학교 산학협력단 | Ferroelectric FET-based Full Adder |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4870932B2 (en) | Extended Montgomery Modular Multiplier Supporting Multiple Precision | |
US11169778B2 (en) | Converting floating point numbers to reduce the precision | |
JP4374363B2 (en) | Bit field operation circuit | |
JP4700051B2 (en) | Encryption apparatus and encryption method | |
JP4357815B2 (en) | Cryptographic operation circuit | |
US7543011B2 (en) | Montgomery modular multiplier and method thereof using carry save addition | |
JPH09274560A (en) | Power remainder operation circuit, power remainder operation system and operation method for power remainder operation | |
JPH0542011B2 (en) | ||
EP3847544B1 (en) | Hardware module for converting numbers | |
JP3615622B2 (en) | Microcomputer | |
JP2010044398A (en) | Multiple precision arithmetic device | |
EP2037357A2 (en) | Montgomery modular multiplier and method thereof using carry save addition | |
US9166795B2 (en) | Device and method for forming a signature | |
US11922133B2 (en) | Processor and method for processing mask data | |
US3436737A (en) | Shift enable algorithm implementation means | |
US7480691B2 (en) | Arithmetic device for multiple precision arithmetic for Montgomery multiplication residue arithmetic | |
JP2005346373A (en) | Arithmetic circuit, logical circuit, read-only memory, register, and semiconductor circuit | |
US7296049B2 (en) | Fast multiplication circuits | |
JP2006508464A (en) | Multiplier with lookup table | |
US6114945A (en) | Apparatus and method for programmable fast comparison of a result of a logic operation with an selected result | |
US6903663B2 (en) | Method for converting the binary representation of a number in a signed binary representation | |
CN104346134A (en) | Data processing apparatus and method for performing a narrowing-and-rounding arithmetic operation | |
US5309385A (en) | Vector division processing method and system | |
US20030146860A1 (en) | Exponent encoder circuit and mask circuit | |
JP2006338215A (en) | Vector product-sum operation circuit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070419 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20070419 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090324 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20090714 |