JP5127241B2 - Residue calculation device and residue calculation method - Google Patents

Residue calculation device and residue calculation method Download PDF

Info

Publication number
JP5127241B2
JP5127241B2 JP2007010538A JP2007010538A JP5127241B2 JP 5127241 B2 JP5127241 B2 JP 5127241B2 JP 2007010538 A JP2007010538 A JP 2007010538A JP 2007010538 A JP2007010538 A JP 2007010538A JP 5127241 B2 JP5127241 B2 JP 5127241B2
Authority
JP
Japan
Prior art keywords
multiplication
result
addition
processing
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.)
Active
Application number
JP2007010538A
Other languages
Japanese (ja)
Other versions
JP2008176136A (en
Inventor
大輔 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2007010538A priority Critical patent/JP5127241B2/en
Publication of JP2008176136A publication Critical patent/JP2008176136A/en
Application granted granted Critical
Publication of JP5127241B2 publication Critical patent/JP5127241B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、剰余演算装置及び剰余演算方法に関するものである。本発明は、特に、剰余演算装置における多倍長演算器及びその制御方式(処理方式)に関するものである。   The present invention relates to a residue calculation device and a residue calculation method. The present invention particularly relates to a multiple length arithmetic unit and a control method (processing method) thereof in a remainder arithmetic apparatus.

現在、電子商取引やネットワーク通信などではRSA(登録商標)(Rivest・Shamir・Adleman)公開鍵暗号方式(以下、「RSA暗号」という)が利用されている。RSA暗号では、べき乗剰余演算の処理を必要とする。一般に、RSA暗号で用いられるべき乗剰余演算は、演算対象となるデータが512ビットや1024ビットなどの大きなサイズを持つため、非常に長い処理時間がかかることが知られている。   Currently, RSA (registered trademark) (Rivest, Shamir, Adleman) public key cryptosystem (hereinafter referred to as “RSA cipher”) is used in electronic commerce and network communication. The RSA cipher requires a power-residue calculation process. In general, it is known that the remainder calculation to be used in the RSA encryption takes a very long processing time because the data to be calculated has a large size such as 512 bits or 1024 bits.

べき乗剰余演算をハードウェア上で効率的に行う計算法として、P.L.Montogomeryにより提案されたモンゴメリ乗算と呼ばれるアルゴリズムが一般に知られている。このモンゴメリ乗算では、剰余演算で必要な除算処理をビットシフトで置き換えることができる。非特許文献1では、回路がレイテンシを持つ場合においても、効率よくモンゴメリ乗算を計算するアルゴリズムが開示されている。以下に非特許文献1に記載されているモンゴメリ乗算のアルゴリズムについて説明する。   As a calculation method for efficiently performing power-residue calculation on hardware, P.I. L. An algorithm called Montgomery multiplication proposed by Montgomery is generally known. In this Montgomery multiplication, the division processing necessary for the remainder operation can be replaced with a bit shift. Non-Patent Document 1 discloses an algorithm for efficiently calculating Montgomery multiplication even when a circuit has latency. The Montgomery multiplication algorithm described in Non-Patent Document 1 will be described below.

Figure 0005127241
Figure 0005127241

上記モンゴメリ乗算のハードウェアによる従来方式として、非特許文献1では、4−2加算器による構成例が開示されている。また、非特許文献2ではFPGA(Field・Programmable・Gate・Array)のRAM(Random・Access・Memory)と加算器で構成される演算器を基本構成単位としたシストリックアレイ(Systolic・Array)の構成が示されている。非特許文献3ではFPGAの組み込み乗算器を用いたシストリックアレイの構成が示されている。FPGAとしては、例えば非特許文献4に示されるようなものがある。
H.Orup、“Simplifying Quotient Determination in High−Radix Modular Multiplication”、Proc. of the 12th Symposium on Computer Arithmetic、1995年 T.Blum、C.Paar、“High−Radix Montgomery Modular Exponentiation on Reconfigurable Hardware”、IEEE Transactions on Computers、Vol.50、No.7、pp.759−764、2001年7月 S.H.Tang、K.S.Tsui、P.H.W.Leong、“Modular Exponentiation using Parallel Multipliers”、Proceedings.2003 IEEE International Conference on Field−Programmable Technology(FPT)、pp.52−59、2003年12月 Xilinx,Inc.、「Virtex−4 ユーザーガイド」、2005年9月12日、インターネット<URL:http://direct.xilinx.com/bvdocs/userguides/j_ug070.pdf>
As a conventional method using the Montgomery multiplication hardware, Non-Patent Document 1 discloses a configuration example using a 4-2 adder. Further, in Non-Patent Document 2, a systolic array having an arithmetic unit composed of a RAM (Random, Access, and Memory) of an FPGA (Field, Programmable, Gate, and Array) and an adder as a basic structural unit. The configuration is shown. Non-Patent Document 3 shows a configuration of a systolic array using an FPGA built-in multiplier. As an FPGA, for example, there is one as shown in Non-Patent Document 4.
H. Orup, “Simplicating Quotient Determination in High-Radix Modular Multiplication”, Proc. of the 12th Symposium on Computer Arithmetic, 1995 T.A. Blum, C.I. Paar, “High-Radix Modular Modular Exponentialation on Reconfigurable Hardware”, IEEE Transactions on Computers, Vol. 50, no. 7, pp. 759-764, July 2001 S. H. Tang, K.K. S. Tsui, P .; H. W. Leong, “Modular Exponentializing Parallel Multipliers”, Proceedings. 2003 IEEE International Conference on Field-Programmable Technology (FPT), pp. 52-59, December 2003 Xilinx, Inc. "Virtex-4 User Guide", September 12, 2005, Internet <URL: http: // direct. xilinx. com / bvdocs / userguides / j_ug070. pdf>

近年のFPGAでは様々な機能拡張が行われている。例えば、一般的なものでは、多倍長データの乗算処理を高速で行うための専用回路が予め実装されているため、これらを利用して乗算処理を効率的に行うデバイスを容易に実現することができる。また、例えば、非特許文献4のFPGAのように、音声や画像などの処理で一般に広く利用されているDSP(Digital・Signal・Processor)の基本要素が複数組み込まれるようになったものもある。前述したようなモンゴメリ乗算のハードウェアによる従来方式は、このようなFPGAの機能拡張を想定して構成されていないため、機能拡張されたFPGAに従来方式を単純に実装しても、FPGAが持つ機能を十分に引き出すことができないという課題があった。   Various functions have been expanded in recent FPGAs. For example, in general, a dedicated circuit for performing multiplication processing of multiple-length data at high speed is pre-installed, and thus a device that efficiently performs multiplication processing can be easily realized using these circuits. Can do. Also, for example, there are some in which a plurality of basic elements of a DSP (Digital / Signal / Processor) which are generally widely used in processing of voices and images are incorporated, such as an FPGA of Non-Patent Document 4. Since the conventional method based on the hardware of Montgomery multiplication as described above is not configured assuming such a function expansion of the FPGA, even if the conventional method is simply implemented in the function-extended FPGA, the FPGA has it. There was a problem that the function could not be fully extracted.

本発明は、剰余演算を行って暗号アルゴリズムを処理する暗号処理回路において、FPGAの機能拡張に適応した回路構成及び処理方式を採ることで、より少ない回路リソースでの高速動作を可能とし、さらに、回路の汎用性を高めることを目的とする。   The present invention enables a high-speed operation with fewer circuit resources by adopting a circuit configuration and processing method adapted to the function expansion of the FPGA in the cryptographic processing circuit that performs the cryptographic operation by performing the remainder operation, The purpose is to increase the versatility of the circuit.

本発明の一の態様に係る剰余演算装置は、
被乗数をA、乗数をB、法をM、中間値をQとし、A及びBの乗算結果とM及びQの乗算結果と中間結果Sとの加算結果に基づいて、モンゴメリ乗算の結果を得る剰余演算装置において、
所定の動作周波数の2倍の動作周波数にて、A及びBの乗算処理とM及びQの乗算処理とを乗算器で行い、それぞれの乗算結果を出力する多倍長乗算部と、
前記所定の動作周波数にて、前記多倍長乗算部により出力された2つの乗算結果とSとの加算処理を複数の加算器で行い、加算器ごとの加算結果を出力する多倍長加算部と、
前記多倍長加算部により出力された加算器ごとの加算結果を連結してモンゴメリ乗算の結果を得る剰余演算部とを備え
前記多倍長乗算部は、前記2倍の動作周波数の各サイクルにて、所定のビット長の乗算処理を行い、
前記多倍長加算部は、前記所定の動作周波数の各サイクルにて、前記所定のビット長の2倍の長さの加算処理を行う
A remainder calculation apparatus according to one aspect of the present invention is provided.
The remainder for obtaining the result of the Montgomery multiplication based on the addition result of the multiplication result of A and B, the multiplication result of M and Q, and the intermediate result S, where the multiplicand is A, the multiplier is B, the modulus is M, and the intermediate value is Q. In the arithmetic unit,
A multiple length multiplication unit that performs multiplication processing of A and B and multiplication processing of M and Q by a multiplier at an operation frequency that is twice the predetermined operation frequency, and outputs each multiplication result;
A multiple length addition unit that performs addition processing of two multiplication results output by the multiple length multiplication unit and S at the predetermined operating frequency with a plurality of adders, and outputs the addition result for each adder When,
A remainder calculation unit that obtains a result of Montgomery multiplication by concatenating the addition results for each adder output by the multiple length addition unit ;
The multiple length multiplication unit performs multiplication processing of a predetermined bit length in each cycle of the double operating frequency,
The multiple length adder performs an addition process of a length twice the predetermined bit length in each cycle of the predetermined operating frequency .

本発明の一の態様によれば、被乗数をA、乗数をB、法をM、中間値をQとし、A及びBの乗算結果とM及びQの乗算結果と中間結果Sとの加算結果に基づいて、モンゴメリ乗算の結果を得る剰余演算装置において、多倍長乗算部が、所定の動作周波数の2倍の動作周波数にて、A及びBの乗算処理とM及びQの乗算処理とを乗算器で行い、それぞれの乗算結果を出力し、多倍長加算部が、前記所定の動作周波数にて、前記多倍長乗算部により出力された2つの乗算結果とSとの加算処理を複数の加算器で行い、加算器ごとの加算結果を出力し、剰余演算部が、前記多倍長加算部により出力された加算器ごとの加算結果を連結してモンゴメリ乗算の結果を得ることにより、剰余演算を行って暗号アルゴリズムを処理する暗号処理回路において、より少ない回路リソースでの高速動作が可能となり、さらに、回路の汎用性が向上する。 According to one aspect of the present invention, the multiplicand is A, the multiplier is B, the modulus is M, the intermediate value is Q, and the multiplication result of A and B, the multiplication result of M and Q, and the intermediate result S are added. Based on this, in the remainder arithmetic unit that obtains the result of the Montgomery multiplication, the multiple length multiplication unit multiplies the A and B multiplication processes and the M and Q multiplication processes at an operating frequency that is twice the predetermined operating frequency. performed in a vessel, and outputs the respective multiplication results, multiple length adder portion, wherein at a predetermined operating frequency, said multiple length multiplied two output by the unit multiplication result S and adding process multiple of An adder outputs an addition result for each adder, and a remainder calculation unit concatenates the addition results for each adder output by the multiple-length adder to obtain a Montgomery multiplication result , In a cryptographic processing circuit that performs computation and processes cryptographic algorithms It enables high-speed operation with less circuit resource, further improves the versatility of the circuit.

以下、本発明の実施の形態について、図を用いて説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

実施の形態1.
本実施の形態に係る暗号処理回路は、剰余演算を行って暗号アルゴリズムを処理するために、特に、FPGAのリソースを有効活用することにより、処理の高速化と回路の小型化を実現するものである。
Embodiment 1 FIG.
The cryptographic processing circuit according to the present embodiment realizes high-speed processing and circuit miniaturization, in particular, by effectively utilizing FPGA resources in order to perform a remainder operation and process cryptographic algorithms. is there.

図1は、本実施の形態に係る暗号処理回路を用いたデバイスの一例として、FPGAを用いたセキュリティチップ101の構成を示すブロック図である。セキュリティチップ101は、例えば、携帯電話、IC(Integrated・Circuit)カード、ICカードリーダライタといった小型端末やネットワークルータなどの通信機器に組み込まれ、通信データの暗号処理のために用いられる。   FIG. 1 is a block diagram illustrating a configuration of a security chip 101 using an FPGA as an example of a device using the cryptographic processing circuit according to the present embodiment. The security chip 101 is incorporated in a communication device such as a small terminal such as a mobile phone, an IC (Integrated Circuit) card, or an IC card reader / writer, or a network router, and used for encryption processing of communication data.

図1において、セキュリティチップ101は、CPU102(Central・Processing・Unit)、内部メモリ103、外部インタフェース104、暗号処理回路用メモリ105を備え、これらはバス106で接続されている。また、セキュリティチップ101は、本実施の形態に係る暗号処理回路として、モンゴメリ乗算回路201を備える。   In FIG. 1, a security chip 101 includes a CPU 102 (Central Processing Unit), an internal memory 103, an external interface 104, and a cryptographic processing circuit memory 105, which are connected by a bus 106. The security chip 101 also includes a Montgomery multiplication circuit 201 as an encryption processing circuit according to the present embodiment.

CPU102は、モンゴメリ乗算回路201に対する入出力の制御、内部メモリ103のデータの読み書き、外部インタフェース104を介した外部装置との通信などを行うプログラムを実行するプロセッサ(処理装置)である。内部メモリ103は、CPU102の作業領域として利用されるRAM(Random・Access・Memory)、各種プログラムや設定パラメータなどを格納するROM(Read・Only・Memory)からなり、FPGAが持つ機能の1つである組み込みメモリで実装することが想定される。外部インタフェース104は、シリアル通信やLAN(ローカルエリアネットワーク)などの各種インタフェースであり、セキュリティチップ101に対して、モンゴメリ乗算回路201で処理するデータの入出力を行う。暗号処理回路用メモリ105は、モンゴメリ乗算回路201とバス106間のインタフェースとして用いられる。   The CPU 102 is a processor (processing device) that executes a program for controlling input / output with respect to the Montgomery multiplication circuit 201, reading / writing data in the internal memory 103, communicating with an external device via the external interface 104, and the like. The internal memory 103 includes a RAM (Random / Access / Memory) used as a work area of the CPU 102 and a ROM (Read / Only / Memory) for storing various programs and setting parameters, and is one of the functions of the FPGA. It is assumed to be implemented with some built-in memory. The external interface 104 is various interfaces such as serial communication and LAN (local area network), and inputs / outputs data processed by the Montgomery multiplication circuit 201 to the security chip 101. The cryptographic processing circuit memory 105 is used as an interface between the Montgomery multiplication circuit 201 and the bus 106.

モンゴメリ乗算回路201は、剰余演算装置の一例である。モンゴメリ乗算回路201は、モンゴメリ乗算を利用した暗号処理に、FPGAが持つ機能や特性を活用することで、従来方式より効率的な演算を可能とするものである。以下、モンゴメリ乗算回路201の詳細について説明する。   The Montgomery multiplication circuit 201 is an example of a remainder calculation device. The Montgomery multiplication circuit 201 makes it possible to perform more efficient calculation than the conventional method by utilizing the functions and characteristics of the FPGA for encryption processing using Montgomery multiplication. Details of the Montgomery multiplication circuit 201 will be described below.

まず、モンゴメリ乗算回路201に実装されるアルゴリズムを以下に示す。下記アルゴリズムは、非特許文献1に記載のモンゴメリ乗算のアルゴリズムをFPGAが持つ機能や特性を考慮して改良したものである。   First, an algorithm implemented in the Montgomery multiplication circuit 201 is shown below. The following algorithm is an improvement of the Montgomery multiplication algorithm described in Non-Patent Document 1 in consideration of the functions and characteristics of the FPGA.

Figure 0005127241
Figure 0005127241

Figure 0005127241
Figure 0005127241

Figure 0005127241
Figure 0005127241

上記アルゴリズムの擬似コードにおいて、“|”はビット連結を意味する。また、carry_kはkビット、carry_1は1ビットの中間値を意味する。また、変数p[i][j]、u[i][j]、v[i][j]、s[i][j]はそれぞれkビットとし、初期値は0とする。   In the pseudo code of the above algorithm, “|” means bit concatenation. Further, carry_k means an intermediate value of k bits and carry_1 means 1 bit. The variables p [i] [j], u [i] [j], v [i] [j], and s [i] [j] are each set to k bits, and the initial value is 0.

上記擬似コードの特徴は、乗算処理をkビットごとの2つの乗算処理、多倍長乗算処理(1)、多倍長乗算処理(2)に分割している点と、加算処理を2kビットごとの2つの加算処理、多倍長加算処理(1)、多倍長加算処理(2)に分割している点である。また、他の特徴として、多倍長乗算処理(2)ではj=0の場合のみ処理を変更することで、q導出処理を高速に行うことが挙げられる。これらの理由及び詳細については後述する。   The pseudo code is characterized in that the multiplication process is divided into two multiplication processes every k bits, a multiple multiplication process (1), and a multiple multiplication process (2), and the addition process is performed every 2 k bits. Are divided into two addition processing, multiple length addition processing (1), and multiple length addition processing (2). As another feature, in the multiple length multiplication process (2), the q derivation process can be performed at high speed by changing the process only when j = 0. These reasons and details will be described later.

図2は、モンゴメリ乗算回路201の構成を示すブロック図である。図2に示したモンゴメリ乗算回路201全体で、前述した擬似コード全体が処理される。   FIG. 2 is a block diagram showing the configuration of the Montgomery multiplication circuit 201. The entire pseudo code described above is processed by the entire Montgomery multiplication circuit 201 shown in FIG.

図2において、モンゴメリ乗算回路201は、演算回路A301、演算回路B401、演算回路C501、演算回路D601の4種類の演算回路を備える。演算回路A301、演算回路D601は、多倍長乗算部の一例であり、擬似コードの多倍長乗算処理(1)及び多倍長乗算処理(2)を行う演算回路である。また、演算回路B401、演算回路C501は、多倍長乗算部の一例であり、順に、擬似コードの多倍長加算処理(1)、多倍長加算処理(2)を行う演算回路である。モンゴメリ乗算回路201全体の構成及び動作について説明する前に、まず、それぞれの種類の演算回路について説明する。   In FIG. 2, the Montgomery multiplication circuit 201 includes four types of arithmetic circuits: an arithmetic circuit A301, an arithmetic circuit B401, an arithmetic circuit C501, and an arithmetic circuit D601. The arithmetic circuit A301 and the arithmetic circuit D601 are an example of a multiple length multiplication unit, and are arithmetic circuits that perform multiple length multiplication processing (1) and multiple length multiplication processing (2) of pseudo code. The arithmetic circuit B401 and the arithmetic circuit C501 are examples of a multiple length multiplication unit, and are arithmetic circuits that sequentially perform multiple length addition processing (1) and multiple length addition processing (2) of pseudo code. Before describing the overall configuration and operation of the Montgomery multiplication circuit 201, each type of arithmetic circuit will be described first.

図3は、演算回路A301の構成の一例を示すブロック図である。   FIG. 3 is a block diagram illustrating an example of the configuration of the arithmetic circuit A301.

図3に示した演算回路A301は、前述した擬似コードの多倍長乗算処理(1)及び多倍長乗算処理(2)におけるループ処理のうち、j=0からj=(2t−1)までの処理を行うものである。この演算回路A301の処理は以下の擬似コード(以下、「擬似コードA」という)で表せる。   The arithmetic circuit A301 shown in FIG. 3 includes j = 0 to j = (2t−1) among the loop processes in the multiple-precision multiplication process (1) and the multiple-precision multiplication process (2) of the pseudo code described above. The process is performed. The processing of the arithmetic circuit A301 can be expressed by the following pseudo code (hereinafter referred to as “pseudo code A”).

Figure 0005127241
Figure 0005127241

ここで、擬似コードAと演算回路A301の各部との対応について説明する。   Here, the correspondence between the pseudo code A and each part of the arithmetic circuit A301 will be described.

まず、入力ポート302から、擬似コードAのa[j]及びa[j+1]、もしくは、m[j]及びm[j+1]が同時に入力される。そのため、入力ポート302は、2kビットのバス幅を持つ。また、入力ポート303からは、擬似コードAのb[i]が入力される。また、入力ポート304からは、擬似コードAのq[i−d]が入力される。入力ポート302,303,304から入力されたデータは、それぞれ入力レジスタ309,310,311,312に格納される。   First, a [j] and a [j + 1] of pseudo code A or m [j] and m [j + 1] are simultaneously input from the input port 302. Therefore, the input port 302 has a 2k bit bus width. Further, b [i] of pseudo code A is input from the input port 303. Further, q [id] of pseudo code A is input from the input port 304. Data input from the input ports 302, 303, and 304 are stored in the input registers 309, 310, 311 and 312 respectively.

入力レジスタ309,310に格納されたデータがa[j]とa[j+1]の場合、そのどちらか一方がマルチプレクサ306で選択され、中間レジスタ313に格納される。同様に、入力レジスタ309,310に格納されたデータがm[j]とm[j+1]の場合、そのどちらか一方がマルチプレクサ306で選択され、中間レジスタ313に格納される。また、入力レジスタ311,312に格納されたb[i]及びq[i−d]は、マルチプレクサ307で選択され、中間レジスタ314に格納される。中間レジスタ314のデータは、出力ポート319に出力される。   When the data stored in the input registers 309 and 310 are a [j] and a [j + 1], one of them is selected by the multiplexer 306 and stored in the intermediate register 313. Similarly, when the data stored in the input registers 309 and 310 are m [j] and m [j + 1], one of them is selected by the multiplexer 306 and stored in the intermediate register 313. Further, b [i] and q [id] stored in the input registers 311 and 312 are selected by the multiplexer 307 and stored in the intermediate register 314. The data in the intermediate register 314 is output to the output port 319.

中間レジスタ313と中間レジスタ314に格納されたデータは、乗算器316で乗算処理され、その結果が中間レジスタ315に格納される。ここで、中間レジスタ315はkビット×kビットの乗算結果を格納するため、2kビットのレジスタとなる。中間レジスタ315に格納されたデータは、入力ポート305から与えられ入力レジスタ308に格納されたデータ、もしくは、出力レジスタ322に格納されたデータの上位kビットと加算器317で加算処理され、その結果が出力レジスタ322に格納される。ここで、入力レジスタ308に格納されたデータと出力レジスタ322に格納されたデータの上位kビットの選択はマルチプレクサ318で行われる。出力レジスタ322は、2kビットのレジスタであり、上位kビットはマルチプレクサ318の入力と出力ポート320に接続され、下位kビットは出力ポート321に接続されている。   The data stored in the intermediate register 313 and the intermediate register 314 is multiplied by the multiplier 316, and the result is stored in the intermediate register 315. Here, since the intermediate register 315 stores a multiplication result of k bits × k bits, the intermediate register 315 is a 2 k bit register. The data stored in the intermediate register 315 is added by the adder 317 with the upper k bits of the data supplied from the input port 305 and stored in the input register 308 or stored in the output register 322, and the result Is stored in the output register 322. Here, the multiplexer 318 selects the upper k bits of the data stored in the input register 308 and the data stored in the output register 322. The output register 322 is a 2 k-bit register, the upper k bits are connected to the input of the multiplexer 318 and the output port 320, and the lower k bits are connected to the output port 321.

続けて、演算回路A301の詳細な動作について説明する。ここで、図3の点線外における動作クロックをclk1xとし、点線内の動作クロックをclk2xと表記する。clk2xはclk1xの2倍の動作周波数であるものとする。図3の点線内は、FPGAであるセキュリティチップ101に予め設けられている多倍長乗算回路323である。前述したように、FPGAは、このような乗算処理のための専用回路を具備している。そして、FPGAの特性の1つとして、このような専用回路は一般的に高い周波数で動作することができる。   Next, detailed operation of the arithmetic circuit A301 will be described. Here, the operation clock outside the dotted line in FIG. 3 is denoted as clk1x, and the operation clock within the dotted line is denoted as clk2x. It is assumed that clk2x has an operating frequency twice that of clk1x. A dotted line in FIG. 3 indicates a multiple length multiplication circuit 323 provided in advance in the security chip 101 which is an FPGA. As described above, the FPGA includes a dedicated circuit for such multiplication processing. As one of the characteristics of the FPGA, such a dedicated circuit can generally operate at a high frequency.

最初に、入力ポート302から、clk1xを基準としてa[1]|a[0]が入力される。以降、clk1xを基準としてa[2t−1]|a[2t−2]まで毎サイクル、入力ポート302からデータが連続して入力される。以下では、この処理を入力処理aと呼ぶことにする。続けて、入力ポート302から、a[2t−1]|a[2t−2]が入力されたサイクルの次のサイクルでm[1]|m[0]が入力される。以降、clk1xを基準としてm[2t−1]|m[2t−2]まで毎サイクル、入力ポート302からデータが連続して入力される。以下では、この入力処理aの終了後の処理を入力処理mと呼ぶことにする。入力処理mの終了後は再び入力処理a、入力処理mが繰り返し実行される。そして、この一連の処理は、所定の回数(i=0からi=n+dまで)繰り返し実行される。   First, a [1] | a [0] is input from the input port 302 with reference to clk1x. Thereafter, data is continuously input from the input port 302 every cycle up to a [2t−1] | a [2t−2] with reference to clk1x. Hereinafter, this processing is referred to as input processing a. Subsequently, m [1] | m [0] is input from the input port 302 in the cycle after the cycle in which a [2t-1] | a [2t-2] is input. Thereafter, data is continuously input from the input port 302 every cycle up to m [2t−1] | m [2t−2] with reference to clk1x. Hereinafter, the process after the end of the input process a will be referred to as an input process m. After the input process m ends, the input process a and the input process m are repeatedly executed again. This series of processing is repeatedly executed a predetermined number of times (from i = 0 to i = n + d).

上記の入力処理a及び入力処理mに同期しながら、clk1xを基準として入力ポート303からはb[i]が、入力ポート304からはq[i−d]が入力される。   In synchronization with the input process a and the input process m, b [i] is input from the input port 303 and q [id] is input from the input port 304 with reference to clk1x.

マルチプレクサ306は、clk2xを基準として入力レジスタ309と入力レジスタ310に格納されたデータを交互に選択する。マルチプレクサ307は、入力レジスタ309と入力レジスタ310に入力処理aのデータが格納されている場合には、入力レジスタ311に格納されたデータであるb[i]を選択する。一方、入力レジスタ309と入力レジスタ310に入力処理mのデータが格納されている場合には、入力レジスタ312に格納されたデータであるq[i−d]を選択する。つまり、中間レジスタ313にa[j]あるいはa[j+1]が格納されている場合は、中間レジスタ314にb[i]が格納され、中間レジスタ313にm[j]あるいはm[j+1]が格納されている場合は、中間レジスタ314にq[i−d]が格納される。   The multiplexer 306 alternately selects the data stored in the input register 309 and the input register 310 with reference to clk2x. The multiplexer 307 selects b [i], which is the data stored in the input register 311, when the data of the input process a is stored in the input register 309 and the input register 310. On the other hand, when the data of the input process m is stored in the input register 309 and the input register 310, q [id] that is the data stored in the input register 312 is selected. That is, when a [j] or a [j + 1] is stored in the intermediate register 313, b [i] is stored in the intermediate register 314, and m [j] or m [j + 1] is stored in the intermediate register 313. If it is, q [id] is stored in the intermediate register 314.

これにより、乗算器316では、入力処理aに対応してb[i]・a[j](“・”は乗算処理を表すが、省略する場合がある)が処理され、入力処理mに対応してq[i−d]・m[j]が処理される。処理結果は、中間レジスタ315に格納される。   Thus, the multiplier 316 processes b [i] · a [j] (“·” represents a multiplication process, but may be omitted) corresponding to the input process a, and corresponds to the input process m. Then q [id] · m [j] is processed. The processing result is stored in the intermediate register 315.

次に、中間レジスタ315にb[i]・a[0]が格納されている場合、入力レジスタ308の値は0にセットされ、マルチプレクサ318で入力レジスタ308の値が選択されて、加算器317がb[i]・a[0]+0の処理を実行する。それ以降は、マルチプレクサ318で出力レジスタ322の上位kビットの値が選択されて、加算器317がb[i]・a[j]+carry_kの処理を実行する。一方、中間レジスタ315にq[i−d]・m[0]が格納されている場合、入力レジスタ308の値はp[i][0]にセットされ、マルチプレクサ318で入力レジスタ308の値が選択されて、加算器317がq[i−d]・m[0]+p[i][0]の処理を実行する。それ以降は、マルチプレクサ318で出力レジスタ322の上位kビットの値が選択されて、加算器317がq[i−d]・m[j]+carry_kの処理を実行する。   Next, when b [i] · a [0] is stored in the intermediate register 315, the value of the input register 308 is set to 0, the value of the input register 308 is selected by the multiplexer 318, and the adder 317 Executes the process of b [i] · a [0] +0. After that, the value of the upper k bits of the output register 322 is selected by the multiplexer 318, and the adder 317 executes the process b [i] · a [j] + carry_k. On the other hand, when q [id] · m [0] is stored in the intermediate register 315, the value of the input register 308 is set to p [i] [0], and the value of the input register 308 is set by the multiplexer 318. When selected, the adder 317 executes a process of q [id] · m [0] + p [i] [0]. Thereafter, the value of the upper k bits of the output register 322 is selected by the multiplexer 318, and the adder 317 executes the process of q [id] · m [j] + carry_k.

以上の処理により、出力ポート321には、入力処理aに対応してp[i][0]からp[i][2t−1]が出力され、入力処理mに対応してv[i][0]及びu[i][1]からu[i][2t−1]が出力される。また、出力ポート320には、出力ポート321に対応したcarry_kが出力される。出力ポート320,321には、clk2xを基準としてサイクルごとに各データが出力される。   Through the above processing, p [i] [0] to p [i] [2t−1] are output from the output port 321 corresponding to the input processing a, and v [i] is output corresponding to the input processing m. U [i] [2t-1] is output from [0] and u [i] [1]. Also, carry_k corresponding to the output port 321 is output to the output port 320. Each data is output to the output ports 320 and 321 for each cycle with reference to clk2x.

このように、演算回路A301では、入力ポート302,303へのデータの入力がclk1xを基準とするのに対して、乗算処理や加算処理自体はclk2xを基準とする。本実施の形態では、このような構成により、入力ポート302,303に接続される外部回路を、clk1xを基準として構成することができ、なおかつ乗算処理や加算処理自体はclk2xを基準として処理できる。このように、本実施の形態では、外部回路を低い動作周波数で構成できるため、タイミング制約が緩くなり外部回路の設計条件を緩めることができる。   As described above, in the arithmetic circuit A301, the input of data to the input ports 302 and 303 is based on clk1x, while the multiplication processing and the addition processing itself are based on clk2x. In the present embodiment, with such a configuration, an external circuit connected to the input ports 302 and 303 can be configured with reference to clk1x, and multiplication processing and addition processing itself can be processed with reference to clk2x. As described above, in this embodiment, since the external circuit can be configured with a low operating frequency, the timing constraint is relaxed and the design conditions of the external circuit can be relaxed.

様々な機能拡張が施された近年のFPGAでは、図3に示した多倍長乗算回路323のような乗算処理や加算処理の専用回路がハードマクロとして組み込まれている。一般にこのような専用回路は、高い動作周波数で動作させることができる。一方で、専用回路以外の部分に関してFPGAの回路を専用回路と同等の動作周波数で動作させることを前提とした場合、タイミング制約が厳しくなるため、複雑な回路を実装することは難しい。本実施の形態は、全体の性能を低下させずに、専用回路部分のみを高い動作周波数で動作させ、それ以外の部分を低い動作周波数で動作させることができるため、効率的な処理が実現できる。   In recent FPGAs to which various functions are expanded, a dedicated circuit for multiplication processing and addition processing such as the multiple-length multiplication circuit 323 shown in FIG. 3 is incorporated as a hard macro. In general, such a dedicated circuit can be operated at a high operating frequency. On the other hand, when it is assumed that the FPGA circuit is operated at an operating frequency equivalent to that of the dedicated circuit with respect to parts other than the dedicated circuit, it is difficult to mount a complicated circuit because the timing constraint becomes severe. In this embodiment, only the dedicated circuit portion can be operated at a high operating frequency and the other portions can be operated at a low operating frequency without degrading the overall performance, so that efficient processing can be realized. .

図4は、前述したアルゴリズムの擬似コードのq導出処理を行う演算回路の構成の一例を示すブロック図である。   FIG. 4 is a block diagram showing an example of the configuration of an arithmetic circuit that performs q derivation processing of pseudo code of the algorithm described above.

図4に示した演算回路のうち、演算回路A301を除いたものは、中間値導出部の一例である。この演算回路において、入力ポート205からは、s[i][1]が入力される。そして、入力レジスタ202は、clk1xに同期してs[i][1]を取り込む。中間レジスタ203は、図3に示した演算回路A301の出力ポート321からv[i][0]が出力されたタイミングでデータを取り込む。その結果、中間レジスタ203にv[i][0]が格納される。加算器204は、v[i][0]+s[i][1]の処理を行い、その結果としてq[i+1]を出力する。加算器204は、演算回路A301の入力ポート304に接続されており、入力レジスタ312が所定のタイミングで入力ポート304からq[i+1]を取り込む。図示していないが、加算器204と演算回路A301の入力ポート304の間にはバッファが設けられており、このバッファが加算器204から出力されるq[i+1]に遅延dを加えることで、上記タイミングが調整される。その結果、図3に示したように、演算回路A301の入力ポート304からはq[i−d]が入力されることになる。また、演算回路A301の出力ポート321は、入力ポート305を介して入力レジスタ308と接続されており、入力レジスタ308が出力ポート321からp[i][0]が出力されたタイミングで入力ポート305からデータを取り込む。その結果、入力レジスタ308にp[i][0]が格納される。   The arithmetic circuit shown in FIG. 4 excluding the arithmetic circuit A301 is an example of the intermediate value deriving unit. In this arithmetic circuit, s [i] [1] is input from the input port 205. Then, the input register 202 captures s [i] [1] in synchronization with clk1x. The intermediate register 203 captures data at the timing when v [i] [0] is output from the output port 321 of the arithmetic circuit A301 illustrated in FIG. As a result, v [i] [0] is stored in the intermediate register 203. The adder 204 processes v [i] [0] + s [i] [1] and outputs q [i + 1] as a result. The adder 204 is connected to the input port 304 of the arithmetic circuit A301, and the input register 312 takes in q [i + 1] from the input port 304 at a predetermined timing. Although not shown, a buffer is provided between the adder 204 and the input port 304 of the arithmetic circuit A301, and this buffer adds a delay d to q [i + 1] output from the adder 204. The timing is adjusted. As a result, as shown in FIG. 3, q [id] is input from the input port 304 of the arithmetic circuit A301. The output port 321 of the arithmetic circuit A301 is connected to the input register 308 via the input port 305, and the input port 305 is output when p [i] [0] is output from the output port 321. Import data from. As a result, p [i] [0] is stored in the input register 308.

上記擬似コードの多倍長乗算処理(2)でj=0の場合のみv[i][0]を算出するように処理するのは、図4に示した演算回路で行う処理を多倍長加算処理(1)の結果を待たずして開始できるからである。これにより、q[i+1]の導出を高速に行うことができる。q[i+1]の導出が高速であれば、繰り返し処理である入力処理a及び入力処理mを連続して行うことができる。逆に、q[i+1]の導出が遅いと、入力処理mを実行しても、乗算対象であるq[i+1]が入力されるまで乗算処理を開始することができず、以降の処理を連続して行うことができなくなってしまう。   The process of calculating v [i] [0] only when j = 0 in the multiple-precision multiplication process (2) of the pseudo code described above is the same as the process performed by the arithmetic circuit shown in FIG. This is because the result of the addition process (1) can be started without waiting. Thereby, q [i + 1] can be derived at high speed. If the derivation of q [i + 1] is fast, the input process a and the input process m, which are repetitive processes, can be performed continuously. Conversely, if the derivation of q [i + 1] is slow, even if the input process m is executed, the multiplication process cannot be started until the multiplication target q [i + 1] is input, and the subsequent processes are continued. And will not be able to do it.

図5は、演算回路B401の構成の一例を示すブロック図である。   FIG. 5 is a block diagram illustrating an example of the configuration of the arithmetic circuit B401.

図5に示した演算回路B401は、前述したアルゴリズムの擬似コードの多倍長加算処理(1)におけるループ処理のうち、j=0からj=t−1までの処理を行うものである。   The arithmetic circuit B401 shown in FIG. 5 performs processing from j = 0 to j = t-1 in the loop processing in the multiple-length addition processing (1) of the pseudo code of the algorithm described above.

図3に示した演算回路A301が2t回のループ処理を行うのに対して、図5に示した演算回路B401はt回のループ処理を行うことに注意されたい。演算回路B401は、clk1xを基準として動作する。このため、演算回路B401は、大部分の回路がclk2xで動作する演算回路A301の半分のループ回数を処理することとなる。   It should be noted that the arithmetic circuit A301 shown in FIG. 3 performs 2t loop processing, whereas the arithmetic circuit B401 shown in FIG. 5 performs t loop processing. The arithmetic circuit B401 operates with reference to clk1x. For this reason, the arithmetic circuit B401 processes most of the number of loops of the arithmetic circuit A301 operating with clk2x.

入力ポート402は、演算回路A301の出力ポート321に接続されている。出力ポート321から出力されるデータのうち、演算回路A301でのループ処理におけるjの値が偶数のときの出力は、中間レジスタ404に格納される。同じくjの値が奇数のときの出力は、中間レジスタ406に格納される。中間レジスタ405は、中間レジスタ404の出力を格納する。このとき、中間レジスタ404と中間レジスタ405,406は、互いに逆のエッジで動作するレジスタであるとする。つまり、中間レジスタ404がclk1xの立ち上がりで動作するレジスタであるとすれば、中間レジスタ405,406はclk1xの立ち下がりで動作するレジスタとなる。このような構成により、中間レジスタ405,406からは同一のタイミングで、隣り合う中間値を連結した値であるp[i][j+1]|p[i][j]あるいはu[i][j+1]|u[i][j]が出力されることになる。例えば、中間レジスタ405がp[i][0]を出力するタイミングでは、中間レジスタ406はp[i][1]を出力し、中間レジスタ405がp[i][2]を出力するタイミングでは、中間レジスタ406はp[i][3]を出力する。また、中間レジスタ405がu[i][2]を出力するタイミングでは、中間レジスタ406はu[i][3]を出力する。ただし、前述したように、上記擬似コードの多倍長乗算処理(2)ではj=0の場合のみv[i][0]を算出する処理を行う関係上、中間レジスタ405がv[i][0]を出力するタイミングでは、中間レジスタ406はu[i][1]を出力することに注意されたい。   The input port 402 is connected to the output port 321 of the arithmetic circuit A301. Of the data output from the output port 321, the output when the value of j in the loop processing in the arithmetic circuit A 301 is an even number is stored in the intermediate register 404. Similarly, the output when the value of j is an odd number is stored in the intermediate register 406. The intermediate register 405 stores the output of the intermediate register 404. At this time, the intermediate register 404 and the intermediate registers 405 and 406 are registers that operate at opposite edges. That is, if the intermediate register 404 is a register that operates at the rising edge of clk1x, the intermediate registers 405 and 406 are registers that operate at the falling edge of clk1x. With such a configuration, the intermediate registers 405 and 406 receive p [i] [j + 1] | p [i] [j] or u [i] [j + 1] that are values obtained by connecting adjacent intermediate values at the same timing. ] [U [i] [j] is output. For example, at the timing when the intermediate register 405 outputs p [i] [0], the intermediate register 406 outputs p [i] [1], and at the timing when the intermediate register 405 outputs p [i] [2]. The intermediate register 406 outputs p [i] [3]. At the timing when the intermediate register 405 outputs u [i] [2], the intermediate register 406 outputs u [i] [3]. However, as described above, the pseudo register multiple multiplication process (2) performs the process of calculating v [i] [0] only when j = 0, so that the intermediate register 405 has v [i]. Note that the intermediate register 406 outputs u [i] [1] at the timing of outputting [0].

中間レジスタ405,406がp[i][j]|p[i][j+1]を出力する場合、ANDゲート407,408の出力が0になるようにマスク処理が行われる。よって、加算器410,411の出力は、p[i][j]|p[i][j+1]となる。加算器410,411がp[i][j]|p[i][j+1]を出力するとき、可変シフトレジスタ412,413は、加算器410,411の出力を取り込む。その結果、可変シフトレジスタ412,413にp[i][j]|p[i][j+1]が格納される。次に、中間レジスタ405,406がu[i][j]|u[i][j+1]を出力する場合、可変シフトレジスタ412,413は、格納されているp[i][j]|p[i][j+1]を出力する。このとき、ANDゲート407,408ではマスク処理が行われず、可変シフトレジスタ412,413の出力が、ANDゲート407,408を介して加算器410,411に入力される。そして、加算器410,411は、p[i][1]+u[i][1]あるいは(p[i][j+1]|p[i][j])+(u[i][j+1]|u[i][j])+carry_1の処理を行う。ここで、carry_1は出力レジスタ416の値である。p[i][1]+u[i][1]の処理が実行される場合は、入力ポート403から0が入力され、マルチプレクサ409で入力ポート403からの0が選択されて加算器410に入力される。それ以外の場合は、マルチプレクサ409で出力レジスタ416の値が選択されて加算器410に入力される。加算器410,411による加算処理の結果であるv[i][j]、v[i][j+1]、及び、加算処理時に発生するキャリー値であるcarry_1は、それぞれ出力レジスタ414〜416に格納され、出力ポート417〜419に出力される。   When the intermediate registers 405 and 406 output p [i] [j] | p [i] [j + 1], mask processing is performed so that the outputs of the AND gates 407 and 408 become zero. Therefore, the outputs of the adders 410 and 411 are p [i] [j] | p [i] [j + 1]. When the adders 410 and 411 output p [i] [j] | p [i] [j + 1], the variable shift registers 412 and 413 capture the outputs of the adders 410 and 411. As a result, p [i] [j] | p [i] [j + 1] is stored in the variable shift registers 412 and 413. Next, when the intermediate registers 405 and 406 output u [i] [j] | u [i] [j + 1], the variable shift registers 412 and 413 store p [i] [j] | p [I] [j + 1] is output. At this time, the mask processing is not performed in the AND gates 407 and 408, and the outputs of the variable shift registers 412 and 413 are input to the adders 410 and 411 via the AND gates 407 and 408. Then, the adders 410 and 411 receive p [i] [1] + u [i] [1] or (p [i] [j + 1] | p [i] [j]) + (u [i] [j + 1] | U [i] [j]) + carry_1. Here, carry_1 is the value of the output register 416. When the process of p [i] [1] + u [i] [1] is executed, 0 is input from the input port 403, and 0 from the input port 403 is selected by the multiplexer 409 and input to the adder 410. Is done. In other cases, the value of the output register 416 is selected by the multiplexer 409 and input to the adder 410. V [i] [j] and v [i] [j + 1], which are the results of the addition processing by the adders 410 and 411, and carry_1, which is the carry value generated during the addition processing, are stored in the output registers 414 to 416, respectively. And output to the output ports 417 to 419.

ここで、可変シフトレジスタ412,413は、レイテンシが変更可能なシフトレジスタであり、tの値によってレイテンシが定められる。例えば、t=0の場合はレイテンシを1とし、t=1の場合はレイテンシを2とする。このように、可変シフトレジスタ412,413は、t+1のレイテンシを持つように設定する。なお、可変シフトレジスタ412,413は、FPGAが持つ機能の1つであり、FPGA上でこのような機能を実現することは容易である。   Here, the variable shift registers 412 and 413 are shift registers whose latency can be changed, and the latency is determined by the value of t. For example, when t = 0, the latency is 1, and when t = 1, the latency is 2. Thus, the variable shift registers 412 and 413 are set to have a latency of t + 1. Note that the variable shift registers 412 and 413 are one of the functions of the FPGA, and it is easy to realize such functions on the FPGA.

図6は、演算回路C501の構成の一例を示すブロック図である。   FIG. 6 is a block diagram showing an example of the configuration of the arithmetic circuit C501.

図6に示した演算回路C501は、前述したアルゴリズムの擬似コードの多倍長加算処理(2)におけるループ処理のうち、j=0からj=t−1までの処理を行うものである。   The arithmetic circuit C501 shown in FIG. 6 performs the processing from j = 0 to j = t-1 in the loop processing in the multiple addition processing (2) of the pseudo code of the algorithm described above.

図3に示した演算回路A301が2t回のループ処理を行うのに対して、図6に示した演算回路C501はt回のループ処理を行うことに注意されたい。演算回路C501はclk1xを基準として動作する。このため、演算回路C501は、大部分の回路がclk2xで動作する演算回路A301の半分のループ回数を処理することとなる。   Note that the arithmetic circuit A301 illustrated in FIG. 3 performs 2t loop processing, whereas the arithmetic circuit C501 illustrated in FIG. 6 performs t loop processing. The arithmetic circuit C501 operates with reference to clk1x. For this reason, the arithmetic circuit C501 processes half the number of loops of the arithmetic circuit A301 in which most circuits operate on clk2x.

入力ポート502は、図5に示した演算回路B401の出力ポート417に接続されている。また、入力ポート503は、演算回路B401の出力ポート418に接続されている。入力ポート502,503から入力されるv[i][j+1]|v[i][j]は、可変シフトレジスタ512及び可変シフトレジスタ513の出力、あるいは、入力ポート504から入力されるデータと加算器510,511で加算処理される。この加算処理は上記擬似コードの(v[i][j+1]|v[i][j])+(s[i][j+2]|s[i][j+1])+carry_1の処理に対応する。加算器510,511は、加算結果s[i+1][j]、s[i+1][j+1]、及び、加算処理時に発生するキャリー値であるcarry_1を出力する。出力されたデータは、それぞれ出力レジスタ514〜516に格納される。また、s[i+1][j]、s[i+1][j+1]については可変シフトレジスタ512,513にも格納される。i=0の処理では、s[i][0]、・・・、s[i][t]であるため、加算処理は(v[0][j+1]|v[0][j])+0となる必要がある。そのため、この処理は、ANDゲート506,507の出力が0となるようにANDゲート506,507が制御され、入力ポート505から0が入力され、マルチプレクサ508で入力ポート505からの0が選択されて加算器510に入力される。   The input port 502 is connected to the output port 417 of the arithmetic circuit B401 shown in FIG. The input port 503 is connected to the output port 418 of the arithmetic circuit B401. V [i] [j + 1] | v [i] [j] input from the input ports 502 and 503 is added to the output of the variable shift register 512 and the variable shift register 513 or the data input from the input port 504. Adders 510 and 511 perform addition processing. This addition processing corresponds to the processing of (v [i] [j + 1] | v [i] [j]) + (s [i] [j + 2] | s [i] [j + 1]) + carry_1 of the pseudo code. Adders 510 and 511 output addition results s [i + 1] [j], s [i + 1] [j + 1], and carry_1, which is a carry value generated during the addition process. The output data is stored in output registers 514 to 516, respectively. Further, s [i + 1] [j] and s [i + 1] [j + 1] are also stored in the variable shift registers 512 and 513. In the process of i = 0, since s [i] [0],..., s [i] [t], the addition process is (v [0] [j + 1] | v [0] [j]) It needs to be +0. Therefore, in this processing, the AND gates 506 and 507 are controlled so that the outputs of the AND gates 506 and 507 become 0, 0 is input from the input port 505, and 0 from the input port 505 is selected by the multiplexer 508. Input to adder 510.

次に、加算処理の詳細について述べる。   Next, details of the addition processing will be described.

前述したように、可変シフトレジスタ512,513には、s[i+1][j]、s[i+1][j+1]が格納される。t=1の場合、i=0の処理後は、s[1][0]が可変シフトレジスタ512に格納され、s[1][1]が可変シフトレジスタ513に格納される。i=1の処理時には、加算器510への入力としてs[1][1]が必要となり、加算器511への入力としてs[1][2]が必要となる。このとき、s[1][1]は可変シフトレジスタ513に格納されているので、ANDゲート506を経由して加算器510に入力されるのに対し、s[1][2]は入力ポート504から入力されるものとする。s[1][1]及びs[1][2]に対する加算処理時に発生するキャリー値は、出力レジスタ516に格納された後、出力ポート519に出力される。i=2以降の処理も同様に行われる。   As described above, the variable shift registers 512 and 513 store s [i + 1] [j] and s [i + 1] [j + 1]. When t = 1, after the process of i = 0, s [1] [0] is stored in the variable shift register 512, and s [1] [1] is stored in the variable shift register 513. When i = 1, s [1] [1] is required as an input to the adder 510 and s [1] [2] is required as an input to the adder 511. At this time, since s [1] [1] is stored in the variable shift register 513, it is input to the adder 510 via the AND gate 506, whereas s [1] [2] is input port Assume that the input is made from 504. The carry value generated during the addition process for s [1] [1] and s [1] [2] is stored in the output register 516 and then output to the output port 519. The processing after i = 2 is performed in the same manner.

t=2の場合、i=0の処理後は、s[1][0]、s[1][2]が可変シフトレジスタ512に格納され、s[1][1]、s[1][3]が可変シフトレジスタ513に格納される。i=1の処理時には、加算器510への入力としてs[1][1]、s[1][3]が必要となり、加算器511への入力としてs[1][2]、s[1][4]が必要となる。このとき、t=1の場合と同様に、加算器510での処理に必要なデータは可変シフトレジスタ513に格納されているので、ANDゲート506を経由して加算器510に入力される。加算器511での処理に必要なデータのうち、s[1][2]は可変シフトレジスタ512に格納されているので、マルチプレクサ509及びANDゲート507を経由して加算器511に入力されるのに対し、s[1][4]は入力ポート504から入力されるものとする。s[1][1]及びs[1][2]に対する加算処理時に発生するキャリー値は、出力レジスタ516に格納された後、次のs[1][3]及びs[1][4]に対する加算処理に必要なcarry_1の値としてマルチプレクサ508を経由して加算器510に入力される。s[1][3]及びs[1][4]に対する加算処理時に発生するキャリー値は、出力レジスタ516に格納された後、出力ポート519に出力される。i=2以降の処理も同様に行われる。   In the case of t = 2, after the process of i = 0, s [1] [0], s [1] [2] are stored in the variable shift register 512, and s [1] [1], s [1] [3] is stored in the variable shift register 513. When i = 1, s [1] [1] and s [1] [3] are required as inputs to the adder 510, and s [1] [2] and s [ 1] [4] are required. At this time, as in the case of t = 1, data necessary for processing in the adder 510 is stored in the variable shift register 513 and is input to the adder 510 via the AND gate 506. Of the data necessary for processing in the adder 511, s [1] [2] is stored in the variable shift register 512, so that it is input to the adder 511 via the multiplexer 509 and the AND gate 507. In contrast, s [1] [4] is input from the input port 504. The carry value generated during the addition process for s [1] [1] and s [1] [2] is stored in the output register 516, and then the next s [1] [3] and s [1] [4] ] Is input to the adder 510 via the multiplexer 508 as the value of carry_1 necessary for the addition process. The carry value generated during the addition process for s [1] [3] and s [1] [4] is stored in the output register 516 and then output to the output port 519. The processing after i = 2 is performed in the same manner.

t=3以上の場合も、t=2の場合と同様に、可変シフトレジスタ512,513に格納済みのsの値は、前述したように、ANDゲート506を経由して加算器510に入力され、加算器510は入力されたsの値を用いて加算処理を行う。そして、可変シフトレジスタ512,513に格納されていないsの値は、前述したように、入力ポート504から入力され、加算器510は入力されたsの値を用いて加算処理を行う。   Also in the case of t = 3 or more, as in the case of t = 2, the value of s already stored in the variable shift registers 512 and 513 is input to the adder 510 via the AND gate 506 as described above. The adder 510 performs addition processing using the input value of s. Then, the value of s that is not stored in the variable shift registers 512 and 513 is input from the input port 504 as described above, and the adder 510 performs addition processing using the input value of s.

次に、図4に示した演算回路と図6に示した演算回路C501の入出力関係について述べる。   Next, the input / output relationship between the arithmetic circuit shown in FIG. 4 and the arithmetic circuit C501 shown in FIG. 6 will be described.

図6に示した演算回路C501の出力ポート518は図4に示した演算回路の入力ポート205に接続する。これによりq導出処理、即ち、v[i][0]+s[i][1]の処理に必要なs[i][1]の値を出力ポート518に出力されたタイミングで入力レジスタ202に格納し、加算器204で加算処理することでq[i+1]を導出することができる。   The output port 518 of the arithmetic circuit C501 shown in FIG. 6 is connected to the input port 205 of the arithmetic circuit shown in FIG. As a result, the value of s [i] [1] necessary for the q derivation process, that is, the process of v [i] [0] + s [i] [1] is output to the input register 202 at the timing when it is output to the output port 518. Q [i + 1] can be derived by storing and adding by the adder 204.

図7は、演算回路D601の構成の一例を示すブロック図である。   FIG. 7 is a block diagram showing an example of the configuration of the arithmetic circuit D601.

図7に示した演算回路D601は、前述したアルゴリズムの擬似コードの多倍長乗算処理(1)及び多倍長乗算処理(2)におけるループ処理のうち、j=2tからj=(4t−1)までの処理を行うものである。ここで、tは正の整数(t≠0)とする。この演算回路D601の処理は以下の擬似コード(以下、「擬似コードD」という)で表せる。   The arithmetic circuit D601 shown in FIG. 7 includes j = 2t to j = (4t−1) among the loop processing in the multiple-precision multiplication processing (1) and the multiple-precision multiplication processing (2) of the pseudo code of the algorithm described above. ). Here, t is a positive integer (t ≠ 0). The processing of the arithmetic circuit D601 can be expressed by the following pseudo code (hereinafter referred to as “pseudo code D”).

Figure 0005127241
Figure 0005127241

ここで、擬似コードDにおける右辺のcarry_kは、それぞれ図3に示した演算回路A301によるj=2t−1のときの処理で発生したキャリー値であるものとする。以下、擬似コードDと演算回路D601の各部との対応について説明する。   Here, carry_k on the right side in the pseudo code D is assumed to be a carry value generated in the process when j = 2t−1 by the arithmetic circuit A301 shown in FIG. Hereinafter, the correspondence between the pseudo code D and each part of the arithmetic circuit D601 will be described.

まず、入力ポート602から、擬似コードDのa[j]及びa[j+1]、もしくは、m[j]及びm[j+1]が同時に入力される。そのため、入力ポート602は、2kビットのバス幅を持つ。また、入力ポート603からは、擬似コードDのb[i]及びq[i−d]が入力される。入力ポート603は、中間レジスタ608,609を経由して、乗算器614と出力ポート616に接続されている。つまり、入力ポート603から入力されたデータは、レイテンシを2として乗算器614で乗算処理されるとともに、出力ポート616に出力される。   First, a [j] and a [j + 1] of pseudo code D or m [j] and m [j + 1] are simultaneously input from input port 602. Therefore, the input port 602 has a bus width of 2k bits. Also, b [i] and q [id] of the pseudo code D are input from the input port 603. The input port 603 is connected to the multiplier 614 and the output port 616 via the intermediate registers 608 and 609. That is, the data input from the input port 603 is multiplied by the multiplier 614 with a latency of 2, and is output to the output port 616.

入力ポート602,603では、データを入力する処理が、図3に示した演算回路A301と同様に行われる。つまり、入力処理aと入力処理mが、clk2xを基準として2tサイクルごとに交互に行われる。   In the input ports 602 and 603, data input processing is performed in the same manner as the arithmetic circuit A301 shown in FIG. That is, the input process a and the input process m are alternately performed every 2t cycles with reference to clk2x.

マルチプレクサ611は、clk2xを基準として入力レジスタ605と入力レジスタ606に格納されたデータを交互に選択する。中間レジスタ607には、マルチプレクサ611で選択されたデータが格納される。中間レジスタ607に入力処理aのデータが格納されている場合、そのデータと同じタイミングで中間レジスタ609からb[i]が乗算器614に入力される。一方、中間レジスタ607に入力処理mのデータが格納されている場合、そのデータと同じタイミングで中間レジスタ609からq[i−d]が乗算器614に入力される。   The multiplexer 611 alternately selects the data stored in the input register 605 and the input register 606 with reference to clk2x. The intermediate register 607 stores the data selected by the multiplexer 611. When the data of the input process a is stored in the intermediate register 607, b [i] is input from the intermediate register 609 to the multiplier 614 at the same timing as that data. On the other hand, when the data of the input process m is stored in the intermediate register 607, q [id] is input from the intermediate register 609 to the multiplier 614 at the same timing as that data.

これにより、乗算器614では、入力処理aに対応してb[i]・a[j]が処理され、入力処理mに対応してq[i−d]・m[j]が処理される。処理結果は、中間レジスタ610に格納される。   Thereby, the multiplier 614 processes b [i] · a [j] corresponding to the input process a, and processes q [id] · m [j] corresponding to the input process m. . The processing result is stored in the intermediate register 610.

次に、加算器615では、中間レジスタ610に格納された乗算器614による乗算処理の結果とcarry_kとの加算処理を行う。j=2tの場合のみ、carry_kの値として入力ポート604から入力される値がマルチプレクサ612で選択されて加算器615で用いられる。それ以外の場合は、図3に示した演算回路A301と同様に、1サイクル前の加算処理で発生したキャリー値がマルチプレクサ612で選択されて加算器615で用いられる。   Next, adder 615 performs addition processing of the result of multiplication processing by multiplier 614 stored in intermediate register 610 and carry_k. Only when j = 2t, the value input from the input port 604 as the value of carry_k is selected by the multiplexer 612 and used by the adder 615. In other cases, the carry value generated in the addition process one cycle before is selected by the multiplexer 612 and used in the adder 615, as in the arithmetic circuit A301 shown in FIG.

以上の処理により、出力ポート618には、入力処理aに対応してp[i][2t]からp[i][4t−1]が出力され、入力処理mに対応してu[i][2t]からu[i][4t−1]が出力される。また、出力ポート617には、出力ポート618に対応したcarry_kが出力される。出力ポート617,618には、clk2xを基準としてサイクルごとに各データが出力される。   Through the above processing, p [i] [2t-1] is output from the output port 618 corresponding to the input process a to p [i] [4t-1], and u [i] is output corresponding to the input process m. U [i] [4t-1] is output from [2t]. Also, carry_k corresponding to the output port 618 is output to the output port 617. Each data is output to the output ports 617 and 618 every cycle with reference to clk2x.

図2に示したように、j=2tからj=(4t−1)までの多倍長加算処理(1)におけるループ処理の回路は、図5に示した演算回路B401と同一の回路を図7に示した演算回路D601に接続して構成する。また、j=2tからj=(4t−1)までの多倍長加算処理(2)におけるループ処理の回路は、さらに、そこに図6に示した演算回路C501と同一の回路を接続して構成する。   As shown in FIG. 2, the circuit of the loop processing in the multiple length addition processing (1) from j = 2t to j = (4t-1) is the same circuit as the arithmetic circuit B401 shown in FIG. 7 is connected to the arithmetic circuit D601 shown in FIG. Further, the loop processing circuit in the multiple length addition processing (2) from j = 2t to j = (4t−1) is further connected to the same circuit as the arithmetic circuit C501 shown in FIG. Configure.

さらに、j=4t以降の処理も2tごとに図7に示した演算回路D601、図5に示した演算回路B401、図6に示した演算回路C501を所定の回数分用意して構成する。   Further, the processing after j = 4t is configured by preparing the arithmetic circuit D601 shown in FIG. 7, the arithmetic circuit B401 shown in FIG. 5, and the arithmetic circuit C501 shown in FIG.

図2において、モンゴメリ乗算回路201の回路構成のうち、演算回路A301及び演算回路D601の大部分(図3の多倍長乗算回路323、図7の多倍長乗算回路619)と演算回路A301の出力を格納する中間レジスタ203は、clk2xを基準として処理を行い、それ以外の回路は、clx1xを基準として処理を行う。そのため、モンゴメリ乗算回路201全体における入出力はclk1xを基準として行われる。これにより、外部回路は低い動作周波数で構成できるため、タイミング制約が緩くなり外部回路の設計条件を緩めることができる。例えば、FPGAに組み込まれているメモリに対する読み出し、書き込み処理を外部回路に利用できる。また、演算回路A301及び演算回路D601に、近年のFPGAに機能拡張として組み込まれている乗算処理及び加算処理の専用回路を用いることにより、専用回路が動作可能な高い動作周波数をそのまま活用した処理が可能となり、高速で効率のよい処理が実現できる。   2, in the circuit configuration of the Montgomery multiplication circuit 201, most of the arithmetic circuit A301 and the arithmetic circuit D601 (the multiple length multiplication circuit 323 in FIG. 3 and the multiple length multiplication circuit 619 in FIG. 7) and the arithmetic circuit A301. The intermediate register 203 that stores the output performs processing with reference to clk2x, and the other circuits perform processing with reference to clx1x. Therefore, input / output in the entire Montgomery multiplication circuit 201 is performed with reference to clk1x. Thereby, since the external circuit can be configured with a low operating frequency, the timing constraint is relaxed and the design conditions of the external circuit can be relaxed. For example, read / write processing for a memory incorporated in an FPGA can be used for an external circuit. In addition, the processing circuit A301 and the processing circuit D601 use a dedicated circuit for multiplication processing and addition processing incorporated as a function expansion in recent FPGAs, so that processing using the high operating frequency at which the dedicated circuit can operate is used as it is. This makes it possible to realize high-speed and efficient processing.

次に、図2に示したモンゴメリ乗算回路201全体の動作について説明する。   Next, the operation of the entire Montgomery multiplication circuit 201 shown in FIG. 2 will be described.

まず、演算回路A301が、図3を用いて説明した処理を開始する。演算回路A301がi=0における入力処理aを完了した後、つまり、処理開始からclk2xを基準として2tサイクル後(clk1xを基準とした場合はtサイクル後)、演算回路A301に接続されている演算回路D601が入力処理aを開始する。同様に、clk2xを基準として2tサイクルごとに、順次隣の演算回路D601が入力処理aを開始する。以降、前述したアルゴリズムの擬似コード全体の処理が完了するまで各演算回路が処理を行う。演算結果は、図2の一番左側の演算回路C501により、s[n+d+1][1]|s[n+d+1][0]からs[n+d+1][2t−1]|s[n+d+1][2t−2]まで順次2kビットずつが、clk1xを基準としてtサイクル間出力される。この出力後、続けて右隣の演算回路C501により、s[n+d+1][2t+1]|s[n+d+1][2t]からs[n+d+1][4t−1]|s[n+d+1][4t−2]まで順次2kビットずつが、clk1xを基準としてtサイクル間出力される。以降、順次隣の演算回路C501により、演算結果が、clk1xを基準としてtサイクル間出力される。また、演算結果として必要なs[n+d][1]、・・・、s[n+1][1]は一番左側の演算回路C501により出力される。   First, the arithmetic circuit A301 starts the processing described with reference to FIG. After the arithmetic circuit A301 completes the input process a at i = 0, that is, after 2t cycles from the start of the process, using clk2x as a reference (after t cycles if clk1x is used as a reference), the arithmetic connected to the arithmetic circuit A301 The circuit D601 starts the input process a. Similarly, the adjacent arithmetic circuit D601 sequentially starts the input process a every 2t cycles with reference to clk2x. Thereafter, each arithmetic circuit performs processing until the processing of the entire pseudo code of the algorithm is completed. The calculation result is output from s [n + d + 1] [1] | s [n + d + 1] [0] to s [n + d + 1] [2t−1] | s [n + d + 1] [2t−2 by the leftmost arithmetic circuit C501 in FIG. ], 2 k bits are output sequentially for t cycles with reference to clk1x. After this output, the operation circuit C501 on the right next continues from s [n + d + 1] [2t + 1] | s [n + d + 1] [2t] to s [n + d + 1] [4t−1] | s [n + d + 1] [4t−2]. Sequentially, 2k bits are output for t cycles with reference to clk1x. Thereafter, the calculation result is sequentially output for t cycles by the adjacent calculation circuit C501 with reference to clk1x. In addition, s [n + d] [1],..., S [n + 1] [1] necessary as calculation results are output by the leftmost calculation circuit C501.

図8は、モンゴメリ乗算回路201の動作(剰余演算方法)を示すフローチャートである。   FIG. 8 is a flowchart showing the operation (residue calculation method) of the Montgomery multiplication circuit 201.

ここで、前述したアルゴリズムの擬似コードにおいて、
被乗数A={An+d,・・・,A,A}(An+d,・・・,Aの各々の値は0)、
乗数B={Bn+d,・・・,B,B}(Bn+d,・・・,Bの各々の値を0)、
M’’’=={M,M,・・・,Mn+d}、
中間値Q={Qn+d+1,・・・,Q,Q,Q−1,・・・,Q−d}、
中間結果S={Sn+d+1,・・・,S,S}、
A及びBの乗算結果P={Pn+d,・・・,P,P}、
M及びQの乗算結果U={Un+d,・・・,U,U}、
P及びUの加算結果V={Vn+d,・・・,V,V}とする。
Here, in the pseudo code of the algorithm described above,
Multiplicand A = {A n + d, ···, A 1, A 0} (A n + d, ···, each of the values of A n 0),
Multiplier B = {B n + d ,..., B 1 , B 0 } (each value of B n + d ,..., B n is 0),
M ′ ″ == {M 0 , M 1 ,..., M n + d },
Intermediate value Q = {Q n + d + 1 ,..., Q 1 , Q 0 , Q −1 ,.
Intermediate result S = {S n + d + 1 ,..., S 1 , S 0 },
Multiplication result of A and B P = {P n + d ,..., P 1 , P 0 },
M and Q multiplication results U = {U n + d ,..., U 1 , U 0 },
The addition result of P and U is V = {V n + d ,..., V 1 , V 0 }.

モンゴメリ乗算回路201(剰余演算装置)は、Sの値を0に設定し、例えばメモリに格納しておく(ステップS101)。また、モンゴメリ乗算回路201は、Q,Q−1,・・・,Q−dの各々の値を0に設定し、例えばメモリに格納しておく(ステップS102)。 Montgomery multiplication circuit 201 (residue arithmetic device), stores the value of S 0 is set to 0, for example, in the memory (step S101). Further, the Montgomery multiplication circuit 201 sets each value of Q 0 , Q −1 ,..., Q −d to 0 and stores it in, for example, a memory (step S102).

モンゴメリ乗算回路201は、カウンタiを0に設定してループ処理を開始する(ステップS103)。   The Montgomery multiplication circuit 201 sets the counter i to 0 and starts loop processing (step S103).

演算回路A301及び演算回路D601(多倍長乗算部)は、所定の動作周波数clk1xの2倍の動作周波数clk2xにて、i回目の処理で、AとBとの乗算処理を乗算器316,614で行い、その乗算結果Pを出力する(ステップS104:多倍長乗算ステップの一部)。また、演算回路A301及び演算回路D601は、2倍の動作周波数clk2xにて、i回目の処理で、M’’’とQi−dとの乗算処理を乗算器316,614で行い、その乗算結果Uを出力する(ステップS105:多倍長乗算ステップの一部)。このステップS105において、演算回路A301及び演算回路D601は、後述するように、i−1回目の処理のステップS108で出力されるQを遅延させたQi−dを用いて、M’’’とQi−dとの乗算処理を行う。本実施の形態では、ステップS105において、演算回路A301は、i回目の処理で、M’’’の最初のkビットとQi−dとの乗算処理を行った後、その乗算結果とステップS104で出力したPの最初のkビットとの加算処理を加算器317で行い、その加算結果をVの最初のkビットとして出力する。 The arithmetic circuit A301 and the arithmetic circuit D601 (multiple-length multiplier) perform multiplication processing of A and B i in the i-th processing at the operating frequency clk2x that is twice the predetermined operating frequency clk1x. In step 614, the multiplication result Pi is output (step S104: part of the multiple length multiplication step). The arithmetic circuit A301 and the arithmetic circuit D601 is at twice the operating frequency clk2x, in i-th processing, performed by the multiplier 316,614 a process of multiplying the M '''and Q i-d, the multiplication The result U i is output (step S105: part of the multiple multiplication step). In this step S105, as will be described later, the arithmetic circuit A301 and the arithmetic circuit D601 use the Q i-d obtained by delaying Q i output in step S108 of the (i−1) -th process to use M ′ ″. And Q i-d are multiplied. In this embodiment, in step S105, the arithmetic circuit A301 is a i-th process, after the process of multiplying the first k bits and Q i-d of M ''', the multiplication result and the step S104 The adder 317 performs addition processing with the first k bits of P i output in step S3, and outputs the addition result as the first k bits of V i .

演算回路B401(多倍長加算部)は、所定の動作周波数clk1xにて、i回目の処理で、ステップS104で出力されたPとステップS105で出力されたUとの加算処理を加算器410,411で行い、その加算結果Vを出力する(ステップS106:多倍長加算ステップの一部)。その後、演算回路C501(多倍長加算部)は、1回目の処理では、ステップS106で出力されたVとステップS101でメモリに格納されたSとの加算処理を加算器510,511で行い、その加算結果をSとして出力する。また、演算回路C501は、2回目以降のi回目の処理では、ステップS106で出力されたVとi−1回目の処理で出力したSとの加算処理を加算器510,511で行い、その加算結果をSi+1として出力する(ステップS107:多倍長加算ステップの一部)。本実施の形態では、ステップS107において、演算回路C501は、i回目の処理で、VとSとの加算処理を行った後、Si+1を可変シフトレジスタ512,513に格納し、tの大きさに合わせてタイミングを調整した上で、可変シフトレジスタ512,513からSi+1を出力する。 Arithmetic circuit B 401 (multiple length adder unit) at a predetermined operating frequency clk1x, in i-th processing, the adder an addition process between the outputted U i at P i and step S105 which is output in step S104 carried out at 410 and 411, and outputs the addition result V i (step S106: part of multiple length adding step). Thereafter, the arithmetic circuit C501 (multiple length adder unit) is the first process, an addition process between the S 0 stored in the memory at V 0 and step S101 which is output in step S106 in the adder 510, 511 performed, and outputs the sum as S 1. In addition, in the second and subsequent i-th processing, the arithmetic circuit C501 performs addition processing of V i output in step S106 and S i output in the i− 1th processing by the adders 510 and 511, The addition result is output as S i + 1 (step S107: part of the multiple length addition step). In the present embodiment, in step S107, the arithmetic circuit C501 performs the addition process of V i and S i in the i-th process, and then stores S i + 1 in the variable shift registers 512 and 513. After adjusting the timing according to the size, S i + 1 is output from the variable shift registers 512 and 513.

図4に示した演算回路(中間値導出部)は、i回目の処理で、ステップS105で出力されたVの最初のkビットとステップS107で出力されたSの2番目のkビットとの加算処理を加算器204で行い、その加算結果をQi+1として出力する(ステップS108:中間値導出ステップ)。ここで、図4に示した演算回路は、ステップS106で出力されたVを用いて、Vの最初のkビットとSの2番目のkビットとの加算処理を行ってもよい。この場合、ステップS105において、演算回路A301はVの最初のkビットを演算しなくてもよい。 The arithmetic circuit (intermediate value deriving unit) shown in FIG. 4 performs the first k bits of V i output in step S105 and the second k bits of S i output in step S107 in the i- th process. Are added by the adder 204, and the addition result is output as Q i + 1 (step S108: intermediate value deriving step). Here, the arithmetic circuit shown in FIG. 4 may perform addition processing of the first k bits of V i and the second k bits of S i using V i output in step S106. In this case, in step S105, the arithmetic circuit A301 may not calculate the first k bits of V i .

モンゴメリ乗算回路201は、カウンタiがn+dになるまで、iを1ずつインクリメントし、上記処理をn+d+1回繰り返す(ステップS109)。   The Montgomery multiplication circuit 201 increments i by 1 until the counter i reaches n + d, and repeats the above process n + d + 1 times (step S109).

演算回路C501(剰余演算部)は、ループ処理が終了した後、直前(即ち、n+d+1回の処理)のステップS107で出力されたSn+d+1とそれより前のd回の処理(時間的に逆の順でいえば、n+d回目からn+1回目まで)のステップS107で出力されたSn+dからSn+1までの各々の2番目のkビットとを連結してビット列S n+d+2≡ABR−1mod(M)を得る(ステップS110:剰余演算ステップ)。 n+d+2 ≡ABR −1 mod(M)がモンゴメリ乗算の結果である。なお、前述したように、モンゴメリ乗算は、除算処理をビットシフトで置き換えた剰余演算である。 After the loop processing ends, the arithmetic circuit C501 (remainder operation unit) outputs S n + d + 1 output in step S107 immediately before (that is, n + d + 1 processing) and d processing (reverse in time). In order, the bit string S n + d + 2 ≡ABR −1 mod (M) by concatenating the second k bits from S n + d to S n + 1 output in step S107 ( from n + d to n + 1 ). the obtained (step S110: remainder operation step). S n + d + 2 ≡ABR −1 mod (M) is the result of Montgomery multiplication. As described above, Montgomery multiplication is a remainder operation in which division processing is replaced with bit shift.

以上のように、本実施の形態に係る剰余演算装置は、多倍長乗算処理と多倍長加算処理を分離し、多倍長乗算処理は多倍長加算処理の2倍の動作周波数で実行されることを特徴とする。   As described above, the remainder calculation apparatus according to the present embodiment separates the multiple length multiplication process and the multiple length addition process, and the multiple length multiplication process is executed at twice the operating frequency of the multiple length addition process. It is characterized by being.

前記剰余演算装置は、多倍長加算処理において、各サイクルあたりに処理するビット長が多倍長乗算処理の2倍の長さであることを特徴とする。   The remainder calculation device is characterized in that in the multiple length addition process, the bit length processed per cycle is twice as long as the multiple length multiplication process.

前記剰余演算装置は、多倍長乗算処理は図3及び図7に示した回路構成を持つことを特徴とする。   The remainder arithmetic unit has the circuit configuration shown in FIGS. 3 and 7 for the multiple length multiplication process.

前記剰余演算装置は、多倍長加算処理は図5及び図6に示した回路構成を持つことを特徴とする。   The remainder arithmetic unit has the circuit configuration shown in FIGS. 5 and 6 for the multiple length addition process.

前記剰余演算装置は、多倍長加算処理のうち、最初のkビットの処理のみ多倍長乗算処理用の回路で行い、多倍長乗算処理で必要な中間値の導出を高速化することを特徴とする。   The remainder calculating device performs only the first k-bit processing in the multiple length addition processing in the multiple length multiplication processing circuit, and accelerates the derivation of the intermediate value necessary for the multiple length multiplication processing. Features.

前記剰余演算装置は、多倍長加算処理用の回路において、多倍長加算処理の結果を可変シフトレジスタに格納し、格納した値を多倍長加算処理に必要なタイミングで可変シフトレジスタから出力することで、任意のループ回数に対応することを特徴とする。つまり、本実施の形態に係る剰余演算装置では、入力データのビット長に合わせてループ回数を調整することが可能である。   The remainder arithmetic unit stores the result of the multiple length addition process in the variable shift register in the circuit for the multiple length addition process, and outputs the stored value from the variable shift register at a timing required for the multiple length addition process. By doing so, it is possible to deal with an arbitrary number of loops. That is, in the remainder calculation apparatus according to the present embodiment, the number of loops can be adjusted according to the bit length of the input data.

FPGAを用いたセキュリティチップの構成を示すブロック図である。It is a block diagram which shows the structure of the security chip using FPGA. モンゴメリ乗算回路の構成を示すブロック図である。It is a block diagram which shows the structure of a Montgomery multiplication circuit. 多倍長乗算処理(1)及び多倍長乗算処理(2)を行う演算回路Aの構成の一例を示すブロック図である。It is a block diagram which shows an example of a structure of the arithmetic circuit A which performs a multiple length multiplication process (1) and a multiple length multiplication process (2). q導出処理を行う演算回路の構成の一例を示すブロック図である。It is a block diagram which shows an example of a structure of the arithmetic circuit which performs q derivation | leading-out process. 多倍長加算処理(1)を行う演算回路Bの構成の一例を示すブロック図である。It is a block diagram which shows an example of a structure of the arithmetic circuit B which performs a multiple length addition process (1). 多倍長加算処理(2)を行う演算回路Cの構成の一例を示すブロック図である。It is a block diagram which shows an example of a structure of the arithmetic circuit C which performs a multiple length addition process (2). 多倍長乗算処理(1)及び多倍長乗算処理(2)を行う演算回路Dの構成の一例を示すブロック図である。It is a block diagram which shows an example of the structure of the arithmetic circuit D which performs a multiple length multiplication process (1) and a multiple length multiplication process (2). モンゴメリ乗算回路の動作を示すフローチャートである。It is a flowchart which shows operation | movement of a Montgomery multiplication circuit.

符号の説明Explanation of symbols

101 セキュリティチップ、102 CPU、103 内部メモリ、104 外部インタフェース、105 暗号処理回路用メモリ、201 モンゴメリ乗算回路、202 入力レジスタ、203 中間レジスタ、204 加算器、205 入力ポート、301 演算回路A、302,303,304,305 入力ポート、306,307 マルチプレクサ、308,309,310,311,312 入力レジスタ、313,314,315 中間レジスタ、316 乗算器、317 加算器、318 マルチプレクサ、319,320,321 出力ポート、322 出力レジスタ、323 多倍長乗算回路、401 演算回路B、402,403 入力ポート、404,405,406 中間レジスタ、407,408 ANDゲート、409 マルチプレクサ、410,411 加算器、412,413 可変シフトレジスタ、414,415,416 出力レジスタ、417,418 出力ポート、501 演算回路C、502,503,504,505 入力ポート、506,507 ANDゲート、508,509 マルチプレクサ、510,511 加算器、512,513 可変シフトレジスタ、514,515,516 出力レジスタ、517,518,519,520 出力ポート、601 演算回路D、602,603,604 入力ポート、605,606 入力レジスタ、607,608,609,610 中間レジスタ、611,612 マルチプレクサ、613 出力レジスタ、614 乗算器、615 加算器、616,617,618 出力ポート、619 多倍長乗算回路。   DESCRIPTION OF SYMBOLS 101 Security chip, 102 CPU, 103 Internal memory, 104 External interface, 105 Encryption processing memory, 201 Montgomery multiplication circuit, 202 Input register, 203 Intermediate register, 204 Adder, 205 Input port, 301 Arithmetic circuit A, 302, 303, 304, 305 Input port, 306, 307 Multiplexer, 308, 309, 310, 311, 312 Input register, 313, 314, 315 Intermediate register, 316 Multiplier, 317 Adder, 318 Multiplexer, 319, 320, 321 Output Port, 322 output register, 323 multiple length multiplication circuit, 401 arithmetic circuit B, 402, 403 input port, 404, 405, 406 intermediate register, 407, 408 AND gate, 409 Chipplexer, 410, 411 adder, 412, 413 variable shift register, 414, 415, 416 output register, 417, 418 output port, 501 arithmetic circuit C, 502, 503, 504, 505 input port, 506, 507 AND gate, 508, 509 Multiplexer, 510, 511 Adder, 512, 513 Variable shift register, 514, 515, 516 Output register, 517, 518, 519, 520 Output port, 601 Arithmetic circuit D, 602, 603, 604 Input port, 605 , 606 input register, 607, 608, 609, 610 intermediate register, 611, 612 multiplexer, 613 output register, 614 multiplier, 615 adder, 616, 617, 618 output port, 619 multiple length multiplication times .

Claims (7)

被乗数をA、乗数をB、法をM、中間値をQとし、A及びBの乗算結果とM及びQの乗算結果と中間結果Sとの加算結果に基づいて、モンゴメリ乗算の結果を得る剰余演算装置において、
所定の動作周波数の2倍の動作周波数にて、A及びBの乗算処理とM及びQの乗算処理とを乗算器で行い、それぞれの乗算結果を出力する多倍長乗算部と、
前記所定の動作周波数にて、前記多倍長乗算部により出力された2つの乗算結果とSとの加算処理を複数の加算器で行い、加算器ごとの加算結果を出力する多倍長加算部と、
前記多倍長加算部により出力された加算器ごとの加算結果を連結してモンゴメリ乗算の結果を得る剰余演算部とを備え、
前記多倍長乗算部は、前記2倍の動作周波数の各サイクルにて、所定のビット長の乗算処理を行い、
前記多倍長加算部は、前記所定の動作周波数の各サイクルにて、前記所定のビット長の2倍の長さの加算処理を行うことを特徴とする剰余演算装置。
The remainder for obtaining the result of the Montgomery multiplication based on the addition result of the multiplication result of A and B, the multiplication result of M and Q, and the intermediate result S, where the multiplicand is A, the multiplier is B, the modulus is M, and the intermediate value is Q. In the arithmetic unit,
A multiple length multiplication unit that performs multiplication processing of A and B and multiplication processing of M and Q by a multiplier at an operation frequency that is twice the predetermined operation frequency, and outputs each multiplication result;
A multiple length addition unit that performs addition processing of two multiplication results output by the multiple length multiplication unit and S at the predetermined operating frequency with a plurality of adders, and outputs the addition result for each adder When,
A remainder calculation unit that obtains a result of Montgomery multiplication by concatenating the addition results for each adder output by the multiple length addition unit;
The multiple length multiplication unit performs multiplication processing of a predetermined bit length in each cycle of the double operating frequency,
The multiple-precision adding unit performs addition processing of a length twice as long as the predetermined bit length in each cycle of the predetermined operating frequency.
被乗数をA、乗数をB、法をM、中間値をQとし、A及びBの乗算結果とM及びQの乗算結果と中間結果Sとの加算結果に基づいて、モンゴメリ乗算の結果を得る剰余演算装置において、
所定の動作周波数の2倍の動作周波数にて、A及びBの乗算処理とM及びQの乗算処理とを乗算器で行い、それぞれの乗算結果を出力する多倍長乗算部と、
前記所定の動作周波数にて、前記多倍長乗算部により出力された2つの乗算結果とSとの加算処理を複数の加算器で行い、加算器ごとの加算結果を出力する多倍長加算部と、
前記多倍長加算部により出力された加算器ごとの加算結果を連結してモンゴメリ乗算の結果を得る剰余演算部とを備え、
前記剰余演算装置は、
Bのビット長をkビット×n、遅延パラメータをdとし、
B={Bn+d,・・・,B,B}、Bn+d,・・・,Bの各々の値を0とし、
Q={Qn+d+1,・・・,Q,Q,Q−1,・・・,Q−d}、Q,Q−1,・・・,Q−dの各々の値を0とし、
M’’’=(M’’+1)/2k(d+1)、M’’=M’(mod(2k(d+1)))M、(−MM’)mod(2k(d+1))=1とし、
S={Sn+d+1,・・・,S,S}、Sの各々の値を0とし、
kn−1mod(M)=1とし、
A及びBの乗算結果P={Pn+d,・・・,P,P}とし、
M及びQの乗算結果U={Un+d,・・・,U,U}とし、
P及びUの加算結果V={Vn+d,・・・,V,V}とし、
カウンタiを0からn+dまで1ずつインクリメントしてn+d+1回の処理を繰り返すループ処理を行い、
前記多倍長乗算部は、前記2倍の動作周波数にて、各回の処理で、AとBとの乗算処理を行い、当該乗算結果Pを出力するとともに、各回の処理で、M’’’とQi−dとの乗算処理を行い、当該乗算結果Uを出力し、
前記多倍長加算部は、前記所定の動作周波数にて、各回の処理で、前記多倍長乗算部により出力されたPとUとの加算処理を行い、当該加算結果Vを出力した後、初回の処理では、VとSとの加算処理を行い、当該加算結果をSとして出力し、2回目以降の処理では、Vと前回の処理で出力したSとの加算処理を行い、当該加算結果をSi+1として出力し、
前記剰余演算装置は、さらに、
各回の処理で、Vの最初のkビットとSの2番目のkビットとの加算処理を加算器で行い、当該加算結果をQi+1として出力する中間値導出部を備え、
前記多倍長乗算部は、各回の処理で、前記中間値導出部により前回の処理で出力されたQを遅延させたQi−dを用いて、M’’’とQi−dとの乗算処理を行い、
前記剰余演算部は、n+d+1回目の処理の後、前記多倍長加算部により出力されたSn+d+1とSn+dからSn+1までの各々の2番目のkビットとを連結しビット列S n+d+2≡ABR−1mod(M)を得ることを特徴とする剰余演算装置。
The remainder for obtaining the result of the Montgomery multiplication based on the addition result of the multiplication result of A and B, the multiplication result of M and Q, and the intermediate result S, where the multiplicand is A, the multiplier is B, the modulus is M, and the intermediate value is Q. In the arithmetic unit,
A multiple length multiplication unit that performs multiplication processing of A and B and multiplication processing of M and Q by a multiplier at an operation frequency that is twice the predetermined operation frequency, and outputs each multiplication result;
A multiple length addition unit that performs addition processing of two multiplication results output by the multiple length multiplication unit and S at the predetermined operating frequency with a plurality of adders, and outputs the addition result for each adder When,
A remainder calculation unit that obtains a result of Montgomery multiplication by concatenating the addition results for each adder output by the multiple length addition unit;
The remainder calculation device is:
The bit length of B is k bits × n, the delay parameter is d,
B = {B n + d, ···, B 1, B 0}, B n + d, ···, a value of each of B n is 0,
Q = {Q n + d + 1 ,..., Q 1 , Q 0 , Q −1 ,..., Q −d }, Q 0 , Q −1 ,. ,
M ′ ″ = (M ″ +1) / 2 k (d + 1) , M ″ = M ′ (mod (2 k (d + 1) )) M, (−MM ′) mod (2 k (d + 1) ) = 1 and
S = {S n + d + 1 ,..., S 1 , S 0 }, S 0 is set to 0,
2 kn R −1 mod (M) = 1,
The multiplication result of A and B is P = {P n + d ,..., P 1 , P 0 },
The multiplication result of M and Q is U = {U n + d ,..., U 1 , U 0 },
The addition result of P and U is V = {V n + d ,..., V 1 , V 0 },
Perform a loop process that increments the counter i by 1 from 0 to n + d and repeats n + d + 1 times,
The multiple length multiplication unit performs multiplication processing of A and B i in each processing at the twice operating frequency, outputs the multiplication result P i , and performs M ′ in each processing. '' And Q i-d are multiplied, the multiplication result U i is output,
The multiple length adder unit, said at a predetermined operating frequency, each time the process performs the addition of the P i and U i output by the multiple length multiplication unit, the addition result output V i After that, in the first process, V 0 and S 0 are added, and the addition result is output as S 1. In the second and subsequent processes, V i and S i output in the previous process are output. Addition process is performed, and the addition result is output as S i + 1 .
The remainder calculation device further includes:
In each process, an adder performs addition processing of the first k bits of V i and the second k bits of S i , and includes an intermediate value deriving unit that outputs the addition result as Q i + 1 .
The multiple length multiplication unit, each time the process, using the Q i-d delayed the Q i output by the previous processing by said intermediate value derivation unit, and M '''and Q i-d The multiplication process of
The remainder operation unit, n + after d + 1 th processing, the multiple length adder unit by the outputted S n + d + 1 and S n + d after connecting the second k bits of each of up to S n + 1 bit sequence S n + d + 2 ≡ A remainder calculation apparatus characterized by obtaining ABR −1 mod (M).
前記多倍長乗算部は、各回の処理で、M’’’の最初のkビットとQi−dとの乗算処理を行った後、当該乗算結果とPの最初のkビットとの加算処理を加算器で行い、当該加算結果をVの最初のkビットとして出力し、
前記中間値導出部は、各回の処理で、前記多倍長乗算部により出力されたVの最初のkビットを用いて、Vの最初のkビットとSの2番目のkビットとの加算処理を行うことを特徴とする請求項2に記載の剰余演算装置。
The multiple length multiplication unit performs a multiplication process of the first k bits of M ′ ″ and Q i-d in each process, and then adds the multiplication result and the first k bits of P i. Processing is performed by an adder, and the addition result is output as the first k bits of V i .
The intermediate value deriving unit uses the first k bits of V i output by the multiple length multiplication unit in each processing, and uses the first k bits of V i and the second k bits of S i. The remainder calculation apparatus according to claim 2, wherein addition processing is performed.
前記多倍長加算部は、各回の処理で、VとSとの加算処理を行った後、Si+1を可変シフトレジスタに格納し、前記可変シフトレジスタからSi+1を出力するタイミングを調整することを特徴とする請求項2に記載の剰余演算装置。 The multiple length addition unit performs addition processing of V i and S i in each process, and then stores S i + 1 in the variable shift register and adjusts the timing for outputting S i + 1 from the variable shift register. The remainder calculation apparatus according to claim 2, wherein: 前記剰余演算装置は、前記2倍の動作周波数にて、多倍長データの乗算処理を行う多倍長乗算回路を予め具備するFPGA(Field・Programmable・Gate・Array)により実装され、
前記多倍長乗算部は、前記多倍長乗算回路により乗算処理を行うことを特徴とする請求項1から4のいずれかに記載の剰余演算装置。
The remainder calculation device is implemented by an FPGA (Field / Programmable / Gate / Array) preliminarily provided with a multiple-precision multiplication circuit that performs multiplication processing of multiple-precision data at the double operating frequency.
5. The remainder calculation device according to claim 1, wherein the multiple length multiplication unit performs multiplication processing by the multiple length multiplication circuit.
被乗数をA、乗数をB、法をM、中間値をQとし、A及びBの乗算結果とM及びQの乗算結果と中間結果Sとの加算結果に基づいて、モンゴメリ乗算の結果を得る剰余演算方法において、
所定の動作周波数の2倍の動作周波数にて、A及びBの乗算処理とM及びQの乗算処理とを行い、それぞれの乗算結果を出力する多倍長乗算ステップと、
前記所定の動作周波数にて、前記多倍長乗算ステップで出力された2つの乗算結果とSとの加算処理を複数の加算器で行い、加算器ごとの加算結果を出力する多倍長加算ステップと、
前記多倍長加算ステップで出力された加算器ごとの加算結果を連結してモンゴメリ乗算の結果を得る剰余演算ステップとを備え、
前記多倍長乗算ステップでは、前記2倍の動作周波数の各サイクルにて、所定のビット長の乗算処理を行い、
前記多倍長加算ステップでは、前記所定の動作周波数の各サイクルにて、前記所定のビット長の2倍の長さの加算処理を行うことを特徴とする剰余演算方法。
The remainder for obtaining the result of the Montgomery multiplication based on the addition result of the multiplication result of A and B, the multiplication result of M and Q, and the intermediate result S, where the multiplicand is A, the multiplier is B, the modulus is M, and the intermediate value is Q. In the calculation method,
A multiple length multiplication step of performing multiplication processing of A and B and multiplication processing of M and Q at an operation frequency twice as high as a predetermined operation frequency, and outputting each multiplication result;
Multiple- precision addition step of performing addition processing of two multiplication results output in the multiple-precision multiplication step and S at the predetermined operating frequency with a plurality of adders and outputting the addition results for each adder When,
A remainder calculation step of obtaining a result of Montgomery multiplication by concatenating the addition results for each adder output in the multiple length addition step,
In the multiple length multiplication step, a multiplication process of a predetermined bit length is performed in each cycle of the double operating frequency,
In the multiple length addition step, an addition process of a length twice the predetermined bit length is performed in each cycle of the predetermined operating frequency.
被乗数をA、乗数をB、法をM、中間値をQとし、A及びBの乗算結果とM及びQの乗算結果と中間結果Sとの加算結果に基づいて、モンゴメリ乗算の結果を得る剰余演算方法において、
所定の動作周波数の2倍の動作周波数にて、A及びBの乗算処理とM及びQの乗算処理とを行い、それぞれの乗算結果を出力する多倍長乗算ステップと、
前記所定の動作周波数にて、前記多倍長乗算ステップで出力された2つの乗算結果とSとの加算処理を複数の加算器で行い、加算器ごとの加算結果を出力する多倍長加算ステップと、
前記多倍長加算ステップで出力された加算器ごとの加算結果を連結してモンゴメリ乗算の結果を得る剰余演算ステップとを備え、
前記剰余演算方法は、
Bのビット長をkビット×n、遅延パラメータをdとし、
B={Bn+d,・・・,B,B}、Bn+d,・・・,Bの各々の値を0とし、
Q={Qn+d+1,・・・,Q,Q,Q−1,・・・,Q−d}、Q,Q−1,・・・,Q−dの各々の値を0とし、
M’’’=(M’’+1)/2k(d+1)、M’’=M’(mod(2k(d+1)))M、(−MM’)mod(2k(d+1))=1とし、
S={Sn+d+1,・・・,S,S}、Sの各々の値を0とし、
kn−1mod(M)=1とし、
A及びBの乗算結果P={Pn+d,・・・,P,P}とし、
M及びQの乗算結果U={Un+d,・・・,U,U}とし、
P及びUの加算結果V={Vn+d,・・・,V,V}とし、
カウンタiを0からn+dまで1ずつインクリメントしてn+d+1回の処理を繰り返すループ処理を行い、
前記多倍長乗算ステップでは、前記2倍の動作周波数にて、各回の処理で、AとBとの乗算処理を行い、当該乗算結果Pを出力するとともに、各回の処理で、M’’’とQi−dとの乗算処理を行い、当該乗算結果Uを出力し、
前記多倍長加算ステップでは、前記所定の動作周波数にて、各回の処理で、前記多倍長乗算ステップで出力されたPとUとの加算処理を行い、当該加算結果Vを出力した後、初回の処理では、VとSとの加算処理を行い、当該加算結果をSとして出力し、2回目以降の処理では、Vと前回の処理で出力したSとの加算処理を行い、当該加算結果をSi+1として出力し、
前記剰余演算方法は、さらに、
各回の処理で、Vの最初のkビットとSの2番目のkビットとの加算処理を加算器で行い、当該加算結果をQi+1として出力する中間値導出ステップを備え、
前記多倍長乗算ステップでは、各回の処理で、前記中間値導出ステップで前回の処理で出力されたQを遅延させたQi−dを用いて、M’’’とQi−dとの乗算処理を行い、
前記剰余演算ステップでは、n+d+1回目の処理の後、前記多倍長加算ステップで出力されたSn+d+1とSn+dからSn+1までの各々の2番目のkビットとを連結しビット列S n+d+2≡ABR−1mod(M)を得ることを特徴とする剰余演算方法。
The remainder for obtaining the result of the Montgomery multiplication based on the addition result of the multiplication result of A and B, the multiplication result of M and Q, and the intermediate result S, where the multiplicand is A, the multiplier is B, the modulus is M, and the intermediate value is Q. In the calculation method,
A multiple length multiplication step of performing multiplication processing of A and B and multiplication processing of M and Q at an operation frequency twice as high as a predetermined operation frequency, and outputting each multiplication result;
Multiple- precision addition step of performing addition processing of two multiplication results output in the multiple-precision multiplication step and S at the predetermined operating frequency with a plurality of adders and outputting the addition results for each adder When,
A remainder calculation step of obtaining a result of Montgomery multiplication by concatenating the addition results for each adder output in the multiple length addition step,
The remainder calculation method is:
The bit length of B is k bits × n, the delay parameter is d,
B = {B n + d, ···, B 1, B 0}, B n + d, ···, a value of each of B n is 0,
Q = {Q n + d + 1 ,..., Q 1 , Q 0 , Q −1 ,..., Q −d }, Q 0 , Q −1 ,. ,
M ′ ″ = (M ″ +1) / 2 k (d + 1) , M ″ = M ′ (mod (2 k (d + 1) )) M, (−MM ′) mod (2 k (d + 1) ) = 1 and
S = {S n + d + 1 ,..., S 1 , S 0 }, S 0 is set to 0,
2 kn R −1 mod (M) = 1,
The multiplication result of A and B is P = {P n + d ,..., P 1 , P 0 },
The multiplication result of M and Q is U = {U n + d ,..., U 1 , U 0 },
The addition result of P and U is V = {V n + d ,..., V 1 , V 0 },
Perform a loop process that increments the counter i by 1 from 0 to n + d and repeats n + d + 1 times,
In the multiple length multiplication step, multiplication processing of A and B i is performed in each processing at the double operating frequency, and the multiplication result P i is output, and in each processing, M ′ '' And Q i-d are multiplied, the multiplication result U i is output,
In the multiple length adding step, wherein at a predetermined operating frequency, each time the process performs the addition of the P i and U i output by the multiple-precision multiplication step, the addition result output V i After that, in the first process, V 0 and S 0 are added, and the addition result is output as S 1. In the second and subsequent processes, V i and S i output in the previous process are output. Addition process is performed, and the addition result is output as S i + 1 .
The remainder calculation method further includes:
In each process, an adder performs an addition process of the first k bits of V i and the second k bits of S i , and includes an intermediate value derivation step for outputting the addition result as Q i + 1 .
In the multiple-length multiplication step, M ′ ″ and Q i-d are obtained by using Q i-d obtained by delaying Q i output in the previous process in the intermediate value derivation step in each process. The multiplication process of
In the remainder calculating step, after n + d + 1-th processing, S n + d + 1 output in the multiple length addition step and each second k bit from S n + d to S n + 1 are connected to form a bit string S n + d + 2 ≡ A remainder calculation method characterized by obtaining ABR −1 mod (M).
JP2007010538A 2007-01-19 2007-01-19 Residue calculation device and residue calculation method Active JP5127241B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007010538A JP5127241B2 (en) 2007-01-19 2007-01-19 Residue calculation device and residue calculation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007010538A JP5127241B2 (en) 2007-01-19 2007-01-19 Residue calculation device and residue calculation method

Publications (2)

Publication Number Publication Date
JP2008176136A JP2008176136A (en) 2008-07-31
JP5127241B2 true JP5127241B2 (en) 2013-01-23

Family

ID=39703197

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007010538A Active JP5127241B2 (en) 2007-01-19 2007-01-19 Residue calculation device and residue calculation method

Country Status (1)

Country Link
JP (1) JP5127241B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681818A (en) * 2011-03-09 2012-09-19 上海华虹集成电路有限责任公司 128-bit modulo addition circuit based on UCPS (unified content protection system) encryption algorithm and control method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR970003979B1 (en) * 1993-11-29 1997-03-24 삼성전자 주식회사 Multiplexer
US7434192B2 (en) * 2004-12-13 2008-10-07 Altera Corporation Techniques for optimizing design of a hard intellectual property block for data transmission

Also Published As

Publication number Publication date
JP2008176136A (en) 2008-07-31

Similar Documents

Publication Publication Date Title
Güneysu et al. Ultra high performance ECC over NIST primes on commercial FPGAs
Khan et al. High-Speed and Low-Latency ECC Processor Implementation Over GF ($2^{m}) $ on FPGA
Suzuki How to maximize the potential of FPGA resources for modular exponentiation
Kumar et al. Are standards compliant elliptic curve cryptosystems feasible on RFID
Chelton et al. Fast elliptic curve cryptography on FPGA
Blum et al. Montgomery modular exponentiation on reconfigurable hardware
CN107545292B (en) Method and circuit for dynamic power control
Güneysu Utilizing hard cores of modern FPGA devices for high-performance cryptography
US7046800B1 (en) Scalable methods and apparatus for Montgomery multiplication
Hossain et al. Efficient fpga implementation of modular arithmetic for elliptic curve cryptography
US20090089350A1 (en) Modular reduction operator
Elkhatib et al. Accelerated RISC-V for post-quantum SIKE
Batina et al. Flexible hardware design for RSA and elliptic curve cryptosystems
KR100478974B1 (en) Serial finite-field multiplier
US20090037508A1 (en) Method for implementing montgomery modular multiplication and device therefore
JP5127241B2 (en) Residue calculation device and residue calculation method
JP3659320B2 (en) Multiplication module, multiplication inverse element operation circuit, multiplication inverse element operation control system, device using the multiplication inverse element operation, encryption device, error correction decoder
Baktır et al. A state-of-the-art elliptic curve cryptographic processor operating in the frequency domain
Zhang et al. High-Performance ECC Scalar Multiplication Architecture Based on Comb Method and Low-Latency Window Recoding Algorithm
Elbirt et al. Instruction-level distributed processing for symmetric-key cryptography
EP1455270A2 (en) Method and apparatus for basis conversion in finite field and a multiplier
Zimmermann et al. High-performance integer factoring with reconfigurable devices
Koppermann et al. Fast FPGA implementations of Diffie-Hellman on the Kummer surface of a genus-2 curve
Issad et al. Efficient and scalable hardware implementation of montgomery modular multiplication
Ch et al. Hardware design of a 256-bit prime field multiplier suitable for computing bilinear pairings

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20091027

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120508

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120613

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20120703

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121002

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20121009

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20121030

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121030

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 5127241

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20151109

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250