JP3870937B2 - Arithmetic processing device and arithmetic processing method - Google Patents
Arithmetic processing device and arithmetic processing method Download PDFInfo
- Publication number
- JP3870937B2 JP3870937B2 JP2003271526A JP2003271526A JP3870937B2 JP 3870937 B2 JP3870937 B2 JP 3870937B2 JP 2003271526 A JP2003271526 A JP 2003271526A JP 2003271526 A JP2003271526 A JP 2003271526A JP 3870937 B2 JP3870937 B2 JP 3870937B2
- Authority
- JP
- Japan
- Prior art keywords
- address
- register
- data
- unit
- control unit
- 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.)
- Expired - Fee Related
Links
- 238000012545 processing Methods 0.000 title claims description 107
- 238000003672 processing method Methods 0.000 title claims description 20
- 230000015654 memory Effects 0.000 claims description 185
- 238000004364 calculation method Methods 0.000 claims description 73
- 238000000034 method Methods 0.000 claims description 73
- 238000013500 data storage Methods 0.000 claims description 50
- 230000008569 process Effects 0.000 claims description 49
- 238000006243 chemical reaction Methods 0.000 claims description 37
- 238000001514 detection method Methods 0.000 claims description 19
- 230000006870 function Effects 0.000 description 11
- 238000013519 translation Methods 0.000 description 6
- 230000014509 gene expression Effects 0.000 description 3
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 description 2
- 241000269319 Squalius cephalus Species 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004587 chromatography analysis Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000013075 data extraction Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Landscapes
- Executing Machine-Instructions (AREA)
Description
本発明は、演算の高速化手法に関する。特に、演算パラメータや中間値をレジスタに格納し、演算プロセスにおいて、レジスタの格納値を取得して、取得値に基づいて演算プロセスの次ステップを実行する演算処理において、効率的なレジスタからのデータ取得を可能とすることにより演算の高速化を実現した演算処理装置、および演算処理方法に関する。 The present invention relates to a method for speeding up operations. In particular, data from an efficient register is stored in a calculation process in which calculation parameters and intermediate values are stored in a register, the stored value of the register is acquired in the calculation process, and the next step of the calculation process is executed based on the acquired value. The present invention relates to an arithmetic processing device and an arithmetic processing method that realize high-speed arithmetic by enabling acquisition.
例えば暗号処理等の演算処理においては、あるシーケンスに基づく演算処理を、パラメータや、前ステップで取得した中間値を用いて繰り返し実行する処理が多く行われる。このような演算処理を実行する場合、パラメータや中間値を格納するレジスタが用いられ、レジスタにパラメータや中間値を適宜、格納するとともに、必要に応じてレジスタ格納値を取得して演算プロセスが進行する。 For example, in an arithmetic process such as an encryption process, a process of repeatedly executing an arithmetic process based on a certain sequence using a parameter or the intermediate value acquired in the previous step is often performed. When executing such arithmetic processing, a register for storing parameters and intermediate values is used. The parameters and intermediate values are stored in the registers as appropriate, and the arithmetic process proceeds by acquiring the register stored values as necessary. To do.
例えば、公開鍵暗号方式として楕円曲線暗号(ECC:Ellipitic Curve Cryptography)が知られているが、この暗号処理演算には、パラメータや中間値を格納するレジスタが用いられる。楕円曲線暗号は、160bitの鍵でRSA1024bitの鍵と同等の強度を持つと言われる。 For example, Ellipitic Curve Cryptography (ECC) is known as a public key cryptosystem, and a register for storing parameters and intermediate values is used for this cryptographic processing calculation. The elliptic curve cryptography is said to have a 160-bit key and a strength equivalent to that of the RSA 1024-bit key.
一般に、楕円曲線暗号(Elliptic Curve Cryptography)は、素体上の楕円曲線y2=x3+ax+b(4a3+27b2≠0)や、2の拡大体上の楕円曲線y2+xy=x3+ax2+b(b≠0)などを用いる。これらの曲線上の点に無限遠点(O)を加えた集合は、加法に関して有限群をなし、無限遠点(O)はその単位元となる。以下、この有限群上の点の加法を+で表す。この有限群上の異なる2点P,Qの加算P+Qを「点の加算」、点Pと点Pの加算P+P=2Pを「点の2倍算」と呼ぶ。また、点Pをk回加算した点P+P+…+P=kPを求める演算を「点のスカラー倍算」と呼ぶ。 In general, elliptic curve cryptography is based on an elliptic curve y 2 = x 3 + ax + b (4a 3 + 27b 2 ≠ 0) on a prime field or an elliptic curve y 2 + xy = x 3 + ax 2 on an extension field of 2. + B (b ≠ 0) or the like is used. A set obtained by adding an infinite point (O) to points on these curves forms a finite group with respect to addition, and the infinite point (O) is the unit element. Hereinafter, the addition of points on the finite group is represented by +. The addition P + Q of two different points P and Q on the finite group is called “point addition”, and the addition P + P = 2P of the points P and P is called “point doubling”. Further, an operation for obtaining a point P + P +... + P = kP obtained by adding the point P k times is referred to as “scalar multiplication of points”.
点のスカラー倍算は、点の加算、および点の2倍算を用いて構成できることが知られている。素体上の楕円曲線や2の拡大体上の楕円曲線上のアフィン座標系(x,y)や射影座標(X,Y,Z)における点の加算法、点の2倍算法、および点のスカラー倍算法は、IEEE P1363/D13 Standard Specifications for Public Key Cryptographyに記されている。 It is known that scalar multiplication of points can be constructed using point addition and point doubling. Point addition, point doubling, and point doubling in the affine coordinate system (x, y) and projective coordinates (X, Y, Z) on the elliptic curve on the prime field and the elliptic curve on the two extension field The scalar multiplication method is described in IEEE P1363 / D13 Standard Specifications for Public Key Cryptography.
また、素因数分解を行なうために導入された素体上のモンゴメリ型楕円曲線By2=x3+Ax2+x((A2−4)B≠0)を用いて点のスカラー倍算法を高速に行なう方法(P.Montgomery "Speeding the Pollard and Elliptic Curve Method of Factorization",Mathematics of Computation,Vol.48,No.177,pp.243-264(1987))が提案されている。以下、この手法を素体上の楕円曲線におけるモンゴメリ法と呼ぶ。 Further, the scalar multiplication of points is performed at high speed using the Montgomery-type elliptic curve By 2 = x 3 + Ax 2 + x ((A 2 −4) B ≠ 0) on the prime field introduced for performing the prime factorization. A method (P. Montgomery “Speeding the Pollard and Elliptic Curve Method of Factorization”, Mathematics of Computation, Vol. 48, No. 177, pp. 243-264 (1987)) has been proposed. Hereinafter, this method is referred to as the Montgomery method on an elliptic curve on a prime field.
この手法によれば、アフィン座標系において、異なる2点:P0(x0,y0),P1(x1,y1)の加算点を点P2=P1+P0とすると、P3(x3,y3)=P1(x1,y1)−P0(x0,y0)が既知であれば、
x2=(x0x1−1)2/(x3(x0−x1)2)
により、x2を求めることができる。
According to this method, if an addition point of two different points: P 0 (x 0 , y 0 ), P 1 (x 1 , y 1 ) is set to a point P 2 = P 1 + P 0 in the affine coordinate system, P If 3 (x 3 , y 3 ) = P 1 (x 1 , y 1 ) −P 0 (x 0 , y 0 ) is known,
x 2 = (x 0 x 1 −1) 2 / (x 3 (x 0 −x 1 ) 2 )
It makes it possible to calculate the x 2.
また、点P0(x0,y0)の2倍算点を点P2(x2,y2)=2P0とすると、
x2=(x0 2−1)2/(4x0(x0 2+Ax0+1))
により、x2を求めることができる。このように、y座標を用いないで、点の加算法、および点の2倍算法を構成することができる。
If the doubling point of the point P 0 (x 0 , y 0 ) is the point P 2 (x 2 , y 2 ) = 2P 0 ,
x 2 = (x 0 2 −1) 2 / (4x 0 (x 0 2 + Ax 0 +1))
It makes it possible to calculate the x 2. Thus, the point addition method and the point doubling method can be configured without using the y coordinate.
上述の楕円曲線暗号(ECC)に基づく暗号化あるいは復号化に伴う演算処理を実行する場合、あるシーケンスに基づく演算処理を、パラメータや、前ステップで取得した中間値を用いて繰り返し実行する処理が多く行われる。レジスタは、複数の値を格納するため複数のデータ格納領域としての複数レジスタによって構成される。 When performing arithmetic processing accompanying encryption or decryption based on the above-described elliptic curve cryptography (ECC), processing for repeatedly executing arithmetic processing based on a sequence using parameters and intermediate values acquired in the previous step is performed. Much done. The register is composed of a plurality of registers as a plurality of data storage areas for storing a plurality of values.
このようなレジスタに対するデータ格納、レジスタからのデータ読み込みを繰り返し実行する演算処理においては、次の演算サイクルにおいてレジスタから読み出し予定のデータがレジスタの予定位置に格納されていない場合に、予定位置にデータコピー処理を行うことが必要となる。その結果、コピー処理に伴う処理時間が増大し、演算処理の遅延を発生させ、演算効率の低下を招くという問題があった。 In an arithmetic process that repeatedly executes data storage and data reading from the register, data is not stored at the planned position if the data scheduled to be read from the register is not stored at the planned position in the next calculation cycle. It is necessary to perform copy processing. As a result, there is a problem in that the processing time associated with the copy process increases, causing a delay in the calculation process and reducing the calculation efficiency.
本発明は、上記、問題点に鑑みてなされたものであり、レジスタに対するデータ格納、レジスタからのデータ読み込みを繰り返し実行する演算処理において、パラメータ、中間値の格納領域が予め定めた特定レジスタでない場合においても、アドレス制御を行うことで、レジスタからの効率的なデータ取得を可能とし、高速な演算処理を実現する演算処理装置、および演算処理方法を提供するものである。 The present invention has been made in view of the above problems, and in the arithmetic processing for repeatedly executing data storage to the register and data reading from the register, the parameter and intermediate value storage areas are not predetermined specific registers. However, the present invention provides an arithmetic processing device and an arithmetic processing method that enable efficient data acquisition from a register by performing address control and realize high-speed arithmetic processing.
本発明の第1の側面は、
データ格納領域としてのレジスタを複数有するメモリブロックを持つメモリ部と、前記レジスタの指定アドレスに基づいてレジスタから読み出されたデータを入力し、入力データに基づく演算処理を実行する演算部と、演算部に対するデータ入出力制御を実行する制御部とを有する演算処理装置において、
前記制御部からレジスタ指定アドレスを入力し、入力アドレスの変換処理を実行するアドレス制御部を有し、
前記アドレス制御部は、前記制御部から予め定められた特定レジスタのアドレスを入力し、かつ、前記演算部に出力予定のデータを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合において、前記制御部からの入力アドレスを前記データ格納レジスタの指定アドレスに変換して、該変換アドレスを前記メモリブロックに対する読み出しアドレスとして出力する構成を有することを特徴とする演算処理装置にある。
The first aspect of the present invention is:
A memory unit having a memory block having a plurality of registers as a data storage area, an arithmetic unit that inputs data read from the register based on a designated address of the register, and executes arithmetic processing based on the input data; An arithmetic processing unit having a control unit that performs data input / output control on the unit,
An address control unit that inputs a register designation address from the control unit and executes input address conversion processing,
The address control unit inputs a predetermined register address from the control unit, and a data storage register storing data to be output to the arithmetic unit is stored in the same memory block as the specific register. In the case of different registers, the arithmetic processing has a configuration in which an input address from the control unit is converted into a designated address of the data storage register, and the converted address is output as a read address for the memory block. In the device.
さらに、本発明の演算処理装置の一実施態様において、前記アドレス制御部は、前記データ格納レジスタのアドレスを格納したラッチと、前記制御部からの入力アドレスが予め定められた特定レジスタのアドレスと一致するか否かを検出する一致検出部と、前記一致検出部の検出情報に基づいて、前記制御部からの入力アドレス、または前記ラッチに格納した前記データ格納レジスタのアドレスのいずれかを選択して、前記メモリブロックに対する読み出しアドレスとして出力するスイッチ手段と、を有することを特徴とする。 Furthermore, in one embodiment of the arithmetic processing unit of the present invention, the address control unit includes a latch that stores an address of the data storage register, and an input address from the control unit matches a predetermined register address. Based on the detection information of the coincidence detecting unit and the coincidence detecting unit, the input address from the control unit or the address of the data storage register stored in the latch is selected based on the detection information of the coincidence detecting unit. Switch means for outputting as a read address for the memory block.
さらに、本発明の演算処理装置の一実施態様において、前記アドレス制御部は、さらに、前記演算部に出力予定のデータを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合にのみ、アドレス変換動作を有効とする情報を格納した情報格納部を含み、該情報格納部にアドレス変換動作を有効とする情報が格納されている場合にのみアドレス変換処理を行う構成であることを特徴とする。 Furthermore, in one embodiment of the arithmetic processing unit of the present invention, the address control unit further includes a data storage register in which data to be output is stored in the arithmetic unit and a different register in the same memory block as the specific register A configuration that includes an information storage unit that stores information that validates the address translation operation only when the address translation operation is stored, and that performs address translation processing only when information that validates the address translation operation is stored in the information storage unit It is characterized by being.
さらに、本発明の演算処理装置の一実施態様において、前記演算部は、暗号処理演算におけるモンゴメリ演算を実行する乗算器および加算器を含み、前記メモリ部は、複数のメモリブロック中の2つのメモリブロックの特定レジスタを次期演算サイクルにおいて前記演算部に入力予定のモンゴメリ演算に適用するパラメータまたは中間値の格納予定領域として設定された構成であり、前記アドレス制御部は、前記制御部からモンゴメリ演算に適用するパラメータまたは中間値の格納予定領域として設定された前記特定レジスタのアドレスを入力し、かつ、前記演算部に出力予定のデータを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合において、前記制御部からの入力アドレスを前記データ格納レジスタの指定アドレスに変換して、該変換アドレスを前記メモリブロックに対する読み出しアドレスとして出力する構成を有することを特徴とする。 Furthermore, in one embodiment of the arithmetic processing apparatus of the present invention, the arithmetic unit includes a multiplier and an adder that execute Montgomery arithmetic in cryptographic processing arithmetic, and the memory unit includes two memories in a plurality of memory blocks. The specific register of the block is set as a storage area for parameters or intermediate values to be applied to the Montgomery calculation scheduled to be input to the calculation unit in the next calculation cycle, and the address control unit performs the Montgomery calculation from the control unit. A memory block in which the address of the specific register set as the storage area for the parameter to be applied or the intermediate value is input, and the data storage register storing the data to be output in the arithmetic unit is the same as the specific register The input address from the control unit It is converted to the specified address of the data storage registers, characterized by having a configuration for outputting the translated address as a read address for the memory block.
さらに、本発明の演算処理装置の一実施態様において、前記演算処理装置は、下記モンプロ演算を実行する演算処理装置であり、
MonPro(a*,b*)
t=a*×b*
for i = 0 to dl-1
m=t0×P0'mod r
t=(t+m×P)/r
next i
if t≧P then return t−P
else return t
前記複数のメモリブロック中の2つのメモリブロックの特定レジスタには、前記モンプロ演算におけるパラメータa*またはb*の格納予定レジスタとして設定された構成であることを特徴とする。
Furthermore, in one embodiment of the arithmetic processing device of the present invention, the arithmetic processing device is an arithmetic processing device that executes the following monpro operation:
MonPro (a * , b * )
t = a * × b *
for i = 0 to dl-1
m = t 0 × P 0 'mod r
t = (t + m × P) / r
next i
if t ≧ P then return t−P
else return t
The specific registers of the two memory blocks in the plurality of memory blocks are configured to be stored as registers for storing parameters a * or b * in the monpro operation.
さらに、本発明の第2の側面は、
演算処理方法であり、
演算部に対するデータ入出力制御を実行する制御部においてレジスタの指定アドレスを生成するアドレス生成ステップと、
前記制御部から予め定められた特定レジスタのアドレスを入力し、かつ、演算部に出力予定のデータを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合において、前記制御部からの入力アドレスを前記データ格納レジスタの指定アドレスに変換して、該変換アドレスをメモリブロックに対する読み出しアドレスとして出力するアドレス制御ステップと、
前記アドレス制御ステップにおいて制御されたアドレスに基づいてメモリブロックのレジスタからデータを読み出し前記演算部に出力するデータ読み出しステップと、
を有することを特徴とする演算処理方法にある。
Furthermore, the second aspect of the present invention provides
An arithmetic processing method,
An address generation step of generating a specified address of the register in the control unit that executes data input / output control for the arithmetic unit;
In the case where the address of the specific register determined in advance from the control unit and the data storage register storing the data to be output to the arithmetic unit are different registers in the same memory block as the specific register, An address control step of converting an input address from the control unit into a designated address of the data storage register and outputting the converted address as a read address for the memory block;
A data read step for reading data from a register of a memory block based on the address controlled in the address control step and outputting the data to the arithmetic unit;
There is an arithmetic processing method characterized by comprising:
さらに、本発明の演算処理方法の一実施態様において、前記アドレス制御ステップは、さらに、前記制御部からの入力アドレスが予め定められた特定レジスタのアドレスと一致するか否かを検出する一致検出ステップと、前記一致検出ステップにおける検出情報に基づいて、前記制御部からの入力アドレス、または予めラッチに格納した前記データ格納レジスタのアドレスのいずれかを選択して、前記メモリブロックに対する読み出しアドレスとして出力する出力切り替えステップとを有することを特徴とする。 Furthermore, in an embodiment of the arithmetic processing method of the present invention, the address control step further includes a coincidence detecting step for detecting whether or not an input address from the control unit coincides with a predetermined specific register address. Based on the detection information in the coincidence detection step, either an input address from the control unit or an address of the data storage register stored in advance in the latch is selected and output as a read address for the memory block And an output switching step.
さらに、本発明の演算処理方法の一実施態様において、前記演算部に出力予定のデータを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合にのみ、前記アドレス制御ステップにおけるアドレス変換処理を行うことを特徴とする。 Furthermore, in one embodiment of the arithmetic processing method of the present invention, the address is stored only when a data storage register storing data to be output in the arithmetic unit is a different register in the same memory block as the specific register. An address conversion process is performed in the control step.
さらに、本発明の演算処理方法の一実施態様において、前記アドレス制御ステップは、前記制御部からモンゴメリ演算に適用するパラメータまたは中間値の格納予定領域として設定された特定レジスタのアドレスを入力し、かつ、前記演算部に出力予定のデータを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合において、前記制御部からの入力アドレスを前記データ格納レジスタの指定アドレスに変換して、該変換アドレスを前記メモリブロックに対する読み出しアドレスとして出力することを特徴とする。 Furthermore, in one embodiment of the arithmetic processing method of the present invention, the address control step inputs a parameter to be applied to Montgomery arithmetic or an address of a specific register set as an intermediate value storage scheduled area from the control unit, and When the data storage register storing the data to be output in the arithmetic unit is a different register in the same memory block as the specific register, the input address from the control unit is set as the designated address of the data storage register. The converted address is output as a read address for the memory block.
さらに、本発明の演算処理方法の一実施態様において、下記モンプロ演算を実行する演算ステップを含み、
MonPro(a*,b*)
t=a*×b*
for i = 0 to dl-1
m=t0×P0'mod r
t=(t+m×P)/r
next i
if t≧P then return t−P
else return t
前記アドレス制御ステップは、前記制御部から前記モンプロ演算におけるパラメータa*またはb*の格納予定領域として設定された特定レジスタのアドレスを入力し、かつ、前記演算部に出力予定のデータを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合において、前記制御部からの入力アドレスを前記データ格納レジスタの指定アドレスに変換して、該変換アドレスを前記メモリブロックに対する読み出しアドレスとして出力することを特徴とする。
Furthermore, in one embodiment of the calculation processing method of the present invention, the calculation processing method includes the calculation step of executing the following monpro calculation:
MonPro (a * , b * )
t = a * × b *
for i = 0 to dl-1
m = t 0 × P 0 'mod r
t = (t + m × P) / r
next i
if t ≧ P then return t−P
else return t
In the address control step, an address of a specific register set as a storage area for the parameter a * or b * in the monpro calculation is input from the control unit, and data to be output is stored in the calculation unit. When the data storage register is a different register of the same memory block as the specific register, the input address from the control unit is converted into a specified address of the data storage register, and the converted address is read out from the memory block It is output as an address.
本発明の構成によれば、データ格納領域としてのレジスタを複数有するメモリブロックを持つメモリ部と、レジスタの指定アドレスに基づいてレジスタから読み出されたデータを入力し、入力データに基づく演算処理を実行する演算部と、演算部に対するデータ入出力制御を実行する制御部とを有する演算処理装置において、演算部に出力予定のデータを格納しているデータ格納レジスタが予め定めた特定レジスタと同一のメモリブロックの異なるレジスタである場合において、制御部からの入力アドレスをデータ格納レジスタの指定アドレスに変換して、該変換アドレスをメモリブロックに対する読み出しアドレスとして出力するアドレス制御処理を実行する構成としたので、予め定めた特定レジスタに対するデータコピー処理を削減してデータ読み出しおよび演算処理を実行することが可能となり、演算の高速化が実現される。 According to the configuration of the present invention, a memory unit having a memory block having a plurality of registers as data storage areas, and data read from the register based on a designated address of the register are input, and arithmetic processing based on the input data is performed. In an arithmetic processing unit having a calculation unit to be executed and a control unit for executing data input / output control on the calculation unit, a data storage register storing data to be output in the calculation unit is the same as a predetermined specific register In the case of different registers in the memory block, the address control process is executed to convert the input address from the control unit to the designated address of the data storage register and output the converted address as a read address for the memory block. , Reduce the data copy process for a specific register It is possible to perform the chromatography data reading and processing, faster operation is realized.
さらに、本発明の構成によれば、モンゴリ演算におけるモンプロ演算:MonPro(a*,b*)の実行において、モンプロ演算におけるパラメータa*またはb*の格納予定領域として設定された特定レジスタと異なるレジスタに、出力予定のパラメータa*またはb*の対応データを格納している場合において、制御部からの入力アドレスを出力予定のパラメータa*またはb*のデータ格納レジスタの指定アドレスに変換して、該変換アドレスを前記メモリブロックに対する読み出しアドレスとして出力する構成としたので、暗号処理演算において、複数回繰り返し実行されるモンプロ演算のデータコピー処理の削減が可能となり、暗号処理演算の高速化が実現される。 Furthermore, according to the configuration of the present invention, in the execution of the Monpro operation: MonPro (a * , b * ) in the Mongolian operation, a register different from the specific register set as the storage area for the parameter a * or b * in the Monpro operation When the data corresponding to the parameter a * or b * to be output is stored, the input address from the control unit is converted to the designated address of the data storage register of the parameter a * or b * to be output, Since the conversion address is output as a read address for the memory block, it is possible to reduce the data copy processing of the monpro operation that is repeatedly executed a plurality of times in the cryptographic processing operation, and the speed of the cryptographic processing operation is realized. The
以下、本発明の演算処理装置、および演算処理方法について詳細に説明する。 Hereinafter, the arithmetic processing device and the arithmetic processing method of the present invention will be described in detail.
本発明は、レジスタに対するデータ格納、レジスタからのデータ読み込みを繰り返し実行する演算処理において、パラメータ、中間値の格納領域が予め定めた特定レジスタでない場合においても、アドレス制御を行うことで、レジスタからの効率的なデータ取得を可能とし、高速な演算処理を実現する演算処理装置、および演算処理方法を提供するものである。 According to the present invention, in the arithmetic processing in which data storage to the register and data reading from the register are repeatedly executed, even when the parameter and intermediate value storage area is not a predetermined specific register, the address control is performed to perform the address control. The present invention provides an arithmetic processing device and an arithmetic processing method that enable efficient data acquisition and realize high-speed arithmetic processing.
以下では、レジスタを適用した演算処理の具体的な例として、公開鍵暗号方式における楕円曲線暗号(Elliptic Curve Cryptography)の演算処理を実行する場合の例について説明する。 Hereinafter, as a specific example of the arithmetic processing using the register, an example in which arithmetic processing of elliptic curve cryptography (Elliptic Curve Cryptography) in the public key cryptosystem is executed will be described.
暗号方式は、大きく分けるとメッセージの発信者と受信者が同じ鍵を用いる共通鍵暗号方式と、メッセージの発信者と受信者が異なる鍵を用いる公開鍵暗号方式とがある。両暗号方式には、以下の特徴がある。
共通鍵暗号:暗号化、復号化の速度が高速に行なわれる。
公開鍵暗号:演算が複雑で、鍵長が長いため、解読は非常に困難(離散対数問題)である。
The encryption methods are roughly classified into a common key encryption method in which the message sender and receiver use the same key, and a public key encryption method in which the message sender and receiver use different keys. Both encryption methods have the following characteristics.
Common key cryptography: encryption and decryption are performed at high speed.
Public key cryptography: Computation is complicated and key length is long, so decryption is very difficult (discrete logarithm problem).
現在では、両方式の利点を生かして、コンテンツの暗号化は共通鍵方式を用い、その鍵の受渡しに公開鍵暗号方式を用いるという使われ方が多い。公開鍵暗号方式では、金融系で古くから使われているRSA暗号と、RSA暗号と同じセキュリティ強度をRSA暗号より短い鍵長で実現できる楕円曲線暗号の2つが代表的である。楕円曲線暗号では、鍵長が短いため、RSA暗号に比べて演算時間が短いという特徴を持つ。近年、金融系とつながらないプラットフォームでの鍵の受け渡しや認証に用いる暗号方式として、楕円曲線暗号が注目されている。 Currently, taking advantage of both methods, content encryption is often performed using a common key method and a public key encryption method is used for delivering the key. There are two typical public key cryptosystems: RSA cryptography that has been used for a long time in financial systems, and elliptic curve cryptography that can realize the same security strength as RSA cryptography with a shorter key length than RSA cryptography. Elliptic curve cryptography has a feature that the computation time is shorter than that of RSA cryptography because the key length is short. In recent years, elliptic curve cryptography has attracted attention as an encryption method used for key exchange and authentication on platforms not connected to financial systems.
例えば、楕円曲線上での鍵交換は、素数を"P"としたとき、楕円曲線
E:y2=x3+ax+b ( mod P )
とE上の点"G"が定義されている状態で、発信者Aと受信者Bが適当な数値"r"と"s"を発生させ
Aさん:rGを計算して、その座標をBさんに送る。
Bさん:sGを計算して、その座標をAさんに送る。
お互いの座標を受け取った後、
Aさん:r(sG)=rsGを計算。
Bさん:s(rG)=srGを計算。
を計算する事により、Aさん・Bさんは共通の鍵"rsG"を得る。悪意の第3者が、送信データ"rG","sG"を得ても、それから"rsG"を得るのは事実上不可能である。
For example, in the key exchange on the elliptic curve, when the prime number is “P”, the elliptic curve E: y 2 = x 3 + ax + b (mod P)
With the point “G” on E and E defined, caller A and receiver B generate appropriate numbers “r” and “s”. A: Calculate rG and set its coordinates to B Send to.
Mr. B: Calculate sG and send the coordinates to Mr. A.
After receiving each other's coordinates,
Mr. A: Calculate r (sG) = rsG.
Mr. B: Calculate s (rG) = srG.
By calculating, Mr. A and Mr. B obtain a common key “rsG”. Even if a malicious third party obtains the transmission data “rG” and “sG”, it is virtually impossible to obtain “rsG” therefrom.
楕円上の演算式としては、次の2つが定義されている。
2倍算:(x2,y2)=2(x1,y1)
x2=α2−2x1
y2=−y1+α(x1―x2)
ただし、α=(3x1 2+a)/2y1
加算:(x3,y3)=(x2,y2)+(x1,y1)
x3=α2−x1−x2
y2=−y1+α(x1―x3)
ただし、α=(y2−y1)/(x2−x1)
The following two are defined as arithmetic expressions on the ellipse.
Double calculation: (x 2 , y 2 ) = 2 (x 1 , y 1 )
x 2 = α 2 -2x 1
y 2 = −y 1 + α (x 1 −x 2 )
Where α = (3 × 1 2 + a) / 2y 1
Addition: (x 3 , y 3 ) = (x 2 , y 2 ) + (x 1 , y 1 )
x 3 = α 2 −x 1 −x 2
y 2 = −y 1 + α (x 1 −x 3 )
Where α = (y 2 −y 1 ) / (x 2 −x 1 )
この2つの演算を用いれば、楕円上の点のスカラー倍演算は可能となる。例えば剰余数がL[bit]の場合
W=sG (s=Σi=0 L-1si・2i )
の計算は、
W=G
for i = L-1 to 0
W:=2×W
if si=1 then W:=W+G
next i
となる。
If these two operations are used, scalar multiplication of points on the ellipse can be performed. For example, when the remainder number is L [bit], W = sG (s = Σ i = 0 L−1 s i · 2 i )
The calculation of
W = G
for i = L-1 to 0
W: = 2 × W
if s i = 1 then W: = W + G
next i
It becomes.
例えば、200Gの演算は、
200G=2{2{2{2{2{2{2G+G}}}+G}}}
で計算される。
For example, the calculation of 200G is
200G = 2 {2 {2 {2 {2 {2 {2G + G}}} + G}}}
Calculated by
しかし、実際の演算では、2倍算、加算の度に逆数演算が必要となり、これには Euclid 互除法またはベキ乗剰余演算が用いられるが、この演算には多くの演算サイクルが必要となる。このため、通常は、3次元のJacobian(ヤコビアン)座標上に展開してスカラー倍演算を行ない、最後に2次元のAffin(アフィン)座標に戻すという手法が採られている。Affin座標(x,y)からJacobian座標(X,Y,Z)への展開は、下記関係式により行なわれる。 However, in actual calculations, reciprocal calculation is required for each doubling and addition, and Euclid algorithm or power-residue calculation is used for this, but this calculation requires many calculation cycles. For this reason, usually, a technique is adopted in which expansion is performed on three-dimensional Jacobian coordinates, scalar multiplication is performed, and finally, two-dimensional Affin coordinates are restored. Expansion from Affin coordinates (x, y) to Jacobiian coordinates (X, Y, Z) is performed by the following relational expression.
x=X/Z2 ・・(数式1)
y=Y/Z3 ・・(数式2)
ここで、Z=1とおくと、
(X,Y,Z)=(x,y,1)
となり、Jacobian座標への展開ができる。
x = X / Z 2 (Equation 1)
y = Y / Z 3 (Equation 2)
Here, if Z = 1,
(X, Y, Z) = (x, y, 1)
Thus, expansion to the Jacobian coordinates can be performed.
Jacobian座標上での2倍算、加算の式は、以下に示される式となる。 Expressions for doubling and adding on the Jacobian coordinates are as shown below.
2倍算:(X2,Y2,Z2)=2(X1,Y1,Z1)
X2=M2−2U (modP)・・(数式3)
Y2=−8Y4+M(U−X2 ) (modP)・・(数式4)
Z2=2Y1Z1 (modP)・・(数式5)
ただし、M=3X1 2+aZ1 4,U=4X1Y1 2
Double multiplication: (X 2 , Y 2 , Z 2 ) = 2 (X 1 , Y 1 , Z 1 )
X 2 = M 2 −2U (modP) (3)
Y 2 = −8 Y 4 + M (U−X 2 ) (modP) (Equation 4)
Z 2 = 2Y 1 Z 1 (modP) (Equation 5)
However, M = 3X 1 2 + aZ 1 4 , U = 4X 1 Y 1 2
加算:(X3,Y3,Z3)=(X2,Y2,Z2)+(X1,Y1,Z1)
X3=R2−TW2 (modP)・・(数式6)
Y3={ R(TW2−2X3)−SW3 }/2 (modP)・・(数式7)
Z3=Z1Z2W (modP)・・(数式8)
ただし、R=Y2Z1 3−Y1Z2 3 ,S=Y2Z1 3+Y1Z2 3
W=X2Z1 2−X1Z2 2 ,T=X2Z1 2+X1Z2 2
と定義できる。
Addition: (X 3 , Y 3 , Z 3 ) = (X 2 , Y 2 , Z 2 ) + (X 1 , Y 1 , Z 1 )
X 3 = R 2 −TW 2 (modP) (Equation 6)
Y 3 = {R (TW 2 −2X 3 ) −SW 3 } / 2 (modP) (Equation 7)
Z 3 = Z 1 Z 2 W (modP) (Equation 8)
However, R = Y 2 Z 1 3 −Y 1 Z 2 3 , S = Y 2 Z 1 3 + Y 1 Z 2 3
W = X 2 Z 1 2 −X 1 Z 2 2 , T = X 2 Z 1 2 + X 1 Z 2 2
Can be defined.
これを用いて、スカラー倍演算を行ない、最後に、(数式1)、(数式2)に基づいてAffin座標への逆変換を行なう。この時、Zの逆数を求める必要があるが、これは、スカラー倍演算で1回行なえばよく、Affin座標上でスカラー倍演算を行なう場合に比べて、演算に要するサイクル数は大幅に少なくてすむ。 Using this, scalar multiplication is performed, and finally, inverse conversion to Affin coordinates is performed based on (Equation 1) and (Equation 2). At this time, it is necessary to obtain the reciprocal of Z, but this may be performed once by the scalar multiplication, and the number of cycles required for the calculation is significantly smaller than the case of performing the scalar multiplication on the Affin coordinates. I'm sorry.
上述の(数式3)〜(数式8)の演算における、素数"P"による剰余演算は、バレット(Barret)法やモンゴメリ(Montgomery)法を適用して、演算サイクル数を削減し、演算時間の削減をはかることが可能である。 In the operations of (Equation 3) to (Equation 8) described above, the remainder calculation using the prime “P” applies the Barret method or the Montgomery method to reduce the number of operation cycles and reduce the calculation time. Reductions can be made.
モンゴメリ(Montgoemry)法を用いた乗算剰余演算では、例えば、
c=a×b mod Pの計算を行なう場合、Pより大きい値"R"(通常、2のベキ乗値)を定義し、
R・R-1−P・P'=1・・・(数式9)
を満たす値"P'"を求めておく。
In a modular multiplication operation using the Montgoemry method, for example,
When calculating c = a × b mod P, define a value “R” (usually a power of 2) greater than P;
R · R −1 −P · P ′ = 1 (Equation 9)
A value “P ′” that satisfies the above is obtained.
この時、乗算剰余演算は、
a*=a×R mod P・・・(数式10)
b*=b×R mod P・・・(数式11)
c*=MonPro(a*,b*)・・(数式12)
c =MonPro(c*,1)・・(数式13)
として行なわれる。
At this time, the modular multiplication operation is
a * = a × R mod P (Formula 10)
b * = b × R mod P (Formula 11)
c * = MonPro (a * , b * ) (formula 12)
c = MonPro (c * , 1) (Equation 13)
As done.
乗算剰余のみだと効率が悪いが、「楕円曲線上の点のスカラー倍演算」等に適用する場合、例えば、
W=sG(s=Σi=0 L-1si・2i )
を計算する場合、
Xg*=xg・r mod P
Yg*=yg・r mod P
Zg*= 1・r mod P
W*=(Xw*,Yw*,Zw*)=G*=(Xg*,Yg*,Zg*)
for i = L-1 to 0
W*:=2×W*
if si=1 then W*:=W*+G*
next i
Xw=MonPro(Xw*,1)
Yw=MonPro(Yw*,1)
Zw=MonPro(Zw*,1)
xw=Xw/Zw2 mod P
yw=Yw/Zw3 mod P
の様に、演算サイクル数の大部分を占めるループの前と後にパラメータの変換を行ない、ループ内はパラメータ変換した値でモンゴメリ(Montgomery)演算を実行することにより、演算サイクル数が格段に削減できる。
When it is applied to "scalar multiplication of points on an elliptic curve" etc.
W = sG (s = Σ i = 0 L−1 s i · 2 i )
When calculating
Xg * = xg · r mod P
Yg * = yg · r mod P
Zg * = 1 ・ r mod P
W * = (Xw * , Yw * , Zw * ) = G * = (Xg * , Yg * , Zg * )
for i = L-1 to 0
W * : = 2 × W *
if s i = 1 then W * : = W * + G *
next i
Xw = MonPro (Xw * , 1)
Yw = MonPro (Yw * , 1)
Zw = MonPro (Zw * , 1)
xw = Xw / Zw 2 mod P
yw = Yw / Zw 3 mod P
In this way, parameter conversion is performed before and after the loop that accounts for the majority of the number of operation cycles, and the number of operation cycles can be significantly reduced by executing Montgomery operation with the parameter converted value in the loop. .
この演算で使われているモンプロ(MonPro)関数は、以下の様に定義される。
MonPro(a*,b*)・・・(数式14)
t=a*×b*
m=t×P' mod R
u=(t+m×P)/R
if u≧P then return u−P
else return u
The MonPro function used in this calculation is defined as follows:
MonPro (a * , b * ) (Formula 14)
t = a * × b *
m = t × P ′ mod R
u = (t + m × P) / R
if u ≧ P then return u−P
else return u
または、乗算器のデータ幅をr[bit],データ幅をdl[word:=rbit]とした時、
MonPro(a*,b*)・・・(数式15)
t=a*×b*
for i = 0 to dl-1
m=t0×P0'mod r
t=(t+m×P)/r
next i
if t≧P then return t−P
else return t
で定義される。
Or, when the data width of the multiplier is r [bit] and the data width is dl [word: = rbit],
MonPro (a * , b * ) (Formula 15)
t = a * × b *
for i = 0 to dl-1
m = t 0 × P 0 'mod r
t = (t + m × P) / r
next i
if t ≧ P then return t−P
else return t
Defined by
上記(数式15)で、t0 ,P' 0はt,P'の0ワード目の値を示す。この演算は、ソフトウェアで規定した演算プログラムで実現する方法と、ハードウェアで実現する方法がある。CPUパワーの無い携帯機器への搭載や、高いセキュリティが必要とされる機器への搭載は、ハードウェアで実現するのが望ましい。 In the above (Formula 15), t 0 and P ′ 0 indicate the values of the 0th word of t and P ′. This calculation includes a method realized by a calculation program defined by software and a method realized by hardware. It is desirable that mounting on a portable device without CPU power or mounting on a device requiring high security is realized by hardware.
上記の(数式15)で示されるモンゴメリ(Montgomery)演算におけるモンプロ(MonPro)関数MonPro(a*,b*)の演算を実行する本発明に係る演算処理装置のハードウェア構成例を図1に示す。 FIG. 1 shows an example of the hardware configuration of an arithmetic processing apparatus according to the present invention that executes the operation of the MontPro function (MonPro) (MonPro (a * , b * )) in the Montgomery operation expressed by the above (Formula 15). .
演算処理装置は、メモリ部110、演算部150を有し、演算部に入力するデータがメモリ部110のレジスタ群のいずれかに格納され、図示しない制御部からのアドレス信号に応じてレジスタからデータが取得され、メモリバススイッチ回路130、およびバスを介して演算部150に入力され、演算部150での演算がなされ、その結果が、バスおよびメモリバススイッチ回路130を介してメモリ部110内のレジスタに格納される。
The arithmetic processing unit includes a
本発明の演算処理装置は、さらにアドレス制御回路200を有し、図示しない制御回路からのアドレスデータを変換して各メモリブロックに出力する。
The arithmetic processing unit of the present invention further includes an
上述のモンゴメリ(Montgomery)演算では、複数回のMonPro(a*,b*)演算を繰り返し実行することになり、各MonPro(a*,b*)演算毎にレジスタからのデータ取得、レジスタに対するデータ格納処理が実行される。 In the Montgomery operation described above, a plurality of MonPro (a * , b * ) operations are repeatedly executed, and data acquisition from the register and data for the register are performed for each MonPro (a * , b * ) operation. Storage processing is executed.
演算部150は、乗算器152と加算器154,157、演算のパラメータや途中結果を格納するラッチ151,153,155,156,158および、これらを制御する図示しないコントロール回路で構成される。
The
メモリ部110は、6個の単位データ格納領域としてのレジスタを有する4つのメモリブロック:メモリ0,120、メモリ1,121、メモリ2,122、メモリ3,123を有する。各メモリブロックは行デコーダ、列デコーダを有し、行デコーダが、入力アドレスに基づいて指定レジスタを選択し、指定レジスタから所定ワード単位のデータを列レジスタを介してメモリバススイッチ回路によって接続されたバスに出力、またはバスからのデータ入力を行う。例えばアドレスは、アドレスA0〜A5によって構成され、レジスタ選択は、図示しない制御部から行デコーダに入力されるアドレスA3〜A5を用いて実行され、多倍長データのワード選択は、図示しない制御部から列デコーダに入力されるアドレスA0〜A2を用いて行われる。
The
多倍長の乗算演算では乗数と被乗数の乗算器への設定と、乗算結果の取出しを行なう必要があるため、少なくとも3つのメモリブロックが必要である。多倍長の加算演算でも同様に3つのメモリブロックが必要となる。例えば、4つのメモリブロックを用いて演算を行なう場合、演算のフローの中で保持しておく中間値を含めた最も多いデータの個数を元に必要なデータ容量を設定する。図1は、楕円曲線上の演算で最も多いデータの個数が24個の場合の構成である。 In a multiple-length multiplication operation, it is necessary to set a multiplier and a multiplicand in a multiplier and to extract a multiplication result. Therefore, at least three memory blocks are required. Similarly, three memory blocks are required for the multiple length addition operation. For example, when performing calculations using four memory blocks, the necessary data capacity is set based on the largest number of data including intermediate values held in the calculation flow. FIG. 1 shows a configuration in the case where the number of data with the largest number of calculations on an elliptic curve is 24.
この構成で、例えば、メモリ1,121のレジスタ9(reg.9)の格納値と、メモリ3,123のレジスタ15(reg.15)の格納値とを演算部150に出力し、乗算処理を実行し、その結果をメモリ0,120のレジスタ4(reg.4)とレジスタ8(reg.8)に分割して格納する場合、すなわち、
(reg.9)×(reg.15)=(reg.8, reg.4)
の多倍長乗算を実行する場合の処理例について説明する。
With this configuration, for example, the stored value of the register 9 (reg. 9) of the
(Reg.9) x (reg.15) = (reg.8, reg.4)
An example of processing in the case of executing the multiple length multiplication will be described.
まず、本発明の特徴であるアドレス制御回路200を持たない場合の処理例について、説明し、その後、アドレス制御回路200によるアドレス制御を実行した場合の処理例について説明する。
First, a processing example when the
(reg.9)×(reg.15)=(reg.8, reg.4)
の多倍長乗算を実行する場合、図示しない制御部からの制御信号に基づいてメモリバススイッチ回路130を制御して、メモリ1とバス0、メモリ3とバス1、メモリ0とバス3を接続する。
(Reg.9) x (reg.15) = (reg.8, reg.4)
When executing a multiple length multiplication of the memory, the memory
次に、多倍長の乗算フローにしたがって、図示しない制御部において、メモリ1,121のレジスタ9(reg.9)の格納値と、メモリ3,123のレジスタ15(reg.15)の格納値とを取り出すためのアドレス1とアドレス3を発生させてメモリバススイッチ回路130および各バスを介して、演算部150の乗算器152前段のラッチ151に格納し、乗算処理を開始する。
Next, according to the multiple-length multiplication flow, in the control unit (not shown), the stored value of the register 9 (reg. 9) in the
なお、演算部150において、乗算器の入力として、レジスタ9(reg.9)の格納値とレジスタ15(reg.15)の格納値が設定され、乗算処理がなされた結果は、バス3およびメモリバススイッチ回路130を介して、メモリ0,120に入力され、アドレス制御回路からのアドレス(アドレス0)に従って指定されたレジスタ(reg.8,reg.4)に乗算結果が格納される。
Note that in the
Jacobian座標上での演算では、複数回のモンゴメリ(Montgomery)演算が必要となる。この演算を実現する手法として、多数回用いられるモンゴメリ(Montgomery)演算を関数化して必要に応じて呼び出す構成を採ることで回路規模は削減される。ただし、演算パラメータすなわち、モンゴメリ(Montgomery)演算において実行するモンプロ関数のパラメータ(MonPro(a*, b*)の、a*, b*)をセットするレジスタ位置は固定されることになる。 The calculation on the Jacobian coordinates requires a plurality of Montgomery calculations. As a technique for realizing this operation, the circuit scale is reduced by adopting a configuration in which a Montgomery operation used many times is converted into a function and called as necessary. However, operation parameters i.e., Montgomery (Montgomery) parameters Monpuro functions that perform the calculation (MonPro (a *, b * ) of, a *, b *) register positions that set will be fixed.
例えばメモリ部110のレジスタ0(reg.0)〜レジスタ7(reg.7)をモンゴメリ(Montgomery)演算におけるモンプロ関数:c*=MonPro(a*,b*)のパラメータ及び演算途中結果としての中間値を格納する場所に設定する。
For example, register 0 (reg. 0) to register 7 (reg. 7) of the
具体例として、パラメータ"a*"と"b*"の格納場所をレジスタ5(reg.5)とレジスタ6(reg.6)に固定し、演算結果c*の格納場所を同じレジスタ5(reg.5)とレジスタ6(reg.6)になる様な設計である場合を想定する。 As a specific example, the storage locations of the parameters “a * ” and “b * ” are fixed to the register 5 (reg. 5) and the register 6 (reg. 6), and the storage location of the operation result c * is the same register 5 (reg. .5) and register 6 (reg. 6) are assumed.
パラメータ"a*"と"b*"の格納場所をレジスタ5(reg.5)とレジスタ6(reg.6)に固定することで、パラメータ"a*"と"b*"を適用したモンプロ関数:c*=MonPro(a*,b*)を演算部150において実行する場合、常に一定のアドレスを適用してデータ取り出しを実行することが可能となる。
A monpro function to which the parameters “a * ” and “b * ” are applied by fixing the storage locations of the parameters “a * ” and “b * ” in the register 5 (reg. 5) and the register 6 (reg. 6). When c * = MonPro (a * , b * ) is executed in the
前の演算サイクルにおける計算結果は、メモリ0,120〜メモリ3,123の24個のレジスタのいずれかのレジスタに格納されることになるので、その格納値をパラメータ"a*"と"b*"の格納場所として設定されたレジスタ5(reg.5)とレジスタ6(reg.6)にコピーする処理が必要となる。
Since the calculation result in the previous operation cycle is stored in any one of the 24 registers of the
例えば、図2に示す様に、演算に用いる2つのデータがメモリ0のレジスタ12(reg.12)とメモリ3のレジスタ19(reg.19)にある場合、これらの2つのデータを、パラメータ"a*"と"b*"の格納場所として設定されたレジスタ5(reg.5)とレジスタ6(reg.6)にコピーする処理が必要となる。
For example, as shown in FIG. 2, when two pieces of data used for the calculation are in the register 12 (reg. 12) of the
図2に示す様にコピー処理の必要なデータが異なるメモリブロックに格納されている場合、メモリ0のレジスタ12(reg.12)からメモリ1のレジスタ5(reg.5)に対するデータコピー処理と、メモリ3のレジスタ19(reg.19)からメモリ2のレジスタ6(reg.6)に対するデータコピー処理とは、並行して実行することができるため、コピーはデータのワード数分のサイクル数程度で終了する。
As shown in FIG. 2, when data required for copy processing is stored in different memory blocks, data copy processing from the register 12 (reg. 12) of the
なお、各メモリブロックにおいて、データ読み取り処理、書き込み処理は1つのサイクルで1つの処理、すなわち1ワードデータの読み取りあるいは1ワードデータの書き込み処理が実行可能である。異なるメモリブロックにおけるデータ読み取りまたは書き込み処理は並列に実行できる。 In each memory block, data read processing and write processing can be performed in one cycle, that is, one word data reading or one word data writing processing can be executed. Data read or write processing in different memory blocks can be performed in parallel.
従って、例えば図3に示すように、次の演算サイクルに用いるデータのうち、少なくとも一方が、コピー先、すなわち、パラメータ"a*"と"b*"の格納場所として設定されたレジスタ5(reg.5)とレジスタ6(reg.6)と同一のメモリブロックにある場合にはデータコピー処理に長い処理サイクルが必要となる。 Therefore, for example, as shown in FIG. 3, at least one of the data used in the next calculation cycle is a copy destination, that is, a register 5 (reg) set as a storage location of the parameters “a * ” and “b * ”. .5) and register 6 (reg. 6) are in the same memory block, a long processing cycle is required for data copy processing.
図3において、メモリ2にはコピー先であるレジスタ6(reg.6)と、コピー元データの格納されたレジスタ14(reg.14)が含まれる。
In FIG. 3, the
この場合、メモリ2のデータ読み取りとデータ書き込みは同一の処理サイクルでは並列に実行できないため、データ読み取り処理とデータ書き込み処理をシーケンシャルに実行しなければならない。例えば、レジスタ14(reg.14)からのデータ読み取り処理を伴うレジスタ14(reg.14)からレジスタ5(reg.5)へのデータコピー処理の終了後、レジスタ19(reg.19)からレジスタ6(reg.6)へのデータコピー処理を実行することが必要となり、図2に示すようなデータ格納態様の場合に比べて2倍のサイクル数を要することになる。
In this case, since data reading and data writing in the
また、図4に示すように、次の演算サイクルに用いるデータの両者が、コピー先、すなわち、パラメータ"a*"と"b*"の格納場所として設定されたレジスタ5(reg.5)とレジスタ6(reg.6)と同一のメモリブロックにある場合にも、同様にデータコピー処理に長い処理サイクルが必要となる。 Further, as shown in FIG. 4, both of the data used in the next calculation cycle are the copy destination, that is, the register 5 (reg. 5) set as the storage location of the parameters “a * ” and “b * ”. Even in the same memory block as the register 6 (reg. 6), similarly, a long processing cycle is required for the data copy processing.
図4において、メモリ2にはコピー先であるレジスタ6(reg.6)と、コピー元データの格納されたレジスタ14(reg.14)が含まれ、メモリ1にはコピー先であるレジスタ5(reg.5)と、コピー元データの格納されたレジスタ17(reg.17)が含まれる。
4, the
この場合、メモリ2のデータ読み取りとデータ書き込みは同一の処理サイクルでは並列に実行できず、また、メモリ1のデータ読み取りとデータ書き込みも同一の処理サイクルでは並列に実行できない。従って、これらの複数のデータ読み取り処理とデータ書き込み処理をシーケンシャルに実行しなければならない。
In this case, data reading and data writing in the
例えば、レジスタ14(reg.14)からのデータ読み取り処理を伴うレジスタ14(reg.14)からレジスタ5(reg.5)へのデータコピー処理の終了後、レジスタ17(reg.17)からレジスタ6(reg.6)へのデータコピー処理を実行することが必要となり、図2に示すようなデータ格納態様の場合に比べて2倍のサイクル数を要することになる。
For example, after the data copy process from the register 14 (reg. 14) to the register 5 (reg. 5) accompanied by the data read process from the register 14 (reg. 14) is completed, the register 17 (reg. 17) to the
座標のスカラー倍演算では、座標の2倍算演算・加算演算は、剰余数"P"のビット幅の回数(例えば、剰余数"P"が160[bit]の場合、160回)分、繰返されるため、コピー処理回数の増大による演算サイクル数の増加の影響が多大となる。 In the coordinate scalar multiplication, the coordinate doubling and addition operations are repeated for the number of times of the bit width of the remainder number “P” (for example, 160 times when the remainder number “P” is 160 [bit]). Therefore, the influence of an increase in the number of operation cycles due to an increase in the number of copy processes becomes great.
本発明では、これらのデータ格納領域に基づくコピー処理による演算サイクルの増大、演算遅延を排除するために、アドレス制御回路200により、アドレスの変換を行う。本発明の構成に従うことにより、演算サイクル数の削減、高速演算が可能となる。
In the present invention, address conversion is performed by the
本発明においては、演算部150の制御を実行する制御部(図示せず)において生成し、メモリブロックへ出力するアドレスを変換するアドレス制御回路200を設けた。アドレス制御回路200の内部構成を図5、図6を参照して説明する。
In the present invention, an
図5に示すように、アドレス制御回路200は、4つのメモリブロック中、パラメータ"a*"と"b*"の格納場所として設定されたレジスタ5(reg.5)とレジスタ6(reg.6)を有する2つのメモリブロック、すなわちメモリ1,121と、メモリ2,122に出力するアドレスを必要に応じて変換して出力する2つのアドレス変換部210,220を有する。
As shown in FIG. 5, the
それぞれのアドレス変換部210,220は、各々アドレス設定のラッチ回路211,221と一致検出回路212,222、及びアドレス切換回路213,223で構成される。1つのアドレス変換回路の具体的回路構成例を図6に示す。
Each of the
アドレスは、前述したように、アドレスA5〜A0によって構成され、図示しない制御部からアドレスA5c〜A3cがアドレス制御回路の各アドレス変換部に入力され、必要に応じて変換され、変換アドレスA5m〜A3mが、行デコーダに入力され、レジスタ選択アドレスとして適用される。また、多倍長データのワード選択は、図示しない制御部から列デコーダに入力されるアドレスA0〜A2を用いて行われる。 As described above, the address is composed of the addresses A5 to A0, and the addresses A5c to A3c are input from the control unit (not shown) to each address conversion unit of the address control circuit, converted as necessary, and converted addresses A5m to A3m. Is input to the row decoder and applied as a register selection address. In addition, word selection of multiple-length data is performed using addresses A0 to A2 input to a column decoder from a control unit (not shown).
楕円曲線暗号の演算においても、モンゴメリ(Montgomery)演算におけるモンプロ関数:c*=MonPro(a*,b*)は繰り返し実行される。パラメータ"a*"と"b*"の格納場所は、メモリ1,121と、メモリ2,122のレジスタ5(reg.5)とレジスタ6(reg.6)に設定され、パラメータ"a*"と"b*"を適用した演算サイクルの開始毎に、パラメータ"a*"と"b*"の読み出しアドレス、すなわち、A3c〜A5c=001が、制御部からアドレス制御回路200に入力される。
Also in the calculation of elliptic curve cryptography, the Montpro function in the Montgomery operation: c * = MonPro (a * , b * ) is repeatedly executed. The storage locations of the parameters “a * ” and “b * ” are set in the
アドレス制御回路200は、制御部から入力されるパラメータ"a*"と"b*"の読み出しアドレス、すなわち、A5c〜A3c=001を必要に応じて変換し、メモリ1,121と、メモリ2,122の行デコーダに出力する。具体的には、パラメータ"a*"または"b*"が、メモリ1,121と、メモリ2,122のパラメータ"a*"と"b*"の格納レジスタ(アドレス(A5,A4,A3)=(001))と異なるアドレスのレジスタ位置に格納されている場合に、制御部から入力されるパラメータ"a*"と"b*"の読み出しアドレス、すなわち、A5c〜A3c=001を、実際にパラメータ"a*"または"b*"が格納されているレジスタを指定するアドレスに変換してメモリ1,121と、メモリ2,122の行デコーダに出力する。
The
ラッチ211のA5_L314〜A3_L312は、以前の演算サイクルにおいて演算部150において算出され、次の演算サイクルにおいて適用するパラメータ"a*"または"b*"が、メモリ1,121または、メモリ2,122に格納されている場合に、そのレジスタアドレスを設定するラッチである。
A5_L314 to A3_L312 of the
USE311は、この回路ブロックを機能させるか否かの設定を行なうラッチであり、機能させる場合には"1"、させない場合は"0"をセットする。
The
アドレス変換部の動作態様には、次の3つの態様がある。
(a)ラッチ211のUSE311に"0"が保持されている場合
(b)ラッチ211のUSE311に"1"が保持され、制御部(コントローラ)からのアドレス信号(A5c,A4c,A3c)が、パラメータ"a*"または"b*"の格納場所であるレジスタ5(reg.5)またはレジスタ6(reg.6)の指定アドレス(001)と異なる場合
(c)ラッチ211のUSE311に"1"が保持され、制御部(コントローラ)からのアドレス信号(A5c,A4c,A3c)が、パラメータ"a*"または"b*"の格納場所であるレジスタ5(reg.5)またはレジスタ6(reg.6)の指定アドレス(001)である場合
There are the following three modes of operation of the address translation unit.
(A) When “0” is held in the
以下、これらの3つの場合におけるアドレス変換部の動作について説明する。
(a)ラッチ211のUSE311に"0"が保持されている場合
ラッチ211のUSE311に"0"が保持されている場合、反転回路334によって反転された信号"1"がOR回路335に入力され、OR回路335の出力は1となり、スイッチ回路213のスイッチ素子341,342,343がONとなり、スイッチ回路213は、制御部(コントローラ)から入力されるアドレス信号A5c〜A3cをそのまま、パラメータ"a*"と"b*"の格納場所であるレジスタ5(reg.5)とレジスタ6(reg.6)を有するメモリブロックであるメモリ1,121と、メモリ2,122に対するレジスタ指定アドレスA5m〜A3mとして、各メモリブロックの行デコーダに出力する。この場合は、制御部(コントローラ)で指定されたレジスタが指定される。
Hereinafter, the operation of the address translation unit in these three cases will be described.
(A) When “0” is held in
なお、スイッチ回路213は、OR回路335の出力が1の場合には、スイッチ素子343,342,341をONとし、制御部(コントローラ)からのアドレス(A5c,A4c,A3c)をメモリに対するレジスタ指定アドレス(A5m,A4m,A3m)として出力し、OR回路335の出力が0の場合には、スイッチ素子346,345,344をONとし、ラッチ211のA3_L312〜A5_L314の格納アドレスをメモリに対するレジスタ指定アドレス(A5m,A4m,A3m)として出力する。
When the output of the
(b)ラッチ211のUSE311に"1"が保持され、制御部(コントローラ)からのアドレス信号(A5c,A4c,A3c)が、パラメータ"a*"または"b*"の格納場所であるレジスタ5(reg.5)またはレジスタ6(reg.6)の指定アドレス(001)と異なる場合
(B) “5” is held in the
ラッチ211のUSE311に"1"が保持されている場合、反転回路334によって反転された信号"0"がOR回路335に入力される。制御部(コントローラ)からのアドレス信号(A5c,A4c,A3c)が、パラメータ"a*"または"b*"の格納場所であるレジスタ5(reg.5)またはレジスタ6(reg.6)の指定アドレス(001)と異なる場合、すなわち、(A5c,A4c,A3c)≠(0,0,1)の場合、EOR回路331,332,333の出力のうち、少なくとも1つは"1"となる。
When “1” is held in the
なお、EOR回路331,332,333の一方の入力には、予めパラメータ"a*"または"b*"の格納場所であるレジスタ5(reg.5)またはレジスタ6(reg.6)の指定アドレス(001)に対応する値を入力とする設定がなされている。EOR入力データ設定部321〜323の設定が、アドレス(001)に対応する値を入力とする設定がなされている。
Note that one input of the
従って、制御部(コントローラ)からのアドレス信号(A5c,A4c,A3c)が、パラメータ"a*"または"b*"の格納場所であるレジスタ5(reg.5)またはレジスタ6(reg.6)の指定アドレス(001)と異なる場合、すなわち、(A5c,A4c,A3c)≠(0,0,1)の場合、EOR回路331,332,333の出力のうち、少なくとも1つは"1"となる。
Therefore, the address signal (A5c, A4c, A3c) from the controller (controller) is stored in the register 5 (reg. 5) or the register 6 (reg. 6) where the parameter “a * ” or “b * ” is stored. In other words, when (A5c, A4c, A3c) ≠ (0, 0, 1), at least one of the outputs of the
その結果、OR回路335の出力は、"1"、すなわち、一致検出部212の出力が"1"となり、上述の(a)の場合と同様、スイッチ回路213のスイッチ素子343,342,341がONとなり、スイッチ回路213は、制御部(コントローラ)から入力されるアドレス信号A5c〜A3cをそのまま、パラメータ"a*"と"b*"の格納場所であるレジスタ5(reg.5)とレジスタ6(reg.6)を有するメモリブロックであるメモリ1,121と、メモリ2,122に対するレジスタ指定アドレスA5m〜A3mとして、各メモリブロックの行デコーダに出力する。この場合は、制御部(コントローラ)で指定されたレジスタが指定される。
As a result, the output of the
(c)ラッチ211のUSE311に"1"が保持され、制御部(コントローラ)からのアドレス信号(A5c,A4c,A3c)が、パラメータ"a*"または"b*"の格納場所であるレジスタ5(reg.5)またはレジスタ6(reg.6)の指定アドレス(001)である場合
(C) “5” is held in the
ラッチ211のUSE311に"1"が保持されている場合、反転回路334によって反転された信号"0"がOR回路335に入力される。制御部(コントローラ)からのアドレス信号(A5c,A4c,A3c)が、パラメータ"a*"または"b*"の格納場所であるレジスタ5(reg.5)またはレジスタ6(reg.6)の指定アドレス(001)と一致する場合、すなわち、(A5c,A4c,A3c)=(0,0,1)の場合、EOR回路333,332,331の出力は全て"0"となる。
When “1” is held in the
その結果、OR回路335の出力は、"0"、すなわち、一致検出部212の出力が"0"となる。従って、スイッチ回路213のスイッチ素子346,345,344がONとなり、スイッチ回路213は、ラッチ211のA5_L314〜A3_L312の格納アドレスをメモリに対するレジスタ指定アドレス(A5m,A4m,A3m)として、各メモリブロックの行デコーダに出力する。この場合は、ラッチ211のA5_L314〜A3_L312の格納アドレスからのデータ読み出しが実行される。
As a result, the output of the
図7、図8を参照してアドレス制御回路200における具体的なアドレス変換処理および、アドレス変換処理によって変換されたアドレスによるデータ読み出し処理について説明する。
A specific address conversion process in the
図7は、先に図3を参照して説明したと同様のデータ格納状態、すなわち、次の演算サイクルに用いるデータのうち、一方のデータが、パラメータ"a*"と"b*"の格納場所として設定されたレジスタ5(reg.5)とレジスタ6(reg.6)と同一のメモリブロックのレジスタに格納された状態である。メモリ2のレジスタ14(reg.14)に次の演算サイクルに用いるデータのうち、一方のデータが格納されている。他方のデータは、メモリ3のレジスタ19(reg.19)に格納されている。
FIG. 7 shows a data storage state similar to that described above with reference to FIG. 3, that is, one of the data used in the next calculation cycle is stored in parameters “a * ” and “b * ”. This is a state in which the register 5 (reg. 5) and the register 6 (reg. 6) set as locations are stored in the same memory block register. One of the data used in the next operation cycle is stored in the register 14 (reg. 14) of the
図8は、先に図4を参照して説明したと同様のデータ格納状態、すなわち、次の演算サイクルに用いる2つのデータが、パラメータ"a*"と"b*"の格納場所として設定されたレジスタ5(reg.5)とレジスタ6(reg.6)と同一のメモリブロックのレジスタに格納された状態である。メモリ2のレジスタ14(reg.14)に次の演算サイクルに用いるデータのうち、一方のデータが格納され、他方のデータがメモリ1のレジスタ17(reg.17)に格納されている。
In FIG. 8, the same data storage state as described above with reference to FIG. 4, that is, two data used in the next operation cycle are set as storage locations of the parameters “a * ” and “b * ”. In this state, the data is stored in the registers of the same memory block as the registers 5 (reg. 5) and 6 (reg. 6). One of the data used in the next operation cycle is stored in the register 14 (reg. 14) of the
従来方式によれば、この2つの状態では、2つのデータコピー処理をシーケンシャルに実行することが必要となるため、処理遅延を招き高速演算処理の妨げとなっていた。本発明のアドレス変換を伴う処理では、最大1回のデータコピー処理のみを実行することで、データのセットを実行し、次の演算サイクルに移行することが可能となる。 According to the conventional method, in these two states, it is necessary to execute two data copy processes sequentially, which causes a processing delay and hinders high-speed arithmetic processing. In the process involving address conversion according to the present invention, it is possible to execute a data set by executing only a maximum of one data copy process and shift to the next operation cycle.
なお、乗算処理あるいは加算処理等の演算処理、例えば上述したモンゴメリ(Montgomery)演算では、(数式14)、(数式15)から理解されるように、"a*","b*"はそのセット位置、すなわち乗算データと被乗算データの立場が入れ替わっても結果に影響を与えない。 In arithmetic processing such as multiplication processing or addition processing, for example, the above-described Montgomery calculation, as understood from (Equation 14) and (Equation 15), “a * ” and “b * ” are the sets. Even if the positions, that is, the positions of the multiplied data and the multiplied data are switched, the result is not affected.
まず、図7を参照して、次の演算サイクルに用いるデータのうち、一方のデータが、パラメータ"a*"と"b*"の格納場所として設定されたレジスタ5(reg.5)とレジスタ6(reg.6)と同一のメモリブロックのレジスタに格納された状態にある場合の処理シーケンスを説明する。 First, referring to FIG. 7, among the data used in the next operation cycle, one of the data is a register 5 (reg. 5) and a register in which parameters “a * ” and “b * ” are stored. 6 (reg. 6) will be described in the case where it is in the state stored in the register of the same memory block.
処理シーケンスは次のようになる。
ステップS101:メモリ3のレジスタ19(reg.19)のデータをメモリ1のレジスタ5(reg.5)にコピーする。
ステップS102:メモリ1に対応するアドレス変換部220(図5参照)のラッチ221のUSEに不使用を示すデータ"0"をセットし、メモリ2に対応するアドレス変換部210のラッチ211のUSEに使用を示すデータ"1"をセットし、(A5_L,A4_L,A3_L)に、レジスタ14(reg.14)に対応するアドレスデータ(0,1,1)を設定する。
The processing sequence is as follows.
Step S101: The data in the register 19 (reg. 19) in the
Step S102: Data “0” indicating non-use is set in the USE of the
ステップS103a:メモリ1に対応するアドレス変換部のアドレス一致検出部222の出力、すなわち図6に示すOR回路335の出力は1となり、スイッチ回路213のスイッチ素子343,342,341がONとなり、スイッチ回路213は、制御部(コントローラ)から入力されるアドレス信号A5c〜A3cをそのまま、パラメータ"a*"の格納場所であるレジスタ5(reg.5)の指定アドレスが、レジスタ指定アドレスA5m〜A3mとして、メモリ1の行デコーダに出力され、レジスタ5(reg.5)からデータ読み出しが行われ、メモリバススイッチ回路130およびバスを介して演算部150に出力される。
Step S103a: The output of the address
ステップS103b:メモリ2に対応するアドレス変換部のアドレス一致検出部212の出力、すなわち図6に示すOR回路335の出力は0となり、スイッチ回路213のスイッチ素子346,345,344がONとなり、スイッチ回路213は、ラッチ211のA5_L314〜A3_L312の格納アドレスをメモリに対するレジスタ指定アドレス(A5m,A4m,A3m)として、メモリ2に出力する。この場合は、ラッチ211のA5_L314〜A3_L312の格納アドレス、すなわち、レジスタ14(reg.14)に対応するアドレスデータ(0,1,1)に基づいてレジスタ14(reg.14)からのデータ読み出しが実行され、メモリバススイッチ回路130およびバスを介して演算部150に出力される。
Step S103b: The output of the address
結果として、メモリ1のレジスタ5(reg.5)のデータと、メモリ2のレジスタ14(reg.14)のデータが演算部150に入力されて、両データに基づく演算が実行される。
As a result, the data of the register 5 (reg. 5) of the
上述の説明から理解されるように、データコピー処理は、ステップS101の1回のコピー処理のみとなる。従って、先に図3を参照して説明したアドレス変換を伴わない場合の処理、すなわち2回のコピー処理をシーケンシャルに実行する必要がある場合に比較し、処理サイクルが減少し、高速演算が可能となる。 As understood from the above description, the data copy process is only one copy process in step S101. Therefore, the processing cycle is reduced and high-speed computation is possible compared to the processing without the address conversion described above with reference to FIG. 3, that is, the case where the two copy processing needs to be executed sequentially. It becomes.
次に、図8を参照して、次の演算サイクルに用いるデータの2つのデータが、パラメータ"a*"と"b*"の格納場所として設定されたレジスタ5(reg.5)とレジスタ6(reg.6)と同一のメモリブロックのレジスタに格納された状態にある場合の処理シーケンスを説明する。 Next, referring to FIG. 8, two data of data used in the next operation cycle are registered in the registers 5 (reg. 5) and 6 where the parameters “a * ” and “b * ” are stored. The processing sequence in the case where it is stored in the register of the same memory block as (reg. 6) will be described.
処理シーケンスは次のようになる。
ステップS201:メモリ1に対応するアドレス変換部220のラッチ221のUSEに使用を示すデータ"1"をセットし、(A5_L,A4_L,A3_L)に、レジスタ17(reg.17)に対応するアドレスデータ(1,0,0)を設定する。さらに、メモリ2に対応するアドレス変換部210のラッチ211のUSEに使用を示すデータ"1"をセットし、(A5_L,A4_L,A3_L)に、レジスタ14(reg.14)に対応するアドレスデータ(0,1,1)を設定する。
The processing sequence is as follows.
Step S201: Data “1” indicating use is set to USE of the
ステップS202a:メモリ1に対応するアドレス変換部のアドレス一致検出部222の出力、すなわち図6に示すOR回路335の出力は0となり、スイッチ回路223のスイッチ素子346,345,344がONとなり、スイッチ回路223は、ラッチ221のA5_L314〜A3_L312の格納アドレスをメモリに対するレジスタ指定アドレス(A5m,A4m,A3m)として、メモリ1に出力する。この場合は、ラッチ221のA5_L314〜A3_L312の格納アドレス、すなわち、レジスタ17(reg.17)に対応するアドレスデータ(1,0,0)に基づいてレジスタ17(reg.17)からのデータ読み出しが実行され、メモリバススイッチ回路130およびバスを介して演算部150に出力される。
Step S202a: The output of the address
ステップS202b:メモリ2に対応するアドレス変換部のアドレス一致検出部212の出力、すなわち図6に示すOR回路335の出力は0となり、スイッチ回路213のスイッチ素子346,345,344がONとなり、スイッチ回路213は、ラッチ211のA5_L314〜A3_L312の格納アドレスをメモリに対するレジスタ指定アドレス(A5m,A4m,A3m)として、メモリ2に出力する。この場合は、ラッチ211のA5_L314〜A3_L312の格納アドレス、すなわち、レジスタ14(reg.14)に対応するアドレスデータ(0,1,1)に基づいてレジスタ14(reg.14)からのデータ読み出しが実行され、メモリバススイッチ回路130およびバスを介して演算部150に出力される。
Step S202b: The output of the address
結果として、メモリ1のレジスタ17(reg.17)のデータと、メモリ2のレジスタ14(reg.14)のデータが演算部150に入力されて、両データに基づく演算が実行される。
As a result, the data of the register 17 (reg. 17) of the
上述の説明から理解されるように、データコピー処理は不要となる。従って、先に図4を参照して説明したアドレス変換を伴わない場合の処理、すなわち2回のコピー処理をシーケンシャルに実行する必要がある場合に比較し、処理サイクルが大幅に減少し、高速演算が可能となる。 As can be understood from the above description, the data copy process is not necessary. Therefore, the processing cycle is greatly reduced compared to the processing without the address conversion described above with reference to FIG. 4, that is, the case where the two copy processing needs to be executed sequentially, and the high-speed operation is reduced. Is possible.
また、演算部150において演算された結果を中間値としてレジスタに格納し、再度、中間値をレジスタから取得し、演算部150に出力して2乗の計算を行なう場合の処理について説明する。例えば、上述のモンプロ関数による2乗の計算処理は、下記の処理として示される。
c* = MonPro(a*,b* )
c2*= MonPro(c*,c* )
ここで、a*,b* に入力するデータが、図8(図4と同様)である場合、すなわち、次の演算サイクルに用いる2つのデータが、パラメータ"a*"と"b*"の格納場所として設定されたレジスタ5(reg.5)とレジスタ6(reg.6)と同一のメモリブロックのレジスタに格納された状態の場合を想定する。すなわち、メモリ2のレジスタ14(reg.14)に次の演算サイクルに用いるデータのうち、一方のデータが格納され、他方のデータがメモリ1のレジスタ17(reg.17)に格納されている。
Also, a description will be given of a process in which the result calculated in the
c * = MonPro (a * , b * )
c2 * = MonPro (c * , c * )
Here, when the data input to a * and b * is as shown in FIG. 8 (similar to FIG. 4), that is, the two data used in the next operation cycle are the parameters “a * ” and “b * ”. A case is assumed in which the data is stored in the register of the same memory block as the register 5 (reg. 5) and the register 6 (reg. 6) set as the storage location. That is, one of the data used in the next operation cycle is stored in the register 14 (reg. 14) of the
この場合は、
ステップS301:メモリ1に対応するアドレス変換部220のラッチ221のUSEに使用を示すデータ"1"をセットし、(A5_L,A4_L,A3_L)に、レジスタ17(reg.17)に対応するアドレスデータ(1,0,0)を設定する。さらに、メモリ2に対応するアドレス変換部210のラッチ211のUSEに使用を示すデータ"1"をセットし、(A5_L,A4_L,A3_L)に、レジスタ14(reg.14)に対応するアドレスデータ(0,1,1)を設定する。
in this case,
Step S301: Data “1” indicating use is set to USE of the
ステップS302a:メモリ1に対応するアドレス変換部のアドレス一致検出部222の出力、すなわち図6に示すOR回路335の出力は0となり、スイッチ回路223のスイッチ素子346,345,344がONとなり、スイッチ回路223は、ラッチ221のA5_L314〜A3_L312の格納アドレスをメモリに対するレジスタ指定アドレス(A5m,A4m,A3m)として、メモリ1に出力する。この場合は、ラッチ221のA5_L314〜A3_L312の格納アドレス、すなわち、レジスタ17(reg.17)に対応するアドレスデータ(1,0,0)に基づいてレジスタ17(reg.17)からのデータ読み出しが実行され、メモリバススイッチ回路130およびバスを介して演算部150に出力される。
Step S302a: The output of the address
ステップS302b:メモリ2に対応するアドレス変換部のアドレス一致検出部212の出力、すなわち図6に示すOR回路335の出力は0となり、スイッチ回路213のスイッチ素子344,345,346がONとなり、スイッチ回路213は、ラッチ211のA5_L314〜A3_L312の格納アドレスをメモリに対するレジスタ指定アドレス(A5m,A4m,A3m)として、メモリ2に出力する。この場合は、ラッチ211のA5_L314〜A3_L312の格納アドレス、すなわち、レジスタ14(reg.14)に対応するアドレスデータ(0,1,1)に基づいてレジスタ14(reg.14)からのデータ読み出しが実行され、メモリバススイッチ回路130およびバスを介して演算部150に出力される。
Step S302b: The output of the address
結果として、メモリ1のレジスタ17(reg.17)のデータと、メモリ2のレジスタ14(reg.14)のデータが演算部150に入力されて、両データに基づく演算が実行される。
As a result, the data of the register 17 (reg. 17) of the
これらの処理により、2乗計算まで実行された結果がメモリ1のレジスタ17(reg.17)のデータと、メモリ2のレジスタ14(reg.14)に格納される。
By these processes, the result executed up to the square calculation is stored in the data of the register 17 (reg. 17) of the
以上、特定の実施例を参照しながら、本発明について詳解してきた。しかしながら、本発明の要旨を逸脱しない範囲で当業者が該実施例の修正や代用を成し得ることは自明である。すなわち、例示という形態で本発明を開示してきたのであり、限定的に解釈されるべきではない。本発明の要旨を判断するためには、冒頭に記載した特許請求の範囲の欄を参酌すべきである。 The present invention has been described in detail above with reference to specific embodiments. However, it is obvious that those skilled in the art can make modifications and substitutions of the embodiments without departing from the gist of the present invention. In other words, the present invention has been disclosed in the form of exemplification, and should not be interpreted in a limited manner. In order to determine the gist of the present invention, the claims section described at the beginning should be considered.
以上、説明したように、本発明の構成によれば、データ格納領域としてのレジスタを複数有するメモリブロックを持つメモリ部と、レジスタの指定アドレスに基づいてレジスタから読み出されたデータを入力し、入力データに基づく演算処理を実行する演算部と、演算部に対するデータ入出力制御を実行する制御部とを有する演算処理装置において、演算部に出力予定のデータを格納しているデータ格納レジスタが予め定めた特定レジスタと同一のメモリブロックの異なるレジスタである場合において、制御部からの入力アドレスをデータ格納レジスタの指定アドレスに変換して、該変換アドレスをメモリブロックに対する読み出しアドレスとして出力するアドレス制御処理を実行する構成としたので、予め定めた特定レジスタに対するデータコピー処理を削減して、データ読み出しおよび演算処理を実行することが可能となり、演算の高速化が実現され、高速処理の要請される暗号処理デバイスにおいて適用可能である。 As described above, according to the configuration of the present invention, the memory unit having a memory block having a plurality of registers as the data storage area, and the data read from the register based on the designated address of the register are input, In an arithmetic processing device having an arithmetic unit that executes arithmetic processing based on input data and a control unit that executes data input / output control for the arithmetic unit, a data storage register that stores data to be output in the arithmetic unit is preliminarily provided. Address control processing for converting an input address from the control unit into a designated address of the data storage register and outputting the converted address as a read address for the memory block when the specified specific register is a different register in the same memory block Data for a specific register that has been set in advance. By reducing the copying process, it is possible to perform a data reading and processing, faster operation is realized, it is applicable in the cryptographic processing devices that are requested of the high-speed processing.
さらに、本発明の構成によれば、モンゴリ演算におけるモンプロ演算:MonPro(a*,b*)の実行において、モンプロ演算におけるパラメータ"a*"または"b*"の格納予定領域として設定された特定レジスタと異なるレジスタに、出力予定のパラメータ"a*"または"b*"の対応データを格納している場合において、制御部からの入力アドレスを出力予定のパラメータ"a*"または"b*"のデータ格納レジスタの指定アドレスに変換して、該変換アドレスを前記メモリブロックに対する読み出しアドレスとして出力する構成としたので、暗号処理演算において、複数回繰り返し実行されるモンプロ演算のデータコピー処理の削減が可能となり、暗号処理演算の高速化が実現され、高速処理の要請される暗号処理デバイスにおいて適用可能である。 Furthermore, according to the configuration of the present invention, in the execution of the Monpro operation: MonPro (a * , b * ) in the Mongolian operation, the identification set as the storage area for the parameter “a * ” or “b * ” in the Monpro operation to register a different register, parameters to be output "a *" or when storing the corresponding data are the "b *", the parameters of expected output an input address from the control unit "a *" or "b *" Since the conversion address is converted into the designated address of the data storage register and the converted address is output as a read address for the memory block, the data copy processing of the monpro operation that is repeatedly executed a plurality of times can be reduced in the cryptographic processing operation. It is possible to realize high-speed cryptographic processing operations and can be applied to cryptographic processing devices that require high-speed processing. It is.
110 メモリ部
120〜123 メモリブロック
130 メモリバススイッチ回路
150 演算部
151,153,155,156,158 ラッチ
152 乗算器
154,157 加算器
200 アドレス制御回路
210,220 アドレス変換部
211,221 ラッチ
212,222 一致検出部
213,223 スイッチ
311〜314 ラッチ
321〜323 EOR入力データ設定部
331〜333 EOR回路
335 OR回路
341〜346 スイッチ素子
DESCRIPTION OF
Claims (10)
前記制御部からレジスタ指定アドレスを入力し、入力アドレスの変換処理を実行するアドレス制御部を有し、
前記アドレス制御部は、前記制御部から予め定められた特定レジスタのアドレスを入力し、かつ、前記演算部に出力予定のデータを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合において、前記制御部からの入力アドレスを前記データ格納レジスタの指定アドレスに変換して、該変換アドレスを前記メモリブロックに対する読み出しアドレスとして出力する構成を有することを特徴とする演算処理装置。 A memory unit having a memory block having a plurality of registers as a data storage area, an arithmetic unit that inputs data read from the register based on a designated address of the register, and executes arithmetic processing based on the input data; An arithmetic processing unit having a control unit that performs data input / output control on the unit,
An address control unit that inputs a register designation address from the control unit and executes input address conversion processing,
The address control unit inputs a predetermined register address from the control unit, and a data storage register storing data to be output to the arithmetic unit is stored in the same memory block as the specific register. In the case of different registers, the arithmetic processing has a configuration in which an input address from the control unit is converted into a designated address of the data storage register, and the converted address is output as a read address for the memory block. apparatus.
前記データ格納レジスタのアドレスを格納したラッチと、
前記制御部からの入力アドレスが予め定められた特定レジスタのアドレスと一致するか否かを検出する一致検出部と、
前記一致検出部の検出情報に基づいて、前記制御部からの入力アドレス、または前記ラッチに格納した前記データ格納レジスタのアドレスのいずれかを選択して、前記メモリブロックに対する読み出しアドレスとして出力するスイッチ手段と、
を有することを特徴とする請求項1に記載の演算処理装置。 The address control unit
A latch storing the address of the data storage register;
A coincidence detection unit that detects whether an input address from the control unit coincides with an address of a predetermined specific register;
Switch means for selecting either an input address from the control unit or an address of the data storage register stored in the latch based on detection information of the coincidence detection unit and outputting the selected address as a read address for the memory block When,
The arithmetic processing apparatus according to claim 1, comprising:
前記演算部に出力予定のデータを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合にのみ、アドレス変換動作を有効とする情報を格納した情報格納部を含み、該情報格納部にアドレス変換動作を有効とする情報が格納されている場合にのみアドレス変換処理を行う構成であることを特徴とする請求項1に記載の演算処理装置。 The address control unit further includes:
Including an information storage unit storing information for enabling an address conversion operation only when a data storage register storing data to be output in the arithmetic unit is a different register in the same memory block as the specific register 2. The arithmetic processing apparatus according to claim 1, wherein the address conversion process is performed only when information for enabling an address conversion operation is stored in the information storage unit.
前記メモリ部は、複数のメモリブロック中の2つのメモリブロックの特定レジスタを次期演算サイクルにおいて前記演算部に入力予定のモンゴメリ演算に適用するパラメータまたは中間値の格納予定領域として設定された構成であり、
前記アドレス制御部は、前記制御部からモンゴメリ演算に適用するパラメータまたは中間値の格納予定領域として設定された前記特定レジスタのアドレスを入力し、かつ、前記演算部に出力予定のデータを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合において、前記制御部からの入力アドレスを前記データ格納レジスタの指定アドレスに変換して、該変換アドレスを前記メモリブロックに対する読み出しアドレスとして出力する構成を有することを特徴とする請求項1に記載の演算処理装置。 The calculation unit includes a multiplier and an adder that perform Montgomery calculation in cryptographic processing calculation,
The memory unit has a configuration in which specific registers of two memory blocks in a plurality of memory blocks are set as storage areas for parameters or intermediate values to be applied to the Montgomery calculation scheduled to be input to the calculation unit in the next calculation cycle. ,
The address control unit inputs an address of the specific register set as a storage area for parameters or intermediate values to be applied to Montgomery calculation from the control unit, and stores data to be output to the calculation unit. When the data storage register is a different register of the same memory block as the specific register, the input address from the control unit is converted into a specified address of the data storage register, and the converted address is read out from the memory block The arithmetic processing unit according to claim 1, wherein the arithmetic processing unit is configured to output as an address.
MonPro(a*,b*)
t=a*×b*
for i = 0 to dl-1
m=t0×P0'mod r
t=(t+m×P)/r
next i
if t≧P then return t−P
else return t
前記複数のメモリブロック中の2つのメモリブロックの特定レジスタには、前記モンプロ演算におけるパラメータa*またはb*の格納予定レジスタとして設定された構成であることを特徴とする請求項4に記載の演算処理装置。 The arithmetic processing device is an arithmetic processing device that executes the following monpro operation:
MonPro (a * , b * )
t = a * × b *
for i = 0 to dl-1
m = t 0 × P 0 'mod r
t = (t + m × P) / r
next i
if t ≧ P then return t−P
else return t
5. The operation according to claim 4, wherein the specific registers of the two memory blocks in the plurality of memory blocks are configured to be stored as registers for storing parameters a * or b * in the Monpro operation. Processing equipment.
演算部に対するデータ入出力制御を実行する制御部においてレジスタの指定アドレスを生成するアドレス生成ステップと、
前記制御部から予め定められた特定レジスタのアドレスを入力し、かつ、演算部に出力予定のデータを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合において、前記制御部からの入力アドレスを前記データ格納レジスタの指定アドレスに変換して、該変換アドレスをメモリブロックに対する読み出しアドレスとして出力するアドレス制御ステップと、
前記アドレス制御ステップにおいて制御されたアドレスに基づいてメモリブロックのレジスタからデータを読み出し前記演算部に出力するデータ読み出しステップと、
を有することを特徴とする演算処理方法。 An arithmetic processing method,
An address generation step of generating a specified address of the register in the control unit that executes data input / output control for the arithmetic unit;
In the case where the address of the specific register determined in advance from the control unit and the data storage register storing the data to be output to the arithmetic unit are different registers in the same memory block as the specific register, An address control step of converting an input address from the control unit into a designated address of the data storage register and outputting the converted address as a read address for the memory block;
A data read step for reading data from a register of a memory block based on the address controlled in the address control step and outputting the data to the arithmetic unit;
An arithmetic processing method characterized by comprising:
前記制御部からの入力アドレスが予め定められた特定レジスタのアドレスと一致するか否かを検出する一致検出ステップと、
前記一致検出ステップにおける検出情報に基づいて、前記制御部からの入力アドレス、または予めラッチに格納した前記データ格納レジスタのアドレスのいずれかを選択して、前記メモリブロックに対する読み出しアドレスとして出力する出力切り替えステップと、
を有することを特徴とする請求項6に記載の演算処理方法。 The address control step further includes:
A coincidence detecting step for detecting whether or not an input address from the control unit coincides with an address of a predetermined specific register;
Based on the detection information in the coincidence detection step, output switching is performed by selecting either the input address from the control unit or the address of the data storage register stored in advance in the latch and outputting it as a read address for the memory block Steps,
The arithmetic processing method according to claim 6, further comprising:
前記演算部に出力予定のデータを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合にのみ、前記アドレス制御ステップにおけるアドレス変換処理を行うことを特徴とする請求項6に記載の演算処理方法。 In the arithmetic processing method,
The address conversion process in the address control step is performed only when a data storage register storing data scheduled to be output in the arithmetic unit is a different register in the same memory block as the specific register. Item 7. The processing method according to Item 6.
MonPro(a*,b*)
t=a*×b*
for i = 0 to dl-1
m=t0×P0'mod r
t=(t+m×P)/r
next i
if t≧P then return t−P
else return t
前記アドレス制御ステップは、前記制御部から前記モンプロ演算におけるパラメータa*またはb*の格納予定領域として設定された特定レジスタのアドレスを入力し、かつ、前記演算部に出力予定のパラメータa*またはb*の対応データを格納しているデータ格納レジスタが前記特定レジスタと同一のメモリブロックの異なるレジスタである場合において、前記制御部からの入力アドレスを前記データ格納レジスタの指定アドレスに変換して、該変換アドレスを前記メモリブロックに対する読み出しアドレスとして出力することを特徴とする請求項9に記載の演算処理方法。 The calculation processing method includes a calculation step for executing the following monpro calculation:
MonPro (a * , b * )
t = a * × b *
for i = 0 to dl-1
m = t 0 × P 0 'mod r
t = (t + m × P) / r
next i
if t ≧ P then return t−P
else return t
In the address control step, an address of a specific register set as a storage area for the parameter a * or b * in the monpro calculation is input from the control unit, and the parameter a * or b scheduled to be output to the calculation unit When the data storage register storing the corresponding data of * is a different register in the same memory block as the specific register, the input address from the control unit is converted into the designated address of the data storage register, The arithmetic processing method according to claim 9, wherein the conversion address is output as a read address for the memory block.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003271526A JP3870937B2 (en) | 2003-07-07 | 2003-07-07 | Arithmetic processing device and arithmetic processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003271526A JP3870937B2 (en) | 2003-07-07 | 2003-07-07 | Arithmetic processing device and arithmetic processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2005032034A JP2005032034A (en) | 2005-02-03 |
JP3870937B2 true JP3870937B2 (en) | 2007-01-24 |
Family
ID=34209367
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003271526A Expired - Fee Related JP3870937B2 (en) | 2003-07-07 | 2003-07-07 | Arithmetic processing device and arithmetic processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3870937B2 (en) |
-
2003
- 2003-07-07 JP JP2003271526A patent/JP3870937B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2005032034A (en) | 2005-02-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3525209B2 (en) | Power-residue operation circuit, power-residue operation system, and operation method for power-residue operation | |
US7505587B2 (en) | Elliptic curve cryptosystem apparatus, storage medium storing elliptic curve cryptosystem program, and elliptic curve cryptosystem arithmetic method | |
CN107040362B (en) | Modular multiplication apparatus and method | |
Lutz et al. | High performance FPGA based elliptic curve cryptographic co-processor | |
US20020010730A1 (en) | Accelerated montgomery exponentiation using plural multipliers | |
JP4513752B2 (en) | Cryptographic processing apparatus, cryptographic processing method, and computer program | |
EP1430392A1 (en) | Component reduction in montgomery multiplier processing element | |
US8199910B2 (en) | Signature generation apparatus and signature verification apparatus | |
CN113032797A (en) | Method for performing cryptographic operations in a processing device | |
US11502836B2 (en) | Method for performing cryptographic operations on data in a processing device, corresponding processing device and computer program product | |
JP2001505325A (en) | Method and apparatus for implementing a decoding mechanism by calculating a standardized modular exponentiation to thwart timing attacks | |
US6917956B2 (en) | Apparatus and method for efficient modular exponentiation | |
JP2002229445A (en) | Modular exponentiation unit | |
JP3794266B2 (en) | Elliptic curve scalar multiplication method and apparatus, and storage medium | |
Gutub et al. | Efficient scalable VLSI architecture for Montgomery inversion in GF (p) | |
JP3870937B2 (en) | Arithmetic processing device and arithmetic processing method | |
CN109284082A (en) | A general point operation method and device for ECC and SM2 | |
CN115129297B (en) | Multiplication operation system, method, graphics processor, electronic device and equipment | |
CN116700797A (en) | RISC-V instruction set extension method and system for information security application | |
CN1696894B (en) | Large number modular multiplication calculation multiplier | |
JP2004125891A (en) | Power remainder computer | |
KR20100063623A (en) | Method and apparatus for modular multiplication | |
JP2007286380A (en) | Finite commutative group operation method, apparatus, and program thereof | |
Nedjah et al. | Four hardware implementations for the m-ary modular exponentiation | |
US20250247229A1 (en) | Scalar masking countermeasure |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060509 |
|
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: 20060926 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20061009 |
|
LAPS | Cancellation because of no payment of annual fees |