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 PDF

Info

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
Application number
JP2004164761A
Other languages
Japanese (ja)
Other versions
JP2005346373A5 (en
Inventor
Shigenori Miyauchi
成典 宮内
Atsuo Yamaguchi
敦男 山口
Kazuhiko Fukushima
和彦 福島
Kazuo Asami
和生 朝見
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Technology Corp
Original Assignee
Renesas Technology Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2004164761A priority Critical patent/JP2005346373A/en
Publication of JP2005346373A publication Critical patent/JP2005346373A/en
Publication of JP2005346373A5 publication Critical patent/JP2005346373A5/ja
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/002Countermeasures against attacks on cryptographic mechanisms
    • H04L9/003Countermeasures against attacks on cryptographic mechanisms for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/12Details 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

<P>PROBLEM TO BE SOLVED: To provide an arithmetic circuit to be used for an encryption circuit, and a logical circuit, a read-only memory, a register, and a semiconductor circuit including a plurality of logics, in which confidential data can be prevented from being intercepted by electronic analysis by using simple constitution. <P>SOLUTION: Positive/negative logic mixing data buses 102, 108 included in a multiplication circuit 100 transmit n (n≥2) bit data in which positive logic and negative logic for bit logic are mixed. An addition part 1000 receives data transmitted from the positive/negative logic mixing data buses 102, 108 and performs addition suited to the logic of the positive/negative logic mixing data buses 102, 108. <P>COPYRIGHT: (C)2006,JPO&NCIPI

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, Patent Document 1 describes power analysis such as SPA (Simple Power Analysis) or DPA (Differential Power Analysis). That is, in the SPA method, the encryption key and the processed data are analyzed from the difference in the consumption current waveform caused by the difference in the operation instruction or the processed data. In the DPA method, the current consumption waveform is statistically processed to estimate the encryption key. In this DPA method, for example, an assumed encryption key is applied to a certain part of DES, and a consumption current waveform is measured and statistically changed while changing plaintext. This operation is repeated while changing the encryption key, and the current waveform shows a large peak when the key is correct.

このような、電力解析による秘匿データの傍受を防止するために、暗号回路の動作時の消費電力が秘匿データの値によって変化しないようにするための手法が提案されている。   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=enn-11の値のei=0でも1でもA2modNとABmodNの両方の演算を常に行なうようにする。 For example, in Patent Document 1, in the coprocessor 209, a dummy operation for the purpose of disturbance is inserted when performing a remainder operation XYmodN that should be used for both encryption and decryption. That, when decomposed into two forms of remainder operation A 2 modN and ABmodN by known algorithms, Y = e n e n- 1 e 1 in the value of e i = 0 Any 1 Any both A 2 modN and ABmodN Always perform operations.

また、特許文献2では、データ機密保持のための暗号処理に用いる鍵データを、その反転データとともにE2PROM4に記憶しておき、E2PROM4より鍵データとその反転データを読出し、それらのうちの鍵データをもとに暗号回路4で暗号処理プログラムを実行し、その実行結果を用いてCPU1にて演算プログラムを実行する。また、暗号処理手段に、鍵データや処理データなどのデータを伝送するラインと、鍵データや処理データなどの反転データを伝送するラインとを持たせ、各ラインとダミー回路とを接続する。   Also, in Patent Document 2, key data used for encryption processing for maintaining data confidentiality is stored in the E2PROM 4 together with its inverted data, the key data and its inverted data are read from the E2PROM 4, and the key data of them is stored. The encryption circuit 4 is originally executed by the encryption circuit 4, and the calculation program is executed by the CPU 1 using the execution result. Further, the cryptographic processing means has a line for transmitting data such as key data and processed data and a line for transmitting inverted data such as key data and processed data, and connects each line and the dummy circuit.

また、特許文献3では、処理するデータを正常処理のデータとそのビットの値を判定したデータの両方を使用する。そして、同一の命令で、正常処理のデータとビットの値を反転したデータとを処理することにより、データバス上の値などが“0”から“1”、あるいは“1”から“0”なる回数を一定にする。データバスでは、値が反転したときに電流を大きく消費するため、“1”と“0”の反転回数が一定になることにより、電流の消費する回数が一定になる。
特開2001−195555号公報 特開2003−18143号公報 特開2000−165375号公報
In Patent Document 3, both normal processing data and data whose bit value is determined are used as data to be processed. Then, by processing the normally processed data and the data obtained by inverting the bit value with the same instruction, the value on the data bus is changed from “0” to “1”, or from “1” to “0”. Keep the number of times constant. Since the data bus consumes a large amount of current when the value is inverted, the number of times the current is consumed becomes constant by making the number of inversions of “1” and “0” constant.
JP 2001-195555 A JP 2003-18143 A JP 2000-165375 A

しかしながら、特許文献1に記載の方法では、モンゴメリ法による剰余演算の一手法において、Y=enn-11の値のei=0のときにA2modNのみの演算が必要で、ei=1のときにA2modNとABmodNの両方の演算が必要なところ、ei=0でもABmodNの演算をダミー演算として実行したものであって、モンゴメリ法による剰余演算の一手法に特有の方法である。 However, in the method described in Patent Document 1, in one approach the remainder calculation according to the Montgomery method, Y = e n e n- 1 when e i = 0 for e 1 value A 2 modN requires operation only When e i = 1, both A 2 mod N and AB mod N are required. However, even when e i = 0, AB mod N is executed as a dummy operation. It is a peculiar method.

また、特許文献2および特許文献3に記載の方法では、演算のたびに、正常処理データの反転データを生成または読出して、それを伝送して処理する必要があるので、暗号回路の構成が複雑、かつ大規模化する。   Further, in the methods described in Patent Document 2 and Patent Document 3, it is necessary to generate or read inverted data of normal processing data and transmit and process it every time an operation is performed, so that the configuration of the encryption circuit is complicated. And scale up.

それゆえに、本発明の目的は、簡易な構成で、電力解析による秘匿データの傍受を防止することのできる、暗号回路に用いられる演算回路、論理回路、読出し専用メモリ、レジスタ、および複数個のロジックを含む半導体回路を提供することである。   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 multiplication circuit 20 includes a register group 21, a Y [i] determination circuit 109, an adder 103, a left shift circuit 105, and a P register 28. A data bus 112 connects between the register group and the Y [i] determination circuit and addition unit 103. The adder 103 and the left shift circuit 105 are connected by a data bus 24. The left shift circuit 105 and the P register 27 are connected by a data bus 26. The P register 27 and the adder 103 are connected by a data bus 28. In all the data buses 112, 24, 26, and 28, the logic of each bit of data to be transmitted is positive logic.

レジスタ群21は、乗数Yを記憶するYレジスタ121と、被乗数Xを記憶するXレジスタ22と、全ビットが「0」である零元Kを記憶するKレジスタ23とを含む。また、Pレジスタ27は、演算の途中結果のデータPを記憶する。   The register group 21 includes a Y register 121 that stores a multiplier Y, an X register 22 that stores a multiplicand X, and a K register 23 that stores a zero element K in which all bits are “0”. The P register 27 stores data P as a result of the operation.

(従来の乗算回路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 algorithm 51 will be described with reference to FIG.

乗数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 X register 22 outputs the multiplicand X to the data bus 112. The P register 27 outputs the stored data P to the data bus 28.

加算部103は、データバス112を通じて受けた被乗数Xと、データバス28を通じて受けたデータPとを加算して、加算結果をデータバス24に出力する。   Adder 103 adds multiplicand X received via data bus 112 and data P received via data bus 28, and outputs the addition result to data bus 24.

左シフト回路105は、データバス24を通じて加算結果を受け、加算結果を1ビットだけ右にシフトして、データバス26を通じてPレジスタ27に出力する。   The left shift circuit 105 receives the addition result through the data bus 24, shifts the addition result to the right by 1 bit, and outputs the result to the P register 27 through the data bus 26.

Pレジスタ27は、デ−タバス26を通じて受けたデータをデータPとして記憶する。   The P register 27 stores the data received through the data bus 26 as data P.

一方、乗数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 data bus 112. The P register 27 outputs the stored data P to the data bus 28.

加算部103は、データバス112を通じて受けた零元Kと、データバス28を通じて受けたデータPとを加算して、加算結果をデータバス24に出力する。   Adder 103 adds zero element K received via data bus 112 and data P received via data bus 28, and outputs the addition result to data bus 24.

左シフト回路105は、データバス24を通じて加算結果を受け、加算結果を1ビットだけ右にシフトして、データバス26を通じてPレジスタ27に出力する。   The left shift circuit 105 receives the addition result through the data bus 24, shifts the addition result to the right by 1 bit, and outputs the result to the P register 27 through the data bus 26.

Pレジスタ27は、デ−タバス26を通じて受けたデータをデータPとして記憶する。   The P register 27 stores the data received through the data bus 26 as data P.

以上のようなアルゴリズムでは、乗数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 K register 23 outputs the zero element K to the data bus 112 is smaller than the power consumed when the X register 22 outputs the multiplicand X to the data bus 112. This is because the power consumed when the adder 103 adds the zero element K and the data P is smaller than the power consumed when the adder 103 adds the multiplicand X and the data P. Therefore, it is possible to specify the multiplier Y by using a power consumption analysis means such as SPA (Simple Power Analysis) or DPA (Differential Power Analysis), thereby being used for cryptographic processing. Secret data such as a key can be specified.

(本実施の形態に係る暗号回路)
図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 encryption circuit 11 includes a control circuit 12 and an arithmetic circuit 13. The control circuit 12 controls the arithmetic circuit 13 based on an external control signal and data. That is, the control circuit 12 sends a control signal through the control bus 113 and data such as the number to be operated through the data bus 112 to the arithmetic circuit 13 to execute an operation necessary for the encryption process.

演算回路13は、乗算回路、除算回路、剰余演算回路、モンゴメリ乗算剰余演算回路、加算回路、および/または減算回路などを含み、制御バス113を通じて送られる制御信号およびデータバス112を通じて送られる被演算数などのデータに基づき、暗号処理に必要な乗算、除算、剰余演算、モンゴメリ乗算剰余演算、加算、および/または減算などの演算を行ない、演算結果のデータをデータバス112を通じて制御回路12に出力する。   The arithmetic circuit 13 includes a multiplication circuit, a division circuit, a remainder arithmetic circuit, a Montgomery multiplication remainder arithmetic circuit, an addition circuit, and / or a subtraction circuit, etc., and a control signal sent through the control bus 113 and an operation to be sent through the data bus 112 Performs operations such as multiplication, division, remainder operation, Montgomery multiplication remainder operation, addition, and / or subtraction necessary for encryption processing based on data such as numbers, and outputs operation result data to the control circuit 12 through the data bus 112 To do.

(乗算回路の構成)
図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 multiplication circuit 100 includes a register group 101, a Y [i] determination circuit 109, an adder 1000, a left shift circuit 105, a P register 107, and a bus logic conversion circuit 150. . The multiplication circuit 100 transmits n (= 1024) bits of data, and positive and negative logic mixed data buses 102, 104, 106, 108 in which even bits are positive logic and odd bits are negative logic, and n bits. The data bus 112 is transmitted and all bits are positive logic. The data bus 112 is connected to the control circuit 12 outside the multiplication circuit 100.

レジスタ群101は、演算に必要なデータを記憶するもので、Yレジスタ121と、Xレジスタ122と、Kレジスタ123とからなる。   The register group 101 stores data necessary for calculation, and includes a Y register 121, an X register 122, and a K register 123.

Yレジスタ121は、1024ビットの乗数Yを記憶する。Yレジスタ121は、乗数Yをデータバス112を通じてY[i]判定回路109に出力する。   The Y register 121 stores a 1024-bit multiplier Y. The Y register 121 outputs the multiplier Y to the Y [i] determination circuit 109 through the data bus 112.

Xレジスタ122は、1024ビットの被乗数Xを記憶する。Xレジスタ122は、Y[i]判定回路109からの読出信号に従って、被乗数Xを正負論理混在データバス102へ出力する。   The X register 122 stores a 1024-bit multiplicand X. The X register 122 outputs the multiplicand X to the positive / negative logic mixed data bus 102 in accordance with the read signal from the Y [i] determination circuit 109.

Kレジスタ123は、1024ビットの零元Kを記憶する。Kレジスタ123は、Y[i]判定回路109からの読出信号に従って、零元Kを正負論理混在データバス102へ出力する。   The K register 123 stores a 1024-bit zero element K. The K register 123 outputs the zero element K to the positive / negative logic mixed data bus 102 in accordance with the read signal from the Y [i] determination circuit 109.

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] determination circuit 109 determines whether Y [i], which is the value of the i-th bit (i = 0 to 1023) of the multiplier Y received through the data bus 112, is “1” or “0”. When the value of Y [i] is “1”, a read signal is sent to the X register 122, and when the value of Y [i] is “0”, a read signal is sent to the K register 123.

左シフト回路105は、正負論理混在データバス104を通じて加算結果を受けて、それを下位ビット(0ビット目〜1023ビット目)とし、正負論理混在データバス108を通じてPレジスタ107内のデータPの上位ビット(1024ビット目〜2047ビット目)を受けて、それを上位ビットとし、それら下位ビットと上位ビットとからなる2048ビットのデータを1ビットだけ左シフトし、左シフトされたデータを正負論理混在データバス106に出力する。   The left shift circuit 105 receives the addition result through the positive / negative logic mixed data bus 104 and sets it as the lower bit (0th to 1023th bits), and the higher order of the data P in the P register 107 through the positive / negative logic mixed data bus 108. Bits (1024th to 2047th bits) are received and used as upper bits, 2048-bit data consisting of these lower bits and upper bits is left-shifted by 1 bit, and left-shifted data is mixed with positive and negative logic Output to the data bus 106.

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 P register 107 receives 2048-bit data left-shifted through the positive / negative logic data bus 106 and stores it as data P. Further, the P register 107 outputs the lower bits (0th bit to 1023th bit) of the stored data P to the adding unit 1000 through the positive / negative logic mixed data bus 108. The P register 107 does not need to add the upper bits (1024th bit to 2047th bit) of the stored data P, so that the upper bit side of the left shift circuit 105 passes through the positive / negative logic mixed data bus 108. Output. Since the P register 107 needs to supply the adder 1000 with data P having a value of “0” at the start of multiplication, an initial value that is compatible with the logic of the mixed data bus 108, that is, even bits are “ 2048-bit data having an odd bit of “1” and “1” is stored.

バス論理変換回路150は、正負論理混在データバス108から受けたデータの論理をデータバス112の論理に変換してデータバス112に出力する。また、バス論理変換回路150は、データバス112から受けたデータの論理を正負論理混在データバス108の論理に変換して、正負論理混在データバス108に出力する。   The bus logic conversion circuit 150 converts the logic of the data received from the positive / negative logic mixed data bus 108 into the logic of the data bus 112 and outputs it to the data bus 112. The bus logic conversion circuit 150 converts the logic of the data received from the data bus 112 into the logic of the positive / negative logic mixed data bus 108 and outputs it to the positive / negative logic mixed data bus 108.

(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 register 122. Referring to the figure, the positive logic of X [0], which is the value of the 0th bit of multiplicand X, passes through terminal Q to 0th bit line DB [0], which is an even number of positive / negative logic mixed data bus 102. The negative logic of X [1], which is the value of the first bit of the multiplicand X, is output to the first bit line DB [1], which is an odd number of the positive / negative logic mixed data bus 102, via the terminal / Q, The positive logic of X [2], which is the value of the second bit of the multiplicand X, is output through the terminal Q to the second bit line DB [2], which is the even bit of the mixed positive / negative logic data bus 102, and the second of the multiplicand X is output. The negative logic of X [3], which is the value of the third bit, is output to the third bit line DB [3], which is an odd-numbered bit of the positive / negative logic mixed data bus 102, through the terminal / Q. The K register 123 has the same configuration.

Xレジスタ122およびKレジスタ123の出力をこのように構成することによって、Kレジスタ123から零元Kが正負論理混在データバス102に出力されたときに、正負論理混在データバス102上のすべてのデータが「L」となることが回避される。したがって、Xレジスタ122から被乗数Xが正負論理混在データバス102に出力されたときと、Kレジスタ123から零元Kが正負論理混在データバス102に出力されたときとで、消費電力が大きく相違することがないようにすることができる。   By configuring the outputs of the X register 122 and the K register 123 in this way, when the zero element K is output from the K register 123 to the positive / negative logic mixed data bus 102, all the data on the positive / negative logic mixed data bus 102 is displayed. Is prevented from becoming “L”. Therefore, the power consumption differs greatly when the multiplicand X is output from the X register 122 to the positive / negative logic mixed data bus 102 and when the zero element K is output from the K register 123 to the positive / negative logic mixed data bus 102. You can prevent it from happening.

(加算部1000の構成)
加算部1000は、正負論理混在データバス102と接続する入力端子1と、正負論理混在データバス108と接続する入力端子2とを備える。入力端子1の第iビット目(0≦i)は、正負論理混在データバス102の第iビット目と接続する。また、入力端子2の第iビット目(0≦i)は、正負論理混在データバス108の第iビット目と接続する。
(Configuration of Adder 1000)
The adder 1000 includes an input terminal 1 connected to the positive / negative logic mixed data bus 102 and an input terminal 2 connected to the positive / negative logic mixed data bus 108. The i-th bit (0 ≦ i) of the input terminal 1 is connected to the i-th bit of the positive / negative logic mixed data bus 102. In addition, the i-th bit (0 ≦ i) of the input terminal 2 is connected to the i-th bit of the positive / negative logic mixed data bus 108.

加算部1000は、正負論理混在データバス102を通じて被乗数Xまたは零元Kを受け、正負論理混在データバス108を通じてPレジスタ107内のデータPの下位ビット(0ビット目〜1023ビット目)を受け、これらを正負論理混在データバス102,108の論理に適合した加算を行ない、加算結果を正負論理混在データバス104に出力する。   The adder 1000 receives the multiplicand X or zero element K through the positive / negative logic mixed data bus 102, receives the lower bits (0th to 1023th bits) of the data P in the P register 107 through the positive / negative logic mixed data bus 108, These are added in accordance with the logic of the positive / negative logic mixed data buses 102 and 108, and the addition result is output to the positive / negative logic mixed data bus 104.

図6は、加算部1000の構成を示す。同図では、代表的に第(m−1)ビット、第mビット、および第(m+1)ビットの加算に関する部分を示している。この加算部1000は、加算回路(正論理キャリー負論理)1001、加算回路(負論理キャリー正論理)1002、および加算回路(正論理キャリー負論理)1003を含む。   FIG. 6 shows a configuration of the adding unit 1000. In the figure, a portion related to the addition of the (m−1) th bit, the mth bit, and the (m + 1) th bit is typically shown. Adder 1000 includes an adder circuit (positive logic carry negative logic) 1001, an adder circuit (negative logic carry positive logic) 1002, and an adder circuit (positive logic carry negative logic) 1003.

第(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 mixed data bus 102 and positive / negative logic mixed data. The positive logic carry in is received from the positive logic input in2 of the (m-1) th bit of the bus 108 and the addition circuit (negative logic carry positive logic) for processing the (m-2) th bit (not shown). Add these together. An adder circuit (positive logic carry negative logic) 1001 outputs an addition result out of positive logic to the mixed data bus 104 of positive and negative logic, and an adder circuit (negative logic carry positive logic) that processes the negative logic carry coutB. ) Output to 1002.

第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 mixed data bus 102 and the m-th bit of the positive / negative logic mixed data bus 108. The negative logic carry coutB is received from the positive logic input inB2 and the addition circuit (positive logic carry negative logic) 1001 for processing the (m−1) th bit, and these are added. An adder circuit (negative logic carry positive logic) 1002 outputs an addition result outB of negative logic to the mixed positive / negative logic data bus 104, and an adder circuit (positive logic carry) for processing the (m + 1) th bit of the positive logic carry cout. Negative logic) 1003.

第(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 mixed data bus 102 and the first of the positive / negative logic mixed data bus 108. The positive logic input in2 of the (m + 1) th bit and the addition circuit (positive logic carry negative logic) 1002 for processing the mth bit are received and added. An adder circuit (positive logic carry positive logic) 1003 outputs a positive logic addition result out to the mixed positive and negative logic data bus 104, and an adder circuit (negative) that processes a negative logic carry coutB (not shown). Output to logic carry positive 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 multiplication algorithm 52, the operation of the multiplication circuit 100 will be described. The Y [i] determination circuit 109 determines the value of Y [i], which is the i-th bit of the multiplier Y, for i from 1023 to 0.

Y[i]判定回路109は、Y[i]=1のときには、Xレジスタ122から正負論理混在データバス102に被乗数Xを出力させる。   The Y [i] determination circuit 109 outputs the multiplicand X from the X register 122 to the mixed positive / negative logic data bus 102 when Y [i] = 1.

Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて左シフト回路105の上位側へ出力し、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1000へ出力する。   The P register 107 outputs the upper bits (1024th to 2047th bits) of the stored data P to the upper side of the left shift circuit 105 through the positive / negative logic mixed data bus 108, and the lower order of the stored data P Bits (0th to 1023th bits) are output to the adder 1000 through the positive / negative logic mixed data bus 108.

加算部1000は、正負論理混在データバス108を通じてデータPの下位ビット(0ビット目〜1023ビット目)と、正負論理混在データバス102を通じて被乗数Xとを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて左シフト回路105の下位側に出力する。   The adder 1000 receives the lower bit (0th to 1023th bits) of the data P through the positive / negative logic mixed data bus 108 and the multiplicand X through the positive / negative logic mixed data bus 102, adds them, and outputs the addition result. The data is output to the lower side of the left shift circuit 105 through the positive / negative logic mixed data bus 104.

左シフト回路105は、加算部1000およびPレジスタ107から受けたデータ(P+X)を1ビットだけ左にシフトし、左シフトしたデータ((P+X)≪1)を正負論理混在データバス106を通じてPレジスタ107に出力する。   The left shift circuit 105 shifts the data (P + X) received from the adder 1000 and the P register 107 to the left by 1 bit, and the left-shifted data ((P + X) << 1) passes through the positive / negative logic mixed data bus 106 to the P register. It outputs to 107.

一方、Y[i]判定回路109は、Y[i]=0のときには、Kレジスタ123から正負論理混在データバス102に零元Kを出力させる。   On the other hand, the Y [i] determination circuit 109 outputs a zero element K from the K register 123 to the positive / negative logic mixed data bus 102 when Y [i] = 0.

Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて左シフト回路105の上位側へ出力し、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1000へ出力する。   The P register 107 outputs the upper bits (1024th to 2047th bits) of the stored data P to the upper side of the left shift circuit 105 through the positive / negative logic mixed data bus 108, and the lower order of the stored data P Bits (0th to 1023th bits) are output to the adder 1000 through the positive / negative logic mixed data bus 108.

加算部1000は、正負論理混在データバス108を通じてデータPの下位ビット(0ビット目〜1023ビット目)と、正負論理混在データバス102を通じて零元Kとを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて左シフト回路105の下位側に出力する。   The adder 1000 receives the lower bit (0th to 1023th bits) of the data P through the positive / negative logic mixed data bus 108 and the zero element K through the positive / negative logic mixed data bus 102, adds them, and adds the result. Is output to the lower side of the left shift circuit 105 through the positive / negative logic mixed data bus 104.

左シフト回路105は、加算部1000およびPレジスタ107から受けたデータ(P+X)を1ビットだけ左にシフトし、左シフトしたデータ((P+X)≪1)を正負論理混在データバス106を通じてPレジスタ107に出力する。   The left shift circuit 105 shifts the data (P + X) received from the adder 1000 and the P register 107 to the left by 1 bit, and the left-shifted data ((P + X) << 1) passes through the positive / negative logic mixed data bus 106 to the P register. It outputs to 107.

このような処理を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 P register 107.

以上のように、本実施の形態に係る乗算回路によれば、零元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レジスタを別の構成要素に置き換えた乗算回路に関する。
[Modification 1 of the first embodiment]
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 multiplication circuit 100 in FIG. 4 are denoted by the same reference numerals as those in FIG. Referring to this figure, the multiplication circuit 300 is different from the multiplication circuit 100 of FIG. 4 in that a zero element output circuit 320 is provided instead of the K register 123.

図10を参照して、零元出力回路320は、2ビット分を代表的に示すもので、インバータIV1と、PチャネルMOSトランジスタP1と、NチャネルMOSトランジスタN1とを備える。正負論理混在データバス102のビット数がnのときには、図示した回路を(n/2)個備えればよい。   Referring to FIG. 10, zero element output circuit 320 representatively shows two bits, and includes an inverter IV1, a P channel MOS transistor P1, and an N channel MOS transistor N1. When the number of bits of the positive / negative logic mixed data bus 102 is n, it is sufficient to provide (n / 2) illustrated circuits.

零元出力回路320は、Y[i]判定回路109から出力される零元の出力を指示する信号が「H」レベルにアサ−トされたときに、正負論理混在データバス102の第0ビット目に「0」を出力し、正負論理混在データバス102の第1ビット目に「1」を出力する。これにより、この零元出力回路320は、零元の偶数ビットの正論理「0」を正負論理混在データバス102の偶数ビットに出力し、零元の奇数ビットの負論理「1」を正負論理混在データバス102の奇数ビットに出力する。これにより、零元の加算時には、正負論理混在バス102の各ビット線には、0と1が交互に並んだデータが伝送される。   The zero element output circuit 320 outputs the 0th bit of the mixed data bus 102 of positive and negative logic when the signal indicating the zero element output outputted from the Y [i] determination circuit 109 is asserted to the “H” level. “0” is output to the eye, and “1” is output to the first bit of the positive / negative logic mixed data bus 102. As a result, this zero element output circuit 320 outputs the positive logic “0” of the zero element even bit to the even bit of the mixed data bus 102 and the negative logic “1” of the odd bit of the zero element. Output to odd bits of the mixed data bus 102. Thus, at the time of addition of zero elements, data in which 0 and 1 are alternately arranged is transmitted to each bit line of the positive / negative logic mixed bus 102.

以上のように、本変形例に係る乗算回路によれば、第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 element output circuit 310 instead of the K register.

[第1の実施形態の変形例2]
本変形例は、第1の実施形態の乗算回路の構成要素の処理順序を変形した乗算回路に関する。
[Modification 2 of the first embodiment]
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 multiplication circuit 100 in FIG. 4 are denoted by the same reference numerals as those in FIG. Referring to the figure, the multiplication circuit 400 is different from the multiplication circuit 100 in FIG. 4 in that the processing order of the left shift circuit 105 and the P register 107 is changed.

(乗算回路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 multiplication algorithm 53, the operation of the multiplication circuit 400 will be described.

Y[i]判定回路109は、1023から0までのiについて、乗数Yのiビット目であるY[i]の値を判定する。   The Y [i] determination circuit 109 determines the value of Y [i], which is the i-th bit of the multiplier Y, for i from 1023 to 0.

Y[i]判定回路109は、Y[i]=1のときには、Xレジスタ122から正負論理混在データバス102に被乗数Xを出力させる。   The Y [i] determination circuit 109 outputs the multiplicand X from the X register 122 to the mixed positive / negative logic data bus 102 when Y [i] = 1.

また、Pレジスタ107は、記憶しているデータPを正負論理混在データバス106を通じて左シフト回路105に出力する。   The P register 107 outputs the stored data P to the left shift circuit 105 through the positive / negative logic mixed data bus 106.

左シフト回路105は、正負論理混在データバス106を通じてデータPを受けて、そのデータPを1ビットだけ左シフトする。左シフト回路105は、左シフトしたデータ(P≪1)の上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じてPレジスタ107の上位側に出力し、左シフトしたデータ(P≪1)の下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1000へ出力する。   The left shift circuit 105 receives the data P through the positive / negative logic mixed data bus 106 and shifts the data P to the left by 1 bit. The left shift circuit 105 outputs the upper bits (1024th to 2047th bits) of the left-shifted data (P << 1) to the upper side of the P register 107 through the positive / negative logic mixed data bus 108, and the left-shifted data ( The lower bits (0th bit to 1023th bit) of P << 1) are output to the adding unit 1000 through the positive / negative logic mixed data bus 108.

加算部1000は、正負論理混在データバス108を通じて左シフトされたデータ(P≪1)の下位ビット(0ビット目〜1023ビット目)と、正負論理混在データバス102を通じて被乗数Xとを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じてPレジスタ107の下位側に出力する。   The adding unit 1000 receives the lower bits (0th to 1023th bits) of the data (P << 1) left-shifted through the positive / negative logic mixed data bus 108 and the multiplicand X through the positive / negative logic mixed data bus 102, These are added, and the addition result is output to the lower side of the P register 107 via the positive / negative logic mixed data bus 104.

一方、Y[i]判定回路109は、Y[i]=0のときには、Kレジスタ122から正負論理混在データバス102に零元Kを出力させる。   On the other hand, when Y [i] = 0, the Y [i] determination circuit 109 outputs a zero element K from the K register 122 to the positive / negative logic mixed data bus 102.

また、Pレジスタ107は、記憶しているデータPを正負論理混在データバス106を通じて左シフト回路105に出力する。   The P register 107 outputs the stored data P to the left shift circuit 105 through the positive / negative logic mixed data bus 106.

左シフト回路105は、正負論理混在データバス106を通じてデータPを受けて、そのデータPを1ビットだけ左シフトする。左シフト回路105は、左シフトしたデータ(P≪1)の上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じてPレジスタ107の上位側に出力し、左シフトしたデータ(P≪1)の下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1000へ出力する。   The left shift circuit 105 receives the data P through the positive / negative logic mixed data bus 106 and shifts the data P to the left by 1 bit. The left shift circuit 105 outputs the upper bits (1024th to 2047th bits) of the left-shifted data (P << 1) to the upper side of the P register 107 through the positive / negative logic mixed data bus 108, and the left-shifted data ( The lower bits (0th bit to 1023th bit) of P << 1) are output to the adding unit 1000 through the positive / negative logic mixed data bus 108.

加算部1000は、正負論理混在データバス108を通じて左シフトされたデータ(P≪1)の下位ビット(0ビット目〜1023ビット目)と、正負論理混在データバス102を通じて零元Kとを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じてPレジスタ107の下位側に出力する。   The adder 1000 receives the lower bits (0th to 1023th bits) of the data (P << 1) left-shifted through the positive / negative logic mixed data bus 108 and the zero element K through the positive / negative logic mixed data bus 102. These are added, and the addition result is output to the lower side of the P register 107 through the positive / negative logic mixed data bus 104.

このような処理を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 P register 107.

以上のように、本変形例に係る乗算回路によれば、第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の実施形態の乗算回路の左シフト回路を右シフト回路に置き換えた乗算回路に関する。
[Modification 3 of the first embodiment]
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 Modification 3 of the first embodiment. In the figure, the same components as those of the multiplication circuit 100 in FIG. 4 are denoted by the same reference numerals as those in FIG. Referring to this figure, the multiplication circuit 500 is different from the multiplication circuit 100 of FIG. 4 in that a right shift circuit 505 is provided instead of the left shift circuit 105, and an adder 1010 is provided instead of the adder 1000. Is a point.

右シフト回路505は、正負論理混在データバス104を通じて加算結果を受けて、それを上位ビット(1024ビット目〜2047ビット目)とし、正負論理混在データバス108を通じてPレジスタ107内のデータPの下位ビット(0ビット目〜1023ビット目)を受けて、それを下位ビットとし、それら下位ビットと上位ビットとからなる2048ビットのデータを1ビットだけ右シフトし、右シフトされたデータを正負論理混在データバス106に出力する。   The right shift circuit 505 receives the addition result through the positive / negative logic mixed data bus 104 and sets it as the upper bit (1024th bit to 2047th bit). The lower shift of the data P in the P register 107 through the positive / negative logic mixed data bus 108 Bits (0th to 1023th bits) are received and used as lower bits, 2048-bit data consisting of these lower bits and upper bits is right-shifted by 1 bit, and right-shifted data is mixed with positive and negative logic Output to the data bus 106.

加算部1010は、正負論理混在データバス102と接続する入力端子1と、正負論理混在データバス108と接続する入力端子2とを備える。入力端子1の第iビット目(1≦i)は、正負論理混在データバス102の第(i−1)ビット目と接続し、入力端子1の第0ビット目は、「0」に固定される。また、入力端子2の第iビット目(0≦i)は、正負論理混在データバス108の第iビット目と接続する。   The adder 1010 includes an input terminal 1 connected to the positive / negative logic mixed data bus 102 and an input terminal 2 connected to the positive / negative logic mixed data bus 108. The i-th bit (1 ≦ i) of the input terminal 1 is connected to the (i−1) -th bit of the mixed data bus 102 and the 0th bit of the input terminal 1 is fixed to “0”. The In addition, the i-th bit (0 ≦ i) of the input terminal 2 is connected to the i-th bit of the positive / negative logic mixed data bus 108.

加算部1010は、正負論理混在データバス102を通じて被乗数Xまたは零元Kが1ビットだけ左シフトしたデータを受け、正負論理混在データバス108を通じてPレジスタ107内のデータPの下位ビット(0ビット目〜1023ビット目)を受け、これらを正負論理混在データバス102,108の論理に適合した加算を行ない、加算結果を正負論理混在データバス104に出力する。   The adder 1010 receives the data in which the multiplicand X or zero element K is shifted to the left by 1 bit through the positive / negative logic mixed data bus 102 and receives the lower bit (0th bit) of the data P in the P register 107 through the positive / negative logic mixed data bus 108. -1023 bits), these are added in accordance with the logic of the positive / negative logic mixed data buses 102 and 108, and the addition result is output to the positive / negative logic mixed data bus 104.

(乗算回路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 multiplication algorithm 54, the operation of the multiplication circuit 500 will be described.

Y[i]判定回路109は、0から1023までのiについて、乗数Yのiビット目であるY[i]の値を判定する。   The Y [i] determination circuit 109 determines the value of Y [i], which is the i-th bit of the multiplier Y, for i from 0 to 1023.

Y[i]判定回路109は、Y[i]=1のときには、Xレジスタ122から正負論理混在データバス102に被乗数Xを出力させる。   The Y [i] determination circuit 109 outputs the multiplicand X from the X register 122 to the mixed positive / negative logic data bus 102 when Y [i] = 1.

Pレジスタ107は、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて右シフト回路505の下位側へ出力し、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて加算部1010へ出力する。   The P register 107 outputs the lower bits (0th to 1023th bits) of the stored data P to the lower side of the right shift circuit 505 through the positive / negative logic mixed data bus 108, and the higher order of the stored data P The bits (from the 1024th bit to the 2047th bit) are output to the adding unit 1010 through the positive / negative logic mixed data bus 108.

加算部1010は、正負論理混在データバス108を通じてデータPの上位ビット(1024ビット目〜2047ビット目)と、正負論理混在データバス102を通じて被乗数Xが1ビットだけ左にシフトしたデータ(X≪1)とを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて右シフト回路505の上位側に出力する。   The adder 1010 receives data (X << 1) by shifting the multiplicand X by 1 bit to the left through the positive and negative logic mixed data bus 108 and the higher bits of the data P (1024th to 2047th bits) and the positive / negative logic mixed data bus 102. ) Are added, and the addition result is output to the upper side of the right shift circuit 505 through the positive / negative logic mixed data bus 104.

右シフト回路505は、加算部1010およびPレジスタ107から受けたデータ(P+(X≪1))を1ビットだけ右にシフトし、右シフトしたデータ((P+(X≪1))≫1)を正負論理混在データバス106を通じてPレジスタ107に出力する。   The right shift circuit 505 shifts the data (P + (X << 1)) received from the adder 1010 and the P register 107 to the right by 1 bit and right-shifted data ((P + (X << 1)) >> 1) Is output to the P register 107 through the positive / negative logic mixed data bus 106.

一方、Y[i]判定回路109は、Y[i]=1のときには、Kレジスタ123から正負論理混在データバス102に零元Kを出力させる。   On the other hand, the Y [i] determination circuit 109 outputs a zero element K from the K register 123 to the positive / negative logic mixed data bus 102 when Y [i] = 1.

Pレジスタ107は、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて右シフト回路505の下位側へ出力し、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて加算部1010へ出力する。   The P register 107 outputs the lower bits (0th to 1023th bits) of the stored data P to the lower side of the right shift circuit 505 through the positive / negative logic mixed data bus 108, and the higher order of the stored data P The bits (from the 1024th bit to the 2047th bit) are output to the adding unit 1010 through the positive / negative logic mixed data bus 108.

加算部1010は、正負論理混在データバス108を通じてデータPの上位ビット(1024ビット目〜2047ビット目)と、正負論理混在データバス102を通じて零元Kが1ビットだけ左にシフトしたデータ(K≪1)とを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて右シフト回路505の上位側に出力する。   The adder 1010 transmits the upper bits (1024th to 2047th bits) of the data P through the positive / negative logic mixed data bus 108 and data obtained by shifting the zero element K to the left by 1 bit through the positive / negative logic mixed data bus 102 (K << 1) and adding them, and the addition result is output to the upper side of the right shift circuit 505 through the positive / negative logic mixed data bus 104.

右シフト回路505は、加算部1010およびPレジスタ107から受けたデータ(P+(K≪1))を1ビットだけ右にシフトし、右シフトしたデータ((P+(K≪1))≫1)を正負論理混在データバス106を通じてPレジスタ107に出力する。   The right shift circuit 505 shifts the data (P + (K << 1)) received from the adder 1010 and the P register 107 to the right by 1 bit and right-shifted data ((P + (K << 1)) >> 1) Is output to the P register 107 through the positive / negative logic mixed data bus 106.

このような処理を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 P register 107.

以上のように、本実施の形態に係る乗算回路によれば、第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 right shift circuit 505 and the P register 107 according to the third modification is changed as in the second modification. Omitted.

(乗算回路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 multiplication algorithm 55, the operation of the multiplication circuit of this modification will be described.

Y[i]判定回路109は、0から1023までのiについて、乗数Yのiビット目であるY[i]の値を判定する。   The Y [i] determination circuit 109 determines the value of Y [i], which is the i-th bit of the multiplier Y, for i from 0 to 1023.

Y[i]判定回路109は、Y[i]=1のときには、Xレジスタ122から正負論理混在データバス102に被乗数Xを出力させる。   The Y [i] determination circuit 109 outputs the multiplicand X from the X register 122 to the mixed positive / negative logic data bus 102 when Y [i] = 1.

また、Pレジスタ107は、記憶しているデータPを正負論理混在データバス106を通じて右シフト回路505に出力する。   Further, the P register 107 outputs the stored data P to the right shift circuit 505 through the positive / negative logic mixed data bus 106.

右シフト回路505は、正負論理混在データバス106を通じてデータPを受けて、そのデータPを1ビットだけ右シフトする。右シフト回路505は、右シフトしたデータ(P≫1)の下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じてPレジスタ107の下位側に出力し、右シフトしたデータ(P≪1)の上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて加算部1010へ出力する。   The right shift circuit 505 receives the data P through the positive / negative logic mixed data bus 106 and shifts the data P to the right by 1 bit. The right shift circuit 505 outputs the lower-order bits (0th to 1023th bits) of the right-shifted data (P >> 1) to the lower-order side of the P register 107 through the positive / negative logic mixed data bus 108 and right-shifted data ( The upper bits (1024th bit to 2047th bit) of P << 1) are output to the adding unit 1010 through the positive / negative logic mixed data bus 108.

加算部1010は、正負論理混在データバス108を通じて右シフトされたデータ(P≫1)の上位ビット(1024ビット目〜2047ビット目)と、正負論理混在データバス102を通じて被乗数Xとを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じてPレジスタ107の上位側に出力する。   The adding unit 1010 receives the upper bits (1024th bit to 2047th bit) of the data (P >> 1) right-shifted through the positive / negative logic mixed data bus 108 and the multiplicand X through the positive / negative logic mixed data bus 102, These are added, and the addition result is output to the upper side of the P register 107 via the positive / negative logic mixed data bus 104.

一方、Y[i]判定回路109は、Y[i]=0のときには、Kレジスタ122から正負論理混在データバス102に零元Kを出力させる。   On the other hand, when Y [i] = 0, the Y [i] determination circuit 109 outputs a zero element K from the K register 122 to the positive / negative logic mixed data bus 102.

また、Pレジスタ107は、記憶しているデータPを正負論理混在データバス106を通じて右シフト回路505に出力する。   Further, the P register 107 outputs the stored data P to the right shift circuit 505 through the positive / negative logic mixed data bus 106.

右シフト回路505は、正負論理混在データバス106を通じてデータPを受けて、そのデータPを1ビットだけ右シフトする。右シフト回路505は、右シフトしたデータ(P≫1)の下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じてPレジスタ107の下位側に出力し、右シフトしたデータ(P≪1)の上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて加算部1010へ出力する。   The right shift circuit 505 receives the data P through the positive / negative logic mixed data bus 106 and shifts the data P to the right by 1 bit. The right shift circuit 505 outputs the lower-order bits (0th to 1023th bits) of the right-shifted data (P >> 1) to the lower-order side of the P register 107 through the positive / negative logic mixed data bus 108 and right-shifted data ( The upper bits (1024th bit to 2047th bit) of P << 1) are output to the adding unit 1010 through the positive / negative logic mixed data bus 108.

加算部1010は、正負論理混在データバス108を通じて右シフトされたデータ(P≫1)の上位ビット(1024ビット目〜2047ビット目)と、正負論理混在データバス102を通じて零元Kとを受けて、これらを加算し、加算結果を正負論理混在データバス104を通じてPレジスタ107の上位側に出力する。   The adder 1010 receives the upper bits (1024th to 2047th bits) of the data (P >> 1) shifted right through the positive / negative logic mixed data bus 108 and the zero element K via the positive / negative logic mixed data bus 102. These are added, and the addition result is output to the upper side of the P register 107 through the positive / negative logic mixed data bus 104.

このような処理を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 P register 107.

以上のように、本実施の形態に係る乗算回路によれば、第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 P register 107 is set so that the zero element K (all bits are 0) conforms to the positive / negative logic of the mixed data bus 108 (even bits are P = 0 in the algorithm 52 is realized by “0” and the odd-numbered bit is “1”. In this modification, a dedicated register for realizing P = 0 is used.

(デ−タ格納レジスタ群の構成)
図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 storage register group 1300 includes P register 107, K register 1302, and selection circuit 1303.

Pレジスタ107は、第1の実施形態と同様である。ただし、アルゴリズム52におけるP=0を実現するための初期値が格納されない。   The P register 107 is the same as that in the first embodiment. However, the initial value for realizing P = 0 in the algorithm 52 is not stored.

Kレジスタ1302は、アルゴリズム52におけるP=0を実現するための専用のレジスタであり、零元Kを記憶する。また、Kレジスタ1302は、図5に示すXレジスタと同様に、正負の論理が混在した出力を正負論理混在データバス108に出力する。   The K register 1302 is a dedicated register for realizing P = 0 in the algorithm 52, and stores a zero element K. Similarly to the X register shown in FIG. 5, the K register 1302 outputs an output in which positive and negative logics are mixed to the positive and negative logic mixed data bus 108.

選択回路1303は、Pの初期値の出力時(たとえばアルゴリズム52におけるP=0)に、Kレジスタ1302から零元Kを出力させ、初期値以外の出力時に、Pレジスタ107から記憶しているデータPを出力させる。   The selection circuit 1303 causes the zero register K to be output from the K register 1302 when the initial value of P is output (for example, P = 0 in the algorithm 52), and the data stored from the P register 107 when outputting other than the initial value. P is output.

以上のように、本実施の形態に係る乗算回路によれば、第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 mixed logic bus 102 in the P register Can be omitted.

[第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 multiplication circuit 100 in FIG. 4 are denoted by the same reference numerals as those in FIG. Referring to this figure, the multiplication circuit 800 is different from the multiplication circuit 100 of FIG. 4 in that a Y [2i, 2i + 1] determination circuit 809 is provided instead of the Y [i] determination circuit 109 and a 1-bit left Instead of the left shift circuit 105 that performs the shift, a 2-bit left shift circuit 805 that performs a 2-bit left shift is provided, and a 3-input adder 1110 is provided instead of the 2-input adder 1000. Instead of the data bus 102, two positive / negative logic mixed data buses 102 a and 102 b are provided, an X register 822 is provided instead of the X register 122, and a K register 823 is provided instead of the K register 123.

正負論理混在データバス102a,102bは、n(=1024)ビットのデータを伝送し、偶数ビットが正論理で、奇数ビットが負論理である。   The positive and negative logic mixed data buses 102a and 102b transmit n (= 1024) bits of data, and even bits are positive logic and odd bits are 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] determination circuit 809 determines the value of Y [2i + 1, 2i] that is the value of the (2i + 1) -th bit and the 2i-th bit of the multiplier Y, and when Y [2i + 1, 2i] = 11 The multiplicand X is output from the X register 822 to the positive / negative logic mixed data buses 102a and 102b. When Y [2i + 1, 2i] = 10, the multiplicand X is output from the X register 822 to the positive / negative logic mixed data bus 102a. 823 outputs the zero element K to the positive / negative logic mixed data bus 102b. When Y [2i + 1, 2i] = 01, the K register 823 outputs the zero element K to the positive / negative logic mixed data bus 102a, and the X register 822 outputs the positive / negative. When the multiplicand X is output to the logical mixed data bus 102b and Y [2i + 1, 2i] = 00, the K register 823 The positive and negative logic mixed data bus 102a to output Reigen K, and outputs the Reigen K from K register 823 to the positive and negative logic mixed data bus 102b.

Xレジスタ822は、1024ビットの被乗数Xを記憶する。Xレジスタ822は、Y[2i+1,2i]判定回路809からの読出信号により、正負論理混在データバス102aおよび/または102bに被乗数Xを出力する。   The X register 822 stores a 1024-bit multiplicand X. The X register 822 outputs the multiplicand X to the positive / negative logic mixed data bus 102a and / or 102b according to the read signal from the Y [2i + 1, 2i] determination circuit 809.

Kレジスタ823は、1024ビットの零元Kを記憶する。Kレジスタ823は、Y[2i+1,2i]判定回路809からの読出信号により、正負論理混在データバス102aおよび/または102bに零元Kを出力する。   The K register 823 stores a 1024-bit zero element K. The K register 823 outputs a zero element K to the positive / negative logic mixed data buses 102a and / or 102b according to a read signal from the Y [2i + 1, 2i] determination circuit 809.

Xレジスタ822およびKレジスタ823の出力信号の論理は、図5に示すXレジスタ122の出力信号の論理と同様である。   The logic of the output signal of the X register 822 and the K register 823 is the same as the logic of the output signal of the X register 122 shown in FIG.

(加算部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 adder 1100 includes an input terminal 1 connected to the positive / negative logic mixed data bus 102a, an input terminal 2 connected to the positive / negative logic mixed data bus 102b, and an input terminal 3 connected to the positive / negative logic mixed data bus 108. The i-th bit (0 ≦ i) of the input terminal 1 of the adder 1100 is connected to the i-th bit of the positive / negative logic mixed data bus 102a. The i-th bit (1 ≦ i) of the input terminal 2 of the adder 1100 is connected to the (i−1) -th bit of the positive / negative logic mixed data bus 102b, and the 0th bit of the input terminal 2 is It is fixed at “0”. The i-th bit (0 ≦ i) of the input terminal 3 of the adder 1100 is connected to the i-th bit of the positive / negative logic mixed data bus 108.

加算部1100は、正負論理混在データバス102aを通じて被乗数Xまたは零元Kを受け、正負論理混在データバス102bを通じて被乗数Xまたは零元Kを1ビットだけ左にシフトされたデータを受け、正負論理混在データバス108を通じてPレジスタ107内のデータPの下位ビット(0ビット目〜1023ビット目)を受け、これらを正負論理混在データバス102a,102b,108の論理に適合した加算を行ない、加算結果を正負論理混在データバス104に出力する。   The adder 1100 receives the multiplicand X or zero element K through the positive / negative logic mixed data bus 102a, and receives the data obtained by shifting the multiplicand X or zero element K to the left by 1 bit through the positive / negative logic mixed data bus 102b. The lower bits (0th bit to 1023th bit) of the data P in the P register 107 are received through the data bus 108, these are added in accordance with the logic of the mixed data buses 102a, 102b, 108 and the result of the addition is obtained. The data is output to the positive / negative logic mixed data bus 104.

図18は、加算部1100の構成を示す。同図では、代表的に第(m−1)ビット、第mビット、および第(m+1)ビットの加算に関する部分を示している。この加算部1100は、前段に加算回路(正論理キャリー負論理)1101、加算回路(負論理キャリー正論理)1102、および加算回路(正論理キャリー負論理)1103を含み、後段に加算回路(正論理キャリー負論理)1104、加算回路(負論理キャリー正論理)1105、および加算回路(正論理キャリー負論理)1106を含む。   FIG. 18 shows a configuration of the adding unit 1100. In the figure, a portion related to the addition of the (m−1) th bit, the mth bit, and the (m + 1) th bit is typically shown. The adder 1100 includes an adder circuit (positive logic carry negative logic) 1101, an adder circuit (negative logic carry positive logic) 1102, and an adder circuit (positive logic carry negative logic) 1103 in the previous stage, and an adder circuit (positive logic in the subsequent stage). Logic carry negative logic) 1104, an adder circuit (negative logic carry positive logic) 1105, and an adder circuit (positive logic carry negative logic) 1106.

前段の第(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 mixed data bus 102a and the positive and negative logic. The positive data input in2 of the (m−1) th bit of the mixed data bus 102b and the positive logic input in3 of the (m−1) th bit of the positive and negative logic mixed data bus 108 are received and added. To do. An adder circuit (positive logic carry negative logic) 1101 outputs a positive logic addition result out to an adder circuit (positive logic carry negative logic) 1104 that processes the (m−1) -th bit of the subsequent stage, and carries a negative logic carry. coutB is output to an adder circuit (negative logic carry positive logic) 1105 for processing the m-th bit in the subsequent stage.

前段の第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 mixed data bus 102a and the m-th bit of the positive / negative logic mixed data bus 102b. The negative logic input inB2 of the eye and the negative logic input inB3 of the mth bit of the mixed positive / negative logic data bus 108 are received and added. The adder circuit (negative logic carry positive logic) 1102 outputs the negative logic addition result outB to the adder circuit (negative logic carry positive logic) 1105 that processes the m-th bit of the subsequent stage, and the positive logic carry cout is output to the subsequent stage. The result is output to an adder circuit (positive logic carry negative logic) 1106 for processing the (m + 1) th bit.

前段の第(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 mixed data bus 102a and a positive / negative logic mixed data bus 102b. The (m + 1) th positive logic input in2 and the (m + 1) th positive logic input in3 of the positive / negative logic mixed data bus 108 are received and added. The adder circuit (positive logic carry negative logic) 1103 outputs the positive logic addition result out to the adder circuit (positive logic carry negative logic) 1106 for processing the (m + 1) -th bit in the subsequent stage, and the negative logic carry coutB is output. , Output to the adder circuit (negative logic carry positive logic) that processes the (m + 2) -th bit of the latter stage (not shown).

後段の第(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 mixed data bus 104, and an adder circuit (negative logic carry) that processes the negative logic carry coutB in the subsequent m-th bit. (Positive logic) 1105.

後段の第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 logic data bus 104, and an adder circuit (positive) that processes the positive logic carry cout in the subsequent (m + 1) -th bit. Logic carry negative logic) 1106.

後段の第(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 mixed data bus 104, and processes a negative logic carry coutB in the subsequent (m + 2) -th bit (not shown). Output to (negative logic carry positive 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 left shift circuit 805 shifts the data received from the adder 1100 and the P register 107 to the left by 2 bits, and outputs the data left-shifted by 2 bits to the P register 107 through the positive / negative logic mixed data bus 106.

(乗算回路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 multiplication algorithm 56, the operation of the multiplication circuit 800 will be described.

Y[2i+1,2i]判定回路809は、511から0までのiについて、乗数Yの(2i+1)ビット目と、2iビット目の値であるY[2i+1,2i]の値を判定する。   The Y [2i + 1, 2i] determination circuit 809 determines the value of Y [2i + 1, 2i] that is the value of the (2i + 1) th bit of the multiplier Y and the 2ith bit for i from 511 to 0.

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] determination circuit 809 sends a read signal to the X register 822, and outputs the multiplicand X from the X register 822 to the positive / negative logic mixed data buses 102a and 102b.

Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて2ビット左シフト回路105の上位側へ出力し、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1100へ出力する。   The P register 107 outputs the upper bits (1024 bits to 2047 bits) of the stored data P to the upper side of the 2-bit left shift circuit 105 through the positive / negative logic mixed data bus 108 and stores the stored data P Lower bits (0th to 1023th bits) are output to the adder 1100 through the mixed data bus 108.

加算部1100は、正負論理混在データバス108を通じてデータPの下位ビット(0ビット目〜1023ビット目)を受け、正負論理混在データバス102aを通じて被乗数Xを受け、正負論理混在データバス102bを通じて被乗数Xが1ビットだけ左にシフトしたデータ(X≪1)を受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて2ビット左シフト回路805の下位側に出力する。   The adder 1100 receives the lower bits (0th to 1023th bits) of the data P through the positive / negative logic mixed data bus 108, receives the multiplicand X through the positive / negative logic mixed data bus 102a, and receives the multiplicand X through the positive / negative logic mixed data bus 102b. Receives the data shifted to the left by 1 bit (X << 1), adds them, and outputs the addition result to the lower side of the 2-bit left shift circuit 805 via the positive / negative logic mixed data bus 104.

2ビット左シフト回路805は、加算部1100およびPレジスタ107から受けたデータ(P+X+(X≪1))を2ビットだけ左にシフトし、2ビットだけ左シフトしたデータ((P+X+(X≪1))≪2))を正負論理混在データバス106を通じてPレジスタ107に出力する。   The 2-bit left shift circuit 805 shifts the data (P + X + (X << 1)) received from the adder 1100 and the P register 107 to the left by 2 bits, and shifts the data left by 2 bits ((P + X + (X << 1) )) << 2)) is output to the P register 107 via the positive / negative logic mixed data bus 106.

また、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] determination circuit 809 sends a read signal to the X register 822 when Y [2i + 1, 2i] = 10, and outputs the multiplicand X from the X register 822 to the positive / negative logic mixed data bus 102a. A read signal is sent to the K register 823, and the zero element K is output from the K register 823 to the mixed data bus 102b.

Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて2ビット左シフト回路805の上位側へ出力し、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1100へ出力する。   The P register 107 outputs the upper bits (1024th to 2047th bits) of the stored data P to the upper side of the 2-bit left shift circuit 805 through the positive / negative logic mixed data bus 108 and stores the stored data P Lower bits (0th to 1023th bits) are output to the adder 1100 through the mixed data bus 108.

加算部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 mixed data bus 108, the multiplicand X through the positive / negative logic mixed data bus 102a, and the zero element through the positive / negative logic mixed data bus 102b. Receiving data (K << 1) where K is shifted to the left by 1 bit, these are added, and the addition result is output to the lower side of the 2-bit left shift circuit 805 through the positive / negative logic mixed data bus 104.

2ビット左シフト回路805は、加算部1100およびPレジスタ107から受けたデータ(P+X+(K≪1))を2ビットだけ左にシフトし、2ビットだけ左シフトしたデータ((P+X+(K≪1))≪2))を正負論理混在データバス106を通じてPレジスタ107に出力する。   The 2-bit left shift circuit 805 shifts the data (P + X + (K << 1)) received from the adder 1100 and the P register 107 to the left by 2 bits and shifts the data left by 2 bits ((P + X + (K << 1) )) << 2)) is output to the P register 107 via the positive / negative logic mixed data bus 106.

また、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] determination circuit 809 sends a read signal to the K register 823, and causes the K register 823 to output the zero element K to the positive / negative logic mixed data bus 102a. The read signal is sent to the X register 822, and the multiplicand X is output from the X register 822 to the mixed data bus 102b.

Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて2ビット左シフト回路805の上位側へ出力し、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1100へ出力する。   The P register 107 outputs the upper bits (1024th to 2047th bits) of the stored data P to the upper side of the 2-bit left shift circuit 805 through the positive / negative logic mixed data bus 108 and stores the stored data P Lower bits (0th to 1023th bits) are output to the adder 1100 through the mixed data bus 108.

加算部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 mixed data bus 108, the zero element K through the positive / negative logic mixed data bus 102a, and the multiplicand through the positive / negative logic mixed data bus 102b. The data (X << 1) in which X is shifted to the left by 1 bit is received, these are added, and the addition result is output to the lower side of the 2-bit left shift circuit 805 through the positive / negative logic mixed data bus 104.

2ビット左シフト回路805は、加算部1100およびPレジスタ107から受けたデータ(P+K+(X≪1))を2ビットだけ左にシフトし、2ビットだけ左シフトしたデータ((P+K+(X≪1))≪2))を正負論理混在データバス106を通じてPレジスタ107に出力する。   The 2-bit left shift circuit 805 shifts the data (P + K + (X << 1)) received from the adder 1100 and the P register 107 to the left by 2 bits and shifts the data left by 2 bits ((P + K + (X << 1) )) << 2)) is output to the P register 107 via the positive / negative logic mixed data bus 106.

また、Y[2i+1,2i]判定回路809は、Y[2i+1,2i]=00のときには、Kレジスタ823に読出信号を送り、Kレジスタ823から正負論理混在データバス102aおよび102bに零元Kを出力させる。   The Y [2i + 1, 2i] determination circuit 809 sends a read signal to the K register 823 when Y [2i + 1, 2i] = 00, and applies a zero element K from the K register 823 to the mixed data buses 102a and 102b. Output.

Pレジスタ107は、記憶しているデータPの上位ビット(1024ビット目〜2047ビット目)を正負論理混在データバス108を通じて2ビット左シフト回路805の上位側へ出力し、記憶しているデータPの下位ビット(0ビット目〜1023ビット目)を正負論理混在データバス108を通じて加算部1100へ出力する。   The P register 107 outputs the upper bits (1024th to 2047th bits) of the stored data P to the upper side of the 2-bit left shift circuit 805 through the positive / negative logic mixed data bus 108 and stores the stored data P Lower bits (0th to 1023th bits) are output to the adder 1100 through the mixed data bus 108.

加算部1100は、正負論理混在データバス108を通じてデータPの下位ビット(0ビット目〜1023ビット目)を受け、正負論理混在データバス102aを通じて零元Kを受け、正負論理混在データバス102bを通じて零元Kが1ビットだけ左にシフトしたデータ(K≪1)を受けて、これらを加算し、加算結果を正負論理混在データバス104を通じて2ビット左シフト回路805の下位側に出力する。   The adder 1100 receives the lower bits (0th to 1023th bits) of the data P through the positive / negative logic mixed data bus 108, receives the zero element K through the positive / negative logic mixed data bus 102a, and zeros through the positive / negative logic mixed data bus 102b. The original K receives data (K << 1) shifted to the left by 1 bit, adds them, and outputs the addition result to the lower side of the 2-bit left shift circuit 805 via the positive / negative logic mixed data bus 104.

2ビット左シフト回路805は、加算部1100およびPレジスタ107から受けたデータ(P+K+(K≪1))を2ビットだけ左にシフトし、2ビットだけ左シフトしたデータ((P+K+(K≪1))≪2))を正負論理混在データバス106を通じてPレジスタ107に出力する。   The 2-bit left shift circuit 805 shifts the data (P + K + (K << 1)) received from the adder 1100 and the P register 107 to the left by 2 bits, and shifts the data left by 2 bits ((P + K + (K << 1) )) << 2)) is output to the P register 107 via the positive / negative logic mixed data bus 106.

このような処理を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 P register 107.

以上のように、本実施の形態に係る乗算回路によれば、第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 multiplication circuit 1500 includes a register group 1501, a Y [i] selection circuit 1510, an adder 1503, a right shift circuit 505a, a P register 107, a right shift circuit 505b, A register 1517 and a selection circuit 1512 are provided. The multiplication circuit 150 includes data buses 112, 1504, 1506, 1507, 1508U, and 1508L that transmit n (= 1024) bits of data and all bits are positive logic. The data bus 112 is connected to the control circuit 12 outside the multiplication circuit 150.

また、レジスタ群1501は、Yレジスタ1521と、Xレジスタ1522と、Aレジスタ1523とを含む。   The register group 1501 includes a Y register 1521, an X register 1522, and an A register 1523.

Yレジスタ1521は、1024ビットの乗数Yを記憶する。Yレジスタ1521は、乗数Yをデータバス112を通じてY[i]選択回路1510に出力する。   The Y register 1521 stores a 1024-bit multiplier Y. The Y register 1521 outputs the multiplier Y to the Y [i] selection circuit 1510 through the data bus 112.

Xレジスタ1522は、1024ビットの被乗数Xを記憶する。Xレジスタ1523は、被乗数Xをデータバス112を通じて加算部1503に出力する。   The X register 1522 stores a 1024-bit multiplicand X. The X register 1523 outputs the multiplicand X to the adder 1503 through the data bus 112.

Aレジスタ1523は、乗算処理の終了後に、乗数Yと被乗数Xとの乗算結果A(2048ビット)を記憶する。   The A register 1523 stores a multiplication result A (2048 bits) of the multiplier Y and the multiplicand X after the multiplication process is completed.

Y[i]選択回路1510は、乗数Yのiビット目であるY[i]の値に応じた選択信号Sをデータバス1511を通じて選択回路1512に出力する。Y[i]が1のときに選択信号S(=1)が出力され、Y[i]が0のときに選択信号S(=0)が出力される。   The Y [i] selection circuit 1510 outputs a selection signal S corresponding to the value of Y [i], which is the i-th bit of the multiplier Y, to the selection circuit 1512 through the data bus 1511. When Y [i] is 1, the selection signal S (= 1) is output, and when Y [i] is 0, the selection signal S (= 0) is output.

加算部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 addition unit 1503 includes an input terminal 1 connected to the data bus 1508U and an input terminal 2 connected to the data bus 112. The i-th bit (0 ≦ i) of the input terminal 1 of the adder 1503 is connected to the i-th bit of the data bus 1508. The i-th bit (1 ≦ i) of the input terminal 2 of the adder 1503 is connected to the (i−1) -th bit of the data bus 112, and the 0th bit of the input terminal 2 is fixed to “0”. Is done. The adder 1503 receives the upper bits (1024th to 2047th bits) of the data A from the input terminal 1, and receives the data (X << 1) in which the multiplicand X is shifted to the left by 1 bit from the input terminal 2. Add these together. The adding unit 1503 outputs the addition result (A + (X << 1)) to the upper side of the right shift circuit 505a through the data bus 1504.

右シフト回路505aは、上位側にデータバス1504を通じて加算結果(A+(X≪1)を受けて、下位側にデータバス1508Lを通じてデータAの下位ビット(0ビット目〜1023ビット目)を受けて、これらを1ビットだけ右にシフトし、右シフトしたデータ((A+(X≪1))≫1)をデータバス1506を通じてPレジスタ107に出力する。   The right shift circuit 505a receives the addition result (A + (X << 1) through the data bus 1504 on the upper side and the lower bits (0th to 1023th bits) of the data A through the data bus 1508L on the lower side. These are shifted to the right by 1 bit, and the right-shifted data ((A + (X << 1)) >> 1) is output to the P register 107 through the data bus 1506.

右シフト回路505bは、上位側にデータバス1508Uを通じてデータAの上位ビット(1024ビット目〜2047ビット目)を受けて、下位側にデータバス1508Lを通じてデータAの下位ビット(0ビット目〜1023ビット目)を受けて、これらを1ビットだけ右にシフトし、右シフトしたデータ(A≫1)をデータバス1506を通じてQレジスタ1517に出力する。   The right shift circuit 505b receives the upper bits (1024th to 2047th bits) of data A through the data bus 1508U on the upper side and the lower bits (0th to 1023 bits) of data A through the data bus 1508L on the lower side. In response, the data is shifted right by 1 bit, and the right-shifted data (A >> 1) is output to the Q register 1517 through the data bus 1506.

加算部1503および右シフト回路505aによる処理と、右シフト回路505bによる処理とは、同時に並行して実行される。   The processing by the adder 1503 and the right shift circuit 505a and the processing by the right shift circuit 505b are performed simultaneously in parallel.

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 P register 107 receives the data ((A + (X << 1))) >> 1) output from the right shift circuit 505a through the data bus 1506, and stores this as data P.

Qレジスタ1517は、乗算の途中結果である2048ビットのデータQを記憶する。Qレジスタ1517は、データバス1506を通じて右シフト回路505bから出力されたデータ(A≫1)を受けて、これをデータQとして記憶する。   The Q register 1517 stores 2048-bit data Q that is a result of the multiplication. The Q register 1517 receives data (A >> 1) output from the right shift circuit 505b through the data bus 1506, and stores this as data Q.

選択回路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 selection circuit 1512 stores an initial value “1” of the selection signal S. The selection circuit 1512 receives the selection signal S from the Y [i] selection circuit 1510. When the selection signal S is “1”, the selection circuit 1512 outputs the data P output from the P register 107 as data A, outputs the upper bits of the data A to the data bus 1508U, and outputs the lower bits of the data A to the data bus. Output to 1508L. When the selection signal S is “0”, the selection circuit 1512 outputs the data Q output from the Q register 1517 as data A, outputs the upper bits of the data A to the data bus 1508U, and outputs the lower bits of the data A to the data bus. Output to 1508L.

(乗算回路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 multiplication algorithm 57, the operation of the multiplication circuit 1500 will be described.

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 selection circuit 1512 receives data P from the P register 107 through the data bus 1507 and receives data Q from the Q register 1517 through the data bus 1507.

選択回路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 selection circuit 1512 selects data P as data A when the selection signal S received through the data bus 1511 is “1”, and receives data Q when the selection signal S received through the data bus 1511 is “0”. Select data A. The selection circuit 1512 outputs the upper bits (1024th to 2047th bits) of data A to the upper side of the adder 1503 and the right shift circuit 505b through the data bus 1508U, and the lower side of the right shift circuit 505a through the data bus 1508L. The lower bits (0th to 1023th bits) of data A are output to the lower side of the right shift circuit 505b.

Xレジスタ1522は、データバス122に被乗数Xを出力する。   X register 1522 outputs multiplicand X to data bus 122.

加算部1503は、データバス1508Uを通じてデータAの上位ビット(1024ビット目〜2047ビット目)と、データバス112を通じて被乗数Xが1ビットだけ左にシフトしたデータ(X≪1)とを受けて、これらを加算し、加算結果をデータバス1504を通じて右シフト回路505aの上位側に出力する。   The adder 1503 receives the upper bits (1024th to 2047th bits) of the data A through the data bus 1508U and the data (X << 1) in which the multiplicand X is shifted to the left by 1 bit through the data bus 112. These are added, and the addition result is output to the upper side of the right shift circuit 505a through the data bus 1504.

右シフト回路505aは、加算部1503および選択回路1512から受けたデータ(A+(X≪1))を1ビットだけ右にシフトし、右シフトしたデータ((A+(X≪1))≫1)をデータバス1506を通じてPレジスタ107に出力する。   The right shift circuit 505a shifts the data (A + (X << 1)) received from the adder 1503 and the selection circuit 1512 to the right by 1 bit, and right-shifted data ((A + (X << 1)) >> 1) Is output to the P register 107 through the data bus 1506.

また、上述の加算部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 adder 1503 and the right shift circuit 505a, the right shift circuit 505a passes the upper bits (1024th to 2047th bits) of the data A through the data bus 1508U and the data bus 1508L. In response to the lower bits (0th to 1023th bits) of data A, data A is shifted to the right by 1 bit, and right-shifted data A >> 1 is output to Q register 1517 through data bus 1506.

Y[i]選択回路1510は、乗数Yのiビット目であるY[i]の値に応じた選択信号Sをデータバス1511を通じて選択回路1512に出力する。Y[i]が「1」のときに選択信号S(=1)が出力され、Y[i]が「0」のときに選択信号S(=0)が出力される。   The Y [i] selection circuit 1510 outputs a selection signal S corresponding to the value of Y [i], which is the i-th bit of the multiplier Y, to the selection circuit 1512 through the data bus 1511. The selection signal S (= 1) is output when Y [i] is “1”, and the selection signal S (= 0) is output when Y [i] is “0”.

このような処理を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 selection circuit 1512 selects the data P as the data A when the value of the selection signal S, that is, the value of Y “1023” is “1”, When the selection signal S is “0”, the data Q is selected as data A. The selection circuit 1512 outputs the upper bits (1024th to 2047th bits) of the data A to the A register 1523 through the data bus 1508U and the data bus 112, and the lower bits of the data A (through the data bus 1508L and the data bus 112). 0th bit to 1023th bit) is output to the A register 1523.

以上のような処理によって、最終的にAレジスタ1523に乗数Yと被乗数Xとの乗算結果が格納される。   Through the above processing, the multiplication result of the multiplier Y and the multiplicand X is finally stored in the A register 1523.

以上のように、本実施の形態に係る乗算回路によれば、乗数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 A register 1523. However, the present invention is not limited to this, and the multiplication result may be stored in either the X register 1522 or the Y register 1521. In this case, the A register 1523 is unnecessary.

[第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 multiplication circuit 1500 in FIG. 20 are denoted by the same reference numerals as those in FIG. Referring to FIG. 20, this multiplication circuit 1600 is different from multiplication circuit 1500 in FIG. 20 in that it includes a K register 1623 and a register selection circuit 1609, and instead of two right shift circuits 505a and 505b. 1 includes a right shift circuit 505 and an adder 1603 instead of the adder 1503.

Kレジスタ1623は、1024ビットの零元Kを記憶する。Kレジスタ1623は、零元Kをデータバス112を通じて加算部1603に出力する。   The K register 1623 stores a 1024-bit zero element K. The K register 1623 outputs the zero element K to the adding unit 1603 through the data bus 112.

レジスタ選択回路1609は、Xレジスタ1522およびKレジスタ1623に交互に制御バス1531,1532を通じて読出信号を送り、データバス112に被乗数Xまたは零元Kを出力させる。   The register selection circuit 1609 alternately sends a read signal to the X register 1522 and the K register 1623 through the control buses 1531 and 1532, and causes the data bus 112 to output the multiplicand X or the zero element K.

加算部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 unit 1603 includes an input terminal 1 connected to the data bus 1508U and an input terminal 2 connected to the data bus 112. The i-th bit (0 ≦ i) of the input terminal 1 of the adder 1603 is connected to the i-th bit of the data bus 1508. The i-th bit (1 ≦ i) of the input terminal 2 of the adder 1603 is connected to the (i−1) -th bit of the data bus 112, and the 0th bit of the input terminal 2 is fixed to “0”. Is done.

加算部1603は、入力端子1からデータAの上位ビット(1024ビット目〜2047ビット目)を受け、入力端子2から被乗数Xが1ビットだけ左にシフトしたデータ(X≪1)を受けて、これらを加算する。加算部1603は、加算結果(A+(X≪1))をデータバス1504を通じて右シフト回路505の上位側に出力する。   The adder 1603 receives the upper bits (1024th to 2047th bits) of the data A from the input terminal 1, receives the data (X << 1) in which the multiplicand X is shifted to the left by 1 bit from the input terminal 2, Add these. The addition unit 1603 outputs the addition result (A + (X << 1)) to the upper side of the right shift circuit 505 through the data bus 1504.

また、加算部1603は、入力端子1からデータAの上位ビット(1024ビット目〜2047ビット目)を受け、入力端子2から零元Kを1ビットだけ左にシフトしたデータ(K≪1)を受けて、これらを加算する。加算部1603は、加算結果(A+(K≪1))をデータバス1504を通じて右シフト回路505の上位側に出力する。   The adder 1603 receives the upper bits (1024th to 2047th bits) of the data A from the input terminal 1 and shifts the data (K << 1) obtained by shifting the zero element K from the input terminal 2 to the left by 1 bit. Receive these and add them. The adding unit 1603 outputs the addition result (A + (K << 1)) to the upper side of the right shift circuit 505 through the data bus 1504.

右シフト回路505は、上位側にデータバス1504を通じて加算結果(A+(X≪1))を受けて、下位側にデータバス1508Lを通じてデータAの下位ビット(0ビット目〜1023ビット目)を受けて、これらを1ビットだけ右にシフトし、右シフトしたデータ((A+(X≪1))≫1)をデータバス1506を通じてPレジスタ107に出力する。   The right shift circuit 505 receives the addition result (A + (X << 1)) through the data bus 1504 on the upper side and the lower bits (0th to 1023th bits) of the data A through the data bus 1508L on the lower side. These are shifted to the right by 1 bit, and the right-shifted data ((A + (X << 1)) >> 1) is output to the P register 107 through the data bus 1506.

また、右シフト回路505は、上位側にデータバス1504を通じて加算結果(A+(K≪1))を受けて、下位側にデータバス1508Lを通じてデータAの下位ビット(0ビット目〜1023ビット目)を受けて、これらを1ビットだけ右にシフトし、右シフトしたデータ((A+(K≪1))≫1)をデータバス1506を通じてQレジスタ1507に出力する。   The right shift circuit 505 receives the addition result (A + (K << 1)) through the data bus 1504 on the upper side and the lower bits (0th to 1023th bits) of data A through the data bus 1508L on the lower side. In response, these are shifted to the right by 1 bit, and the right-shifted data ((A + (K << 1)) >> 1) is output to the Q register 1507 via the data bus 1506.

レジスタ選択回路1609により、被乗数Xと零元が交互にレジスタ群1601からデータバス112に出力されるので、加算部1603および右シフト回路505は、被乗数Xについての処理と、零元Kとの処理を交互に実行する。   Since the register selection circuit 1609 alternately outputs the multiplicand X and the zero element from the register group 1601 to the data bus 112, the adder 1603 and the right shift circuit 505 process the multiplicand X and process the zero element K. Execute alternately.

(乗算回路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 multiplication algorithm 58, the operation of the multiplication circuit 1600 will be described.

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 selection circuit 1512 receives data P from the P register 107 through the data bus 1507 and receives data Q from the Q register 1517 through the data bus 1507.

選択回路1512は、データバス1511を通じて受けた選択信号Sが「1」のときには、データPを選択してデータAとし、データバス1511を通じて受けた選択信号Sが「0」のときには、データQを選択してデータAとする。選択回路1512は、データバス1508Uを通じて加算部1603にデータAの上位ビット(1024ビット目〜2047ビット目)を出力し、データバス1508Lを通じて右シフト回路505の下位側にデータAの下位ビット(0ビット目〜1023ビット目)を出力する。   The selection circuit 1512 selects data P as data A when the selection signal S received through the data bus 1511 is “1”, and receives data Q when the selection signal S received through the data bus 1511 is “0”. Select data A. The selection circuit 1512 outputs the upper bits (1024th to 2047th bits) of the data A to the addition unit 1603 through the data bus 1508U, and the lower bits (0) of the data A to the lower side of the right shift circuit 505 through the data bus 1508L. Bits 0 through 1023) are output.

レジスタ選択回路1609は、Xレジスタ1522に制御バス1531を通じて読出信号を送り、Xレジスタ1522からからデータバス112に被乗数Xを出力させる。   The register selection circuit 1609 sends a read signal to the X register 1522 through the control bus 1531, and causes the multiplicand X to be output from the X register 1522 to the data bus 112.

加算部1603は、データバス1508Uを通じてデータAの上位ビット(1024ビット目〜2047ビット目)を受け、データバス112を通じて被乗数Xが1ビットだけ左にシフトしたデータ(X≪1)を受けて、これらを加算し、加算結果をデータバス1504を通じて右シフト回路505の上位側に出力する。   The adding unit 1603 receives the upper bits (1024th to 2047th bits) of the data A through the data bus 1508U, receives the data (X << 1) in which the multiplicand X is shifted to the left by 1 bit through the data bus 112, These are added, and the addition result is output to the upper side of the right shift circuit 505 through the data bus 1504.

右シフト回路505は、加算部1603および選択回路1512から受けたデータ(A+(X≪1))を1ビットだけ右にシフトし、右シフトしたデータ((A+(X≪1))≫1)をデータバス1506を通じてPレジスタ107に出力する。   The right shift circuit 505 shifts the data (A + (X << 1)) received from the adder 1603 and the selection circuit 1512 to the right by 1 bit and right-shifted data ((A + (X << 1)) >> 1) Is output to the P register 107 through the data bus 1506.

上述の加算部1603および右シフト回路505の処理が終了後、レジスタ選択回路1609は、Kレジスタ1623に制御バス1532を通じて読出信号を送り、Kレジスタ1623からデータバス122に零元Kを出力させる。   After the processing of the adder 1603 and the right shift circuit 505 is completed, the register selection circuit 1609 sends a read signal to the K register 1623 through the control bus 1532 and causes the zero register K to be output from the K register 1623 to the data bus 122.

加算部1603は、データバス1508Uを通じてデータAの上位ビット(1024ビット目〜2047ビット目)を受け、データバス112を通じて零元Kが1ビットだけ左にシフトしたデータ(K≪1)を受けて、これらを加算し、加算結果をデータバス1504を通じて右シフト回路505の上位側に出力する。   The adder 1603 receives upper bits (1024th to 2047th bits) of data A through the data bus 1508U, and receives data (K << 1) in which the zero element K is shifted to the left by 1 bit through the data bus 112. These are added, and the addition result is output to the upper side of the right shift circuit 505 through the data bus 1504.

右シフト回路505は、加算部1603および選択回路1512から受けたデータ(A+(K≪1))を1ビットだけ右にシフトし、右シフトしたデータ((A+(K≪1))≫1)をデータバス1506を通じてQレジスタ1517に出力する。   The right shift circuit 505 shifts the data (A + (K << 1)) received from the adder 1603 and the selection circuit 1512 to the right by 1 bit and right-shifted data ((A + (K << 1)) >> 1) Is output to the Q register 1517 through the data bus 1506.

Y[i]選択回路1510は、乗数Yのiビット目であるY[i]の値に応じた選択信号Sをデータバス1511を通じて選択回路1512に出力する。Y[i]が「1」のときに選択信号S(=1)が出力され、Y[i]が「0」のときに選択信号S(=0)が出力される。   The Y [i] selection circuit 1510 outputs a selection signal S corresponding to the value of Y [i], which is the i-th bit of the multiplier Y, to the selection circuit 1512 through the data bus 1511. The selection signal S (= 1) is output when Y [i] is “1”, and the selection signal S (= 0) is output when Y [i] is “0”.

このような処理を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 selection circuit 1512 selects the data P as the data A when the value of the selection signal S, that is, the value of Y “1023” is “1”, When the selection signal S is “0”, the data Q is selected as data A. The selection circuit 1512 outputs the upper bits (1024th to 2047th bits) of the data A to the A register 1523 through the data bus 1508U and the data bus 112, and the lower bits of the data A (through the data bus 1508L and the data bus 112). 0th bit to 1023th bit) is output to the A register 1523.

以上のような処理によって、最終的にAレジスタ1523に乗数Yと被乗数Xとの乗算結果が格納される。   Through the above processing, the multiplication result of the multiplier Y and the multiplicand X is finally stored in the A register 1523.

以上のように、本変形例に係る乗算回路によれば、第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 remainder calculation circuit 1400 includes a register group 1401, a register selection circuit 1409, a Y [i] selection circuit 1410, an adder / subtractor 1403, a P register 1407, a Q register 1418, a left A shift circuit 1405 and an addition / subtraction / register selection circuit 1412 are provided.

また、この乗算回路1400は、n(=1024)ビットのデータを伝送し、全ビットが正論理であるデータバス112,1404,1406,1408を含む。データバス112は、剰余演算回路1400の外部の制御回路12と接続する。   The multiplication circuit 1400 includes data buses 112, 1404, 1406, and 1408 that transmit n (= 1024) bits of data and all bits are positive logic. The data bus 112 is connected to the control circuit 12 outside the remainder calculation circuit 1400.

レジスタ群1401は、演算に必要なデータを記憶するもので、Yレジスタ1421と、Nレジスタ1422と、Kレジスタ1423と、Aレジスタ1523とからなる。   The register group 1401 stores data necessary for calculation, and includes a Y register 1421, an N register 1422, a K register 1423, and an A register 1523.

Yレジスタ1421は、1024ビットの被除数Yを記憶する。Yレジスタ1421は、被除数Yをデータバス112を通じてY[i]選択回路1410に出力する。   The Y register 1421 stores the dividend Y of 1024 bits. The Y register 1421 outputs the dividend Y to the Y [i] selection circuit 1410 through the data bus 112.

Nレジスタ1422は、1024ビットの除数Nを記憶する。Nレジスタ1422は、除数Nをデータバス112を通じて加算部1403に出力する。   The N register 1422 stores a 1024-bit divisor N. The N register 1422 outputs the divisor N to the adding unit 1403 through the data bus 112.

Kレジスタ1423は、1024ビットの零元Kを記憶する。Kレジスタ1423は、零元Kをデータバス112を通じて加算部1403に出力する。   The K register 1423 stores a 1024-bit zero element K. The K register 1423 outputs the zero element K to the adding unit 1403 through the data bus 112.

Aレジスタ1523は、剰余演算処理の終了後に、乗数Yと被乗数Xとの剰余演算結果A(1024ビット)を記憶する。   The A register 1523 stores the remainder calculation result A (1024 bits) of the multiplier Y and the multiplicand X after the remainder calculation processing is completed.

レジスタ選択回路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 register selection circuit 1409 sends a read signal to the N register 1422 through the control bus 1437 and outputs the divisor N from the N register 1422 to the data bus 112 during the remainder calculation. The register selection circuit 1409 transmits a read signal to the N register 1422 through the control bus 1437 and causes the N register 1422 to output the divisor N to the data bus 112 during the first addition in the correction operation. The register selection circuit 1409 sends a read signal to the K register 1423 through the control bus 1436 during the second addition in the correction operation, and causes the zero register K to be output from the K register 1423 to the data bus 112.

Y[i]選択回路1410は、被除数Yのiビット目であるY[i]を制御バス1411を通じて左シフト回路1405に出力する。   The Y [i] selection circuit 1410 outputs Y [i], which is the i-th bit of the dividend Y, to the left shift circuit 1405 through the control bus 1411.

左シフト回路1405は、データバス1406を通じて受けたデータAを1ビットだけ左にシフトするとともに、制御バス1411を通じて受けたY[i]の値を第0ビット目の値とする。左シフト回路1405は、データ((A≪1)+Y[i])をデータバス1408に出力する。   The left shift circuit 1405 shifts the data A received through the data bus 1406 to the left by 1 bit, and sets the value of Y [i] received through the control bus 1411 as the value of the 0th bit. The left shift circuit 1405 outputs data ((A << 1) + Y [i]) to the data bus 1408.

加減算/レジスタ選択回路1412は、制御バス1431を通じて加減算選択信号を加減算器1403に出力する。加減算/レジスタ選択回路1412は、制御バス1432を通じてP読出信号およびP書込信号をPレジスタ1407に出力する。加減算/レジスタ選択回路1412は、制御バス1433を通じてQ読出信号およびQ書込信号をQレジスタ1418に出力する。   The addition / subtraction / register selection circuit 1412 outputs an addition / subtraction selection signal to the adder / subtractor 1403 through the control bus 1431. Addition / subtraction / register selection circuit 1412 outputs a P read signal and a P write signal to P register 1407 through control bus 1432. Addition / subtraction / register selection circuit 1412 outputs a Q read signal and a Q write signal to Q register 1418 through control bus 1433.

加減算/レジスタ選択回路1412は、剰余演算における読出し時に、記憶している符号データSが「0」(Aの符号が正を示す)のときには、Q読出信号を活性化し、記憶している符号データSが「1」(Aの符号が負を示す)のときには、P読出信号を活性化する。   The addition / subtraction / register selection circuit 1412 activates the Q read signal and stores the stored code data when the stored code data S is “0” (the sign of A indicates positive) during reading in the remainder operation. When S is “1” (the sign of A indicates negative), the P read signal is activated.

加減算/レジスタ選択回路1412は、剰余演算における第1の加減算時には、記憶している符号データSが「0」(Aの符号が正を示す)のときには、加減算選択信号を活性化し、P書込信号を活性化し、Q書込信号を非活性化し、記憶している符号データSが「1」(Aの符号が負を示す)のときには、加減算選択信号を非活性化し、P書込信号を非活性化し、Q書込信号を活性化する。   The addition / subtraction / register selection circuit 1412 activates the addition / subtraction selection signal when the stored code data S is “0” (the sign of A indicates positive) at the time of the first addition / subtraction in the remainder operation, and P writing When the signal is activated, the Q write signal is deactivated, and the stored code data S is “1” (the sign of A indicates negative), the addition / subtraction selection signal is deactivated, and the P write signal is Deactivates and activates the Q write signal.

加減算/レジスタ選択回路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 / register selection circuit 1412 deactivates the addition / subtraction selection signal when the stored code data is “0” (the sign of A indicates positive), and P writing The signal is deactivated, the Q write signal is activated, and when the stored code data is “1” (the sign of A indicates negative), the addition / subtraction selection signal is activated and the P write signal is activated. The Q write signal is deactivated.

加減算/レジスタ選択回路1412は、補正演算における第1の読出し時に、記憶している符号データSが「1」(Aの符号が負を示す)ときには、Q読出信号を活性化し、記憶している符号データSが「0」(Aの符号が正を示す)のときには、P読出信号を活性化する。   The addition / subtraction / register selection circuit 1412 activates and stores the Q read signal when the stored code data S is “1” (the sign of A indicates negative) during the first reading in the correction operation. When the code data S is “0” (the sign of A indicates positive), the P read signal is activated.

加減算/レジスタ選択回路1412は、補正演算における第1の加算時に、加減算選択信号を活性化し、P書込信号を活性化し、Q書込信号を非活性化する。加減算/レジスタ選択回路1412は、補正演算における第2の加算時に、加減算選択信号を活性化し、P書込信号を非活性化し、Q書込信号を活性化する。   The addition / subtraction / register selection circuit 1412 activates the addition / subtraction selection signal, activates the P write signal, and deactivates the Q write signal during the first addition in the correction operation. The addition / subtraction / register selection circuit 1412 activates the addition / subtraction selection signal, deactivates the P write signal, and activates the Q write signal during the second addition in the correction operation.

加減算/レジスタ選択回路1412は、補正演算における第2の読出時に、記憶している符号データSが「1」(Aの符号が負を示す)ときには、P読出信号を活性化し、記憶している符号データSが「0」(Aの符号が正を示す)ときには、Q読出信号を活性化する。   The addition / subtraction / register selection circuit 1412 activates and stores the P read signal when the stored code data S is “1” (the sign of A indicates negative) during the second read in the correction operation. When the code data S is “0” (the sign of A indicates positive), the Q read signal is activated.

加減算/レジスタ選択回路1412は、データバス1406またはデータバス1408を通じてデータAを受け、データAの最上位ビットであり、Aの符号を表わすA[1023]を新たな符号データSとして記憶する。   The addition / subtraction / register selection circuit 1412 receives the data A through the data bus 1406 or the data bus 1408, and stores A [1023] which is the most significant bit of the data A and represents the sign of A as new code data S.

加減算器1403は、データバス1408と接続する入力端子1と、データバス112と接続する入力端子2とを備える。加減算器1403の入力端子1の第iビット目(0≦i)は、データバス1408の第iビット目と接続し、入力端子2の第iビット目(0≦i)は、データバス112の第iビット目と接続する。   The adder / subtractor 1403 includes an input terminal 1 connected to the data bus 1408 and an input terminal 2 connected to the data bus 112. The i-th bit (0 ≦ i) of the input terminal 1 of the adder / subtractor 1403 is connected to the i-th bit of the data bus 1408, and the i-th bit (0 ≦ i) of the input terminal 2 is connected to the data bus 112. Connect to the i-th bit.

加減算器1403は、入力端子1からデータ{(A≪1)+Y[i]}またはデータAを受け、入力端子2から除数Nまたは零元Kとを受けて、加減算選択信号が活性化されているときにこれらを加算し、加減算選択信号が非活性化されているときにこれらを減算する。加減算器1403は、演算結果をデータバス1404に出力する。   The adder / subtractor 1403 receives data {(A << 1) + Y [i]} or data A from the input terminal 1, receives a divisor N or zero element K from the input terminal 2, and the addition / subtraction selection signal is activated. These are added when the signal is added, and are subtracted when the addition / subtraction selection signal is inactivated. The adder / subtractor 1403 outputs the calculation result to the data bus 1404.

Pレジスタ1407は、剰余演算の途中結果のデータPを記憶する。Pレジスタ1407は、P書込信号が活性化されているときには、データバス1404を通じて受けたデータをデータPとして記憶する。また、Pレジスタ1407は、P読出信号が活性化されているときには、記憶しているデータPをデータAとしてデータバス1406またはデータバス1408に出力する。   The P register 1407 stores data P as an intermediate result of the remainder calculation. P register 1407 stores the data received through data bus 1404 as data P when the P write signal is activated. P register 1407 outputs stored data P as data A to data bus 1406 or data bus 1408 when the P read signal is activated.

Qレジスタ1418は、Q書込信号が活性化されているときには、データバス1404を通じて受けたデータをデータQとして記憶する。また、Qレジスタ1418は、Q読出信号が活性化されているときには、記憶しているデータQをデータAとしてデータバス1406またはデータバス1408に出力する。   Q register 1418 stores the data received through data bus 1404 as data Q when the Q write signal is activated. Q register 1418 outputs stored data Q as data A to data bus 1406 or data bus 1408 when the Q read signal is activated.

(剰余演算回路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 remainder calculation algorithm 60, the operation of the remainder calculation circuit 1400 will be described. Referring to the figure, it is assumed that the initial value of code data S stored in addition / subtraction / register selection circuit 1412 is “1” which is a value for instructing subtraction.

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] selection circuit 1410 outputs Y [i], which is the i-th bit of the dividend Y, to the left shift circuit 1405 through the control bus 1411.

加減算/レジスタ選択回路1412は、剰余演算における読出し時に、記憶している符号データSが「0」(Aの符号が正を示す)のときには、Q読出信号を活性化する。Qレジスタ1418は、Q読出信号が活性化により、記憶しているデータQをデータAとしてデータバス1406を通じて左シフト回路1405および加減算/レジスタ選択回路1412に出力する。加減算/レジスタ選択回路1412は、データバス1406を通じてデータAを受け、データAの最上位ビットであり、Aの符号を表わすA[1023]を新たな符号データSとして記憶する。   The addition / subtraction / register selection circuit 1412 activates the Q read signal when the stored code data S is “0” (the sign of A indicates positive) during reading in the remainder operation. The Q register 1418 outputs the stored data Q as data A to the left shift circuit 1405 and the addition / subtraction / register selection circuit 1412 through the data bus 1406 when the Q read signal is activated. The addition / subtraction / register selection circuit 1412 receives data A through the data bus 1406 and stores A [1023], which is the most significant bit of data A and represents the sign of A, as new code data S.

左シフト回路1405は、データバス1406を通じて受けたデータAを1ビットだけ左にシフトするとともに、制御バス1411を通じて受けたY[i]の値を第0ビット目の値とする。左シフト回路1405は、データ((A≪1)+Y[i])をデータバス1408に出力する。   The left shift circuit 1405 shifts the data A received through the data bus 1406 to the left by 1 bit, and sets the value of Y [i] received through the control bus 1411 as the value of the 0th bit. The left shift circuit 1405 outputs data ((A << 1) + Y [i]) to the data bus 1408.

レジスタ選択回路1409は、剰余演算時には、Nレジスタ1422から除数Nをデータバス112に出力させる。   The register selection circuit 1409 causes the divisor N to be output from the N register 1422 to the data bus 112 during the remainder operation.

次に、剰余演算における第1の加減算のための処理が行なわれる。   Next, processing for the first addition / subtraction in the remainder calculation is performed.

加減算/レジスタ選択回路1412は、剰余演算における第1の加減算時には、記憶している符号データSが「0」(Aの符号が正を示す)のときには、加減算選択信号を活性化し、P書込信号を活性化し、Q書込信号を非活性化する。   The addition / subtraction / register selection circuit 1412 activates the addition / subtraction selection signal when the stored code data S is “0” (the sign of A indicates positive) at the time of the first addition / subtraction in the remainder operation, and P writing The signal is activated and the Q write signal is deactivated.

加減算器1403は、第1の加減算を行なう。すなわち、加減算器1403は、データバス1408を通じてデータ((A≪1)+Y[i])と、データバス112を通じて除数Nとを受けて、加減算選択信号が活性化により、これらを加算し、加算結果((A≪1)+Y[i]+N)をデータバス1404に出力する。   The adder / subtractor 1403 performs the first addition / subtraction. That is, the adder / subtractor 1403 receives the data ((A << 1) + Y [i]) through the data bus 1408 and the divisor N through the data bus 112, and adds and subtracts them when the addition / subtraction selection signal is activated. The result ((A << 1) + Y [i] + N) is output to the data bus 1404.

Pレジスタ1407は、P書込信号が活性化により、データバス1404を通じて受けた加算結果((A≪1)+Y[i]+N)をデータPとして記憶する。Qレジスタ1418は、Q書込信号が非活性化により、データバス1404を通じて受けた加算結果((A≪1)+Y[i]+N)をデータQとして記憶しない。   The P register 1407 stores the addition result ((A << 1) + Y [i] + N) received through the data bus 1404 as data P when the P write signal is activated. The Q register 1418 does not store the addition result ((A << 1) + Y [i] + N) received through the data bus 1404 as the data Q when the Q write signal is deactivated.

次に、剰余演算における第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 / register selection circuit 1412 deactivates the addition / subtraction selection signal when the stored code data is “0” (the sign of A indicates positive), and P writing The signal is deactivated and the Q write signal is activated.

加減算器1403は、第2の加減算を行なう。すなわち、加減算器1403は、データバス1408を通じてデータ((A≪1)+Y[i])と、データバス112を通じて除数Nとを受けて、加減算選択信号が非活性化により、これらを減算し、減算結果((A≪1)+Y[i]−N)をデータバス1404に出力する。   The adder / subtractor 1403 performs the second addition / subtraction. That is, the adder / subtractor 1403 receives the data ((A << 1) + Y [i]) through the data bus 1408 and the divisor N through the data bus 112, and subtracts them by deactivating the addition / subtraction selection signal. The subtraction result ((A << 1) + Y [i] −N) is output to the data bus 1404.

Pレジスタ1407は、P書込信号が非活性化により、データバス1404を通じて受けた減算結果((A≪1)+Y[i]−N)をデータPとして記憶しない。Qレジスタ1418は、Q書込信号が活性化により、データバス1404を通じて受けた減算結果((A≪1)+Y[i]−N)をデータQとして記憶する。   The P register 1407 does not store the subtraction result ((A << 1) + Y [i] −N) received through the data bus 1404 as data P when the P write signal is deactivated. The Q register 1418 stores the subtraction result ((A << 1) + Y [i] −N) received through the data bus 1404 as the data Q when the Q write signal is activated.

一方、加減算/レジスタ選択回路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 / register selection circuit 1412 activates the P read signal when the stored code data S is “1” (the sign of A indicates negative) at the time of reading in the remainder calculation. The P register 1407 outputs the stored data P as data A to the left shift circuit 1405 and the addition / subtraction / register selection circuit 1412 through the data bus 1406 when the P read signal is activated. The addition / subtraction / register selection circuit 1412 receives data A through the data bus 1406 and stores A [1023], which is the most significant bit of data A and represents the sign of A, as new code data S.

左シフト回路1405は、受けたデータAを1ビットだけ左にシフトするとともに、制御バス1411を通じて受けたY[i]の値を第0ビット目の値とする。左シフト回路1405は、データ((A≪1)+Y[i])をデータバス1408に出力する。   The left shift circuit 1405 shifts the received data A to the left by 1 bit, and sets the value of Y [i] received through the control bus 1411 as the value of the 0th bit. The left shift circuit 1405 outputs data ((A << 1) + Y [i]) to the data bus 1408.

レジスタ選択回路1409は、剰余演算時には、Nレジスタ1422から除数Nをデータバス112に出力させる。   The register selection circuit 1409 causes the divisor N to be output from the N register 1422 to the data bus 112 during the remainder operation.

次に、剰余演算における第1の加減算のための処理が行なわれる。   Next, processing for the first addition / subtraction in the remainder calculation is performed.

加減算/レジスタ選択回路1412は、剰余演算における第1の加減算時に、記憶している符号データSが「1」(Aの符号が負を示す)のときには、加減算選択信号を非活性化し、P書込信号を非活性化し、Q書込信号を活性化する。   The addition / subtraction / register selection circuit 1412 deactivates the addition / subtraction selection signal when the stored code data S is “1” (the sign of A indicates negative) during the first addition / subtraction in the remainder operation. The write signal is deactivated and the Q write signal is activated.

加減算器1403は、第1の加減算を行なう。すなわち、加減算器1403は、データバス1408を通じてデータ((A≪1)+Y[i])と、データバス112を通じて除数Nとを受けて、加減算選択信号が非活性化により、これらを減算し、減算結果((A≪1)+Y[i]−N)をデータバス1404に出力する。   The adder / subtractor 1403 performs the first addition / subtraction. That is, the adder / subtractor 1403 receives the data ((A << 1) + Y [i]) through the data bus 1408 and the divisor N through the data bus 112, and subtracts them by deactivating the addition / subtraction selection signal. The subtraction result ((A << 1) + Y [i] −N) is output to the data bus 1404.

Pレジスタ1407は、P書込信号が非活性化により、データバス1404を通じて受けた減算結果((A≪1)+Y[i]−N)をデータPとして記憶しない。Qレジスタ1418は、Q書込信号が活性化により、データバス1404を通じて受けた減算結果((A≪1)+Y[i]−N)をデータQとして記憶する。   The P register 1407 does not store the subtraction result ((A << 1) + Y [i] −N) received through the data bus 1404 as data P when the P write signal is deactivated. The Q register 1418 stores the subtraction result ((A << 1) + Y [i] −N) received through the data bus 1404 as the data Q when the Q write signal is activated.

次に、剰余演算における第2の加減算のための処理が行なわれる。   Next, processing for the second addition / subtraction in the remainder calculation is performed.

加減算/レジスタ選択回路1412は、剰余演算における第2の加減算時に、記憶している符号データが「1」(Aの符号が負を示す)のときには、加減算選択信号を活性化し、P書込信号を活性化し、Q書込信号を非活性化する。   The addition / subtraction / register selection circuit 1412 activates the addition / subtraction selection signal when the stored code data is “1” (the sign of A indicates negative) during the second addition / subtraction in the remainder operation, and the P write signal Is activated and the Q write signal is deactivated.

加減算器1403は、第2の加減算を行なう。加減算器1403は、データバス1408を通じてデータ((A≪1)+Y[i])と、データバス112を通じて除数Nとを受けて、加減算選択信号が活性化により、これらを加算し、加算結果((A≪1)+Y[i]+N)をデータバス1404に出力する。   The adder / subtractor 1403 performs the second addition / subtraction. The adder / subtractor 1403 receives the data ((A << 1) + Y [i]) through the data bus 1408 and the divisor N through the data bus 112, and adds and subtracts these signals when the add / subtract selection signal is activated. (A << 1) + Y [i] + N) is output to the data bus 1404.

Pレジスタ1407は、P書込信号が活性化により、データバス1404を通じて受けた加算結果((A≪1)+Y[i]+N)をデータPとして記憶する。Qレジスタ1418は、Q書込信号が非活性化により、データバス1404を通じて受けた加算結果((A≪1)+Y[i]+N)をデータQとして記憶しない。   The P register 1407 stores the addition result ((A << 1) + Y [i] + N) received through the data bus 1404 as data P when the P write signal is activated. The Q register 1418 does not store the addition result ((A << 1) + Y [i] + N) received through the data bus 1404 as the data Q when the Q write signal is deactivated.

以上のような処理を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 / register selection circuit 1412 activates the Q read signal when the stored code data S is “1” (the sign of A indicates negative) during the first reading in the correction operation. The Q register 1418 outputs the stored data Q as data A to the adder / subtractor 1403 through the data bus 1408 when the Q read signal is activated. The Q register 1418 outputs the sign (most significant bit) of the data A to the addition / subtraction / register selection circuit 1412 through the data bus 1406. The addition / subtraction / register selection circuit 1412 stores the code (most significant bit) of data A as code data S.

一方、加減算/レジスタ選択回路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 / register selection circuit 1412 activates the P read signal when the stored code data S is “1” (the sign of A indicates positive) during the first reading in the correction operation. The P register 1407 outputs the stored data P as data A to the adder / subtractor 1403 through the data bus 1408 when the P read signal is activated. The P register 1407 outputs the sign (most significant bit) of the data A to the addition / subtraction / register selection circuit 1412 through the data bus 1406. The addition / subtraction / register selection circuit 1412 stores the code (most significant bit) of data A as code data S.

レジスタ選択回路1409は、補正演算における第1の加算時に、Nレジスタ1422から除数Nをデータバス112に出力させる。   The register selection circuit 1409 outputs the divisor N from the N register 1422 to the data bus 112 during the first addition in the correction operation.

加減算/レジスタ選択回路1412は、補正演算における第1の加算時に、加減算選択信号を活性化し、P書込信号を活性化し、Q書込信号を非活性化する。   The addition / subtraction / register selection circuit 1412 activates the addition / subtraction selection signal, activates the P write signal, and deactivates the Q write signal during the first addition in the correction operation.

加減算器1403は、データバス1408を通じてデータAと、データバス112を通じて除数Nとを受けて、加減算選択信号が活性化により、これらを加算し、加算結果(A+N)をデータバス1404に出力する。   The adder / subtractor 1403 receives the data A through the data bus 1408 and the divisor N through the data bus 112, adds and subtracts these signals when the add / subtract selection signal is activated, and outputs the addition result (A + N) to the data bus 1404.

Pレジスタ1407は、P書込信号が活性化により、データバス1404を通じて受けた加算結果(A+N)をデータPとして記憶する。Qレジスタ1418は、Q書込信号が非活性化により、データバス1404を通じて受けた加算結果(A+N)をデータQとして記憶しない。   The P register 1407 stores the addition result (A + N) received through the data bus 1404 as data P when the P write signal is activated. The Q register 1418 does not store the addition result (A + N) received through the data bus 1404 as data Q because the Q write signal is deactivated.

さらに、レジスタ選択回路1409は、補正演算における第2の加算時に、Kレジスタ1423から零元Kをデータバス112に出力させる。   Further, the register selection circuit 1409 outputs the zero element K from the K register 1423 to the data bus 112 at the time of the second addition in the correction operation.

加減算/レジスタ選択回路1412は、補正演算における第2の加算時に、加減算選択信号を活性化し、P書込信号を非活性化し、Q書込信号を活性化する。   The addition / subtraction / register selection circuit 1412 activates the addition / subtraction selection signal, deactivates the P write signal, and activates the Q write signal during the second addition in the correction operation.

次に、加減算器1403は、データバス1408を通じてデータAと、データバス112を通じて零元Kとを受けて、加減算選択信号が活性化により、これらを加算し、加算結果(A+K)をデータバス1404に出力する。   Next, the adder / subtractor 1403 receives the data A through the data bus 1408 and the zero element K through the data bus 112 and adds them when the add / subtract selection signal is activated, and the addition result (A + K) is added to the data bus 1404. Output to.

Pレジスタ1407は、P書込信号が非活性化により、データバス1404を通じて受けた加算結果(A+K)をデータPとして記憶しない。Qレジスタ1418は、Q書込信号が活性化により、データバス1404を通じて受けた加算結果(A+K)をデータQとして記憶する。   The P register 1407 does not store the addition result (A + K) received through the data bus 1404 as data P because the P write signal is deactivated. The Q register 1418 stores the addition result (A + K) received through the data bus 1404 as data Q when the Q write signal is activated.

さらに、加減算/レジスタ選択回路1412は、補正演算における第2の読出時に、記憶している符号データSが「1」(Aの符号が負を示す)ときには、P読出信号を活性化する。Pレジスタ1407は、P読出信号が活性化により、記憶しているデータPをデータAとしてデータバス1406およびデータバス112を通じてAレジスタ1523に出力する。   Further, the addition / subtraction / register selection circuit 1412 activates the P read signal when the stored code data S is “1” (the sign of A indicates negative) during the second read in the correction operation. The P register 1407 outputs the stored data P as data A to the A register 1523 through the data bus 1406 and the data bus 112 when the P read signal is activated.

一方、加減算/レジスタ選択回路1412は、補正演算における第2の読出時に、記憶している符号データSが「0」(Aの符号が正を示す)ときには、Q読出信号を活性化する。Qレジスタ1418は、Q読出信号が活性化により、記憶しているデータQをデータAとしてデータバス1406およびデータバス112を通じてAレジスタ1523に出力する。   On the other hand, the addition / subtraction / register selection circuit 1412 activates the Q read signal when the stored code data S is “0” (the sign of A indicates positive) during the second reading in the correction operation. The Q register 1418 outputs the stored data Q as data A to the A register 1523 through the data bus 1406 and the data bus 112 when the Q read signal is activated.

以上のような処理によって、最終的に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 register 1523.

なお、本実施の形態では、Aレジスタ1523に剰余演算結果が格納されるものとしたが、これに限定するものではなく、Yレジスタ1421、Nレジスタ1422、およびKレジスタ1423のいずれかに乗算結果を格納するものとしてもよく、この場合、Aレジスタ1523は不要となる。   In this embodiment, the remainder calculation result is stored in the A register 1523. However, the present invention is not limited to this, and the multiplication result is stored in any of the Y register 1421, the N register 1422, and the K register 1423. In this case, the A register 1523 is not necessary.

以上のように、本実施の形態に係る剰余演算回路によれば、演算の途中結果である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 multiplication operation circuit 600 is a circuit that performs a modular multiplication operation by Montgomery algorithm, and includes a register group 601, a Y [i] evaluation unit 609, an addition unit 603, and a right shift. A circuit 605, a P register 607, and a bus logic conversion circuit 150 are provided.

また、このモンゴメリ乗算剰余回路600は、n(=1024)ビットのデータを伝送し、偶数ビットが正論理で、奇数ビットが負論理である正負論理混在データバス102,104,106,108と、nビットのデータを伝送し、全ビットが正論理であるデータバス112を含む。データバス112は、モンゴメリ乗算剰余回路600の外部の制御回路12と接続する。   The Montgomery multiplication remainder circuit 600 transmits n (= 1024) bits of data, and the positive and negative logic mixed data buses 102, 104, 106, 108 in which even bits are positive logic and odd bits are negative logic, It includes a data bus 112 that transmits n bits of data and all bits are positive logic. The data bus 112 is connected to the control circuit 12 outside the Montgomery multiplication remainder circuit 600.

レジスタ群601は、演算に必要なデータを記憶するもので、Yレジスタ621と、Xレジスタ622と、Kレジスタ623と、Nレジスタ624と、(X+N)レジスタ625とからなる。   The register group 601 stores data necessary for calculation, and includes a Y register 621, an X register 622, a K register 623, an N register 624, and an (X + N) register 625.

Yレジスタ621は、1024ビットの乗数Yを記憶する。Yレジスタ621は、データバス112を通じてY[i]評価部609に乗数Yを出力する。   The Y register 621 stores a 1024-bit multiplier Y. The Y register 621 outputs the multiplier Y to the Y [i] evaluation unit 609 through the data bus 112.

Xレジスタ622は、1024ビットの被乗数Xを記憶する。Xレジスタ622は、Y[i]評価部609から制御バス634を通じて読出信号を受けると、被乗数Xを正負論理混在データバス102に出力する。また、Xレジスタ622は、被乗数Xの第0ビット目であるX[0]を制御バス611を通じてY[i]評価部609に出力する。   The X register 622 stores a 1024-bit multiplicand X. When the X register 622 receives a read signal from the Y [i] evaluation unit 609 via the control bus 634, the X register 622 outputs the multiplicand X to the positive / negative logic mixed data bus 102. The X register 622 outputs X [0], which is the 0th bit of the multiplicand X, to the Y [i] evaluation unit 609 through the control bus 611.

Kレジスタ623は、1024ビットの零元Kを記憶する。Kレジスタ623は、Y[i]評価部609から制御バス633を通じて読出信号を受けると、零元Kを正負論理混在データバス102に出力する。   The K register 623 stores a 1024-bit zero element K. When the K register 623 receives a read signal from the Y [i] evaluation unit 609 through the control bus 633, the K register 623 outputs the zero element K to the mixed logic bus 102.

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 N register 624 receives a read signal from the Y [i] evaluation unit 609 through the control bus 632, the N register 624 outputs the divisor N to the positive / negative logic mixed data bus 102.

(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] evaluation unit 609 via the control bus 631, it outputs the divisor N to the positive / negative logic mixed data bus 102.

Xレジスタ622、Kレジスタ623、Nレジスタ624、(X+N)レジスタ625の出力信号の論理は、図5に示すXレジスタ122の出力信号の論理と同様である。   The logic of the output signal of the X register 622, the K register 623, the N register 624, and the (X + N) register 625 is the same as the logic of the output signal of the X register 122 shown in FIG.

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] evaluation unit 609 receives the multiplier Y through the data bus, receives X [0] through the control bus 611, receives P [0] through the control bus 610, and receives data M = P [0 from these values. ] ^ (Y [i] · X [0]) is calculated. The Y [i] evaluation unit 609 sends a read signal to the K register 623 through the control bus 633 when Y [i] = 0 and M = 0, and when Y [i] = 0 and M = 1, A read signal is sent to the N register 624 through the control bus 632. When Y [i] = 1 and M = 0, a read signal is sent to the X register 622 through the control bus 634, and Y [i] = 1 and M = When it is 1, a read signal is sent to the (X + N) register 625 through the control bus 631.

加算部603は、正負論理混在データバス108と接続する入力端子1と、正負論理混在データバス102と接続する入力端子2とを備える。入力端子1の第iビット目(0≦i)は、正負論理混在データバス108の第iビット目と接続する。また、入力端子2の第iビット目(0≦i)は、正負論理混在データバス102の第iビット目と接続する。   The adder 603 includes an input terminal 1 connected to the positive / negative logic mixed data bus 108 and an input terminal 2 connected to the positive / negative logic mixed data bus 102. The i-th bit (0 ≦ i) of the input terminal 1 is connected to the i-th bit of the positive / negative logic mixed data bus 108. The i-th bit (0 ≦ i) of the input terminal 2 is connected to the i-th bit of the mixed data bus 102 with positive and negative logic.

加算部603は、入力端子1からデータPを受け、入力端子2からK、N、X、または(X+N)を受けて、これらを加算する。加算部603は、加算結果をデータバス104を通じて右シフト回路605に出力する。加算部603の加算処理の論理は、加算部1000と同一なので、ここでは説明を繰返さない。   The adder 603 receives data P from the input terminal 1, receives K, N, X, or (X + N) from the input terminal 2 and adds them. The adding unit 603 outputs the addition result to the right shift circuit 605 through the data bus 104. Since the logic of the adding process of the adding unit 603 is the same as that of the adding unit 1000, description thereof will not be repeated here.

右シフト回路605は、正負論理混在データバス104を通じて受けたデータを1ビットだけ右にシフトし、右シフトしたデータを正負論理混在データバス106を通じてPレジスタ607に出力する。   The right shift circuit 605 shifts the data received through the positive / negative logic mixed data bus 104 to the right by 1 bit, and outputs the right-shifted data to the P register 607 through the positive / negative logic mixed data bus 106.

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 mixed data bus 106 as data P. Further, the P register 607 outputs the stored data P to the adding unit 603 through the positive / negative logic mixed data bus 108. The P register 607 outputs P [0], which is the 0th bit of the stored data P, to the Y [i] evaluation unit 609 through the control bus 610.

バス論理変換回路150は、正負論理混在データバス108から受けたデータの論理をデータバス112の論理に変換してデータバス112に出力する。また、バス論理変換回路150は、データバス112から受けたデータの論理を正負論理混在データバス108の論理に変換して、正負論理混在データバス108に出力する。   The bus logic conversion circuit 150 converts the logic of the data received from the positive / negative logic mixed data bus 108 into the logic of the data bus 112 and outputs it to the data bus 112. The bus logic conversion circuit 150 converts the logic of the data received from the data bus 112 into the logic of the positive / negative logic mixed data bus 108 and outputs it to the positive / negative logic mixed data bus 108.

(モンゴメリ乗算剰余演算回路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 modular multiplication circuit 600. Based on the Montgomery modular multiplication algorithm 61, the operation of the Montgomery modular multiplication circuit 600 will be described.

0〜1023までのiについて以下の処理が行なわれる。   The following processing is performed for i from 0 to 1023.

Yレジスタ621は、データバス112を通じてY[i]評価部609に乗数Yを出力する。   The Y register 621 outputs the multiplier Y to the Y [i] evaluation unit 609 through the data bus 112.

Xレジスタ622は、被乗数Xの第0ビット目であるX[0]を制御バス611に出力し、Pレジスタ607は、記憶しているデータPの第0ビット目であるP[0]を制御バス610を通じてY[i]評価部609に出力する。   The X register 622 outputs X [0], which is the 0th bit of the multiplicand X, to the control bus 611, and the P register 607 controls P [0], which is the 0th bit of the stored data P. The data is output to the Y [i] evaluation unit 609 through the bus 610.

Y[i]評価部609は、データバスを通じて乗数Yを受け、制御バス611を通じてX[0]を受け、制御バス610を通じてP[0]を受けて、これらの値よりデータM=P[0]^(Y[i]・X[0])を算出する。   The Y [i] evaluation unit 609 receives the multiplier Y through the data bus, receives X [0] through the control bus 611, receives P [0] through the control bus 610, and receives data M = P [0 from these values. ] ^ (Y [i] · X [0]) is calculated.

Y[i]評価部609は、Y[i]=0、かつM=0のときには、Kレジスタ623に制御バス633を通じて読出信号を送り、零元Kを正負論理混在データバス102に出力させる。   When Y [i] = 0 and M = 0, the Y [i] evaluation unit 609 sends a read signal to the K register 623 through the control bus 633, and causes the zero element K to be output to the positive / negative logic mixed data bus 102.

Y[i]評価部609は、Y[i]=0、かつM=1のときには、Nレジスタ624に制御バス632を通じて読出信号を送り、除数Nを正負論理混在データバス102に出力させる。   When Y [i] = 0 and M = 1, the Y [i] evaluation unit 609 sends a read signal to the N register 624 through the control bus 632 and causes the divisor N to be output to the mixed logic bus 102.

Y[i]評価部609は、Y[i]=1、かつM=0のときには、Xレジスタ622に制御バス634を通じて読出信号を送り、被乗数Xを正負論理混在データバス102に出力させる。   When Y [i] = 1 and M = 0, the Y [i] evaluation unit 609 sends a read signal to the X register 622 through the control bus 634 and outputs the multiplicand X to the mixed positive / negative logic data bus 102.

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] evaluation unit 609 sends a read signal to the (X + N) register 625 through the control bus 631, and sends the data (X + N) to the positive / negative logic mixed data bus 102. Output.

Pレジスタ607は、記憶しているデータPを正負論理混在データバス108を通じて加算部603へ出力する。   The P register 607 outputs the stored data P to the adder 603 through the positive / negative logic mixed data bus 108.

加算部603は、正負論理混在データバス108を通じてデータPを受け、正負論理混在データバス102を通じてK、N、X、または(X+N)を受けて、受けたデータを加算し、加算結果を正負論理混在データバス104を通じて右シフト回路605に出力する。   The adder 603 receives the data P through the positive / negative logic mixed data bus 108, receives K, N, X, or (X + N) through the positive / negative logic mixed data bus 102, adds the received data, and adds the result to the positive / negative logic The data is output to the right shift circuit 605 through the mixed data bus 104.

右シフト回路605は、加算部603から受けたデータを1ビットだけ右にシフトし、右シフトしたデータを正負論理混在データバス106を通じてPレジスタ607に出力する。   The right shift circuit 605 shifts the data received from the adder 603 to the right by 1 bit, and outputs the right-shifted data to the P register 607 via the positive / negative logic mixed data bus 106.

Pレジスタ607は、正負論理混在データバス106を通じて受けた右シフトしたデータをデータPとして記憶する。   The P register 607 stores the right-shifted data received through the positive / negative logic mixed data bus 106 as data P.

このような処理を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 P register 607.

以上のように、本変形例に係るモンゴメリ乗算剰余演算回路によれば、乗数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 modular multiplication circuit 600 in FIG. 27 are denoted by the same reference numerals as in FIG. Referring to this figure, this Montgomery modular multiplication circuit 700 is different from Montgomery modular multiplication circuit 600 in FIG. 27 in that it includes a selector 721 and is a dedicated register such as an X register 622, a K register 623, and an N register. Instead of the 624 and (X + N) registers 625, general-purpose registers G1 register 722, G2 register 723, G3 register 724, and G4 register 725 are provided.

G1レジスタ722、G2レジスタ723、G3レジスタ724、およびG4レジスタ725は、1024ビットの被乗数K、零元K、除数N、およびデータ(X+N)のうちのそれぞれ互いに異なるデータを記憶する。   The G1 register 722, the G2 register 723, the G3 register 724, and the G4 register 725 store different data among the 1024-bit multiplicand K, zero element K, divisor N, and data (X + N).

G1レジスタ722、G2レジスタ723、G3レジスタ724、およびG4レジスタ725の出力信号の論理は、図5に示すXレジスタ122の出力信号の論理と同様である。   The logic of the output signals of the G1 register 722, G2 register 723, G3 register 724, and G4 register 725 is the same as the logic of the output signal of the X register 122 shown in FIG.

セレクタ721は、G1レジスタ722、G2レジスタ723、G3レジスタ724、およびG4レジスタ725から、保存しているデータの第0ビット目を受ける。セレクタ721は、これらの第0ビット目のデータのうち、被乗数Xを保存しているレジスタから出力された第0ビット目のデータを選択して、制御バス711を通じてY[i]評価部609に出力する。   The selector 721 receives the 0th bit of the stored data from the G1 register 722, the G2 register 723, the G3 register 724, and the G4 register 725. The selector 721 selects the 0th bit data output from the register storing the multiplicand X among these 0th bit data, and sends it to the Y [i] evaluation unit 609 through the control bus 711. Output.

また、セレクタ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 selector 721 receives a read signal of the register storing the multiplicand X from the Y [i] evaluation unit 609 via the control bus 734, the selector 721 sends the read signal to the register storing the multiplicand X. In addition, upon receiving a read signal of the register storing the zero element K from the Y [i] evaluation unit 609 via the control bus 733, the seclect 701 transmits the read signal to the register storing the zero element K. In addition, upon receiving a read signal of the register storing the divisor N from the Y [i] evaluation unit 609 via the control bus 732, the seclect 701 transmits the read signal to the register storing the divisor N. In addition, upon receiving a read signal of the register storing the data (X + N) from the Y [i] evaluation unit 609 from the Y [i] evaluation unit 609, the secret 701 sends the read signal to the register storing the data (X + N). send.

以上のように、本変形例に係るモンゴメリ乗算剰余演算回路によれば、第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 X register 722 that sends the output to the Y [i] evaluation unit 609 as in the fifth embodiment, so what data is stored in which register. It is possible to provide versatility to use a register for storing.

[第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 modular multiplication circuit 900 includes register group 901, Y [i + 1, i] evaluation unit 909, addition unit 1200, 2-bit right shift circuit 905, and P register 907. Prepare.

また、このモンゴメリ乗算剰余回路900は、n(=1024)ビットのデータを伝送し、偶数ビットが正論理で、奇数ビットが負論理である正負論理混在データバス102a102b,102c,104,106,108と、nビットのデータを伝送し、全ビットが正論理であるデータバス112を含む。データバス112は、モンゴメリ乗算剰余回路900の外部の制御回路12と接続する。   The Montgomery multiplication remainder circuit 900 transmits n (= 1024) bits of data, and positive and negative logic mixed data buses 102a102b, 102c, 104, 106, and 108 in which even bits are positive logic and odd bits are negative logic. And a data bus 112 that transmits n bits of data and all bits are positive logic. The data bus 112 is connected to the control circuit 12 outside the Montgomery multiplication remainder circuit 900.

レジスタ群901は、演算に必要なデータを記憶するもので、Yレジスタ621と、Xレジスタ922と、Kレジスタ923と、Nレジスタ924と、(X+N)レジスタ925とからなる。   The register group 901 stores data necessary for calculation, and includes a Y register 621, an X register 922, a K register 923, an N register 924, and an (X + N) register 925.

Yレジスタ621は、1024ビットの乗数Yを記憶する。Yレジスタ621は、データバス112を通じてY[i+1,i]評価部909に乗数Yを出力する。   The Y register 621 stores a 1024-bit multiplier Y. The Y register 621 outputs the multiplier Y to the Y [i + 1, i] evaluation unit 909 through the data bus 112.

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 X register 922 stores a 1024-bit multiplicand X. The X register 922 receives a 3-bit read signal from the Y [i + 1, i] evaluation unit 909 via the control bus 634. The X register 922 outputs the multiplicand X to the positive / negative logic mixed data bus 102a when the second bit of the read signal is “1”, and outputs the multiplicand X to the positive / negative logic mixed data bus when the first bit of the read signal is “1”. When the 0th bit of the read signal is “1”, the multiplicand X is output to the mixed logic bus 102c. The X register 922 outputs X [1, 0], which is the 0th bit and the 1st bit of the multiplicand X, to the Y [i + 1, i] evaluation unit 909 via the control bus 911.

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 K register 923 stores a 1024-bit zero element K. The K register 923 receives a 3-bit read signal from the Y [i + 1, i] evaluation unit 909 via the control bus 933. The K register 923 outputs the zero element K to the positive / negative logic mixed data bus 102a when the second bit of the read signal is “1”, and mixes the zero element K with the positive / negative logic when the first bit of the read signal is “1”. When the 0th bit of the read signal is “1”, the zero element K is output to the positive / negative logic mixed data bus 102c.

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 N register 924 receives a 3-bit read signal from the Y [i + 1, i] evaluation unit 909 via the control bus 932. The N register 924 outputs the divisor N to the positive / negative logic mixed data bus 102a when the second bit of the read signal is “1”, and outputs the divisor N to the positive / negative logic mixed data bus when the first bit of the read signal is “1”. When the 0th bit of the read signal is “1”, the divisor N is output to the positive / negative logic mixed data bus 102c.

(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] evaluation unit 909 via the control bus 931. The (X + N) register 925 outputs data (X + N) to the positive / negative logic mixed data bus 102a when the second bit of the read signal is “1”, and data (X + N) when the first bit of the read signal is “1”. Is output to the positive / negative logic mixed data bus 102b, and when the 0th bit of the read signal is “1”, the data (X + N) is output to the positive / negative logic mixed data bus 102c.

Xレジスタ922、Kレジスタ923、Nレジスタ924、および(X+N)レジスタ925の出力信号の論理は、図5に示すXレジスタ122の出力信号の論理と同様である。   The logic of the output signals of the X register 922, K register 923, N register 924, and (X + N) register 925 is the same as the logic of the output signal of the X register 122 shown in FIG.

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] evaluation unit 909 receives the multiplier Y through the data bus 112, receives X [1, 0] through the control bus 911, receives P [1, 0] through the control bus 910, and receives these values. Data M [0] = P [0] ^ (Y [i] · X [0]), data MC = P [0] · Y [i] · X [0], and data M [1] = P [1] ^ (Y [i] · X [1]) ^ (Y [i + 1] · X [0]) ^ MC ^ M [0] ^ (M [0] · X [1]) To do.

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] evaluation unit 909 sends a read signal (“111”) to the K register 923 when Y [i + 1, i] = 00, M [0] = 0, and M [1] = 0. . The Y [i + 1, i] evaluation unit 909 sends a read signal (“101”) to the K register 923 when Y [i + 1, i] = 00, M [0] = 0, and M [1] = 1. , A read signal (“010”) is sent to the N register 924. The Y [i + 1, i] evaluation unit 909 sends a read signal (“100”) to the N register 924 when Y [i + 1, i] = 00, M [0] = 1, and M [1] = 0. , A read signal (“011”) is sent to the K register 923. The Y [i + 1, i] evaluation unit 909 sends a read signal (“110”) to the N register 924 when Y [i + 1, i] = 00, M [0] = 1, and M [1] = 1. , A read signal (“001”) is sent to the K register 923.

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] evaluation unit 909 sends a read signal (“100”) to the X register 922 when Y [i + 1, i] = 01, M [0] = 0, and M [1] = 0. , A read signal (“011”) is sent to the K register 923. The Y [i + 1, i] evaluation unit 909 sends a read signal (“100”) to the X register 922 when Y [i + 1, i] = 01, M [0] = 0, and M [1] = 1. The read signal (“010”) is sent to the N register 924 and the read signal (“001”) is sent to the K register 923. The Y [i + 1, i] evaluation unit 909 reads the read signal (“100”) to the (X + N) register 925 when Y [i + 1, i] = 01, M [0] = 1, and M [1] = 0. And a read signal (“011”) is sent to the K register 923. The Y [i + 1, i] evaluation unit 909 reads the read signal (“100”) to the (X + N) register 925 when Y [i + 1, i] = 01, M [0] = 1, and M [1] = 1. , A read signal (“010”) is sent to the N register 924, and a read signal (“001”) is sent to the K register 923.

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] evaluation unit 909 sends a read signal (“110”) to the K register 923 when Y [i + 1, i] = 10, M [0] = 0, and M [1] = 0. The read signal (“001”) is sent to the X register 922. The Y [i + 1, i] evaluation unit 909 sends a read signal (“100”) to the K register 923 when Y [i + 1, i] = 10, M [0] = 0, and M [1] = 1. The read signal (“010”) is sent to the N register 924 and the read signal (“001”) is sent to the X register 922. The Y [i + 1, i] evaluation unit 909 sends a read signal (“100”) to the N register 924 when Y [i + 1, i] = 10, M [0] = 1, and M [1] = 0. The read signal (“010”) is sent to the K register 923 and the read signal (“001”) is sent to the X register 922. The Y [i + 1, i] evaluation unit 909 sends a read signal (“110”) to the N register 924 when Y [i + 1, i] = 10, M [0] = 1, and M [1] = 1. The read signal (“001”) is sent to the X register 922.

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] evaluation unit 909 sends a read signal (“101”) to the X register 922 when Y [i + 1, i] = 11, M [0] = 0, and M [1] = 0. , A read signal (“010”) is sent to the K register 923. The Y [i + 1, i] evaluation unit 909 sends a read signal (“101”) to the X register 922 when Y [i + 1, i] = 11, M [0] = 0, and M [1] = 1. , A read signal (“010”) is sent to the N register 924.

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] evaluation unit 909 sends a read signal (“100”) to the (X + N) register 925. , A read signal (“010”) is sent to the K register 923, and a read signal (“001”) is sent to the X register 922. When Y [i + 1, i] = 11, M [0] = 1, and M [1] = 1, the Y [i + 1, i] evaluation unit 909 sends a read signal (“100”) to the (X + N) register 925. , A read signal (“010”) is sent to the N register 924, and a read signal (“001”) is sent to the X register 922.

加算部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 adder 1200 includes an input terminal 1 connected to the positive / negative logic mixed data bus 108, an input terminal 2 connected to the positive / negative logic mixed data bus 102a, an input terminal 3 connected to the positive / negative logic mixed data bus 102b, and a positive / negative logic mixed. And an input terminal 4 connected to the data bus 102c. The i-th bit (0 ≦ i) of the input terminal 1 is connected to the i-th bit of the positive / negative logic mixed data bus 108. The i-th bit (0 ≦ i) of the input terminal 2 is connected to the i-th bit of the positive / negative logic mixed data bus 102a. The i-th bit (1 ≦ i) of the input terminal 3 is connected to the (i−1) -th bit of the positive / negative logic mixed data bus 102b, and the 0th bit of the input terminal 3 is set to “0”. Fixed. The i-th bit (1 ≦ i) of the input terminal 4 is connected to the (i−1) -th bit of the positive / negative logic mixed data bus 102c, and the 0th bit of the input terminal 4 is set to “0”. Fixed.

加算部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 adder 1200 receives the multiplicand X, zero element K, divisor N, or data (X + N) through the positive / negative logic mixed data bus 102a, and receives the multiplicand X, zero element K, divisor N, or data through the positive / negative logic mixed data bus 102b. X + N) is received by shifting data to the left by 1 bit, and the multiplicand X, zero element K, divisor N, or data (X + N) is shifted by 1 bit to the left through the positive / negative logic mixed data bus 102c, The upper bit (1024th bit to 2048th bit) of the data in the P register 907 is received through the positive / negative logic mixed data bus 108, and addition suitable for the logic of the positive / negative logic mixed data buses 102a, 102b, 102c, 108 is performed. The result is output to the positive logic mixed data bus 104.

(加算部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 unit 1200. In the figure, a portion related to the addition of the (m−1) th bit, the mth bit, and the (m + 1) th bit is typically shown. This adder 1200 includes an adder circuit (positive logic carry negative logic) 1201, an adder circuit (negative logic carry positive logic) 1202, and an adder circuit (positive logic carry negative logic) 1203 in the previous stage, and an adder circuit (positive logic carry negative logic) 1203 in the middle stage. Logic carry negative logic) 1204, an adder circuit (negative logic carry positive logic) 1205, and an adder circuit (positive logic carry negative logic) 1206, and an adder circuit (positive logic carry negative logic) 1207 and an adder circuit (negative logic) Carry positive logic) 1208, and an adder circuit (positive logic carry negative logic) 1209.

前段の第(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 mixed data bus 102a and the positive and negative logic. Receives the positive logic input in3 of the (m-1) th bit of the mixed data bus 102b and the positive logic input in4 of the (m-1) th bit of the mixed data bus 102c and adds them. To do. An adder circuit (positive logic carry negative logic) 1201 outputs a positive logic addition result out to an adder circuit (positive logic carry negative logic) 1204 for processing the (m−1) -th bit in the middle stage, and carries a negative logic carry. coutB is output to an adder circuit (negative logic carry positive logic) 1205 that processes the m-th bit in the middle stage.

前段の第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 mixed data bus 102a and the m-th bit of the positive / negative logic mixed data bus 102b. The negative logic input inB3 of the eye and the negative logic input inB4 of the mth bit of the mixed positive and negative logic data bus 102c are received and added. The adder circuit (negative logic carry positive logic) 1202 outputs the addition result outB of negative logic to the adder circuit (negative logic carry positive logic) 1205 that processes the m-th bit of the middle stage, and the positive logic carry cout is output to the middle stage. The result is output to an addition circuit (positive logic carry negative logic) 1206 for processing the (m + 1) th bit.

前段の第(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 mixed data bus 102a and the positive / negative logic mixed data bus 102b. The (m + 1) th positive logic input in3 and the (m + 1) th positive logic input in4 of the positive / negative logic mixed data bus 102c are received and added. An adder circuit (positive logic carry negative logic) 1203 outputs a positive logic addition result out to an adder circuit (positive logic carry negative logic) 1206 that processes the (m + 1) -th bit in the middle stage, and carries a negative logic carry coutB. This is output to an adder circuit (negative logic carry positive logic) that processes the (m + 2) -th bit in the middle stage (not shown).

中段の第(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 logic data bus 108 and the previous stage. An adder circuit (negative logic) that receives the positive logic addition result out from the adder circuit (positive logic carry negative logic) 1201 that processes the (m−1) th bit and processes the (m−2) th bit of the preceding stage (not shown). The logic carry positive logic) is received from the positive logic carry cout, and these are added. An adder circuit (positive logic carry negative logic) 1204 outputs a positive logic addition result out to an adder circuit (positive logic carry negative logic) 1207 that processes the (m−1) -th bit in the subsequent stage. coutB is output to an adder circuit (negative logic carry positive logic) 1208 for processing the m-th bit in the subsequent stage.

中段の第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 mixed data bus 108 and the previous m-th bit. A negative logic addition result outB is received from the circuit (negative logic carry positive logic) 1202, and a negative logic carry coutB is received from the addition circuit (negative logic carry positive logic) 1202 that processes the (m−1) -th bit in the preceding stage. And add these. The adder circuit (negative logic carry positive logic) 1205 outputs the addition result outB of negative logic to the adder circuit (negative logic carry positive logic) 1208 that processes the m-th bit of the subsequent stage, and the positive logic carry cout is output to the subsequent stage. The result is output to an addition circuit (positive logic carry negative logic) 1209 for processing the (m + 1) th bit.

中段の第(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 mixed data bus 108 and the (m + 1) th bit in the preceding stage. A positive logic addition result out is received from an adder circuit (positive logic carry negative logic) 1203 that processes the bit, and a positive logic carry cout is processed from the adder circuit (positive logic carry negative logic) 1203 that processes the m-th bit in the previous stage. And add them. An adder circuit (positive logic carry negative logic) 1206 outputs a positive logic addition result out to an adder circuit (positive logic carry negative logic) 1209 that processes the (m + 1) th bit in the subsequent stage, and carries a negative logic carry coutB. This is output to an adder circuit (negative logic carry positive logic) that processes the (m + 2) -th bit of the latter stage (not shown).

後段の第(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 mixed data bus 104, and an adder circuit (negative logic carry) that processes the negative logic carry coutB in the subsequent m-th bit. (Positive logic) 1208.

後段の第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 mixed data bus 104, and adds a positive logic carry cout to the (m + 1) -th bit in the subsequent stage (positive circuit). (Logic carry negative logic) 1209.

後段の第(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 mixed data bus 104 of positive and negative logic, and an adder circuit that processes the (m + 2) -th bit in the subsequent stage of the negative logic carry coutB. Output to (negative logic carry positive logic).

2ビット右シフト回路905は、正負論理混在データバス104を通じて加算部1200から受けたデータを2ビットだけ右にシフトし、右シフトしたデータを正負論理混在データバス106を通じてPレジスタ907に出力する。   The 2-bit right shift circuit 905 shifts the data received from the adder 1200 through the positive / negative logic mixed data bus 104 to the right by 2 bits, and outputs the right-shifted data to the P register 907 through the positive / negative logic mixed data bus 106.

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 mixed data bus 106 as data P. Further, the P register 907 outputs the stored data P to the adding unit 1200 through the mixed positive / negative logic data bus 108. Further, the P register 907 outputs P [1, 0], which is the inverted data of the 0th bit and the 1st bit of the stored data P, to the Y [i + 1, i] evaluation unit 909 via the control bus 910. To do.

バス論理変換回路150は、正負論理混在データバス108から受けたデータの論理をデータバス112の論理に変換してデータバス112に出力する。また、バス論理変換回路150は、データバス112から受けたデータの論理を正負論理混在データバス108の論理に変換して、正負論理混在データバス108に出力する。   The bus logic conversion circuit 150 converts the logic of the data received from the positive / negative logic mixed data bus 108 into the logic of the data bus 112 and outputs it to the data bus 112. The bus logic conversion circuit 150 converts the logic of the data received from the data bus 112 into the logic of the positive / negative logic mixed data bus 108 and outputs it to the positive / negative logic mixed data bus 108.

(モンゴメリ乗算剰余演算回路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 modular multiplication circuit 900 will be described based on this Montgomery modular multiplication algorithm 62.

0〜1023までのiについて以下の処理が行なわれる。   The following processing is performed for i from 0 to 1023.

Yレジスタ621は、データバス112に乗数Yを出力する。   The Y register 621 outputs the multiplier Y to the data bus 112.

Xレジスタ922は、被乗数Xの第0ビット目と第1ビット目であるX[1,0]を制御バス911に出力し、Pレジスタ907は、記憶しているデータPの第0ビット目と第1ビット目であるP[1,0]を制御バス910に出力する。   The X register 922 outputs X [1, 0], which is the 0th and 1st bits of the multiplicand X, to the control bus 911, and the P register 907 outputs the 0th bit of the stored data P and The first bit P [1, 0] is output to the control bus 910.

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] evaluation unit 909 receives Y through the data bus 112, receives X [1, 0] through the control bus 911, and receives P [1, 0] through the control bus 910. Data M [0] = P [0] ^ (Y [i] · X [0]), data MC = P [0] · Y [i] · X [0], and data M [1] = P [1] ^ (Y [i] · X [1]) ^ (Y [i + 1] · X [0]) ^ MC ^ M [0] ^ (M [0] · X [1]) .

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] evaluation unit 909 sends a read signal (“111”) to the K register 923 when Y [i + 1, i] = 00, M [0] = 0, and M [1] = 0. The zero element K is output to the positive / negative logic mixed data buses 102a, 102b, and 102c.

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] evaluation unit 909 sends a read signal (“101”) to the K register 923 when Y [i + 1, i] = 00, M [0] = 0, and M [1] = 1. The zero element K is output to the positive / negative logic mixed data buses 102a and 102c, the read signal (“010”) is sent to the N register 924, and the divisor N is output to the positive / negative logic mixed data bus 102b.

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] evaluation unit 909 sends a read signal (“100”) to the N register 924 when Y [i + 1, i] = 00, M [0] = 1, and M [1] = 0. The divisor N is output to the positive / negative logic mixed data bus 102a, the read signal (“011”) is sent to the K register 923, and the zero element K is output to the positive / negative logic mixed data buses 102b and 102c.

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] evaluation unit 909 sends a read signal (“110”) to the N register 924 when Y [i + 1, i] = 00, M [0] = 1, and M [1] = 1. The divisor N is output to the positive / negative logic mixed data buses 102a and 102b, the read signal (“001”) is sent to the K register 923, and the zero element K is output to the positive / negative logic mixed data bus 102c.

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] evaluation unit 909 sends a read signal (“100”) to the X register 922 when Y [i + 1, i] = 01, M [0] = 0, and M [1] = 0. The multiplicand X is output to the positive / negative logic mixed data bus 102a, the read signal (“011”) is sent to the K register 923, and the zero element K is output to the positive / negative logic mixed data buses 102b and 102c.

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] evaluation unit 909 sends a read signal (“100”) to the X register 922 when Y [i + 1, i] = 01, M [0] = 0, and M [1] = 1. The multiplicand X is output to the positive / negative logic mixed data bus 102a, the read signal (“010”) is sent to the N register 924, the divisor N is output to the positive / negative logic mixed data bus 102b, and the read signal (“001”) is output to the K register 923. To output the zero element K to the positive / negative logic mixed data bus 102c.

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] evaluation unit 909 reads the read signal (“100”) to the (X + N) register 925 when Y [i + 1, i] = 01, M [0] = 1, and M [1] = 0. The data (X + N) is output to the positive / negative logic mixed data bus 102a, the read signal (“011”) is sent to the K register 923, and the zero element K is output to the positive / negative logic mixed data buses 102b and 102c.

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] evaluation unit 909 reads the read signal (“100”) to the (X + N) register 925 when Y [i + 1, i] = 01, M [0] = 1, and M [1] = 1. The data (X + N) is output to the positive / negative logic mixed data bus 102a, the read signal (“010”) is output to the N register 924, the divisor N is output to the positive / negative logic mixed data bus 102b, and the read signal ( "001") is sent and the zero element K is output to the positive / negative logic mixed data bus 102c.

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] evaluation unit 909 sends a read signal (“110”) to the K register 923 when Y [i + 1, i] = 10, M [0] = 0, and M [1] = 0. The zero element K is output to the positive / negative logic mixed data buses 102a and 102b, the read signal (“001”) is sent to the X register 922, and the multiplicand X is output to the positive / negative logic mixed data bus 102c.

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] evaluation unit 909 sends a read signal (“100”) to the K register 923 when Y [i + 1, i] = 10, M [0] = 0, and M [1] = 1. The zero element K is output to the positive / negative logic mixed data bus 102a, the read signal (“010”) is sent to the N register 924, the divisor N is output to the positive / negative logic mixed data bus 102b, and the read signal (“001”) is output to the X register 922. ) To output the multiplicand X to the mixed logic bus 102c.

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] evaluation unit 909 sends a read signal (“100”) to the N register 924 when Y [i + 1, i] = 10, M [0] = 1, and M [1] = 0. The divisor N is output to the positive / negative logic mixed data bus 102a, the read signal (“010”) is sent to the K register 923, the zero element K is output to the positive / negative logic mixed data bus 102b, and the read signal (“001”) is output to the X register 922. ) To output the multiplicand X to the mixed logic bus 102c.

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] evaluation unit 909 sends a read signal (“110”) to the N register 924 when Y [i + 1, i] = 10, M [0] = 1, and M [1] = 1. The divisor N is output to the positive / negative logic mixed data buses 102a and 102b, the read signal (“001”) is sent to the X register 922, and the multiplicand X is output to the positive / negative logic mixed data bus 102c.

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] evaluation unit 909 sends a read signal (“101”) to the X register 922 when Y [i + 1, i] = 11, M [0] = 0, and M [1] = 0. The multiplicand X is output to the positive / negative logic mixed data buses 102a and 102c, the read signal (“010”) is sent to the K register 923, and the zero element K is output to the positive / negative logic mixed data bus 102b.

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] evaluation unit 909 sends a read signal (“101”) to the X register 922 when Y [i + 1, i] = 11, M [0] = 0, and M [1] = 1. The multiplicand X is output to the positive / negative logic mixed data buses 102a and 102c, the read signal ("010") is sent to the N register 924, and the divisor N is output to the positive / negative logic mixed data bus 102b.

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] evaluation unit 909 sends a read signal (“100”) to the (X + N) register 925. The data (X + N) is output to the positive / negative logic mixed data bus 102a, the read signal (“010”) is sent to the K register 923, the zero element K is output to the positive / negative logic mixed data bus 102b, and the read signal is output to the X register 922. (“001”) is sent to output the multiplicand X to the mixed logic bus 102c.

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] evaluation unit 909 sends a read signal (“100”) to the (X + N) register 925. The data (X + N) is output to the positive / negative logic mixed data bus 102a, the read signal ("010") is output to the N register 924, the divisor N is output to the positive / negative logic mixed data bus 102b, and the read signal (X "001") is sent to output the multiplicand X to the mixed logic bus 102c.

Pレジスタ907は、記憶しているデータPを正負論理混在データバス108を通じて加算部1200へ出力する。   The P register 907 outputs the stored data P to the adding unit 1200 through the mixed positive / negative logic data bus 108.

加算部1200は、正負論理混在データバス108を通じてデータPの上位ビット(1024ビット目〜2047ビット目)を受け、正負論理混在データバス102a,102b,102cを通じてK、N、X、または(X+N)を受けて、受けたデータを加算し、加算結果を正負論理混在データバス104を通じて、2ビット右シフト回路905に出力する。   The adding unit 1200 receives the upper bits (1024th to 2047th bits) of the data P through the positive / negative logic mixed data bus 108, and K, N, X, or (X + N) through the positive / negative logic mixed data buses 102a, 102b, and 102c. In response, the received data is added, and the addition result is output to the 2-bit right shift circuit 905 via the positive / negative logic mixed data bus 104.

2ビット右シフト回路905は、加算部1200から受けたデータを2ビットだけ右にシフトし、右シフトしたデータを正負論理混在データバス106を通じてPレジスタ907に出力する。   The 2-bit right shift circuit 905 shifts the data received from the adder 1200 to the right by 2 bits, and outputs the right-shifted data to the P register 907 via the positive / negative logic mixed data bus 106.

Pレジスタ907は、正負論理混在データバス106を通じて受けた右シフトしたデータをデータPとして記憶する。   The P register 907 stores right-shifted data received through the positive / negative logic mixed data bus 106 as data P.

このような処理を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 P register 607.

以上のように、本変形例に係るモンゴメリ乗算剰余演算回路によれば、乗数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 modular multiplication circuit 1700 includes a register group 1701, a Y [i] selection circuit 1410, an adder 1703, a right shift circuit 1705, a shift selection circuit 1712, and a P register 1707. A Q register 1718 and a register selection circuit (SQ) 1714.

また、このモンゴメリ乗算剰余回路1700は、n(=1024)ビットのデータを伝送し、全ビットが正論理であるデータバス112,1704,1706,1718,1713とを含む。データバス112は、モンゴメリ乗算剰余回路1700の外部の制御回路12と接続する。   The Montgomery multiplication remainder circuit 1700 includes data buses 112, 1704, 1706, 1718, and 1713 that transmit n (= 1024) bits of data and all bits are positive logic. The data bus 112 is connected to the control circuit 12 outside the Montgomery multiplication remainder circuit 1700.

レジスタ群1701は、演算に必要なデータを記憶するもので、Yレジスタ621と、Xレジスタ622と、Kレジスタ623と、Nレジスタ624と、Rレジスタ1723とからなる。   The register group 1701 stores data necessary for calculation, and includes a Y register 621, an X register 622, a K register 623, an N register 624, and an R register 1723.

Yレジスタ621は、1024ビットの乗数Yを記憶する。Yレジスタ621は、データバス112を通じてY[i]選択回路1410に乗数Yを出力する。   The Y register 621 stores a 1024-bit multiplier Y. The Y register 621 outputs the multiplier Y to the Y [i] selection circuit 1410 through the data bus 112.

Xレジスタ622は、1024ビットの被乗数Xを記憶する。Xレジスタ622は、レジスタ選択回路1709から制御バス1731を通じて読出信号を受けると、被乗数Xをデータバス112に出力する。   The X register 622 stores a 1024-bit multiplicand X. When the X register 622 receives a read signal from the register selection circuit 1709 through the control bus 1731, the X register 622 outputs the multiplicand X to the data bus 112.

Kレジスタ623は、1024ビットの零元Kを記憶する。Kレジスタ623は、レジスタ選択回路1709から制御バス1733を通じて読出信号を受けると、零元Kをデータバス112に出力する。   The K register 623 stores a 1024-bit zero element K. When the K register 623 receives a read signal from the register selection circuit 1709 through the control bus 1733, the K register 623 outputs the zero element K to the data bus 112.

Nレジスタ624は、1024ビットの除数Nを記憶する。Nレジスタ624は、レジスタ選択回路1709から制御バス1732を通じて読出信号を受けると、除数Nをデータバス112に出力する。   The N register 624 stores a divisor N of 1024 bits. When the N register 624 receives a read signal from the register selection circuit 1709 through the control bus 1732, the N register 624 outputs the divisor N to the data bus 112.

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 register selection circuit 1709 stores the K register 623 in the first addition in the first stage calculation described later, the first addition in the second stage calculation described later, and the first addition in the correction calculation described later. A read signal is sent, a read signal is sent to the X register 622 at the second addition in the first stage calculation described later, and a second addition at the second addition in the second stage calculation described later and the second in the correction calculation described later. At the time of addition, a read signal is sent to the N register 624.

Y[i]選択回路1410は、データバス112を通じて乗数Yを受け、制御バス1411を通じてレジスタ選択回路(SQ)1714に乗数Yのiビット目の値であるY[i]を出力する。   The Y [i] selection circuit 1410 receives the multiplier Y through the data bus 112, and outputs Y [i], which is the i-th value of the multiplier Y, to the register selection circuit (SQ) 1714 through the control bus 1411.

レジスタ選択回路(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 P register 1707 through control bus 1734, and outputs a Q read signal and a Q write signal to Q register 1718 through control bus 1735.

レジスタ選択回路(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 register selection circuit 1712 is “0”. The register selection circuit (SQ) 1714 receives Y [i] from the Y [i] selection circuit 1410 through the control bus 1411 before the end of the first stage operation, and sets the value of SQ ^ Y [i] to a new value. Store as data SQ. ^ Represents an exclusive OR (Exclusive-OR). The register selection circuit (SQ) 1714 receives the data R through the data bus 1713 connected to the data bus 1708 and terminates the value of SQ ^ R [0] before the end of the second-stage operation described later. Remember as. The register selection circuit (SQ) 1714 receives the data R through the data bus 1713 connected to the data bus 1708 before the end of the first reading in the correction calculation described later, and is the most significant bit of R. R [1023] representing is stored as new data SQ.

加算部1703は、データバス1708と接続する入力端子1と、データバス112と接続する入力端子2とを備える。入力端子1の第iビット目(0≦i)は、データバス1708の第iビット目と接続する。また、入力端子2の第iビット目(0≦i)は、データバス112の第iビット目と接続する。   The adding unit 1703 includes an input terminal 1 connected to the data bus 1708 and an input terminal 2 connected to the data bus 112. The i-th bit (0 ≦ i) of the input terminal 1 is connected to the i-th bit of the data bus 1708. The i-th bit (0 ≦ i) of the input terminal 2 is connected to the i-th bit of the data bus 112.

加算部1703は、入力端子1からデータRを受け、入力端子2からK、N、またはXを受けて、これらを加算する。加算部1703は、加算結果をデータバス1704を通じて右シフト回路1705に出力する。加算部1703の加算処理の論理は、加算部1000と同一なので、ここでは説明を繰返さない。   The adder 1703 receives data R from the input terminal 1, receives K, N, or X from the input terminal 2 and adds them. The adding unit 1703 outputs the addition result to the right shift circuit 1705 through the data bus 1704. Since the logic of the adding process of the adding unit 1703 is the same as that of the adding unit 1000, description thereof will not be repeated here.

シフト選択回路1712は、制御バス1736を通じてシフト選択信号を右シフト回路1705に出力する。   The shift selection circuit 1712 outputs a shift selection signal to the right shift circuit 1705 through the control bus 1736.

シフト選択回路1712は、後述する第2段階の演算時には、シフト選択信号を活性化し、後述する第1段階の演算時および補正演算時には、シフト選択信号を非活性化する。右シフト回路1705は、シフト選択信号が活性化のときには、データバス1704を通じて受けたデータを1ビットだけ右にシフトし、右シフトしたデータをデータバス1706に出力する。右シフト回路1705は、シフト選択信号が非活性化のときには、データバス1704を通じて受けたデータをそのままデータバス1706に出力する。   The shift selection circuit 1712 activates a shift selection signal during a second stage calculation described later, and deactivates the shift selection signal during a first stage calculation and correction calculation described later. When the shift selection signal is activated, right shift circuit 1705 shifts the data received through data bus 1704 to the right by 1 bit, and outputs the right-shifted data to data bus 1706. The right shift circuit 1705 outputs the data received through the data bus 1704 as it is to the data bus 1706 when the shift selection signal is inactive.

Pレジスタ1707は、P読出信号が活性化されると、記憶しているデータPをデータRとしてデータバス1708に出力する。また、Pレジスタ1707は、P書込信号が活性化により、データバス1706を通じて受けたデータをデータPとして記憶する。   P register 1707 outputs stored data P to data bus 1708 as data R when the P read signal is activated. The P register 1707 stores data received through the data bus 1706 as data P when the P write signal is activated.

Qレジスタ1718は、Q読出信号が活性化されると、記憶しているデータQをデータRとしてデータバス1708に出力する。Qレジスタ1718は、Q書込信号が活性化により、データバス1706を通じて受けたデータをデータQとして記憶する。   Q register 1718 outputs stored data Q to data bus 1708 as data R when the Q read signal is activated. Q register 1718 stores data received through data bus 1706 as data Q when the Q write signal is activated.

(モンゴメリ乗算剰余演算回路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 modular multiplication circuit 1700. Based on the Montgomery modular multiplication algorithm 63, the operation of the Montgomery modular multiplication circuit 1700 will be described.

まず、レジスタ選択回路1712に記憶されるデータSQの初期値は「0」とする。   First, the initial value of the data SQ stored in the register selection circuit 1712 is “0”.

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 shift selection circuit 1712 deactivates the shift selection signal at the time of the first stage calculation.

レジスタ選択回路(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. Q register 1718 outputs stored data Q to data bus 1708 as data R when the Q read signal is activated. The register selection circuit (SQ) 1714 deactivates the Q read signal after the data Q is output.

レジスタ選択回路1709は、第1段階の演算における第1の加算時に、Kレジスタ623に読出信号を送り、Kレジスタ623は、零元Kをデータバス112に出力する。加算部1703は、第1段階の第1の加算を行なう。すなわち、加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて零元Kを受けて、受けたデータを加算し、加算結果(R+K)をデータバス1704に出力する。   The register selection circuit 1709 sends a read signal to the K register 623 during the first addition in the first stage operation, and the K register 623 outputs the zero element K to the data bus 112. Adder 1703 performs the first addition in the first stage. That is, the adding unit 1703 receives the data R through the data bus 1708, receives the zero element K through the data bus 112, adds the received data, and outputs the addition result (R + K) to the data bus 1704.

右シフト回路1705は、シフト選択信号が非活性化により、データバス1704を通じて受けた加算結果(R+K)をそのままデータバス1706に出力する。   The right shift circuit 1705 outputs the addition result (R + K) received through the data bus 1704 as it is to the data bus 1706 when the shift selection signal is deactivated.

レジスタ選択回路(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 data bus 1706 as data P when the P write signal is activated. After the data P is written, the register selection circuit (SQ) 1714 deactivates the P write signal.

次に、レジスタ選択回路1709は、第1段階の演算における第2の加算時に、Xレジスタ622に読出信号を送り、Xレジスタ622は、被乗数Xをデータバス112に出力する。加算部1703は、第1段階の第2の加算を行なう。すなわち、加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて被乗数Xを受けて、受けたデータを加算し、加算結果(R+X)をデータバス1704に出力する。   Next, the register selection circuit 1709 sends a read signal to the X register 622 during the second addition in the first stage operation, and the X register 622 outputs the multiplicand X to the data bus 112. Adder 1703 performs the second addition in the first stage. That is, the adding unit 1703 receives the data R through the data bus 1708, receives the multiplicand X through the data bus 112, adds the received data, and outputs the addition result (R + X) to the data bus 1704.

右シフト回路1705は、シフト選択信号が非活性化により、データバス1704を通じて受けた加算結果(R+X)をそのままデータバス1706に出力する。   The right shift circuit 1705 outputs the addition result (R + X) received via the data bus 1704 as it is to the data bus 1706 when the shift selection signal is deactivated.

レジスタ選択回路(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 Q register 1718 stores data (R + X) received through the data bus 1706 as data Q when the Q write signal is activated. The register selection circuit (SQ) 1714 deactivates the Q write signal after the data Q is written.

一方、レジスタ選択回路(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. P register 1707 outputs stored data P to data bus 1708 as data R when the P read signal is activated. Register selection circuit (SQ) 1714 deactivates the P read signal after data P is output.

レジスタ選択回路1709は、第1段階の演算における第1の加算時に、Kレジスタ623に読出信号を送り、Kレジスタ623は、零元Kをデータバス112に出力する。加算部1703は、第1段階の第1の加算を行なう。加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて零元Kを受けて、受けたデータを加算し、加算結果(R+K)をデータバス1704に出力する。   The register selection circuit 1709 sends a read signal to the K register 623 during the first addition in the first stage operation, and the K register 623 outputs the zero element K to the data bus 112. Adder 1703 performs the first addition in the first stage. The adder 1703 receives the data R through the data bus 1708, receives the zero element K through the data bus 112, adds the received data, and outputs the addition result (R + K) to the data bus 1704.

右シフト回路1705は、シフト選択信号が非活性化により、データバス1704を通じて受けた加算結果(R+K)をそのままデータバス1706に出力する。   The right shift circuit 1705 outputs the addition result (R + K) received through the data bus 1704 as it is to the data bus 1706 when the shift selection signal is deactivated.

レジスタ選択回路(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書込信号を非活性化する。   Q register 1718 stores data (R + K) received through data bus 1706 as data Q when the Q write signal is activated. The register selection circuit (SQ) 1714 deactivates the Q write signal after the data Q is written.

次に、レジスタ選択回路1709は、第1段階の演算における第2の加算時に、Xレジスタ622に読出信号を送り、Xレジスタ622は、被乗数Xをデータバス112に出力する。加算部1703は、第1段階の第2の加算を行なう。すなわち、加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて被乗数Xを受けて、受けたデータを加算し、加算結果(R+X)をデータバス1704に出力する。   Next, the register selection circuit 1709 sends a read signal to the X register 622 during the second addition in the first stage operation, and the X register 622 outputs the multiplicand X to the data bus 112. Adder 1703 performs the second addition in the first stage. That is, the adding unit 1703 receives the data R through the data bus 1708, receives the multiplicand X through the data bus 112, adds the received data, and outputs the addition result (R + X) to the data bus 1704.

右シフト回路1705は、シフト選択信号が非活性化により、データバス1704を通じて受けた加算結果(R+X)をそのままデータバス1706に出力する。   The right shift circuit 1705 outputs the addition result (R + X) received via the data bus 1704 as it is to the data bus 1706 when the shift selection signal is deactivated.

レジスタ選択回路(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 P register 1707 stores data (R + X) received through the data bus 1706 as data P when the P write signal is activated. After the data P is written, the register selection circuit (SQ) 1714 deactivates the P write signal.

次に、レジスタ選択回路(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] selection circuit 1410 through the control bus 1411 and finishes the value of SQ ^ Y [i] before the end of the first stage calculation. Is stored as new data SQ.

以上により、第1段階の演算が終了し、第2段階の演算が行なわれる。シフト選択回路1712は、第2段階の演算時には、シフト選択信号を活性化する。   Thus, the first stage of computation is completed, and the second stage of computation is performed. The shift selection circuit 1712 activates the shift selection signal at the time of the second stage calculation.

レジスタ選択回路(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. P register 1707 outputs stored data P to data bus 1708 as data R when the P read signal is activated. Register selection circuit (SQ) 1714 deactivates the P read signal after data P is output.

レジスタ選択回路1709は、第2段階の演算における第1の加算時に、Kレジスタ623に読出信号を送り、Kレジスタ623は、零元Kをデータバス112に出力する。加算部1703は、第2段階の第1の加算を行なう。すなわち、加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて零元Kを受けて、受けたデータを加算し、加算結果(R+K)をデータバス1704に出力する。   The register selection circuit 1709 sends a read signal to the K register 623 during the first addition in the second stage operation, and the K register 623 outputs the zero element K to the data bus 112. Adder 1703 performs the first addition in the second stage. That is, the adding unit 1703 receives the data R through the data bus 1708, receives the zero element K through the data bus 112, adds the received data, and outputs the addition result (R + K) to the data bus 1704.

右シフト回路1705は、シフト選択信号が活性化により、データバス1704を通じて受けた加算結果(R+K)を1ビットだけ右にシフトしたデータ((R+K)≫1)をデータバス1706に出力する。   The right shift circuit 1705 outputs data ((R + K) >> 1) obtained by shifting the addition result (R + K) received through the data bus 1704 to the right by 1 bit when the shift selection signal is activated, to the data bus 1706.

レジスタ選択回路(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 Q register 1718 stores data ((R + K) >> 1) received through the data bus 1706 as data Q when the Q write signal is activated. The register selection circuit (SQ) 1714 deactivates the Q write signal after the data Q is written.

次に、レジスタ選択回路1709は、第2段階の演算における第2の加算時に、Nレジスタ624に読出信号を送り、Nレジスタ624は、除数Nをデータバス112に出力する。加算部1703は、第2段階の第2の加算を行なう。加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて乗数Nを受けて、受けたデータを加算し、加算結果(R+N)をデータバス1704に出力する。   Next, the register selection circuit 1709 sends a read signal to the N register 624 during the second addition in the second stage operation, and the N register 624 outputs the divisor N to the data bus 112. Adder 1703 performs the second addition in the second stage. The adder 1703 receives the data R through the data bus 1708, receives the multiplier N through the data bus 112, adds the received data, and outputs the addition result (R + N) to the data bus 1704.

右シフト回路1705は、シフト選択信号が活性化により、データバス1704を通じて受けた加算結果(R+N)を1ビットだけ右にシフトしたデータ((R+N)≫1)をデータバス1706に出力する。   The right shift circuit 1705 outputs data ((R + N) >> 1) obtained by shifting the addition result (R + N) received through the data bus 1704 to the right by 1 bit when the shift selection signal is activated, to the data bus 1706.

レジスタ選択回路(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 P register 1707 stores data ((R + N) >> 1) received through the data bus 1706 as data P when the P write signal is activated. The register selection circuit (SQ) 1714 deactivates the P write signal after writing the data QP.

一方、レジスタ選択回路(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. Q register 1718 outputs stored data Q to data bus 1708 as data R when the Q read signal is activated. The register selection circuit (SQ) 1714 deactivates the Q read signal after the data Q is output.

レジスタ選択回路1709は、第2段階の演算における第1の加算時に、Kレジスタ623に読出信号を送り、Kレジスタ623は、零元Kをデータバス112に出力する。加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて零元Kを受けて、受けたデータを加算し、加算結果(R+K)をデータバス1704に出力する。   The register selection circuit 1709 sends a read signal to the K register 623 during the first addition in the second stage operation, and the K register 623 outputs the zero element K to the data bus 112. The adder 1703 receives the data R through the data bus 1708, receives the zero element K through the data bus 112, adds the received data, and outputs the addition result (R + K) to the data bus 1704.

右シフト回路1705は、シフト選択信号が活性化のときには、データバス1704を通じて受けた加算結果(R+K)を1ビットだけ右にシフトしたデータ((R+K)≫1)をデータバス1706に出力する。   When the shift selection signal is activated, the right shift circuit 1705 outputs data ((R + K) >> 1) obtained by shifting the addition result (R + K) received through the data bus 1704 to the right by 1 bit to the data bus 1706.

レジスタ選択回路(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 P register 1707 stores data ((R + K) >> 1) received through the data bus 1706 as data P when the P write signal is activated. After the data P is written, the register selection circuit (SQ) 1714 deactivates the P write signal.

次に、レジスタ選択回路1709は、第2段階の演算における第2の加算時に、Nレジスタ624に読出信号を送り、Nレジスタ624は、除数Nをデータバス112に出力する。加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて乗数Nを受けて、受けたデータを加算し、加算結果(R+N)をデータバス1704に出力する。   Next, the register selection circuit 1709 sends a read signal to the N register 624 during the second addition in the second stage operation, and the N register 624 outputs the divisor N to the data bus 112. The adder 1703 receives the data R through the data bus 1708, receives the multiplier N through the data bus 112, adds the received data, and outputs the addition result (R + N) to the data bus 1704.

右シフト回路1705は、シフト選択信号が活性化により、データバス1704を通じて受けた加算結果(R+N)を1ビットだけ右にシフトしたデータ((R+N)≫1)をデータバス1706に出力する。   The right shift circuit 1705 outputs data ((R + N) >> 1) obtained by shifting the addition result (R + N) received through the data bus 1704 to the right by 1 bit when the shift selection signal is activated, to the data bus 1706.

レジスタ選択回路(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書込信号を非活性化する。   Q register 1718 stores data ((R + N) >> 1) received through data bus 1706 as data Q when the Q write signal is activated. The register selection circuit (SQ) 1714 deactivates the Q write signal after the data Q is written.

次に、レジスタ選択回路(SQ)1714は、第2段階の演算の終了前に、データバス1708と接続するデータバス1713を通じてデータRを受けて、SQ^R[0]の値を新たなデータSQとして記憶する。   Next, the register selection circuit (SQ) 1714 receives the data R through the data bus 1713 connected to the data bus 1708 before the end of the second-stage operation, and sets the value of SQ ^ R [0] to the new data. Store as SQ.

以上により、第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 shift selection circuit 1712 deactivates the shift selection signal during the correction calculation.

レジスタ選択回路(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. Q register 1718 outputs stored data Q to data bus 1708 as data R when the Q read signal is activated. The register selection circuit (SQ) 1714 deactivates the Q read signal after the data Q is output.

一方、レジスタ選択回路(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. P register 1707 outputs stored data P to data bus 1708 as data R when the P read signal is activated. Register selection circuit (SQ) 1714 deactivates the P read signal after data P is output.

レジスタ選択回路(SQ)1714は、補正演算における第1の読出しの終了前に、データバス1708と接続するデータバス1713を通じてデータRを受けて、Rの最上位ビットであり、Rの符号を表わすR[1023]を新たなデータSQとして記憶する。   The register selection circuit (SQ) 1714 receives the data R through the data bus 1713 connected to the data bus 1708 before the end of the first reading in the correction operation, and is the most significant bit of R and represents the sign of R. R [1023] is stored as new data SQ.

レジスタ選択回路1709は、補正演算における第1の加算時には、Kレジスタ622に読出信号を送り、Kレジスタ623は、零元Kをデータバス112に出力する。加算部1703は、補正演算における第1の加算を行なう。すなわち、加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて零元Kを受けて、受けたデータを加算し、加算結果(R+K)をデータバス1704に出力する。   The register selection circuit 1709 sends a read signal to the K register 622 during the first addition in the correction operation, and the K register 623 outputs the zero element K to the data bus 112. Adder 1703 performs the first addition in the correction calculation. That is, the adding unit 1703 receives the data R through the data bus 1708, receives the zero element K through the data bus 112, adds the received data, and outputs the addition result (R + K) to the data bus 1704.

右シフト回路1705は、シフト選択信号が非活性化により、データバス1704を通じて受けた加算結果(R+K)をそのままデータバス1706に出力する。   The right shift circuit 1705 outputs the addition result (R + K) received through the data bus 1704 as it is to the data bus 1706 when the shift selection signal is deactivated.

レジスタ選択回路(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書込信号を非活性化する。   Q register 1718 stores data (R + K) received through data bus 1706 as data Q when the Q write signal is activated. The register selection circuit (SQ) 1714 deactivates the Q write signal after the data Q is written.

次に、レジスタ選択回路1709は、補正演算における第2の加算時に、Nレジスタ624に読出信号を送り、Nレジスタ624は、除数Nをデータバス112に出力する。加算部1703は、補正演算における第2の加算を行なう。すなわち、加算部1703は、データバス1708を通じてデータRを受け、データバス112を通じて乗数Nを受けて、受けたデータを加算し、加算結果(R+N)をデータバス1704に出力する。   Next, the register selection circuit 1709 sends a read signal to the N register 624 during the second addition in the correction operation, and the N register 624 outputs the divisor N to the data bus 112. Adder 1703 performs the second addition in the correction calculation. That is, the adding unit 1703 receives the data R through the data bus 1708, receives the multiplier N through the data bus 112, adds the received data, and outputs the addition result (R + N) to the data bus 1704.

右シフト回路1705は、シフト選択信号が非活性化により、データバス1704を通じて受けた加算結果(R+N)をそのままデータバス1706に出力する。   The right shift circuit 1705 outputs the addition result (R + N) received through the data bus 1704 as it is to the data bus 1706 when the shift selection signal is deactivated.

レジスタ選択回路(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 data bus 1706 as data P when the P write signal is activated.

次に、レジスタ選択回路(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 Q register 1718 outputs the stored data Q as data R to the R register 1723 through the data bus 1708 and the data bus 112. The register selection circuit (SQ) 1714 deactivates the Q read signal after the data Q is output.

一方、レジスタ選択回路(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, P register 1707 outputs stored data P as data R to R register 1723 through data bus 1708 and data bus 112. Register selection circuit (SQ) 1714 deactivates the P read signal after data P is output.

以上のような処理によって、最終的にRレジスタ1723にモンゴメリ乗算剰余演算の結果が格納される。   Through the processing as described above, the Montgomery modular multiplication result is finally stored in the R register 1723.

以上のように、本実施の形態に係るモンゴメリ乗算剰余演算回路によれば、演算の途中結果のデータの値に係らず、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 R register 1723. However, the present invention is not limited to this, and the Y register 621, the X register 622, the N register 622, and the K register 623 are not limited thereto. In any case, the R register 1723 is not necessary.

[第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 adder circuit 1900 includes a register group 1901 and an adder 1903.

レジスタ群1901は、演算に必要なデータを記憶するもので、X1レジスタ1911と、X2レジスタ1912と、Aレジスタ1914とからなる。   The register group 1901 stores data necessary for calculation, and includes an X1 register 1911, an X2 register 1912, and an A register 1914.

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 X register 22 of the first embodiment, the X1 register 1911 outputs the added number X1 to the mixed data bus 102 with positive and negative logic.

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 X register 22 of the first embodiment, the X2 register 1912 outputs the added number X2 to the positive / negative logic mixed data bus 102.

加算部1903は、第1の実施形態の加算部1000と同様に、正負論理混在データバス102aを通じて1024ビットの被加算数X1を受け、正負論理混在データバス102bを通じて1024ビットの被加算数X2を受け、これらの受けたデータを加算し、加算結果(X1+X2)を正負論理混在データバス108に出力する。   Similar to the adding unit 1000 of the first embodiment, the adding unit 1903 receives the 1024-bit added number X1 through the positive / negative logic mixed data bus 102a, and receives the 1024-bit added number X2 through the positive / negative logic mixed data bus 102b. The received data is added, and the addition result (X1 + X2) is output to the positive / negative logic mixed data bus 108.

変換器150は、正負論理混在データバス108の加算結果(X1+X2)を、正論理に変換して、データバス112を通じてAレジスタ1914に出力する。   The converter 150 converts the addition result (X1 + X2) of the positive / negative logic mixed data bus 108 into positive logic, and outputs it to the A register 1914 through the data bus 112.

このようにして、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 A register 1914. However, the present invention is not limited to this, and the addition result may be stored in either the X1 register 1911 or the X2 register 1912. In this case, the A register 1914 is unnecessary.

[第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 conventional inverter circuit 949, when input signal in1 changes from "H" to "L", N-channel MOS transistor NT2 is turned off and P-channel MOS transistor PT1 is turned on. As a result, a current is supplied from the power source to the output terminal, and the output signal out1 becomes “H”. Therefore, in this case, power is consumed.

一方、入力信号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, inverter circuit 950 includes P channel MOS transistors PT1, PT2, PT3, PT4 and N channel MOS transistors NT1, NT2, NT3.

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 inverter circuit 950 will be described. FIG. 38 is a diagram illustrating an example of a temporal change in a signal input to and output from the inverter circuit 950. Referring to the figure, in period 1, control signal ctrl1 becomes “H”. Thereby, N channel MOS transistor NT3 is turned on and P channel MOS transistors PT1, PT2 are turned off. In the period 1, the input signal in1 is set to “H” and the inverted input signal inB1 is set to “L”. As a result, N channel MOS transistor NT1 is turned on and N channel MOS transistor NT2 is turned off. When the N channel MOS transistors NT3 and NT1 are turned on, the output signal out1 becomes "L". Further, when the output signal out1 (= “L”) is input to the gate of the P-channel MOS transistor PT3, the P-channel MOS transistor PT3 is turned on, and the inverted output signal outB1 becomes “H”.

次に、期間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 period 2, the control signal ctrl1 becomes “L”. Thereby, N channel MOS transistor NT3 is turned off and P channel MOS transistors PT1, PT2 are turned on. In the middle of period 2, the input signal in1 changes to “L”, the inverted input signal inB1 changes to “H”, whereby the N-channel MOS transistor NT1 changes to OFF and the N-channel MOS transistor NT2 turns on. To change. However, regardless of whether N-channel MOS transistors NT1 and NT2 are on or off, N-channel MOS transistor NT3 is off and P-channel MOS transistors PT1 and PT2 are on, so that both output signal out1 and inverted output signal outB1 are “H”. Therefore, the output signal out 1 is always “H” in the period 2.

次に、期間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 period 3, the control signal ctrl1 becomes “H”. Thereby, N channel MOS transistor NT3 is turned on and P channel MOS transistors PT1, PT2 are turned off. N channel MOS transistor NT1 is off, and N channel MOS transistor NT2 is on. When the N-channel MOS transistors NT3 and NT2 are turned on, the inverted output signal outB1 becomes “L”. Further, when the inverted output signal outB1 (= “L”) is input to the gate of the P-channel MOS transistor PT4, the P-channel MOS transistor PT4 is turned on, and the output signal out1 becomes “H”.

(動作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 inverter circuit 950. In FIG. Referring to the figure, in period 1, control signal ctrl1 becomes “H”. Thereby, N channel MOS transistor NT3 is turned on and P channel MOS transistors PT1, PT2 are turned off. In the period 1, the input signal in1 is set to “L” and the inverted input signal inB1 is set to “H”. Thereby, N channel MOS transistor NT1 is turned off and N channel MOS transistor NT2 is turned on. When the N-channel MOS transistors NT3 and NT2 are turned on, the inverted output signal outB1 becomes “L”. Further, when the inverted output signal outB1 (= “L”) is input to the gate of the P-channel MOS transistor PT4, the P-channel MOS transistor PT4 is turned on, and the output signal out1 becomes “H”.

次に、期間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 period 2, the control signal ctrl1 becomes “L”. Thereby, N channel MOS transistor NT3 is turned off and P channel MOS transistors PT1, PT2 are turned on. In the middle of period 2, the input signal in1 changes to “H”, the inverted input signal inB1 changes to “L”, whereby the N-channel MOS transistor NT1 changes to ON and the N-channel MOS transistor NT2 turns OFF. To change. However, regardless of whether N-channel MOS transistors NT1 and NT2 are on or off, N-channel MOS transistor NT3 is off and P-channel MOS transistors PT1 and PT2 are on, so that both output signal out1 and inverted output signal outB1 are “H”. Therefore, the output signal out 1 is always “H” in the period 2.

次に、期間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 period 3, the control signal ctrl1 becomes “H”. Thereby, N channel MOS transistor NT3 is turned on and P channel MOS transistors PT1, PT2 are turned off. N channel MOS transistor NT1 is on, and N channel MOS transistor NT2 is off. When the N channel MOS transistors NT3 and NT1 are turned on, the output signal out1 becomes "L". Further, when the output signal out1 (= “L”) is input to the gate of the P-channel MOS transistor PT3, the P-channel MOS transistor PT3 is turned on, and the inverted output signal outB1 becomes “H”.

図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 inverter circuit 950. Referring to FIG. 8, in period 1 and period 3 in which control signal ctrl1 is inactivated, that is, “1” (= “H”), one of output signal out1 and inverted output signal outB1 is “1” ( = “H”) and the other becomes “0” (= “L”). In the period 2 in which the control signal ctrl1 is activated, that is, “0” (= “L”), both the output signal out1 and the inverted output signal outB1 are “1” (= “H”).

以上のように、本実施の形態に係るインバータ回路によれば、期間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 period 1 regardless of how the input signal in1 and the inverted output signal inB1 change in the period 2. Of these, one at “L” level changes to “H” in period 2 (charge), and the other changes to “L” in period 3 (discharge). It is possible to prevent the power from changing. Therefore, it is possible to prevent interception of secret data such as a key used for encryption processing by power analysis.

[第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, NAND circuit 951 includes P channel MOS transistors PT1, PT2, PT3, PT4 and N channel MOS transistors NT1, NT2, NT3, NT4, NT5, NT6.

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 NAND circuit 951 and the output signal will be described. FIG. 42 is a diagram summarizing the input / output relationships of the NAND circuit 951. Similarly to the ninth embodiment, the period 1, the period 2 and the period 3 in the figure change in this order, and the levels of the input signals in1 and in2 and the inverted input signals inB1 and inB2 change. Limited to two.

同図を参照して、期間1および期間3では、制御信号ctrl1が「H」となる。これにより、NチャネルMOSトランジスタNT5がオン、PチャネルMOSトランジスタPT1,PT2がオフとなる。   Referring to FIG. 8, in period 1 and period 3, control signal ctrl1 is “H”. As a result, N channel MOS transistor NT5 is turned on and P channel MOS transistors PT1 and PT2 are turned off.

期間1および期間3で、入力信号in1が「H」、入力信号in2が「H」、反転入力信号inB1が「L」、かつ反転入力信号inB2が「L」のとき、NチャネルMOSトランジスタNT1がオン、NチャネルMOSトランジスタNT2がオン、NチャネルMOSトランジスタNT3がオフ、かつNチャネルMOSトランジスタNT4がオフとなる。   In period 1 and period 3, when the input signal in1 is “H”, the input signal in2 is “H”, the inverted input signal inB1 is “L”, and the inverted input signal inB2 is “L”, the N-channel MOS transistor NT1 is On, N-channel MOS transistor NT2 is on, N-channel MOS transistor NT3 is off, and N-channel MOS transistor NT4 is off.

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 periods 1 and 3, when the input signal in1 is “H”, the input signal in2 is “H”, the inverted input signal inB1 is “L”, and the inverted input signal inB2 is other than “L”, the N-channel MOS transistor NT1 And NT2 are turned on and the other is turned off. Also, one of N channel MOS transistors NT3 and NT4 is turned on and the other is turned off. When the N channel MOS transistor NT5 and NT3 or NT4 are turned on, the inverted output signal outB1 becomes "L". Further, when the N channel MOS transistor NT1 or NT2 is off and the inverted output signal outB1 (= “L”) is input to the gate of the P channel MOS transistor PT4, the P channel MOS transistor PT4 is turned on, and the output signal out1 becomes “H”.

一方、期間2では、制御信号ctrl1が「L」となる。これにより、NチャネルMOSトランジスタNT5がオフ、PチャネルMOSトランジスタPT1,PT2がオンとなる。   On the other hand, in the period 2, the control signal ctrl1 becomes “L”. As a result, N channel MOS transistor NT5 is turned off and P channel MOS transistors PT1 and PT2 are turned on.

このときには、入力信号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 period 2.

以上のように、本実施の形態に係る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 period 1 regardless of how the input signals in1, in2 and the inverted input signals inB1, inB2 have changed in the period 2. And the inverted output signal outB1 which is at the “L” level changes to “H” in the period 2 (charge), and in the period 3, either the output signal out1 or the inverted output signal outB1 is “L”. Therefore, it is possible to prevent the power consumption from changing due to the difference in the change in the input signal. Therefore, it is possible to prevent interception of secret data such as a key used for encryption processing by power analysis.

[第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 adder circuit 952 and the output signal will be described. FIG. 44 is a diagram summarizing the input / output relationships of the adder circuit 952. Similarly to the ninth embodiment, the period 1, the period 2, and the period 3 in the figure change in this order, and the input signals in1, in2, the inverted input signals inB1, inB2, the carry input signal cin1, and the inverted carry input The change in the level of the signal cinB1 is limited to the period 2.

同図を参照して、期間1および期間3では、制御信号ctrl1が「H」となる。これにより、NチャネルMOSトランジスタNT21がオン、PチャネルMOSトランジスタPT1,PT2がオフとなる。また、NチャネルMOSトランジスタNT32がオン、PチャネルMOSトランジスタPT5,PT6がオフとなる。   Referring to FIG. 8, in period 1 and period 3, control signal ctrl1 is “H”. As a result, N channel MOS transistor NT21 is turned on and P channel MOS transistors PT1 and PT2 are turned off. Further, N channel MOS transistor NT32 is turned on, and P channel MOS transistors PT5 and PT6 are turned off.

期間1および期間3の信号のレベルは、以下のようになる。   The signal levels in period 1 and period 3 are as follows.

(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 period 1 and the period 3 in which the control signal ctrl1 becomes “H”, 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 , One of the output signal out1 and the inverted output signal outB1 is “H”, the other is “L”, one of the carry output signal cout1 and the inverted carry output signal coutB1 is “H”, and the other is “ L ".

一方、期間2では、制御信号ctrl1が「L」となる。これにより、NチャネルMOSトランジスタNT21がオフ、PチャネルMOSトランジスタPT1,PT2がオンとなる。また、NチャネルMOSトランジスタNT32がオフ、PチャネルMOSトランジスタPT5,PT6がオンとなる。   On the other hand, in the period 2, the control signal ctrl1 becomes “L”. As a result, N channel MOS transistor NT21 is turned off and P channel MOS transistors PT1 and PT2 are turned on. Further, N channel MOS transistor NT32 is turned off, and P channel MOS transistors PT5 and PT6 are turned on.

このときには、キャリー入力信号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 period 2. .

以上のように、本実施の形態に係る加算回路によれば、期間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 period 1 regardless of how the input signals in1, in2 and the inverted input signals inB1, inB2 change in period 2. And the inverted output signal outB1 that is at the “L” level and the carry output signal cout1 and the inverted carry output signal coutB1 that are at the “L” level change to “H” in the period 2 (charging). Further, in period 3, any of output signal out1 and inverted output signal outB1 and any of carry output signal cout1 and inverted carry output signal coutB1 change to “L” level (discharge), so that input signal It is possible to prevent the power consumption from changing due to the difference in change. Therefore, it is possible to prevent interception of secret data such as a key used for encryption processing by power analysis.

[第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, ROM 953 includes P channel MOS transistors PT1, PT2, PT3, PT4 and N channel MOS transistors NT1 to NT129, NT130.

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 ROM 953 stores “L” level in the first, third, fifth,. The “H” level is stored in the second, fourth,.

第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 ROM 953 and the output signal will be described. FIG. 46 is a diagram summarizing the input / output relationships of the ROM 953. Similarly to the ninth embodiment, the period 1, the period 2 and the period 3 in the figure change in this order, and the level of the input signals in1 to in129 changes only in the period 2.

同図を参照して、期間1および期間3では、制御信号ctrl1が「H」となる。これにより、NチャネルMOSトランジスタNT130がオンとなり、PチャネルMOSトランジスタPT1,PT2がオフとなる。このとき、入力信号in1〜in129のいずれかが「H」となるので、「H」となった入力信号が入力されるNチャネルMOSトランスタがオンとなる。   Referring to FIG. 8, in period 1 and period 3, control signal ctrl1 is “H”. Thereby, N channel MOS transistor NT130 is turned on, and P channel MOS transistors PT1, PT2 are turned off. At this time, since any of the input signals in1 to in129 is "H", the N-channel MOS transformer to which the input signal that has become "H" is input is turned on.

オンとなった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 period 2, the control signal ctrl1 becomes “L”. Thereby, N channel MOS transistor NT130 is turned off and P channel MOS transistors PT1, PT2 are turned on. Thereby, regardless of the level of the input signals in1 to in129, both the output signal out1 and the inverted output signal outB1 become “H”.

したがって、第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 period 2.

以上のように、本実施の形態に係る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 period 2, the output signal out1 and the inverted output signal outB1 in the period 1 Since the one at the “L” level changes to “H” in the period 2 (charge), and further, either the output signal out1 or the inverted output signal outB1 changes to “L” (discharge) in the period 3. The power consumption can be prevented from changing due to the difference in change of the input signals in1 to in129. Therefore, it is possible to prevent interception of secret data such as a key used for encryption processing by power analysis.

[第12の実施形態の変形例1]
本変形例は、第12の実施形態と同様に、入力信号の相違によって消費電力が変化しないのに加えて、より簡易な構成のROMに関する。
[Modification 1 of the twelfth embodiment]
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, ROM 954 is different from ROM 953 in FIG. 45 in that it does not include N channel MOS transistor NT130 but includes N channel MOS transistors NW1 to NW129 and N channel MOS transistors NE1 to NE129. is there.

第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 ROM 954 and the output signal will be described. The input / output relationship of the ROM 954 is the same as the input / output relationship of the ROM 953 shown in FIG. Similarly to the ninth embodiment, the period 1, the period 2 and the period 3 in the figure change in this order, and the level of the input signals in1 to in129 changes only in the period 2.

同図を参照して、期間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 period 1 and period 3, control signal ctrl1 becomes “H”. Thereby, N channel MOS transistors NW1 to NW129 are turned on, N channel MOS transistors NE1 to NE129 are turned on, and P channel MOS transistors PT1 and PT2 are turned off. At this time, since any of the input signals in1 to in129 is "H", the N-channel MOS transformer to which the input signal that has become "H" is input is turned on.

オンとなった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 period 2, the control signal ctrl1 becomes “L”. Thereby, N channel MOS transistors NW1 to NW129 and NE1 to NE129 are turned off, and P channel MOS transistors PT1 and PT2 are turned on. Thereby, regardless of the level of the input signals in1 to in129, both the output signal out1 and the inverted output signal outB1 become “H”.

したがって、第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 period 2.

以上のように、本変形例に係る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 period 2, the output signal out1 and the inverted output signal outB1 in the period 1 Since the one at the “L” level changes to “H” in the period 2 (charge), and further, either the output signal out1 or the inverted output signal outB1 changes to “L” (discharge) in the period 3. The power consumption can be prevented from changing due to the difference in change of the input signals in1 to in129. Therefore, it is possible to prevent interception of secret data such as a key used for encryption processing by power analysis. In the ROM of the twelfth embodiment, the N-channel MOS transistor NT130 having a small resistance value and a large size is used to supply the ground potential to 129 N-channel MOS transistors NT1 to NT129. Although it was necessary, in the ROM of the present modification example, since the small N-channel MOS transistors NW1 to NW129 and NE1 to NE129 are used instead of the N-channel MOS transistor NT130, the circuit scale can be reduced. .

[第12の実施形態の変形例2]
本変形例は、第12の実施形態と同様に、入力信号の変化の相違によって消費電力が変化しないことに加えて、より簡易な構成のROMに関する。
[Modification 2 of the twelfth embodiment]
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 ROM 955 is different from ROM 953 in FIG. 45 in that it does not include N-channel MOS transistor NT130 and includes AND circuit ANDk in the k-th row (k = 1 to 129). It is.

論理積回路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 ROM 955 and the output signal will be described. The input / output relationship of the ROM 955 is the same as the input / output relationship of the ROM 953 shown in FIG. Similarly to the ninth embodiment, the period 1, the period 2 and the period 3 in the figure change in this order, and the level of the input signals in1 to in129 changes only in the period 2.

同図を参照して、期間1および期間3において、制御信号ctrl1が「H」となる。これにより、論理積回路ANDk(k=1〜129)の入力端子の1つに「H」レベルが入力され、PチャネルMOSトランジスタPT1,PT2がオフとなる。   Referring to the figure, in period 1 and period 3, control signal ctrl1 becomes “H”. As a result, the “H” level is input to one of the input terminals of the AND circuit ANDk (k = 1 to 129), and the P-channel MOS transistors PT1 and PT2 are turned off.

このとき、入力信号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 period 2, the control signal ctrl1 becomes “L”. As a result, the “L” level is input to one of the input terminals of the AND circuit ANDk (k = 1 to 129), and the P-channel MOS transistors PT1 and PT2 are turned on. Thereby, regardless of the level of the input signals in1 to in129, both the output signal out1 and the inverted output signal outB1 become “H”.

したがって、第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 period 2.

以上のように、本変形例に係る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 period 2, the output signal out1 and the inverted output signal outB1 in the period 1 Since the one at the “L” level changes to “H” in the period 2 (charge), and further, either the output signal out1 or the inverted output signal outB1 changes to “L” (discharge) in the period 3. The power consumption can be prevented from changing due to the difference in change of the input signals in1 to in129. Therefore, it is possible to prevent interception of secret data such as a key used for encryption processing by power analysis. Further, in the ROM of this modification, the AND circuits AND1 to AND129 are used in place of the N-channel MOS transistor NT130 in the ROM of the twelfth embodiment, so that the circuit scale can be reduced.

[第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 register 956 will be described. FIG. 50 is a diagram illustrating an example of a temporal change in a signal input to and output from the register 956. Referring to the figure, in period 1, control signal ctrl1 is “H”, control signal ctrl2 is “H”, read instruction signal read1 is “L”, and write instruction signal write1 is “L”.

制御信号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 period 1, the input signal in1 is set to “H”, the inverted input signal inB1 is set to “L”, the logic logic node reg1 “L” is set, and the negative logic node regB1 is set to “H”.

期間2では、制御信号ctrl1が「L」となる。制御信号ctrl1が「L」となると、PチャネルMOSトランジスタPT1,PT2がオンとなり、NチャネルMOSトランジスタNT7がオフとなる。   In the period 2, the control signal ctrl1 becomes “L”. When the control signal ctrl1 becomes “L”, the P-channel MOS transistors PT1 and PT2 are turned on and the N-channel MOS transistor NT7 is turned off.

期間2では、入力信号in1が「L」に変化し、反転入力信号inB1が「H」に変化するが、PチャネルMOSトランジスタPT1,PT2がオン、NチャネルMOSトランジスタNT7がオフ、およびNチャネルMOSトランジスタNT1,NT2がオフより、
これらの変化に係りなく、正論理のノードreg1、および負論理のノードregB1がともに「H」となる。
In period 2, input signal in1 changes to "L" and inverted input signal inB1 changes to "H", but P-channel MOS transistors PT1 and PT2 are on, N-channel MOS transistor NT7 is off, and N-channel MOS Since transistors NT1 and NT2 are off,
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 period 3, the control signal ctrl1 becomes “H” and the write instruction signal write1 becomes “H”. When control signal ctrl1 becomes “H”, P-channel MOS transistors PT1 and PT2 are turned off, and N-channel MOS transistor NT7 is turned on.
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 period 1 regardless of how the input signal in1 and the inverted input signal inB1 have changed in the period 2 at the time of writing. The one at the “L” level changes to “H” (charge) in the period 2 in which the control signal ctrl1 becomes “L”, and further in the period 3 in which the write instruction signal write1 becomes “H”. Since either reg1 or node regB1 changes to “L” (discharge), the power consumption can be prevented from changing due to the difference in the change of the input signal. At the time of reading, regardless of the level of data stored in the node reg and the node regB, the control signal ctrl2 is “L” level of the output signal out1 and the inverted output signal outB1 in the period 3 “ It changes to “H” (charge) in the period 4 that becomes “L”, and in the middle of the period 5 in which the read instruction signal read1 becomes “H”, one of the output signal out1 and the inverted output signal outB1 becomes “ Since it changes to “L” (discharge), it is possible to prevent the power consumption from changing due to the difference in the stored data of the node reg and the node regB1. Therefore, it is possible to prevent interception of secret data such as a key used for encryption processing by power analysis.

[第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 logic 1 to logic 2 via a plurality of buses. The signal 01 is a first signal of positive logic, the signal 01B is a first signal of negative logic obtained by inverting the signal 01, the signal 02 is a second signal of positive logic, and the signal 02B is , A negative second signal obtained by inverting the signal 02. It is assumed that the pair of the signal 02 and the signal 02B is a signal having the maximum delay amount among signals sent from the logic 1 to the logic 2.

ロジック2の動作タイミングを制御する制御信号を生成する制御信号生成回路290は、論理積回路AND2および反転論理和回路NOR2とからなる。この制御信号生成回路290は、遅延量が最大の信号のペア02,02Bと、すべてのロジック群の制御の基準タイミングを定める基準制御信号05(たとえば、クロック信号)を受けて、ロジック2の制御信号04(すなわち、第9〜第11、および第13の実施形態において、ロジック2を制御対象としたときの制御信号ctrl1に相当する)を出力する。   A control signal generation circuit 290 that generates a control signal for controlling the operation timing of the logic 2 includes an AND circuit AND2 and an inverting OR circuit NOR2. The control signal generation circuit 290 receives the signal pair 02 and 02B having the maximum delay amount and the reference control signal 05 (for example, a clock signal) that determines the reference timing for the control of all the logic groups, and controls the logic 2. The signal 04 (that is, in the ninth to eleventh and thirteenth embodiments, corresponding to the control signal ctrl1 when the logic 2 is a control target) is output.

制御信号生成回路290は、遅延量が最大である信号02および信号02のいずれかが「L」、かつ信号05が「L」のときに、信号04を「H」にする。   The control signal generation circuit 290 sets the signal 04 to “H” when either the signal 02 or the signal 02 having the maximum delay amount is “L” and the signal 05 is “L”.

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 inverter circuit 950 in FIG. Transistors PT1, PT2, P channel MOS transistors PT1, PT2 in NAND circuit 951 in FIG. 41, P channel MOS transistors PT1, PT2, PT5, PT6 in adder circuit 952 in FIG. 43, and P channel MOS transistors in register 956 in FIG. It corresponds to PT1 and PT2.

同様に、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 inverter circuit 950 in FIG. This corresponds to channel MOS transistor NT3, N channel MOS transistor NT5 in NAND circuit 951 in FIG. 41, N channel MOS transistors NT21 and NT32 in adder circuit 952 in FIG. 43, and N channel MOS transistor NT7 in register 956 in FIG.

(動作)
次に、この半導体回路の動作を説明する。図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 logic 2. In the figure, period 1, period 2, and period 3 correspond to period 1, period 2, and period 3 in the ninth to eleventh and thirteenth embodiments, respectively.

期間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 period 1, the signal 05 is “L”. The signal 01 is “L”, the signal 01B is “H”, the signal 02 is “H”, and the signal 02B is “L”. The control signal generation circuit 290 sets the control signal 04 to “H” in accordance with the levels of the signal 02, the signal 02B, and the signal 05. When the control signal 04 is “H”, the P-channel MOS transistor PX2 is turned off and the N-channel MOS transistor NX2 is turned on.

期間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 period 2, first, the signal 05 becomes “H”. As a result, the levels of the signals 01, 01B, 02, and 02B output from the logic 1 all change to “H”. The control signal generation circuit 290 sets the control signal 04 to “L” when the signal 02, the signal 02B, and the signal 05 all become “H”. When the control signal 04 is “L”, the P-channel MOS transistor PX2 is turned on and the N-channel MOS transistor NX2 is turned off.

期間2では、その後、信号05が「L」になると、信号01および信号01Bのいずれかが「L」に変化し、信号02および信号02Bのいずれかが「L」に変化する。ここでは、信号01Bが「L」に変化し、信号02が「L」に変化するものとする。制御信号生成回路290は、信号02Bが「L」に変化すると、制御信号04を「H」に変化させ、期間3に移行する。   In period 2, thereafter, when the signal 05 becomes “L”, one of the signal 01 and the signal 01B changes to “L”, and one of the signal 02 and the signal 02B changes to “L”. Here, it is assumed that the signal 01B changes to “L” and the signal 02 changes to “L”. When the signal 02B changes to “L”, the control signal generation circuit 290 changes the control signal 04 to “H” and shifts to the period 3.

期間3では、制御信号04が「H」によって、PチャネルMOSトランジスタPX2はオフとなり、NチャネルMOSトランジスタNX2はオンとなる。   In period 3, the control signal 04 is “H”, the P-channel MOS transistor PX2 is turned off, and the N-channel MOS transistor NX2 is turned on.

以上のように、本実施の形態に係る制御信号生成回路によれば、ロジック2に入力されるすべての信号が変化するタイミングを、ロジック2の動作を制御する制御信号04が「L」となる期間2に限定することができる。   As described above, according to the control signal generation circuit according to the present embodiment, the control signal 04 for controlling the operation of the logic 2 becomes “L” at the timing when all the signals input to the logic 2 change. The period can be limited to 2.

[第14の実施形態の変形例1]
本変形例は、第14の実施形態と同様に、ロジックの動作タイミングを制御する制御信号ctrl1を生成することに加えて、遅延量が最大の信号のペアが予め定まっていない場合にでも対応できる制御信号生成回路を含む半導体回路に関する。
[Modification 1 of 14th Embodiment]
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 logic 1 to logic 2 via a plurality of buses. The signal 01 is a first signal of positive logic, the signal 01B is a first signal of negative logic obtained by inverting the signal 01, the signal 02 is a second signal of positive logic, and the signal 02B is , A negative second signal obtained by inverting the signal 02.

ロジック2の動作を制御する制御信号を生成する制御信号生成回路310は、論理積回路AND1、論理積回路AND2、および反転論理和回路NOR3とからなる。この制御信号生成回路310は、ペアの信号01,01Bと、ペアの信号02,02B、およびすべてのロジック群の制御の基準タイミングを定める基準制御信号05(たとえば、外部から与えられるクロック信号)を受けて、ロジック2の制御信号04(すなわち、制御信号ctrl1)を出力する。   A control signal generation circuit 310 that generates a control signal for controlling the operation of the logic 2 includes an AND circuit AND1, an AND circuit AND2, and an inverting OR circuit NOR3. The control signal generation circuit 310 receives a pair of signals 01 and 01B, a pair of signals 02 and 02B, and a reference control signal 05 (for example, a clock signal given from the outside) that determines a reference timing for controlling all logic groups. In response to this, the control signal 04 (that is, the control signal ctrl1) of the logic 2 is output.

制御信号生成回路310は、信号01および信号01のいずれかが「L」、信号02および信号02のいずれかが「L」、かつ信号05が「L」のときに、制御信号04を「H」にする。   The control signal generation circuit 310 sets the control signal 04 to “H” when one of the signal 01 and the signal 01 is “L”, one of the signal 02 and the signal 02 is “L”, and the signal 05 is “L”. "

(動作)
次に、この半導体回路の動作を説明する。図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 logic 2. In the figure, period 1, period 2, and period 3 correspond to period 1, period 2, and period 3 in the ninth to eleventh and thirteenth embodiments, respectively.

期間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 period 1, the signal 05 is “L”. The signal 01 is “L”, the signal 01B is “H”, the signal 02 is “H”, and the signal 02B is “L”. The control signal generation circuit 310 sets the signal 04 to “H” in accordance with the levels of the signal 01, the signal 01B, the signal 02, the signal 02B, and the signal 05. When the signal 04 is “H”, the P-channel MOS transistor PX2 is turned off and the N-channel MOS transistor NX2 is turned on.

期間2では、まず、信号05が「H」となる。これにより、ロジック1が出力する信号01,01B,02,02Bのレベルは、すべて「H」に変化する。   In the period 2, first, the signal 05 becomes “H”. As a result, the levels of the signals 01, 01B, 02, and 02B output from the logic 1 all change to “H”.

制御信号生成回路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 signal 01, signal 01B, signal 02, signal 02B, and signal 05 are set to “H”, control signal generation circuit 290 sets control signal 04 to “L”. When the control signal 04 is “L”, the P-channel MOS transistor PX2 is turned on and the N-channel MOS transistor NX2 is turned off. Thereafter, when the signal 05 becomes “L”, one of the signal 01 and the signal 01B changes to “L”, and one of the signal 02 and the signal 02B changes to “L”. Here, it is assumed that the signal 01B changes to “L” and then the signal 02 changes to “L”. When the signal 01 changes to “L” and the signal 02 changes to “L”, the control signal generation circuit 310 changes the control signal 04 to “H” and shifts to the period 3.

期間3では、制御信号04が「H」によって、PチャネルMOSトランジスタPX2はオフとなり、NチャネルMOSトランジスタNX2はオンとなる。   In period 3, the control signal 04 is “H”, the P-channel MOS transistor PX2 is turned off, and the N-channel MOS transistor NX2 is turned on.

以上のように、本変形例に係る制御信号生成回路によれば、第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 logic 2 is performed at the timing at which all the signals input to the logic 2 change, as in the fourteenth embodiment. The period can be limited to the period 2 in which the signal 04 is “L”. Further, the control signal generation circuit of the fourteenth embodiment corresponds only when the pair of signals with the maximum delay amount is 02, 02B, whereas the control signal generation circuit according to the present modification example Can handle both when the pair of signals with the maximum delay amount is 01, 01B and when the pair of signals is 02, 02B.

[第14の実施形態の変形例2]
本変形例は、第14の実施形態の制御信号生成回路とは別の構成で、第14の実施形態と同様に、ロジックの動作タイミングを制御する制御信号ctrl1を生成する制御信号生成回路を含む半導体回路に関する。
[Modification 2 of the 14th embodiment]
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 logic 1 to logic 2 via a plurality of buses. The signal 01 is a first signal of positive logic, the signal 01B is a first signal of negative logic obtained by inverting the signal 01, the signal 02 is a second signal of positive logic, and the signal 02B is , A negative second signal obtained by inverting the signal 02.

ロジック2の動作を制御する制御信号を生成する制御信号生成回路330は、遅延回路(delay)D2と、論理和回路OR2と、インバータIV2とからなる。この制御信号生成回路330は、すべてのロジック群の制御の基準タイミングを定める基準制御信号07(たとえば、外部から与えられるクロック信号)と、前段から信号04を受けて、ロジック2の制御信号06(すなわち、制御信号ctrl1)を出力する。   The control signal generation circuit 330 that generates a control signal for controlling the operation of the logic 2 includes a delay circuit (delay) D2, an OR circuit OR2, and an inverter IV2. This control signal generation circuit 330 receives a reference control signal 07 (for example, a clock signal given from the outside) that determines the reference timing of control of all logic groups and a signal 04 from the previous stage, and receives a control signal 06 ( That is, the control signal ctrl1) is output.

遅延回路(delay)D2は、前段から信号04を受けて、信号04をαだけ遅延させた信号05を出力する。そして、信号05と、基準制御信号07とに応じて、論理和回路OR2およびインバータIV2によって、制御信号06が生成される。   The delay circuit (delay) D2 receives the signal 04 from the previous stage and outputs a signal 05 obtained by delaying the signal 04 by α. Then, according to the signal 05 and the reference control signal 07, the control signal 06 is generated by the OR circuit OR2 and the inverter IV2.

遅延回路(delay)D2の遅延量αは、期間2において、ロジック2に入力される信号のペアのうちの遅延量が最大である信号02および信号02のペアのいずれかが「L」になるタイミングよりも後のタイミングで制御信号06が「H」になるように設定されている。   The delay amount α of the delay circuit (delay) D2 is “L” in the period 2 in which one of the pair of the signal 02 and the signal 02 having the maximum delay amount among the pair of signals input to the logic 2 is “L”. The control signal 06 is set to “H” at a timing later than the timing.

(動作)
次に、この半導体回路の動作を説明する。図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 logic 2. In the figure, period 1, period 2, and period 3 correspond to period 1, period 2, and period 3 in the ninth to eleventh and thirteenth embodiments, respectively.

期間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 period 1, the signal 07 is “L”. The signal 01 is “L”, the signal 01B is “H”, the signal 02 is “H”, the signal 02B is “L”, the signal 04 is “L”, and the signal 05 is “L”. The control signal generation circuit 330 sets the control signal 06 to “H” in accordance with the levels of the signal 04, the signal 05, and the signal 07. When the control signal 06 is “H”, the P-channel MOS transistor PX2 is turned off and the N-channel MOS transistor NX2 is turned on.

期間2では、まず、信号07が「H」となる。これにより、ロジック1が出力する信号01,01B,02,02Bのレベルは、すべて「H」に変化する。また、信号07が「H」へ変化した時から、ロジック1の前段にある図示しない遅延回路での遅延の後、信号04が「H」に変化する。信号04が「H」に変化してから、遅延回路(delay)D2による遅延量αだけ遅延の後、信号05が「H」に変化する。   In the period 2, first, the signal 07 becomes “H”. As a result, the levels of the signals 01, 01B, 02, and 02B output from the logic 1 all change to “H”. Further, after the signal 07 changes to “H”, the signal 04 changes to “H” after a delay in a delay circuit (not shown) in the preceding stage of the logic 1. After the signal 04 changes to “H”, the signal 05 changes to “H” after being delayed by the delay amount α by the delay circuit (delay) D2.

一方、信号07が「H」となると(信号05のレベルに係らず)、論理和回路OR2およびインバータIV2によって、制御信号06は「L」に変化する。制御信号06が「L」になると、PチャネルMOSトランジスタPX2はオンとなり、NチャネルMOSトランジスタNX2はオフとなる。   On the other hand, when the signal 07 becomes “H” (regardless of the level of the signal 05), the control signal 06 is changed to “L” by the OR circuit OR2 and the inverter IV2. When the control signal 06 becomes “L”, the P-channel MOS transistor PX2 is turned on and the N-channel MOS transistor NX2 is turned off.

その後、信号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 signal 07 becomes “L”, one of the signal 01 and the signal 01B changes to “L”, and one of the signal 02 and the signal 02B changes to “L”. Here, it is assumed that the signal 01B changes to “L” and then the signal 02 changes to “L”. From the time when the signal 07 changes to “L”, the signal 04 changes to “L” after the delay in the delay circuit in the preceding stage of the logic 1. After the signal 04 changes to “L”, the signal 05 changes to “L” after being delayed by the delay amount α by the delay circuit (delay) D2.

信号07が「L」、および信号05が「L」となると、論理和回路OR2およびインバータIV2によって、制御信号06は「H」に変化し、期間3に移行する。   When the signal 07 becomes “L” and the signal 05 becomes “L”, the control signal 06 is changed to “H” by the OR circuit OR2 and the inverter IV2, and the period 3 is started.

期間3では、制御信号06が「H」によって、PチャネルMOSトランジスタPX2はオフとなり、NチャネルMOSトランジスタNX2はオンとなる。   In period 3, the control signal 06 is “H”, the P-channel MOS transistor PX 2 is turned off, and the N-channel MOS transistor NX 2 is turned on.

以上のように、本変形例に係る制御信号生成回路によれば、第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 logic 2 is performed at the timing at which all the signals input to the logic 2 change, as in the fourteenth embodiment. The period can be limited to the period 2 in which the signal 06 is “L”.

[第14の実施形態の変形例3]
本変形例は、第14の実施形態の制御信号生成回路とは別の構成で、第14の実施形態と同様に、ロジックの動作タイミングを制御する制御信号ctrl1を生成する制御信号生成回路を含む半導体回路に関する。
[Modification 3 of the fourteenth embodiment]
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 Modification 3 of the fourteenth embodiment. Referring to the figure, signals 01, 01B, 02, and 02B are input from logic 1 to logic 2 via a plurality of buses. The signal 01 is a first signal of positive logic, the signal 01B is a first signal of negative logic obtained by inverting the signal 01, the signal 02 is a second signal of positive logic, and the signal 02B is , A negative second signal obtained by inverting the signal 02. It is assumed that the pair of the signal 02 and the signal 02B is a signal having the maximum delay amount among signals sent from the logic 1 to the logic 2.

ロジック2の動作を制御する制御信号を生成する制御信号生成回路350は、遅延回路(delay)D2と、反転論理和回路NOR2とからなる。この制御信号生成回路350は、すべてのロジック群の制御の基準タイミングを定める基準制御信号07(たとえば、外部から与えられるクロック信号)と、前段から信号04を受けて、ロジック2の制御信号06(すなわち、制御信号ctrl1)を出力する。   The control signal generation circuit 350 that generates a control signal for controlling the operation of the logic 2 includes a delay circuit (delay) D2 and an inverting OR circuit NOR2. The control signal generation circuit 350 receives a reference control signal 07 (for example, a clock signal given from the outside) that determines the reference timing of control of all logic groups and a signal 04 from the previous stage, and receives a control signal 06 ( That is, the control signal ctrl1) is output.

遅延回路(delay)D2は、前段から信号04を受けて、信号04をαだけ遅延させた信号05を出力する。そして、信号05と、基準制御信号07とに応じて、反転論理和回路NOR2によって、制御信号06が生成される。   The delay circuit (delay) D2 receives the signal 04 from the previous stage and outputs a signal 05 obtained by delaying the signal 04 by α. Then, in response to the signal 05 and the reference control signal 07, the inverting OR circuit NOR2 generates the control signal 06.

遅延回路(delay)D2の遅延量αは、期間2において、ロジック2に入力される信号のペアのうちの遅延量が最大である信号02および信号02のペアのいずれかが「L」になるタイミングよりも後のタイミングで制御信号06が「H」になるように設定されている。   The delay amount α of the delay circuit (delay) D2 is “L” in the period 2 in which one of the pair of the signal 02 and the signal 02 having the maximum delay amount among the pair of signals input to the logic 2 The control signal 06 is set to “H” at a timing later than the timing.

(動作)
次に、この半導体回路の動作を説明する。図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 logic 2. In the figure, period 1, period 2, and period 3 correspond to period 1, period 2, and period 3 in the ninth to eleventh and thirteenth embodiments, respectively.

期間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 period 1, the signal 07 is “L”. The signal 01 is “L”, the signal 01B is “H”, the signal 02 is “H”, the signal 02B is “L”, the signal 04 is “L”, and the signal 05 is “L”. The control signal generation circuit 350 sets the control signal 06 to “H” in accordance with the levels of the signal 04, the signal 05, and the signal 07. When the control signal 06 is “H”, the P-channel MOS transistor PX2 is turned off and the N-channel MOS transistor NX2 is turned on.

期間2では、まず、信号07が「H」となる。これにより、ロジック1が出力する信号01,01B,02,02Bのレベルは、すべて「H」に変化する。また、信号07が「H」へ変化した時から、ロジック1の前段にある図示しない遅延回路での遅延の後、信号04が「H」に変化する。信号04が「H」に変化してから、遅延回路(delay)D2による遅延量αだけ遅延の後、信号05が「H」に変化する。   In the period 2, first, the signal 07 becomes “H”. As a result, the levels of the signals 01, 01B, 02, and 02B output from the logic 1 all change to “H”. Further, after the signal 07 changes to “H”, the signal 04 changes to “H” after a delay in a delay circuit (not shown) in the preceding stage of the logic 1. After the signal 04 changes to “H”, the signal 05 changes to “H” after being delayed by the delay amount α by the delay circuit (delay) D2.

一方、信号07が「H」となると(信号05のレベルに係らず)、反転論理和回路NOR2によって、制御信号06は「L」に変化する。制御信号06が「L」になると、PチャネルMOSトランジスタPX2はオンとなり、NチャネルMOSトランジスタNX2はオフとなる。   On the other hand, when the signal 07 becomes “H” (regardless of the level of the signal 05), the control signal 06 is changed to “L” by the inverting OR circuit NOR2. When the control signal 06 becomes “L”, the P-channel MOS transistor PX2 is turned on and the N-channel MOS transistor NX2 is turned off.

その後、信号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 signal 07 becomes “L”, one of the signal 01 and the signal 01B changes to “L”, and one of the signal 02 and the signal 02B changes to “L”. Here, it is assumed that the signal 01B changes to “L” and then the signal 02 changes to “L”. From the time when the signal 07 changes to “L”, the signal 04 changes to “L” after the delay in the delay circuit in the preceding stage of the logic 1. After the signal 04 changes to “L”, the signal 05 changes to “L” after being delayed by the delay amount α by the delay circuit (delay) D2.

信号07が「L」、および信号05が「L」となると、反転論理和回路NOR2によって、制御信号06は「H」に変化し、期間3に移行する。   When the signal 07 becomes “L” and the signal 05 becomes “L”, the control signal 06 is changed to “H” by the inverting OR circuit NOR2, and the period 3 is started.

期間3では、制御信号06が「H」によって、PチャネルMOSトランジスタPX2はオフとなり、NチャネルMOSトランジスタNX2はオンとなる。   In period 3, the control signal 06 is “H”, the P-channel MOS transistor PX 2 is turned off, and the N-channel MOS transistor NX 2 is turned on.

以上のように、本変形例に係る制御信号生成回路によれば、第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 logic 2 is performed at the timing at which all the signals input to the logic 2 change, as in the fourteenth embodiment. The period can be limited to the period 2 in which the signal 06 is “L”.

[第14の実施形態の変形例4]
本変形例は、第14の実施形態の変形例3の基準制御信号を内部で自発的に生成するようにした半導体回路に関する。
[Fourth Modification of Fourteenth Embodiment]
This modification relates to a semiconductor circuit in which the reference control signal of modification 3 of the fourteenth embodiment is generated spontaneously.

(半導体回路の構成)
図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 Modification 3 of the fourteenth embodiment. Referring to the figure, this semiconductor circuit includes a control signal generation circuit 3501 for generating a control signal for controlling the operation of logic 1, a control signal generation circuit 3502 for generating a control signal for controlling the operation of logic 2, A control signal generation circuit 3503 for generating a control signal for controlling the operation of the logic 3 and a control signal generation circuit 3504 for generating a control signal for controlling the operation of the logic 4 are provided.

制御信号生成回路3501,3502,3503,3504は、変形例3の制御信号生成回路350と同様に、遅延回路(delay)と、反転論理和回路とを備え、前段からの信号と、すべてのロジック群の制御の基準タイミングを定める基準制御信号とを受けて、対応するロジックに制御信号を出力する。   The control signal generation circuits 3501, 3502, 3503, 3504 are provided with a delay circuit (delay) and an inverting OR circuit, as with the control signal generation circuit 350 of the third modification, and the signals from the previous stage and all logics In response to the reference control signal that determines the reference timing of group control, the control signal is output to the corresponding logic.

すべてのロジック群の制御の基準タイミングを定める基準制御信号は、第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 modifications 1 to 3, but as described below, this semiconductor circuit Generated spontaneously internally.

遅延回路(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 signal generation circuit 3504 corresponding to the last stage logic 4 via the inverter IV1. Is sent to the delay circuit (delay) D4 of the control signal generation circuit 3501 corresponding to the logic 1 in the forefront stage.

そして、このループを流れる信号で、遅延回路(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 mixed data bus 102a, 102b, 102c
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 mixed data buses 102a and 102b. However, it is not limited to this. For example, n bits of the multiplier Y may be processed simultaneously by outputting data to n (≧ 3) mixed positive and negative logic data buses. The same applies to the sixth embodiment of the present invention.

今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。   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.

従来の乗算回路の構成を示す図である。It is a figure which shows the structure of the conventional multiplication circuit. 従来の乗算回路20による乗算のアルゴリズム(1024ビットの場合)を示す図である。It is a figure which shows the algorithm (in the case of 1024 bits) of the multiplication by the conventional multiplication circuit 20. FIG. 暗号回路の構成を示す図である。It is a figure which shows the structure of an encryption circuit. 第1の実施形態に係る乗算回路の構成を示す図である。It is a figure which shows the structure of the multiplication circuit which concerns on 1st Embodiment. Xレジスタ122の出力信号の論理を示す図である。FIG. 6 is a diagram illustrating logic of an output signal of an X register 122. 加算部1000の構成を示す図である。3 is a diagram illustrating a configuration of an adding unit 1000. FIG. 加算回路(正論理キャリー負論理)1001の具体的な構成を示す図である。5 is a diagram showing a specific configuration of an adder circuit (positive logic carry negative logic) 1001. FIG. 加算回路(負論理キャリー正論理)1002の具体的な構成を示す図である。5 is a diagram showing a specific configuration of an adder circuit (negative logic carry positive logic) 1002; FIG. 乗算回路100による乗算のアルゴリズム(1024ビットの場合)を示す図である。It is a figure which shows the algorithm (in the case of 1024 bits) of the multiplication by the multiplication circuit 100. 第1の実施形態の変形例1に係る乗算回路の構成を示す図である。It is a figure which shows the structure of the multiplication circuit which concerns on the modification 1 of 1st Embodiment. 第1の実施形態の変形例2に係る乗算回路の構成を示す図である。It is a figure which shows the structure of the multiplication circuit which concerns on the modification 2 of 1st Embodiment. 乗算回路400による乗算のアルゴリズム(1024ビットの場合)を示す図である。It is a figure which shows the algorithm (in the case of 1024 bits) of the multiplication by the multiplication circuit 400. 第1の実施形態の変形例3に係る乗算回路の構成を示す図である。It is a figure which shows the structure of the multiplication circuit which concerns on the modification 3 of 1st Embodiment. 乗算回路500による乗算のアルゴリズム(1024ビットの場合)を示す図である。It is a figure which shows the algorithm (in the case of 1024 bits) of the multiplication by the multiplication circuit 500. 第1の実施形態の変形例4に係る乗算回路の乗算のアルゴリズム(1024ビットの場合)を示す図である。It is a figure which shows the algorithm (in the case of 1024 bits) of the multiplication of the multiplication circuit which concerns on the modification 4 of 1st Embodiment. 第1の実施形態の変形例5に係るデータ格納レジスタ群の構成を示す図である。It is a figure which shows the structure of the data storage register group which concerns on the modification 5 of 1st Embodiment. 第2の実施形態に関する乗算回路の構成を示す図である。It is a figure which shows the structure of the multiplication circuit regarding 2nd Embodiment. 加算部1100の構成を示す図である。5 is a diagram showing a configuration of an adding unit 1100. FIG. 乗算回路800による乗算のアルゴリズム(1024ビットの場合)を示す図である。It is a figure which shows the algorithm (in the case of 1024 bits) of the multiplication by the multiplication circuit 800. 第3の実施形態に係る乗算回路の構成を示す図である。It is a figure which shows the structure of the multiplication circuit which concerns on 3rd Embodiment. 乗算回路1500による乗算のアルゴリズム(1024ビットの場合)を示す図である。FIG. 11 is a diagram showing an algorithm for multiplication by a multiplication circuit 1500 (in the case of 1024 bits). 第3の実施形態の変形例に係る乗算回路の構成を示す図である。It is a figure which shows the structure of the multiplication circuit which concerns on the modification of 3rd Embodiment. 乗算回路1600による乗算のアルゴリズム(1024ビットの場合)を示す図である。It is a figure which shows the algorithm (in the case of 1024 bits) of the multiplication by the multiplication circuit 1600. 従来の剰余演算回路の剰余演算のアルゴリズムを示す図である。It is a figure which shows the algorithm of the remainder calculation of the conventional remainder calculation circuit. 第4の実施形態に係る剰余演算回路の構成を示す図である。It is a figure which shows the structure of the remainder arithmetic circuit which concerns on 4th Embodiment. 剰余演算回路1400による剰余演算のアルゴリズム(1024ビットの場合)を示す図である。It is a figure which shows the algorithm (in the case of 1024 bits) of the remainder calculation by the remainder calculation circuit 1400. 第5の実施形態に係るモンゴメリ乗算剰余演算回路の構成を示す図である。It is a figure which shows the structure of the Montgomery multiplication remainder arithmetic circuit which concerns on 5th Embodiment. モンゴメリ乗算剰余演算回路600によるモンゴメリ乗算剰余演算のアルゴリズム(1024ビットの場合)を示す図である。FIG. 11 is a diagram illustrating an algorithm of Montgomery modular multiplication by the Montgomery modular multiplication circuit 600 (in the case of 1024 bits). 第5の実施形態の変形例に係るモンゴメリ乗算剰余演算回路の構成を示す図である。It is a figure which shows the structure of the Montgomery multiplication remainder arithmetic circuit which concerns on the modification of 5th Embodiment. 第6の実施形態に係るモンゴメリ乗算剰余演算回路の構成を示す図である。It is a figure which shows the structure of the Montgomery multiplication remainder arithmetic circuit which concerns on 6th Embodiment. 加算部1200の構成を示す図である。5 is a diagram showing a configuration of an adding unit 1200. FIG. モンゴメリ乗算剰余演算回路900によるモンゴメリ乗算剰余演算のアルゴリズム(1024ビットの場合)を示す図である。FIG. 11 is a diagram illustrating an algorithm (in the case of 1024 bits) of Montgomery modular multiplication by the Montgomery modular multiplication circuit 900. 第7の実施形態に係るモンゴメリ乗算剰余演算回路の構成を示す図である。It is a figure which shows the structure of the Montgomery multiplication remainder arithmetic circuit which concerns on 7th Embodiment. モンゴメリ乗算剰余演算回路1700によるモンゴメリ乗算剰余演算のアルゴリズム(1024ビットの場合)を示す図である。FIG. 12 is a diagram illustrating an algorithm of Montgomery modular multiplication by the Montgomery modular multiplication circuit 1700 (in the case of 1024 bits). 第8の実施形態に係る加算回路の構成を示す図である。It is a figure which shows the structure of the addition circuit which concerns on 8th Embodiment. 従来のインバータ回路の構成を示す図である。It is a figure which shows the structure of the conventional inverter circuit. 第9の実施形態に係るインバータ回路の構成を示す図である。It is a figure which shows the structure of the inverter circuit which concerns on 9th Embodiment. インバータ回路950に入力および出力される信号の時間的な変化の例を示す図である。It is a figure which shows the example of the time change of the signal input and output to the inverter circuit 950. インバータ回路950に入力および出力される信号の時間的な変化の別の例を示す図である。It is a figure which shows another example of the time change of the signal input and output to the inverter circuit 950. FIG. インバータ回路950の入出力関係をまとめた図である。It is the figure which put together the input-output relationship of the inverter circuit 950. 第10の実施形態に係るNAND回路の構成を示す図である。It is a figure which shows the structure of the NAND circuit based on 10th Embodiment. NAND回路951の入出力関係をまとめた図である。FIG. 7 is a diagram summarizing input / output relationships of a NAND circuit 951. 第11の実施形態に係る加算回路の構成を示す図である。It is a figure which shows the structure of the addition circuit which concerns on 11th Embodiment. 加算回路952の入出力関係をまとめた図である。6 is a diagram summarizing input / output relationships of an adder circuit 952. FIG. 第12の実施形態に係るROMの構成を示す図である。It is a figure which shows the structure of ROM which concerns on 12th Embodiment. ROM953の入出力関係をまとめた図である。10 is a diagram summarizing input / output relationships of a ROM 953. FIG. 第12の実施形態の変形例1に係るROMの構成を示す図である。It is a figure which shows the structure of ROM which concerns on the modification 1 of 12th Embodiment. 第12の実施形態の変形例2に係るROMの構成を示す図である。It is a figure which shows the structure of ROM which concerns on the modification 2 of 12th Embodiment. 第13の実施形態に係るレジスタの構成を示す図である。It is a figure which shows the structure of the register | resistor which concerns on 13th Embodiment. レジスタ956に入力および出力される信号の時間的な変化の例を示す図である。It is a figure which shows the example of the time change of the signal input and output to the register | resistor 956. FIG. 第14の実施形態に係る複数個のロジックを含む半導体回路を示す図である。It is a figure which shows the semiconductor circuit containing several logic based on 14th Embodiment. ロジック2に入力および出力される信号の時間的な変化の例を示す図である。It is a figure which shows the example of the time change of the signal input and output to the logic 2. FIG. 第14の実施形態の変形例1に係る複数個のロジックを含む半導体回路を示す図である。It is a figure which shows the semiconductor circuit containing several logic based on the modification 1 of 14th Embodiment. ロジック2に入力および出力される信号の時間的な変化の例を示す図である。It is a figure which shows the example of the time change of the signal input and output to the logic 2. FIG. 第14の実施形態の変形例2に係る複数個のロジックを含む半導体回路を示す図である。It is a figure which shows the semiconductor circuit containing several logic based on the modification 2 of 14th Embodiment. ロジック2に入力および出力される信号の時間的な変化の例を示す図である。It is a figure which shows the example of the time change of the signal input and output to the logic 2. FIG. 第14の実施形態の変形例3に係る複数個のロジックを含む半導体回路を示す図である。It is a figure which shows the semiconductor circuit containing several logic based on the modification 3 of 14th Embodiment. ロジック2に入力および出力される信号の時間的な変化の例を示す図である。It is a figure which shows the example of the time change of the signal input and output to the logic 2. FIG. 第14の実施形態の変形例3に係る複数個のロジックを含む半導体回路を示す図である。It is a figure which shows the semiconductor circuit containing several logic based on the modification 3 of 14th Embodiment.

符号の説明Explanation of symbols

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)

n(n≧2)ビットのデータを伝送し、ビットの論理が正論理と負論理とが混在しているnビットのデータバスと、
前記データバスで伝送されるデータを受けて、前記データバスの論理に適合した加算を行なう加算部とを備えた演算回路。
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のデータバスをN個(N≧2)備え、
前記第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.
前記加算部は、前記被乗数のビット数がnのときに、各段につきn個の加算回路をN段含み、
第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.
正論理を出力する第1の出力端子と、
負論理を出力する第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.
前記制御信号が活性化されている期間に、前記入力信号のレベルおよび前記反転入力信号のレベルが変化する、請求項10記載の論理回路。   The logic circuit according to claim 10, wherein a level of the input signal and a level of the inverted input signal change during a period in which the control signal is activated. 正論理を出力する第1の出力端子と、
負論理を出力する第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.
前記制御信号が活性化されている期間に、前記活性化する入力信号を変化させる、請求項12記載の読出し専用メモリ。   The read-only memory according to claim 12, wherein the input signal to be activated is changed during a period in which the control signal is activated. 正論理のデータを記憶する第1のノードと、
負論理のデータを記憶する第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.
前記制御信号が活性化されている期間に、前記入力信号のレベルおよび前記反転入力信号のレベルが変化する、請求項14記載のレジスタ。   The register according to claim 14, wherein a level of the input signal and a level of the inverted input signal change during a period in which the control signal is activated. 正論理のデータを記憶する第1のノードと、
負論理のデータを記憶する第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.
前記制御信号生成回路は、すべてのブロックに共通の基準信号と、前記対応するロジックに入力される少なくとも1つの入力信号および反転入力信号のペアを受けて、前記制御信号を生成する複数個の論理素子を含む、請求項17記載の半導体回路。   The control signal generation circuit receives a reference signal common to all blocks and at least one input signal and inverted input signal pair input to the corresponding logic, and generates a plurality of logics for generating the control signal. The semiconductor circuit according to claim 17, comprising an element. 前記制御信号生成回路は、制御入力信号を受ける遅延回路と、
前記遅延回路の出力と、すべてのブロックに共通の基準信号とを受けて、前記制御信号を生成するとともに、後段の制御信号生成回路の制御入力信号を生成する論理回路を含む、請求項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.
JP2004164761A 2004-06-02 2004-06-02 Arithmetic circuit, logical circuit, read-only memory, register, and semiconductor circuit Pending JP2005346373A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (3)

* Cited by examiner, † Cited by third party
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