Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7286239B2 - Arithmetic processing method, arithmetic processing device, and semiconductor device - Google Patents
[go: Go Back, main page]

JP7286239B2 - Arithmetic processing method, arithmetic processing device, and semiconductor device - Google Patents

Arithmetic processing method, arithmetic processing device, and semiconductor device Download PDF

Info

Publication number
JP7286239B2
JP7286239B2 JP2019036619A JP2019036619A JP7286239B2 JP 7286239 B2 JP7286239 B2 JP 7286239B2 JP 2019036619 A JP2019036619 A JP 2019036619A JP 2019036619 A JP2019036619 A JP 2019036619A JP 7286239 B2 JP7286239 B2 JP 7286239B2
Authority
JP
Japan
Prior art keywords
bit
multiplication
cpu
arithmetic
remainder
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
JP2019036619A
Other languages
Japanese (ja)
Other versions
JP2020140120A (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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics 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 Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2019036619A priority Critical patent/JP7286239B2/en
Publication of JP2020140120A publication Critical patent/JP2020140120A/en
Application granted granted Critical
Publication of JP7286239B2 publication Critical patent/JP7286239B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Executing Machine-Instructions (AREA)

Description

本発明は、演算処理方法、演算処理装置、及び半導体装置に関する。 The present invention relates to an arithmetic processing method, an arithmetic processing device, and a semiconductor device.

暗号処理分野では、乗算剰余の算出処理が行われる。例えば、非特許文献1~3には、モンゴメリ乗算剰余について開示されている。非特許文献1には、モンゴメリ乗算剰余の基本的な内容が開示されている。非特許文献1によれば、モンゴメリ乗算剰余の算出には、数回の乗算とシフト演算とが組み合わされる旨記載されている。モンゴメリ乗算剰余は、除算を必要とせず、他の乗算剰余アルゴリズムと比べて極めて高速で実行することが可能である。このため、モンゴメリ乗算剰余は、暗号処理分野において広く利用されている。 In the field of cryptographic processing, processing for calculating a remainder of multiplication is performed. For example, Non-Patent Documents 1 to 3 disclose the Montgomery modular multiplication. Non-Patent Document 1 discloses the basic content of the Montgomery multiplication modulo. Non-Patent Document 1 describes that the calculation of the Montgomery multiplication remainder involves combining several multiplications and shift operations. Montgomery modulo multiplication does not require division and can be performed very quickly compared to other modulo multiplication algorithms. For this reason, the Montgomery modular multiplication is widely used in the field of cryptographic processing.

非特許文献2~3には、nビットモンゴメリ乗算剰余を用いて、2nビットモンゴメリ乗算剰余を算出する方法が開示されている。 Non-Patent Documents 2 and 3 disclose a method of calculating a 2n-bit Montgomery multiplication remainder using an n-bit Montgomery multiplication remainder.

Montgomery, Peter L. "Modular multiplication without trial division." Mathematics of computation 44.170 (1985): 519-521.Montgomery, Peter L. "Modular multiplication without trial division." Mathematics of computation 44.170 (1985): 519-521. Yoshino, Masayuki, Katsuyuki Okeya, and Camille Vuillaume. "Montgomery multiplication with twice the bit-length of multipliers." IEICE transactions on fundamentals of electronics, communications and computer sciences 91.1 (2008): 203-210.Yoshino, Masayuki, Katsuyuki Okeya, and Camille Vuillaume. "Montgomery multiplication with twice the bit-length of multipliers." IEICE transactions on fundamentals of electronics, communications and computer sciences 91.1 (2008): 203-210. Yoshino, Masayuki, Katsuyuki Okeya, and Camille Vuillaume. "Recursive Double-Size Modular Multiplications from Euclidean and Montgomery Multipliers." IEICE transactions on fundamentals of electronics, communications and computer sciences 93.1 (2010): 180-187.Yoshino, Masayuki, Katsuyuki Okeya, and Camille Vuillaume. "Recursive Double-Size Modular Multiplications from Euclidean and Montgomery Multipliers." IEICE transactions on fundamentals of electronics, communications and computer sciences 93.1 (2010): 180-187.

ここで、従来の暗号処理における、nビットモンゴメリ乗算剰余を用いた2nビットモンゴメリ乗算剰余の算出方法について説明する。図16は、暗号処理を行う従来の演算処理装置の構成の一例を示す図である。演算処理装置1001は、CPU(Central Processing Unit)10、演算器1020、メモリ30を備えている。CPU10は、メモリ30に保持されたプログラムを読み出し、プログラムに基づく命令を演算器1020に送信する。また、CPU10は、演算器1020における演算に必要なデータを、メモリ30から読み出し演算器1020に送信する。 Here, a method of calculating a 2n-bit Montgomery multiplication remainder using an n-bit Montgomery multiplication remainder in conventional cryptographic processing will be described. FIG. 16 is a diagram showing an example of the configuration of a conventional arithmetic processing device that performs cryptographic processing. The arithmetic processing device 1001 includes a CPU (Central Processing Unit) 10 , an arithmetic unit 1020 and a memory 30 . The CPU 10 reads out the program held in the memory 30 and transmits an instruction based on the program to the calculator 1020 . In addition, the CPU 10 reads out data necessary for computation in the computing unit 1020 from the memory 30 and transmits the data to the computing unit 1020 .

演算器1020は、CPU10から受信した命令及びデータに基づき、モンゴメリ乗算剰余算出の演算等を含むマルチ演算(MultMonDiv)を行う。 The calculator 1020 performs multi-calculation (MultMonDiv) including calculation of Montgomery modular multiplication, etc. based on the instructions and data received from the CPU 10 .

メモリ30は、RAM(Random Access Memory)等を備え、CPU10で実行するプログラムや、CPU10や演算器1020における演算結果、演算処理装置1001の設定情報等のデータを保持する。 The memory 30 includes a RAM (Random Access Memory) or the like, and holds data such as programs to be executed by the CPU 10, calculation results in the CPU 10 and the arithmetic unit 1020, and setting information of the arithmetic processing unit 1001.

図17は、従来の暗号処理における2nビットモンゴメリ乗算剰余の算出に係るアルゴリズムを示す図である。図18は、マルチ演算のアルゴリズムを示す図である。図19は、図17のアルゴリズムに対応するフロー図である。図17、図19に示すように、2nビットモンゴメリ乗算剰余の算出には、それぞれの入力値に対し、6回のマルチ演算(Step1~Step6)が順次実行される。そして、各Stepにおける演算結果を用いて、2nビットモンゴメリ乗算剰余が出力値(Output)として算出される。なお、図19における各ステップを示す符号は、後述する図3等と対応している。 FIG. 17 is a diagram showing an algorithm for calculating a 2n-bit Montgomery multiplication remainder in conventional cryptographic processing. FIG. 18 is a diagram showing a multi-operation algorithm. FIG. 19 is a flow diagram corresponding to the algorithm of FIG. As shown in FIGS. 17 and 19, in calculating the 2n-bit Montgomery multiplication remainder, six multi-operations (Step 1 to Step 6) are sequentially executed for each input value. Then, a 2n-bit Montgomery multiplication residue is calculated as an output value (Output) using the calculation result in each step. 19 correspond to those in FIG. 3 and the like, which will be described later.

図18に示すように、それぞれのマルチ演算(MultMonDiv)では、例えば「x」、「y」、「w」を入力とし、「q」、「r」が出力される。図18に示すように、それぞれのマルチ演算では、1行目及び4行目において、nビットモンゴメリ乗算剰余の算出(MultMon)が行われる。すなわち、2nビットモンゴメリ乗算(2nビットモンゴメリ乗算剰余)の算出には、12回のnビットモンゴメリ乗算剰余の算出を行う必要がある。 As shown in FIG. 18, in each multi-operation (MultMonDiv), for example, "x", "y" and "w" are input and "q" and "r" are output. As shown in FIG. 18, in each multi-operation, calculation of an n-bit Montgomery multiplication remainder (MultMon) is performed on the first and fourth lines. That is, in order to calculate the 2n-bit Montgomery multiplication (2n-bit Montgomery multiplication remainder), it is necessary to calculate the n-bit Montgomery multiplication remainder 12 times.

図20は、nビットモンゴメリ乗算剰余の算出に係る演算量と、nビット乗算に係る演算量とを比較する図である。図20に示すように、nビットモンゴメリ乗算剰余の算出に要する演算量は、nビット乗算に要する演算量よりも多く、nビットモンゴメリ乗算剰余の算出には、nビット乗算の1.5倍以上の演算時間が必要となる。そうすると、2nビットモンゴメリ乗算剰余の算出には、nビット乗算の18倍以上の演算時間が必要となる。 FIG. 20 is a diagram for comparing the amount of computation involved in calculating the n-bit Montgomery multiplication remainder and the amount of computation involved in n-bit multiplication. As shown in FIG. 20, the amount of calculation required to calculate the n-bit Montgomery multiplication remainder is greater than the amount of calculation required for the n-bit multiplication, and the calculation of the n-bit Montgomery multiplication remainder requires 1.5 times or more of the n-bit multiplication. of calculation time is required. Then, calculation of the 2n-bit Montgomery multiplication remainder requires an operation time that is 18 times longer than the n-bit multiplication.

その他の課題と新規な特徴は、本明細書の記述および添付図面から明らかになるであろう。 Other problems and novel features will become apparent from the description of the specification and the accompanying drawings.

本明細書には、複数の実施の形態の演算処理方法等が記載されているが、一実施の形態の演算処理方法を述べると、次の通りである。演算処理方法は、CPUと、CPUの命令によりnビットモンゴメリ乗算剰余の算出、又はnビット乗算を切り換えて行う演算器と、メモリと、を備えた演算処理装置において、nビットの整数倍のビット数のモンゴメリ乗算剰余を算出する演算処理方法である。演算処理方法は、CPUが、メモリから読み出したプログラムに基づき、nビットモンゴメリ乗算剰余の算出、又はnビット乗算から演算方法を選択する第1ステップと、CPUが、選択した演算方法による演算を演算器に実行させる第2ステップと、を有する。 Although the arithmetic processing method and the like of a plurality of embodiments are described in this specification, the arithmetic processing method of one embodiment is as follows. The arithmetic processing method is an arithmetic processing unit comprising a CPU, an arithmetic unit that switches between n-bit Montgomery multiplication remainder or n-bit multiplication according to instructions from the CPU, and a memory. An arithmetic processing method for calculating a Montgomery multiplication remainder of a number. The arithmetic processing method includes a first step in which the CPU selects an arithmetic method from n-bit Montgomery multiplication remainder calculation or n-bit multiplication based on a program read from the memory, and the CPU performs an arithmetic operation according to the selected arithmetic method. and a second step causing the device to perform the second step.

一実施の形態によれば、nビットモンゴメリ乗算剰余を用いたnビットの整数倍のビット数のモンゴメリ乗算剰余の算出に要する演算時間を短縮することが可能となる。 According to one embodiment, it is possible to shorten the operation time required to calculate the Montgomery multiplication remainder having the number of bits that is an integral multiple of n bits using the n-bit Montgomery multiplication remainder.

図1は、本発明の実施の形態1に係る演算処理装置の構成の一例を示す図である。FIG. 1 is a diagram showing an example of the configuration of an arithmetic processing device according to Embodiment 1 of the present invention. 図2は、本発明の実施の形態1に係る2nビットモンゴメリ乗算剰余算出のアルゴリズムを例示する図である。FIG. 2 is a diagram illustrating an algorithm for calculating a 2n-bit Montgomery modular multiplication according to Embodiment 1 of the present invention. 図3は、図2のアルゴリズムに対応するフロー図である。FIG. 3 is a flow diagram corresponding to the algorithm of FIG. 図4は、本発明の実施の形態1の変形例に係る2nビットモンゴメリ乗算剰余算出のアルゴリズムを例示する図である。FIG. 4 is a diagram illustrating an algorithm for calculating a 2n-bit Montgomery modular multiplication according to the modification of the first embodiment of the present invention. 図5は、図4のアルゴリズムに対応するフロー図である。FIG. 5 is a flow diagram corresponding to the algorithm of FIG. 図6は、本発明の実施の形態2に係る演算処理装置の構成の一例を示す図である。FIG. 6 is a diagram showing an example of the configuration of an arithmetic processing device according to Embodiment 2 of the present invention. 図7は、本発明の実施の形態3に係る3nビットモンゴメリ乗算剰余算出のアルゴリズムを例示する図である。FIG. 7 is a diagram illustrating an algorithm for 3n-bit Montgomery modular multiplication calculation according to the third embodiment of the present invention. 図8は、図7のアルゴリズムに対応するフロー図である。FIG. 8 is a flow diagram corresponding to the algorithm of FIG. 図9は、本発明の実施の形態4に係る演算処理装置の構成の一例を示す図である。FIG. 9 is a diagram showing an example of the configuration of an arithmetic processing device according to Embodiment 4 of the present invention. 図10は、本発明の実施の形態4におけるマルチ演算とnビット乗算とを並列実行させる手順の一例を示す図である。FIG. 10 is a diagram showing an example of a procedure for parallel execution of multi-operation and n-bit multiplication according to Embodiment 4 of the present invention. 図11は、本発明の実施の形態4におけるマルチ演算とnビット乗算とを並列実行させる手順の他の例を示す図である。FIG. 11 is a diagram showing another example of a procedure for parallel execution of multi-operation and n-bit multiplication according to Embodiment 4 of the present invention. 図12は、本発明の実施の形態5に係る演算処理装置の構成の一例を示す図である。FIG. 12 is a diagram showing an example of a configuration of an arithmetic processing device according to Embodiment 5 of the present invention. 図13は、本発明の実施の形態5に係るマルチ演算のアルゴリズムを例示する図である。FIG. 13 is a diagram illustrating an algorithm for multi-operation according to Embodiment 5 of the present invention. 図14は、図13のアルゴリズムに対応するフロー図である。FIG. 14 is a flow diagram corresponding to the algorithm of FIG. 図15は、図13のアルゴリズムに対応するフロー図である。FIG. 15 is a flow diagram corresponding to the algorithm of FIG. 図16は、暗号処理を行う従来の演算処理装置の構成の一例を示す図である。FIG. 16 is a diagram showing an example of the configuration of a conventional arithmetic processing device that performs cryptographic processing. 図17は、従来の暗号処理における2nビットモンゴメリ乗算剰余の算出に係るアルゴリズムを示す図である。FIG. 17 is a diagram showing an algorithm for calculating a 2n-bit Montgomery multiplication remainder in conventional cryptographic processing. 図18は、マルチ演算のアルゴリズムを示す図である。FIG. 18 is a diagram showing a multi-operation algorithm. 図19は、図17のアルゴリズムに対応するフロー図である。FIG. 19 is a flow diagram corresponding to the algorithm of FIG. 図20は、nビットモンゴメリ乗算剰余の算出に係る演算量と、nビット乗算に係る演算量とを比較する図である。FIG. 20 is a diagram for comparing the amount of computation involved in calculating the n-bit Montgomery multiplication remainder and the amount of computation involved in n-bit multiplication.

以下、本発明の実施の形態を図面に基づいて詳細に説明する。なお、実施の形態を説明するためのすべての図において、同一部分には原則として同一の符号を付し、その繰り返しの説明は省略する。 BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In all the drawings for explaining the embodiments, the same parts are basically denoted by the same reference numerals, and repeated explanations thereof will be omitted.

(実施の形態1)
本実施の形態では、nビットモンゴメリ乗算剰余の算出を含むマルチ演算(MultMonDiv)と、nビット乗算とを、CPUが適宜選択することにより、2nビットモンゴメリ乗算剰余の算出が行われる。
(Embodiment 1)
In the present embodiment, the 2n-bit Montgomery multiplication remainder is calculated by the CPU appropriately selecting the multi-operation (MultMonDiv) including the calculation of the n-bit Montgomery multiplication remainder and the n-bit multiplication.

<演算処理装置の構成>
図1は、本発明の実施の形態1に係る演算処理装置の構成の一例を示す図である。図1は図16に類似しており、演算器1020が演算器20に置き換えられている点が異なる。演算器20は、CPU10の命令により、nビットモンゴメリ乗算剰余の算出(MultMon)と、nビット乗算とを切り換えて実行する。
<Configuration of arithmetic processing unit>
FIG. 1 is a diagram showing an example of the configuration of an arithmetic processing device according to Embodiment 1 of the present invention. FIG. 1 is similar to FIG. 16, except that calculator 1020 is replaced with calculator 20. FIG. The calculator 20 switches between calculation of an n-bit Montgomery multiplication remainder (MultMon) and n-bit multiplication according to instructions from the CPU 10 .

図2は、本発明の実施の形態1に係る2nビットモンゴメリ乗算剰余算出のアルゴリズムを例示する図である。本実施の形態における2nビットモンゴメリ乗算剰余算出には、図2に示すStep1~Step6等の演算処理が実行される。図2に示すように、Step1、Step2、Step4、Step6ではnビット乗算が実行され、Step3、Step5ではnビットモンゴメリ乗算剰余の算出や加減算を含むマルチ演算(MultMonDiv)が実行される。 FIG. 2 is a diagram illustrating an algorithm for calculating a 2n-bit Montgomery modular multiplication according to Embodiment 1 of the present invention. In the calculation of the 2n-bit Montgomery multiplication remainder in the present embodiment, arithmetic processing such as Steps 1 to 6 shown in FIG. 2 is executed. As shown in FIG. 2, Step 1, Step 2, Step 4, and Step 6 execute n-bit multiplication, and Step 3 and Step 5 execute n-bit Montgomery multiplication remainder calculation and multi-operation (MultMonDiv) including addition and subtraction.

具体的に説明すると、図2のアルゴリズムでは、A=am+a、B=bm+b、N=nm+nを入力として、2nビットの各値{r、q}、{r、q}、(q、r)、{r、q}、(q、r)、{r、q}が算出される。なお、m:=2、M:=m=22nである。a、b、nは各値(A、B、N)における上位ビット(nビット)、a、b、nは各値(A、B、N)における下位ビット(nビット)を示している。また、rは算出された各値の上位ビット(nビット)であり、qは算出された各値の下位ビット(nビット)を示している。 Specifically, in the algorithm of FIG. 2, A=a 1 m+a 0 , B=b 1 m+b 0 , N=n 1 m+n 0 are input, and 2n-bit values {r 0 , q 0 }, { r 1 , q 1 }, (q 2 , r 2 ), {r 3 , q 3 }, (q 4 , r 4 ), {r 5 , q 5 } are calculated. Note that m:=2 n and M:=m 2 =2 2n . a 1 , b 1 , n 1 are upper bits (n bits) in each value (A, B, N), a 0 , b 0 , n 0 are lower bits (n bits) in each value (A, B, N) ). Also, r is the upper bit (n bits) of each calculated value, and q is the lower bit (n bits) of each calculated value.

Step1では、[a、b]を入力として、これらの乗算が実行される。これにより、2nビットの値{r、q}が算出される。Step2では、[a+a、b+b]を入力として、これらの乗算が算出される。これにより、2nビットの値{r、q}が算出される。Step3では、[a、b、n]を入力として、マルチ演算(MultMonDiv)が実行される。これにより、2nビットの値(q、r)が算出される。 In Step 1, [a 1 , b 1 ] are input and their multiplication is executed. Thereby, a 2n-bit value {r 0 , q 0 } is calculated. In Step 2, [a 1 +a 0 , b 1 +b 0 ] are input and their multiplication is calculated. Thereby, a 2n-bit value {r 1 , q 1 } is calculated. In Step 3, [a 0 , b 0 , n 0 ] are input and multi-operation (MultMonDiv) is executed. As a result, a 2n-bit value (q 2 , r 2 ) is calculated.

Step4では、[q、n]を入力として、これらの乗算が実行される。これにより、2nビットの値{r、q}が算出される。Step5では、[-q+q+r-q、1、n]を入力として、マルチ演算(MultMonDiv)が実行される。これにより、2nビットの値(q、r)が算出される。Step6では、[q、n]を入力として、これらの乗算が実行される。これにより、2nビットの値{r、q}が算出される。 In Step 4, [q 2 , n 1 ] are input and these multiplications are executed. Thereby, a 2n-bit value {r 3 , q 3 } is calculated. In Step 5, [-q 0 +q 1 +r 2 -q 3 , 1, n 0 ] are input and multi-operation (MultMonDiv) is executed. As a result, a 2n-bit value (q 4 , r 4 ) is calculated. In Step 6, [q 4 , n 1 ] are input and these multiplications are executed. As a result, a 2n-bit value {r 5 , q 5 } is calculated.

そして、これらの演算結果を用いて、以下の式(1)により、2nビットモンゴメリ乗算剰余が出力値として算出される。 Then, using these calculation results, a 2n-bit Montgomery multiplication residue is calculated as an output value according to the following equation (1).

A*B*M-1(mod N)=(r+r-r)m+(q-r+r-r+q-r+r-q) ・・・(1)
<演算処理方法>
図3は、図2のアルゴリズムに対応するフロー図である。図3のフロー図は、ステップS101~S108を含む。ステップS101では、CPU10は、メモリ30に対してカウント値の初期化を実行し、カウント値を「1」に設定する。ここで、カウント値とは、図2のアルゴリズムにおける処理の進捗状況を識別する値である。詳しくは後述するが、各Stepの処理が完了するごとに、カウント値が更新される。例えば、カウント値が「4」に設定されていれば、図2における処理がStep3まで完了していることが示される。
A*B*M −1 (mod N)=(r 0 +r 3 −r 5 )m+(q 0 −r 0 +r 1 −r 2 +q 3 −r 3 +r 4 −q 5 ) (1)
<Arithmetic processing method>
FIG. 3 is a flow diagram corresponding to the algorithm of FIG. The flow diagram of FIG. 3 includes steps S101-S108. In step S101, the CPU 10 initializes the count value in the memory 30 and sets the count value to "1". Here, the count value is a value that identifies the progress of processing in the algorithm of FIG. Although details will be described later, the count value is updated each time the processing of each step is completed. For example, if the count value is set to "4", it indicates that the processing up to Step 3 in FIG. 2 has been completed.

ステップS102では、図2の各Stepに対応する入力値の準備が行われる。CPU10は、メモリ30から読み出したプログラムに基づき、各Stepの入力値を作成する。例えば、Step1であれば、CPU10は、入力値[a、b]を作成する。また、Step2、5では、CPU10は、加減算を行って入力値を作成する。 In step S102, input values corresponding to each step in FIG. 2 are prepared. The CPU 10 creates input values for each step based on the program read from the memory 30 . For example, in Step 1, the CPU 10 creates input values [a 1 , b 1 ]. In Steps 2 and 5, the CPU 10 performs addition and subtraction to create an input value.

ステップS103では、カウント値に応じて、演算方法が選択される。具体的に述べると、カウント値が「3、5」の場合(Yes)、CPU10は、マルチ演算(MultMonDiv)、すなわちnビットモンゴメリ乗算剰余の算出を選択し、ステップS104の処理が実行される。一方、カウント値がそれ以外の値である場合(No)、CPU10は、乗算を選択し、ステップS105の処理が実行される。 In step S103, a calculation method is selected according to the count value. Specifically, when the count value is "3, 5" (Yes), the CPU 10 selects multi-operation (MultMonDiv), that is, calculation of n-bit Montgomery multiplication remainder, and the process of step S104 is executed. On the other hand, if the count value is any other value (No), the CPU 10 selects multiplication, and the process of step S105 is executed.

CPU10は、ステップS102で作成した入力値を送信するとともに、選択した演算方法を実行するため、演算器20に演算方法を命令する。 The CPU 10 transmits the input value created in step S102 and instructs the computing unit 20 to execute the selected computing method.

例えば、Step1では、カウント値が「1」に設定されているので、CPU10は、乗算を選択する。そして、CPU10は、入力値[a、b]を送信し、演算器20に乗算を行うよう命令する。 For example, in Step 1, the count value is set to "1", so the CPU 10 selects multiplication. The CPU 10 then transmits the input values [a 1 , b 1 ] and commands the calculator 20 to perform multiplication.

ステップS105では、演算器20は、CPU10からの命令に従い、受信した入力値を用いた乗算を行う。例えば、Step1では、演算器20は、入力値[a、b]を用いたnビット乗算を行い、2nビットの値{r、q}を算出する。算出された値は、メモリ30に保持される。 In step S<b>105 , the calculator 20 performs multiplication using the received input value according to the command from the CPU 10 . For example, in Step 1, the calculator 20 performs n-bit multiplication using input values [a 1 , b 1 ] to calculate 2n-bit values {r 0 , q 0 }. The calculated value is held in the memory 30 .

ステップS104では、演算器20におけるnビットモンゴメリ乗算剰余の算出や、CPU10による加減算等の処理が実行される。ステップS104は、図3に示すように、ステップS104a~S104cを有する。 In step S104, calculation of an n-bit Montgomery multiplication residue in the arithmetic unit 20 and processing such as addition and subtraction by the CPU 10 are executed. Step S104 has steps S104a to S104c, as shown in FIG.

ステップS104aでは、図18の1行目に対応するnビットモンゴメリ乗算剰余の算出が行われる。CPU10は、読み出したプログラムに基づき、演算器20に対し、nビットモンゴメリ乗算剰余の算出を行うよう命令し、図18に示す入力値[x、y、w]を送信する。入力値は、図2のStep3では[a、b、n]であり、Step5では[-q+q+r-q、1、n]である。CPU10の命令に基づき、演算器20は、入力された値を用いてnビットモンゴメリ乗算剰余の算出を行い、出力値の上位ビットの値rを算出する。ここで算出された値rは、メモリ30に保持される。 In step S104a, an n-bit Montgomery multiplication residue corresponding to the first line in FIG. 18 is calculated. Based on the read program, the CPU 10 instructs the calculator 20 to calculate the n-bit Montgomery multiplication remainder, and transmits the input values [x, y, w] shown in FIG. The input values are [a 0 , b 0 , n 0 ] in Step 3 of FIG. 2 and [−q 0 +q 1 +r 2 −q 3 , 1, n 0 ] in Step 5. Based on a command from the CPU 10, the arithmetic unit 20 uses the input value to calculate an n-bit Montgomery multiplication remainder, and calculates the value r of the high-order bits of the output value. The value r calculated here is held in the memory 30 .

ステップS104bでは、図18の4行目に対応するnビットモンゴメリ乗算剰余の算出が行われる。なお、ステップS104bの入力となる図18の2~3行目の演算は、例えばCPU10において実行される。CPU10は、プログラムに基づき、演算器20に対し、nビットモンゴメリ乗算剰余の算出を行うよう命令し、図18の2~3行目に対応する値等を入力値として送信する。演算器20は、入力された値を用いてnビットモンゴメリ乗算剰余の算出を行い、出力値の下位ビットの算出用の値r’を算出する。 In step S104b, an n-bit Montgomery multiplication residue corresponding to the fourth line in FIG. 18 is calculated. Note that the calculations on the second and third lines in FIG. 18, which are the inputs in step S104b, are executed by the CPU 10, for example. Based on the program, the CPU 10 instructs the calculator 20 to calculate the n-bit Montgomery multiplication remainder, and transmits the values corresponding to the second and third lines in FIG. 18 as input values. The calculator 20 calculates an n-bit Montgomery multiplication remainder using the input value, and calculates a value r' for calculating the lower bits of the output value.

そして、ステップS104cにおいて、CPU10は、図18の6~8行目に対応する加算等の各演算を行い、出力値の下位ビットの値qを算出する。そして、CPU10は、出力値として2nビットの値(q、r)を作成する。算出された値は、メモリ30に保持される。 Then, in step S104c, the CPU 10 performs each operation such as addition corresponding to the 6th to 8th lines in FIG. 18, and calculates the lower bit value q of the output value. Then, the CPU 10 creates a 2n-bit value (q, r) as an output value. The calculated value is held in the memory 30 .

例えば、Step3において、CPU10は、演算器20に対し入力値[a、b、n]に基づくnビットモンゴメリ乗算剰余の算出を2回実行させ、加算等の演算を行って2nビットの値(q、r)を算出する。また、Step5において、CPU10は、演算器20に対し入力値[-q+q+r-q、1、n]に基づくnビットモンゴメリ乗算剰余の算出を2回実行させ、加算等の演算を行って2nビットの値(q、r)を算出する。 For example, in Step 3, the CPU 10 causes the arithmetic unit 20 to twice calculate the n-bit Montgomery multiplication residue based on the input values [a 0 , b 0 , n 0 ], and performs an operation such as addition to obtain 2n-bit Calculate the values (q 2 , r 2 ). In Step 5, the CPU 10 causes the arithmetic unit 20 to twice calculate the n-bit Montgomery multiplication remainder based on the input value [-q 0 +q 1 +r 2 -q 3 , 1, n 0 ], An operation is performed to calculate a 2n-bit value (q 4 , r 4 ).

ステップS106では、カウント値が「6」であるかどうかが判定される。CPU10は、カウント値が「6」でないと判定した場合(No)、ステップS107において、カウント値を「+1」加算する処理を行う。例えば、Step1の処理が行われた場合、CPU10は、カウント値を1+1=2に更新し、更新したカウント値をメモリ30に保持させる。そして、ステップS102に戻り、Step2以降の処理が続いて実行される。 In step S106, it is determined whether the count value is "6". If the CPU 10 determines that the count value is not "6" (No), it performs a process of adding "+1" to the count value in step S107. For example, when the process of Step 1 is performed, the CPU 10 updates the count value to 1+1=2 and causes the memory 30 to retain the updated count value. Then, the process returns to step S102, and the processes after step 2 are continuously executed.

一方、ステップS106において、CPU10は、カウント値が「6」であると判定した場合(Yes)、Step1~Step6の処理がすべて完了したと判断し、ステップS108の処理が実行される。ステップS108では、CPU10は、Step1~Step6における演算結果を用いて出力値を算出する。CPU10は、メモリ30に保持された各演算結果の値を読み出し、式(1)に示す2nビットモンゴメリ乗算剰余を出力値として算出する。算出された出力値は、メモリ30に保持されてもよいし、外部に送信されてもよい。 On the other hand, in step S106, when the CPU 10 determines that the count value is "6" (Yes), it determines that the processes of Steps 1 to 6 are all completed, and the process of Step S108 is executed. In step S108, the CPU 10 calculates an output value using the calculation results in steps 1-6. The CPU 10 reads the value of each operation result held in the memory 30, and calculates the 2n-bit Montgomery multiplication residue shown in Equation (1) as an output value. The calculated output value may be held in the memory 30 or may be transmitted to the outside.

<本実施の形態による主な効果>
本実施の形態によれば、CPU10は、メモリ30から読み出したプログラムに基づき、nビットモンゴメリ乗算剰余の算出、又はnビット乗算を選択して演算器に実行させる。
<Main effects of the present embodiment>
According to the present embodiment, the CPU 10 selects the calculation of the n-bit Montgomery multiplication remainder or the n-bit multiplication based on the program read from the memory 30 and causes the calculator to execute it.

この構成によれば、演算時間が長いnビットモンゴメリ乗算剰余を含むマルチ演算の回数を削減し、演算時間が短い乗算が用いられるので、nビットモンゴメリ乗算剰余を用いた2nビットモンゴメリ乗算剰余の算出に係る演算時間を短縮することが可能となる。 According to this configuration, the number of multi-operations including the n-bit Montgomery multiplication remainder having a long operation time is reduced, and the multiplication having a short operation time is used. It is possible to shorten the calculation time related to.

削減される演算時間は、nビット乗算とnビットモンゴメリ乗算剰余における演算時間の差によって決まる。具体的に述べると、nビット乗算に対してnビットモンゴメリ乗算剰余の演算時間が遅いほど効果が大きくなる。nビットモンゴメリ乗算剰余がnビット乗算に対してk倍の時間が掛かるとした場合、2nビットモンゴメリ乗算剰余の演算時間は、次の通りとなる。k=3の場合、本実施の形態における演算時間は、従来の約44.4%となる。k=2の場合、本実施の形態における演算時間は、従来の約50%となる。k=1.5の場合、本実施の形態における演算時間は、従来の約55.6%となる。k=1の場合、本実施の形態における演算時間は、従来の約66.7%となる。このように、nビットモンゴメリ乗算剰余の演算時間がnビット乗算の演算時間より長くなると、2nビットモンゴメリ乗算剰余の演算時間の削減効果はより大きくなる。 The reduced computation time is determined by the difference in computation time between n-bit multiplication and n-bit Montgomery multiplication remainder. Specifically, the slower the operation time of the n-bit Montgomery multiplication remainder with respect to the n-bit multiplication, the greater the effect. If the n-bit Montgomery multiplication remainder takes k times as long as the n-bit multiplication, the calculation time for the 2n-bit Montgomery multiplication remainder is as follows. When k=3, the computation time in this embodiment is about 44.4% of the conventional one. When k=2, the computation time in this embodiment is about 50% of the conventional one. When k=1.5, the computation time in this embodiment is about 55.6% of the conventional one. When k=1, the computation time in this embodiment is about 66.7% of the conventional one. Thus, when the operation time of the n-bit Montgomery multiplication remainder is longer than the operation time of the n-bit multiplication, the effect of reducing the operation time of the 2n-bit Montgomery multiplication remainder becomes greater.

[変形例]
2nビットモンゴメリ乗算剰余の算出は、図2以外のアルゴリズムでも可能である。そこで、ここでは、図2以外のアルゴリズムを変形例として例示する。図4は、本発明の実施の形態1の変形例に係る2nビットモンゴメリ乗算剰余算出のアルゴリズムを例示する図である。図4のStep1~Srep5は、図2と同じであるが、図4のStep6がマルチ演算に置き換えられている。図5は、図4のアルゴリズムに対応するフロー図である。
[Modification]
Calculation of the 2n-bit Montgomery multiplication remainder is also possible with an algorithm other than that shown in FIG. Therefore, here, an algorithm other than that shown in FIG. 2 is illustrated as a modified example. FIG. 4 is a diagram illustrating an algorithm for calculating a 2n-bit Montgomery modular multiplication according to the modification of the first embodiment of the present invention. Steps 1 to Srep5 in FIG. 4 are the same as in FIG. 2, but Step 6 in FIG. 4 is replaced with multi-operation. FIG. 5 is a flow diagram corresponding to the algorithm of FIG.

図4のStep6では、[q、n、m-1]を入力として、マルチ演算(MultMonDiv)が実行される。これにより、2nビットの値(q、r)が算出される。出力値である2nビット乗算剰余は、すでに述べた式(1)を用いて算出される。 In Step 6 of FIG. 4, [q 4 , n 1 , m−1] are input and multi-operation (MultMonDiv) is executed. As a result, a 2n-bit value (q 5 , r 5 ) is calculated. The 2n-bit multiplication remainder, which is the output value, is calculated using equation (1) already described.

図5は、図3に対し、ステップS103の処理内容のみが異なる。図4に示すように、Step6においてもマルチ演算が実行される。このため、ステップS103では、カウント値が「3、5、6」の場合(Yes)、CPU10は、マルチ演算(MultMonDiv)を選択し、ステップS104の処理が実行される。一方、カウント値がそれ以外の値「1、2、4」である場合(No)、CPU10は、乗算を選択し、ステップS105の処理が実行される。 FIG. 5 differs from FIG. 3 only in the processing content of step S103. As shown in FIG. 4, multi-operation is also executed in Step 6. FIG. Therefore, in step S103, when the count value is "3, 5, 6" (Yes), the CPU 10 selects multi-operation (MultMonDiv), and the process of step S104 is executed. On the other hand, if the count value is other value "1, 2, 4" (No), the CPU 10 selects multiplication, and the process of step S105 is executed.

本変形例においても、従来の演算方法に比べて2nビットモンゴメリ乗算剰余の演算時間を削減することが可能である。 Also in this modification, it is possible to reduce the computation time for the 2n-bit Montgomery multiplication remainder compared to the conventional computation method.

(実施の形態2)
次に、実施の形態2について説明する。なお、以下では、すでに述べた内容と重複する箇所については、原則として説明を省略する。
(Embodiment 2)
Next, Embodiment 2 will be described. In addition, below, description is abbreviate|omitted in principle about the part which overlaps with the content already described.

図6は、本発明の実施の形態2に係る演算処理装置の構成の一例を示す図である。図6に示す演算処理装置101は、図1の演算器20が演算器120に置き換えられている。演算器120は、CPU10から送信される命令に基づき、nビットモンゴメリ乗算剰余の算出、nビット乗算、及び加減算を切り換えて実行する。 FIG. 6 is a diagram showing an example of the configuration of an arithmetic processing device according to Embodiment 2 of the present invention. In an arithmetic processing device 101 shown in FIG. 6, the arithmetic unit 20 of FIG. 1 is replaced with an arithmetic unit 120 . The calculator 120 switches between calculation of an n-bit Montgomery multiplication remainder, n-bit multiplication, and addition/subtraction based on instructions sent from the CPU 10 .

演算器120は、例えば図3のステップS108における出力値の算出を加減算により行う。このように、演算器120は、CPU10が行っていた演算を代わりに実行することができる。また、演算器120は、出力値の算出以外にも、加減算による入力値の算出をCPU10に代わり行ってもよい。 The arithmetic unit 120 performs addition and subtraction to calculate the output value in step S108 of FIG. 3, for example. In this way, the computing unit 120 can perform the computation that the CPU 10 was performing instead. In addition to the calculation of the output value, the calculator 120 may also calculate the input value by addition and subtraction instead of the CPU 10 .

具体的に述べると、図2のStep2において、CPU10は、入力値の算出に必要な値[a、a、b、b]を演算器120に送信し、演算器120に入力値[a+a、b+b]を算出させてもよい。そして、演算器120は、自身が算出した入力値を用いてnビット乗算を実行することができる。 Specifically , in Step 2 of FIG . [a 1 +a 0 , b 1 +b 0 ] may be calculated. Then, the operator 120 can perform n-bit multiplication using the input value calculated by itself.

図2、図3におけるその他の場合においても、演算器120は、CPU10に代わり加減算を実行することが可能となる。 2 and 3, the calculator 120 can perform addition and subtraction instead of the CPU 10. FIG.

本実施の形態によれば、演算器120は、CPU10の命令によりnビットモンゴメリ乗算剰余の算出、nビット乗算、及び加減算を切り換えて行う。この構成によれば、CPU10の負荷が軽減され演算処理装置101における処理が高速化される。また、演算結果を、CPU10に読み出す必要がなくなるので、2nビットモンゴメリ乗算剰余の演算時間がより短縮される。 According to the present embodiment, the computing unit 120 switches between calculation of the n-bit Montgomery multiplication remainder, n-bit multiplication, and addition/subtraction according to instructions from the CPU 10 . This configuration reduces the load on the CPU 10 and speeds up the processing in the arithmetic processing unit 101 . Further, since it is not necessary to read out the operation result to the CPU 10, the operation time for the 2n-bit Montgomery multiplication remainder is further shortened.

(実施の形態3)
次に、実施の形態3について説明する。従来手法を用いることにより、2n、4n、8nビット等のモンゴメリ乗算剰余の算出は可能ではあるが、3nビットモンゴメリ乗算剰余の算出には、一旦、4nビットモンゴメリ乗算剰余の算出を行う必要がある。しかし、この方法では、nビットモンゴメリ乗算剰余の算出回数が増え、演算時間が長くなるとともに、4nビットのメモリ領域が必要となる。そこで、本実施の形態では、nビットモンゴメリ乗算剰余やnビット乗算を用いた3nビットモンゴメリ乗算剰余の算出方法について説明する。
(Embodiment 3)
Next, Embodiment 3 will be described. By using the conventional method, it is possible to calculate Montgomery multiplication remainders of 2n, 4n, 8n bits, etc., but in order to calculate the 3n-bit Montgomery multiplication remainders, it is necessary to first calculate the 4n-bit Montgomery multiplication remainders. . However, in this method, the number of calculations of the n-bit Montgomery multiplication remainder increases, the calculation time increases, and a memory area of 4n bits is required. Therefore, in the present embodiment, a method of calculating an n-bit Montgomery multiplication remainder and a 3n-bit Montgomery multiplication remainder using n-bit multiplication will be described.

図7は、本発明の実施の形態3に係る3nビットモンゴメリ乗算剰余算出のアルゴリズムを例示する図である。本実施の形態における3nビットモンゴメリ乗算剰余算出には、図7のStep1~Step14等の演算処理が実行される。図7に示すように、Step1~2、Step4~8、Step10~11、Step13~14ではnビット乗算が実行され、Step3、Step9、Step12ではnビットモンゴメリ乗算剰余の算出や加減算を含むマルチ演算(MultMonDiv)が実行される。このように、本実施の形態では、Step数を増やすことにより、3nビット乗算剰余が直接算出される。 FIG. 7 is a diagram illustrating an algorithm for 3n-bit Montgomery modular multiplication calculation according to the third embodiment of the present invention. In the calculation of the 3n-bit Montgomery multiplication remainder in the present embodiment, arithmetic processing such as Steps 1 to 14 in FIG. 7 is executed. As shown in FIG. 7, in Steps 1-2, Steps 4-8, Steps 10-11, and Steps 13-14, n-bit multiplication is performed, and in Steps 3, 9, and 12, multi-operations ( MultMonDiv) is executed. Thus, in this embodiment, the 3n-bit multiplication remainder is directly calculated by increasing the number of Steps.

具体的に述べると、図7のアルゴリズムでは、A=a+am+a、B=b+bm+b、N=n+nm+nを入力として、2nビットの各値{r、q}~{r、q}、(q、r)、{r、q}~{r、q}、(q、r)、{r、q}~{r10、q10}、(q11、r11)、{r12、q12}~{r13、q13}が算出される。なお、m:=2、M:=m=23nである。 Specifically, in the algorithm of FIG. 7, with A=a 2 m 2 +a 1 m+a 0 , B=b 2 m 2 +b 1 m+b 0 , N=n 2 m 2 +n 1 m+n 0 as input, 2n bits Each value of {r 0 , q 0 } to {r 1 , q 1 }, (q 2 , r 2 ), {r 3 , q 3 } to {r 7 , q 7 }, (q 8 , r 8 ) , {r 9 , q 9 } to {r 10 , q 10 }, (q 11 , r 11 ), {r 12 , q 12 } to {r 13 , q 13 } are calculated. Note that m:=2 n and M:=m 3 =2 3n .

Step1では、[a、b]を入力とし、これらの乗算が実行される。これにより、2nビットの値{r、q}が算出される。Step2では、[a、b]を入力とし、これらの乗算が実行される。これにより、2nビットの値{r、q}が算出される。Step3では、[a、b、n]を入力として、マルチ演算(MultMonDiv)が実行される。これにより、2nビットの値(q、r)が算出される。 In Step 1, [a 2 , b 2 ] are input and their multiplication is executed. Thereby, a 2n-bit value {r 0 , q 0 } is calculated. In Step 2, [a 1 , b 1 ] are input and their multiplication is executed. Thereby, a 2n-bit value {r 1 , q 1 } is calculated. In Step 3, [a 0 , b 0 , n 0 ] are input and multi-operation (MultMonDiv) is executed. As a result, a 2n-bit value (q 2 , r 2 ) is calculated.

Step4では、[a+a、b+b]を入力として、これらの乗算が実行される。これにより、2nビットの値{r、q}が算出される。Step5では、[a+a、b+b]を入力として、これらの乗算が実行される。これにより、2nビットの値{r、q}が算出される。Step6では、[a+a、b+b]を入力として、これらの乗算が実行される。これにより、2nビットの値{r、q}が算出される。 In Step 4, [a 2 +a 1 , b 2 +b 1 ] are input, and these multiplications are executed. Thereby, a 2n-bit value {r 3 , q 3 } is calculated. In Step 5, [a 2 +a 0 , b 2 +b 0 ] are input and these multiplications are executed. Thus, a 2n-bit value {r 4 , q 4 } is calculated. In Step 6, [a 1 +a 0 , b 1 +b 0 ] are input and these multiplications are executed. As a result, a 2n-bit value {r 5 , q 5 } is calculated.

Step7では、[q、n]を入力として、これらの乗算が実行される。これにより、2nビットの値{r、q}が算出される。Step8では、[q、n]を入力として、これらの乗算が実行される。これにより、2nビットの値{r、q}が算出される。Step9では、[-q+r+q-q、1、n]を入力として、マルチ演算(MultMonDiv)が実行される。これにより、2nビットの値(q、r)が算出される。 In Step 7, [q 2 , n 2 ] are input and these multiplications are executed. Thus, a 2n-bit value {r 6 , q 6 } is calculated. In Step 8, [q 2 , n 1 ] are input and these multiplications are executed. Thus, a 2n-bit value {r 7 , q 7 } is calculated. In Step 9, [-q 1 +r 2 +q 5 -q 7 , 1, n 0 ] are input and multi-operation (MultMonDiv) is executed. As a result, a 2n-bit value (q 8 , r 8 ) is calculated.

Step10では、[q、n]を入力として、これらの乗算が実行される。これにより、2nビットの値{r、q}が算出される。Step11では、[q、n]を入力として、これらの乗算が実行される。これにより、2nビットの値{r10、q10}が算出される。Step12では、[-q+q-r-r+q+r-q+q-r+r-q10、1、n]を入力として、マルチ演算(MultMonDiv)が実行される。これにより、2nビットの値(q11、r11)が算出される。 At Step 10, [q 8 , n 2 ] are input and these multiplications are executed. As a result, a 2n-bit value {r 9 , q 9 } is calculated. In Step 11, [q 8 , n 1 ] are input and these multiplications are executed. As a result, a 2n-bit value {r 10 , q 10 } is calculated. In Step 12, [-q 0 +q 1 -r 1 -r 2 +q 4 +r 5 -q 6 +q 7 -r 7 +r 8 -q 10 , 1, n 0 ] are input and multi-operation (MultMonDiv) is executed. be. As a result, a 2n-bit value (q 11 , r 11 ) is calculated.

Step13では、[q11、n]を入力として、これらの乗算が実行される。これにより、2nビットの値{r12、q12}が算出される。Step14では、[q11、n]を入力として、これらの乗算が実行される。これにより、2nビットの値{r13、q13}が算出される。 In Step 13, [q 11 , n 2 ] are input and these multiplications are executed. As a result, a 2n-bit value {r 12 , q 12 } is calculated. In Step 14, [q 11 , n 1 ] are input and these multiplications are executed. As a result, a 2n-bit value {r 13 , q 13 } is calculated.

そして、これらの演算結果を用いて、以下の式(2)により、3nビットモンゴメリ乗算剰余が出力値として算出される。 Then, using these calculation results, a 3n-bit Montgomery multiplication residue is calculated as an output value according to the following equation (2).

A*B*M-1(mod N)=(r+r-r12)m+(q-r-r+r+q+r+r-r-q12-r13)m+(-q-r-q+r-r+q+r+q-r+q+r-q-r10+r11-q13) ・・・(2)
図8は、図7のアルゴリズムに対応するフロー図である。図7は、図3に対し、ステップS103、S106の処理内容が異なる。図7に示すように、本実施の形態では、Step3、9、12においてマルチ演算が実行される。このため、図8のステップS103では、カウント値が「3、9、12」の場合(Yes)、CPU10は、マルチ演算(MultMonDiv)を選択し、ステップS104の処理が実行される。一方、カウント値がそれ以外の値「1~2、4~8、10~11、13~14」である場合(No)、CPU10は、乗算を選択し、ステップS105の処理が実行される。
A*B*M −1 (mod N)=(r 0 +r 6 −r 12 )m 2 +(q 0 −r 0 −r 1 +r 3 +q 6 +r 6 +r 7 −r 9 −q 12 −r 13 ) m + (-q 0 -r 0 -q 1 +r 1 -r 2 +q 3 +r 4 +q 6 -r 6 +q 7 +r 7 -q 9 -r 10 +r 11 -q 13 ) (2)
FIG. 8 is a flow diagram corresponding to the algorithm of FIG. FIG. 7 differs from FIG. 3 in the processing contents of steps S103 and S106. As shown in FIG. 7, in this embodiment, multi-operations are executed in Steps 3, 9, and 12. FIG. Therefore, in step S103 of FIG. 8, when the count value is "3, 9, 12" (Yes), the CPU 10 selects the multi-operation (MultMonDiv), and the process of step S104 is executed. On the other hand, if the count value is other value "1 to 2, 4 to 8, 10 to 11, 13 to 14" (No), the CPU 10 selects multiplication, and the process of step S105 is executed.

ステップS106では、カウント値が「14」であるかどうかが判定される。CPU10が、カウント値が「14」でないと判定した場合(No)、ステップS107の処理が実行される。これに対し、CPU10が、カウント値が「14」であると判定した場合(Yes)、ステップS108の処理が実行される。 In step S106, it is determined whether the count value is "14". When the CPU 10 determines that the count value is not "14" (No), the process of step S107 is executed. On the other hand, when the CPU 10 determines that the count value is "14" (Yes), the process of step S108 is executed.

本実施の形態によれば、演算器20において、nビットモンゴメリ乗算剰余の算出と、nビット乗算とを適宜切り換えて実行することにより、3nビットモンゴメリ乗算剰余の算出が行われる。2nビットモンゴメリ乗算剰余の算出に比べてステップ数が増えているが、nビットモンゴメリ乗算剰余の算出の回数が6回に抑えられており、3nビットモンゴメリ乗算剰余の算出に要する演算時間を短縮させることが可能となる。また、4nビットモンゴメリ乗算剰余の算出を行うことなく、3nビットモンゴメリ乗算剰余を直接算出することが可能となるので、3nビット以上のメモリ領域を用意する必要がなくなり、メモリを有効に利用することが可能となる。 According to the present embodiment, calculation of the 3n-bit Montgomery multiplication remainder is performed by appropriately switching between calculation of the n-bit Montgomery multiplication remainder and n-bit multiplication in the calculator 20 . Although the number of steps is increased compared to the calculation of the 2n-bit Montgomery multiplication remainder, the number of calculations of the n-bit Montgomery multiplication remainder is suppressed to 6 times, and the operation time required to calculate the 3n-bit Montgomery multiplication remainder is shortened. becomes possible. In addition, since the 3n-bit Montgomery multiplication remainder can be directly calculated without calculating the 4n-bit Montgomery multiplication remainder, there is no need to prepare a memory area of 3n bits or more, and the memory can be used effectively. becomes possible.

本実施の形態では、3nビットモンゴメリ乗算剰余の算出方法について説明したが、ステップ数を増やすことにより、さらにビット数の大きいnビットの整数倍のビット数のモンゴメリ乗算剰余も短時間で算出可能である。 In the present embodiment, a method for calculating a 3n-bit Montgomery multiplication remainder has been described. However, by increasing the number of steps, it is possible to calculate a Montgomery multiplication remainder having a bit number that is an integer multiple of n bits, which is a large number of bits, in a short time. be.

(実施の形態4)
次に、実施の形態4について説明する。本実施の形態では、nビットモンゴメリ乗算剰余を行う演算器(第1演算器)と、nビット乗算を行う演算器(第2演算器)とがそれぞれ独立して設けられている。図9は、本発明の実施の形態4に係る演算処理装置の構成の一例を示す図である。図9に示す演算処理装置201は、図1の演算器20が演算器221、222に置き換えられている。演算器221は、CPU10の命令に基づきnビットモンゴメリ乗算剰余の算出を実行する。演算器222は、CPU10の命令に基づき、nビット乗算を実行する。
(Embodiment 4)
Next, Embodiment 4 will be described. In the present embodiment, an arithmetic unit (first arithmetic unit) that performs n-bit Montgomery multiplication remainder and an arithmetic unit (second arithmetic unit) that performs n-bit multiplication are provided independently of each other. FIG. 9 is a diagram showing an example of the configuration of an arithmetic processing device according to Embodiment 4 of the present invention. In an arithmetic processing device 201 shown in FIG. 9, the arithmetic unit 20 of FIG. 1 is replaced with arithmetic units 221 and 222 . Arithmetic unit 221 calculates an n-bit Montgomery multiplication remainder based on instructions from CPU 10 . Arithmetic unit 222 executes n-bit multiplication based on instructions from CPU 10 .

本実施の形態に係る演算処理装置201は、演算器221によるnビットモンゴメリ乗算剰余の算出を含むマルチ演算と、演算器222によるnビット乗算とを並列に実行することが可能である。図10は、本発明の実施の形態4におけるマルチ演算とnビット乗算とを並列実行させる手順の一例を示す図である。図10には、図2のアルゴリズムを例にした並列実行手順が示されている。 Arithmetic processing device 201 according to the present embodiment can execute multi-operation including calculation of n-bit Montgomery multiplication remainder by arithmetic unit 221 and n-bit multiplication by arithmetic unit 222 in parallel. FIG. 10 is a diagram showing an example of a procedure for parallel execution of multi-operation and n-bit multiplication according to Embodiment 4 of the present invention. FIG. 10 shows a parallel execution procedure using the algorithm of FIG. 2 as an example.

図2のアルゴリズムについて検討する。Step3のマルチ演算は、入力値(Input)のみを用いて実行可能である。したがって、Step1のnビット乗算と、Step3のマルチ演算とを並列実行可能である。また、Step3の実行中、Step1に続いてStep2のnビット乗算を並行実行することが可能である。 Consider the algorithm of FIG. The multi-calculation in Step 3 can be executed using only the input value (Input). Therefore, the n-bit multiplication in Step 1 and the multi-operation in Step 3 can be executed in parallel. Also, during execution of Step 3, it is possible to parallelly execute Step 1 and then Step 2 of n-bit multiplication.

一方、Step4のnビット乗算には、Step3の演算結果「q」が必要となるので、Step3の処理が完了するまで、Step4を実行することはできない。また、Step5のマルチ演算には、Step4の演算結果「q」が必要となるので、Step4の処理が完了するまで、Step5を実行することができない。また、Step6のnビット乗算には、Step5の演算結果「q」が必要となるので、Step5の処理が完了するまで、Step6を実行することができない。 On the other hand, the n-bit multiplication of Step 4 requires the operation result "q 2 " of Step 3, so Step 4 cannot be executed until the processing of Step 3 is completed. Further, since the multi-calculation of Step 5 requires the calculation result "q 3 " of Step 4, Step 5 cannot be executed until the processing of Step 4 is completed. Further, since the n-bit multiplication in Step 6 requires the operation result "q 4 " in Step 5, Step 6 cannot be executed until the processing of Step 5 is completed.

したがって、図2のアルゴリズムに対し、演算処理装置201では、Step1及びStep3、Step2及びStep3がそれぞれ並行実行可能である。 Therefore, in the arithmetic processing unit 201, Step 1 and Step 3, and Step 2 and Step 3 can be executed in parallel with respect to the algorithm of FIG.

図11は、本発明の実施の形態4におけるマルチ演算とnビット乗算とを並列実行させる手順の他の例を示す図である。図11は、図7のアルゴリズムを例にした並列実行手順が示されている。図11に示すように、Step3のマルチ演算時には、Step2、6、8のnビット乗算が順次並列実行可能である。Step9のマルチ演算時には、Step1、5、7のnビット乗算が順次並列実行可能である。 FIG. 11 is a diagram showing another example of a procedure for parallel execution of multi-operation and n-bit multiplication according to Embodiment 4 of the present invention. FIG. 11 shows a parallel execution procedure using the algorithm of FIG. 7 as an example. As shown in FIG. 11, during multi-operation in Step 3, n-bit multiplications in Steps 2, 6, and 8 can be sequentially executed in parallel. At the time of multi-operation in Step 9, the n-bit multiplications in Steps 1, 5 and 7 can be sequentially executed in parallel.

一部でnビット乗算の順序が入れ換わっているが、これは、各Stepにおいて必要な値が得られるタイミング等を考慮したためである。例えば、Step1で得られる値「q」は、Step12のマルチ演算まで使用されない。このため、Step1は、必ずしも最初に実行される必要はない。一方、Step9のマルチ演算は、Step8の演算結果「q」が必要なので、Step3と並行して実行されることが望ましい。そうすれば、Step3とStep9とを連続して実行可能となる。その他のStepについても、ここで述べた事情により適宜実行順序が決定される。 The order of n-bit multiplication is partially changed, but this is due to consideration of the timing of obtaining the required value in each step. For example, the value “q 0 ” obtained in Step 1 is not used until multi-operation in Step 12 . Therefore, Step 1 does not necessarily have to be executed first. On the other hand, since the multi-calculation in Step 9 requires the calculation result "q 7 " in Step 8, it is desirable to be executed in parallel with Step 3. Then, Step 3 and Step 9 can be executed continuously. As for the other steps, the order of execution is appropriately determined according to the circumstances described here.

本実施の形態によれば、演算器221によるnビットモンゴメリ乗算剰余の算出を含むマルチ演算と、演算器222によるnビット乗算とを並列に実行することが可能であるので、2nビットや3nビット等のモンゴメリ乗算剰余の算出に要する演算時間がより短縮される。 According to the present embodiment, it is possible to execute in parallel the multi-operation including the calculation of the n-bit Montgomery multiplication remainder by the arithmetic unit 221 and the n-bit multiplication by the arithmetic unit 222. The calculation time required for calculating the Montgomery multiplication remainder is further shortened.

(実施の形態5)
次に、実施の形態5について説明する。本実施の形態では、マルチ演算をnビット乗算及び加減算により実行する場合について説明する。図12は、本発明の実施の形態5に係る演算処理装置の構成の一例を示す図である。図12に示す演算処理装置301は、図1の演算器20が演算器320に置き換えられている。演算器320は、CPU10の命令に基づきnビット乗算を実行する。すなわち、本実施の形態では、演算器においてnビットモンゴメリ乗算剰余の算出が直接行われることはない。
(Embodiment 5)
Next, Embodiment 5 will be described. In this embodiment, a case of executing multi-operation by n-bit multiplication and addition/subtraction will be described. FIG. 12 is a diagram showing an example of a configuration of an arithmetic processing device according to Embodiment 5 of the present invention. A processor 301 shown in FIG. 12 has a calculator 320 instead of the calculator 20 in FIG. Arithmetic unit 320 executes n-bit multiplication based on instructions from CPU 10 . That is, in the present embodiment, calculation of the n-bit Montgomery multiplication remainder is not performed directly in the calculator.

図13は、本発明の実施の形態5に係るマルチ演算のアルゴリズムを例示する図である。図13のマルチ演算では、「a、b、n、m、s」が入力され、「q、r」が出力される。なお、sはn-1(mod m)で規定される値であり、マルチ演算の実行前に、CPU10等で事前に算出しておく。 FIG. 13 is a diagram illustrating an algorithm for multi-operation according to Embodiment 5 of the present invention. In the multi-operation of FIG. 13, "a, b, n, m, s" are input and "q, r" are output. Note that s is a value defined by n −1 (mod m) and is calculated in advance by the CPU 10 or the like before executing the multi-operation.

Step1では、[a、b]を入力として、これらの乗算が実行され、値{c、c}が算出される。なお、b=1の場合、{c、c}=aである。Step2では、[c、s]を入力としてこれらの乗算等を行い、値「q」が算出される。Step3では、[q、n]を入力とする乗算等や、[c、c]を入力とする加減算等が実行される。 In Step 1, [a, b] are used as inputs and their multiplication is executed to calculate the values {c 1 , c 0 }. Note that when b=1, {c 1 , c 0 }=a. In Step 2, [c 0 , s] is input and these are multiplied and the like to calculate the value "q". In Step 3, multiplication with [q, n] as input and addition/subtraction with [c 0 , c 1 ] as input are executed.

図14及び図15は、図13のアルゴリズムに対応するフロー図である。図14は、2nビットモンゴメリ乗算剰余の算出に係るフロー図であり、図3と対応している。図15は、3nビットモンゴメリ乗算剰余の算出に係るフロー図であり、図8と対応している。 14 and 15 are flow diagrams corresponding to the algorithm of FIG. FIG. 14 is a flowchart relating to calculation of the 2n-bit Montgomery multiplication remainder, and corresponds to FIG. FIG. 15 is a flowchart relating to calculation of the 3n-bit Montgomery multiplication remainder, and corresponds to FIG.

図14及び図15では、図3のステップS104がステップS304に置き換えられている。ステップS304は、ステップS304a~S304eを含んでいる。ステップS304aでは、入力値「b」が1であるどうかが判断される。CPU10が、b≠1と判断すると(No)、ステップS304bの処理が実行される。一方、ステップS304aにおいて、CPU10がb=1と判断すると(Yes)、ステップS304cの処理が実行される。 14 and 15, step S104 of FIG. 3 is replaced with step S304. Step S304 includes steps S304a-S304e. In step S304a, it is determined whether the input value "b" is one. When the CPU 10 determines that b≠1 (No), the process of step S304b is executed. On the other hand, when the CPU 10 determines that b=1 in step S304a (Yes), the process of step S304c is executed.

ステップS304bでは、図13のStep1の処理が実行される。CPU10は値「a、b」を演算器320に送信し、乗算を行うよう命令する。演算器320は、CPU10の命令に従い、[a、b]を入力とする乗算(a*b)を実行する。算出された値{c、c}は、例えばメモリ30に保持される。 In step S304b, the process of step 1 in FIG. 13 is executed. The CPU 10 sends the value "a,b" to the calculator 320 and instructs it to perform the multiplication. Arithmetic unit 320 executes multiplication (a*b) with [a, b] as input in accordance with an instruction from CPU 10 . The calculated values {c 1 , c 0 } are stored in the memory 30, for example.

ステップS304cでは、図13のStep2の処理が実行される。CPU10は値[c、s]を演算器320に送信し、乗算を行うよう命令する。演算器320は、CPU10の命令に従い、[c、s]を入力とする乗算(c*s)を実行する。算出された値「q」は、例えばメモリ30に保持される。 In step S304c, the process of step 2 in FIG. 13 is executed. The CPU 10 sends the value [c 0 , s] to the calculator 320 and commands it to perform the multiplication. The arithmetic unit 320 executes multiplication (c 0 *s) with [c 0 , s] as input according to the instruction of the CPU 10 . The calculated value “q” is held in the memory 30, for example.

ステップS304d~S304eでは、図13のStep2の処理が実行される。ステップS304dにおいて、CPU10は、値[q、n]を演算器320に送信し、乗算を行うよう命令する。演算器320は、CPU10の命令に従い、[q、n]を入力とする乗算(q*n)を実行する。算出された値「q*n」は、例えばメモリ30に保持される。 In steps S304d to S304e, the process of step 2 in FIG. 13 is executed. In step S304d, the CPU 10 sends the value [q, n] to the arithmetic unit 320 and instructs it to perform multiplication. The arithmetic unit 320 executes multiplication (q*n) with [q, n] as input according to the instruction of the CPU 10 . The calculated value “q*n” is held in the memory 30, for example.

ステップS304eにおいて、CPU10は、ステップS304で算出された値「q*n」、及び値[c、c]を用いて値「r」を算出する。算出された値「r」は、例えばメモリ30に保持される。このように、マルチ演算により値(q、r)が算出される。このように、乗算及び加減算を含むステップS304のマルチ演算により算出された値は、nビットモンゴメリ乗算剰余の算出及び加算を含むS104のマルチ演算により算出された値と同一である。 In step S304e, the CPU 10 calculates the value "r" using the value "q*n" calculated in step S304 and the value [ c0 , c1 ]. The calculated value "r" is held in the memory 30, for example. Thus, the value (q, r) is calculated by multi-operation. Thus, the value calculated by the multi-operation of step S304 including multiplication and addition/subtraction is the same as the value calculated by the multi-operation of S104 including calculation and addition of the n-bit Montgomery multiplication remainder.

図14及び図15のマルチ演算では、2回のnビットモンゴメリ乗算剰余の算出が、3回の乗算に変更されている。したがって、2nビットモンゴメリ乗算剰余の算出では、マルチ演算で6(3×2)回の乗算が実行される。また、3nビットモンゴメリ乗算剰余の算出では、マルチ演算で9(3×3)回の乗算が実行される。また、bの値に応じて、マルチ演算における乗算回数は削減される。 In the multi-operations of FIGS. 14 and 15, two calculations of the n-bit Montgomery multiplication remainder are changed to three multiplications. Therefore, in the calculation of the 2n-bit Montgomery multiplication remainder, 6 (3×2) multiplications are executed in the multi-operation. Further, in the calculation of the 3n-bit Montgomery multiplication remainder, 9 (3×3) multiplications are executed in multi-operations. Also, the number of multiplications in the multi-operation is reduced according to the value of b.

本実施の形態によれば、乗算及び加減算によりマルチ演算が実行される。この構成によれば、nビット乗算剰余の算出を行わなくてもよいので、2nビットや3nビット等のモンゴメリ乗算剰余の算出に要する演算時間がさらに短縮される。 According to this embodiment, multi-operations are executed by multiplication and addition/subtraction. According to this configuration, it is not necessary to calculate the n-bit multiplication remainder, so the operation time required for calculating the Montgomery multiplication remainder of 2n bits, 3n bits, or the like can be further shortened.

これまで説明した各実施の形態に係る演算処理装置は、例えば、セキュリティ機能が要求されるネットワーク機器、自動車、産業機器等に搭載される。また、演算処理装置は、その他の機能を含めた半導体装置として構成されてもよい。 The arithmetic processing units according to the embodiments described so far are installed in, for example, network equipment, automobiles, industrial equipment, etc. that require security functions. Further, the arithmetic processing device may be configured as a semiconductor device including other functions.

以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。 The invention made by the present inventor has been specifically described above based on the embodiments, but the present invention is not limited to the above embodiments, and various modifications can be made without departing from the gist of the invention. Needless to say.

1、101、201、301…演算処理装置、10…CPU、20、120、221、222、320…演算器、30…メモリ 1, 101, 201, 301... Arithmetic processing unit 10... CPU 20, 120, 221, 222, 320... Arithmetic unit 30... Memory

Claims (7)

CPUと、
前記CPUの命令によりnビットモンゴメリ乗算剰余の算出、又はnビット乗算を切り換えて行う演算器と、
メモリと、
を備えた演算処理装置において、nビットモンゴメリ乗算剰余の算出とnビット乗算とを時系列的に組み合わせてnビットの整数倍のビット数のモンゴメリ乗算剰余を算出する演算処理方法であって、
前記CPUが、前記メモリから読み出したプログラムに基づき、カウント値が所定の値である場合にはnビットモンゴメリ乗算剰余の算出を演算方法として選択し、前記カウント値が前記所定の値でない場合にはnビット乗算を前記演算方法として選択する第1ステップと、
前記CPUが、選択した前記演算方法による演算を前記演算器に実行させ、実行を完了すると前記カウント値を更新して前記第1ステップに戻る第2ステップと、
を有する、
演算処理方法。
a CPU;
an arithmetic unit that switches between calculating an n-bit Montgomery multiplication remainder or n-bit multiplication according to instructions from the CPU;
memory;
An arithmetic processing method for calculating a Montgomery multiplication remainder having a number of bits that is an integral multiple of n bits by combining calculation of an n-bit Montgomery multiplication remainder and n-bit multiplication in time series, wherein
Based on the program read from the memory, the CPU selects the calculation of the n-bit Montgomery multiplication remainder as the calculation method when the count value is a predetermined value, and when the count value is not the predetermined value a first step of selecting n-bit multiplication as the method of operation;
a second step in which the CPU causes the arithmetic unit to execute an arithmetic operation according to the selected arithmetic method, updates the count value when the execution is completed, and returns to the first step;
having
Arithmetic method.
請求項1に記載の演算処理方法において、
前記演算器は、nビットモンゴメリ乗算剰余の算出を行う第1演算器と、nビット乗算を行う第2演算器と、が独立して設けられており、
前記CPUは、前記第1ステップにおいてnビットモンゴメリ乗算剰余の算出を選択した場合、前記第2ステップにおいて前記第1演算器による演算を実行させ、前記第1ステップにおいてnビット乗算を選択した場合、前記第2ステップにおいて前記第2演算器による演算を実行させる、
演算処理方法。
In the arithmetic processing method according to claim 1,
The arithmetic unit is provided independently of a first arithmetic unit for calculating an n-bit Montgomery multiplication remainder and a second arithmetic unit for performing n-bit multiplication,
When the CPU selects the calculation of the n-bit Montgomery multiplication remainder in the first step, the CPU causes the first computing unit to perform an operation in the second step, and when the n-bit multiplication is selected in the first step, causing the second computing unit to perform computation in the second step;
Arithmetic method.
請求項1に記載の演算処理方法において、
前記CPUは、前記演算器を用いて、2nビット又は3nビットモンゴメリ乗算剰余を算出する、
演算処理方法。
In the arithmetic processing method according to claim 1,
The CPU uses the calculator to calculate a 2n-bit or 3n-bit Montgomery multiplication remainder,
Arithmetic method.
CPUと、
前記CPUの命令によりnビットモンゴメリ乗算剰余の算出、又はnビット乗算を切り換えて行う演算器と、
メモリと、
を備え、
前記CPUは、前記メモリから読み出したプログラムに基づき、カウント値が所定の値である場合にはnビットモンゴメリ乗算剰余の算出を選択し、前記カウント値が前記所定の値でない場合にはnビット乗算を選択して前記演算器に実行させ、実行を完了すると前記カウント値を更新する処理を繰り返すことで、nビットモンゴメリ乗算剰余の算出とnビット乗算とを時系列的に組み合わせて、nビットの整数倍のビット数のモンゴメリ乗算剰余を算出する、
演算処理装置。
a CPU;
an arithmetic unit that switches between calculating an n-bit Montgomery multiplication remainder or n-bit multiplication according to instructions from the CPU;
memory;
with
Based on the program read from the memory, the CPU selects calculation of an n-bit Montgomery multiplication remainder when the count value is a predetermined value, and n-bit multiplication when the count value is not the predetermined value. is selected and executed by the arithmetic unit, and when the execution is completed, the processing of updating the count value is repeated, so that the calculation of the n-bit Montgomery multiplication remainder and the n-bit multiplication are combined in time series to obtain n-bit Calculate the Montgomery multiplication remainder of the number of bits of the integer multiple,
Arithmetic processing unit.
請求項に記載の演算処理装置において、
前記演算器は、nビットモンゴメリ乗算剰余の算出を行う第1演算器と、nビット乗算を行う第2演算器と、が独立して設けられている、
演算処理装置。
In the arithmetic processing device according to claim 4 ,
The arithmetic unit is provided independently of a first arithmetic unit for calculating an n-bit Montgomery multiplication remainder and a second arithmetic unit for performing n-bit multiplication.
Arithmetic processing unit.
請求項に記載の演算処理装置において、
前記CPUは、前記演算器を用いて、2nビット又は3nビットモンゴメリ乗算剰余を算出する、
演算処理装置。
In the arithmetic processing device according to claim 4 ,
The CPU uses the calculator to calculate a 2n-bit or 3n-bit Montgomery multiplication remainder,
Arithmetic processing unit.
請求項に記載の演算処理装置を備えた、
半導体装置。
Equipped with the arithmetic processing device according to claim 4 ,
semiconductor device.
JP2019036619A 2019-02-28 2019-02-28 Arithmetic processing method, arithmetic processing device, and semiconductor device Active JP7286239B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019036619A JP7286239B2 (en) 2019-02-28 2019-02-28 Arithmetic processing method, arithmetic processing device, and semiconductor device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019036619A JP7286239B2 (en) 2019-02-28 2019-02-28 Arithmetic processing method, arithmetic processing device, and semiconductor device

Publications (2)

Publication Number Publication Date
JP2020140120A JP2020140120A (en) 2020-09-03
JP7286239B2 true JP7286239B2 (en) 2023-06-05

Family

ID=72280305

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019036619A Active JP7286239B2 (en) 2019-02-28 2019-02-28 Arithmetic processing method, arithmetic processing device, and semiconductor device

Country Status (1)

Country Link
JP (1) JP7286239B2 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005122141A (en) 2003-10-15 2005-05-12 Microsoft Corp Use of SIMD instructions in Montgomery multiplication
WO2007080652A1 (en) 2006-01-13 2007-07-19 Fujitsu Limited Montgomery’s algorithm multiplication remainder calculator
JP2007212701A (en) 2006-02-09 2007-08-23 Renesas Technology Corp Residual arithmetic processor
WO2009034800A1 (en) 2007-09-14 2009-03-19 Hitachi, Ltd. Remainder multiplication processing device
JP2010091913A (en) 2008-10-10 2010-04-22 Renesas Technology Corp Data processing device
JP2013057828A (en) 2011-09-08 2013-03-28 Canon Inc Information processing apparatus and method thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005122141A (en) 2003-10-15 2005-05-12 Microsoft Corp Use of SIMD instructions in Montgomery multiplication
WO2007080652A1 (en) 2006-01-13 2007-07-19 Fujitsu Limited Montgomery’s algorithm multiplication remainder calculator
JP2007212701A (en) 2006-02-09 2007-08-23 Renesas Technology Corp Residual arithmetic processor
WO2009034800A1 (en) 2007-09-14 2009-03-19 Hitachi, Ltd. Remainder multiplication processing device
JP2010091913A (en) 2008-10-10 2010-04-22 Renesas Technology Corp Data processing device
JP2013057828A (en) 2011-09-08 2013-03-28 Canon Inc Information processing apparatus and method thereof

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Masayuki Yoshino et al.,Unbridle the Bit-Length of a Crypto-coprocessor with Montgomery Multiplication,LNSC, International Workshop on Selected Areas in Cryptography,2007年,Vol. 4356,p。188-202
吉野 雅之 ほか,コプロセッサの2倍のビット長をもつモンゴメリ乗算,電子情報通信学会技術研究報告,日本,社団法人電子情報通信学会,2006年07月13日,Vol.106 No.175,p.87~94

Also Published As

Publication number Publication date
JP2020140120A (en) 2020-09-03

Similar Documents

Publication Publication Date Title
JP5378579B2 (en) Module reduction using folding
JP3525209B2 (en) Power-residue operation circuit, power-residue operation system, and operation method for power-residue operation
CN117254902B (en) Data processing methods, apparatus, equipment and storage media
KR102496446B1 (en) Word-parallel calculation method for modular arithmetic
US10768898B2 (en) Efficient modulo calculation
CN109814838B (en) Method, hardware device and system for obtaining intermediate result set in encryption and decryption operation
WO2015164996A1 (en) Elliptic domain curve operational method and elliptic domain curve operational unit
CN106681690A (en) Montgomery modular multiplication based data processing method, modular multiplication operation method and device
JP5553773B2 (en) Apparatus and method for calculating scalar multiple of points on elliptic curve
US7558817B2 (en) Apparatus and method for calculating a result of a modular multiplication
JP7286239B2 (en) Arithmetic processing method, arithmetic processing device, and semiconductor device
KR101977873B1 (en) Hardware-implemented modular inversion module
JP2000207387A (en) Arithmetic unit and cryptographic processing unit
JP3660075B2 (en) Dividing device
JP4850884B2 (en) Power-residue calculator
JP4223819B2 (en) Power residue calculation apparatus and program
JP2007503036A (en) Method for performing modular multiplication and method for performing Euclidean multiplication using 2N-bit numbers
JP4202701B2 (en) Polynomial residue arithmetic unit, method and program
JP2010122246A (en) Inverse computing device and inverse computing program
JP3540280B2 (en) Power-residue calculation method and remainder calculation method
JP6102649B2 (en) Arithmetic circuit and control method of arithmetic circuit
CN121255140A (en) Hardware implementation methods, devices and electronic equipment for modular inverse operation
JP5000399B2 (en) Elliptic curve calculation device and elliptic curve calculation method
CN120744994A (en) Method and apparatus for performing truncated multiplication using optimized truncated multiplication circuit
JPH0371332A (en) Remainder multiplying circuit and remainder multiplying method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210811

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220713

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220809

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221006

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20221213

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230313

C60 Trial request (containing other claim documents, opposition documents)

Free format text: JAPANESE INTERMEDIATE CODE: C60

Effective date: 20230313

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

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20230323

C21 Notice of transfer of a case for reconsideration by examiners before appeal proceedings

Free format text: JAPANESE INTERMEDIATE CODE: C21

Effective date: 20230328

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: 20230523

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230523

R150 Certificate of patent or registration of utility model

Ref document number: 7286239

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150