JP3321416B2 - Arithmetic device with correction processing and program recording medium therefor - Google Patents

Arithmetic device with correction processing and program recording medium therefor

Info

Publication number
JP3321416B2
JP3321416B2 JP23849098A JP23849098A JP3321416B2 JP 3321416 B2 JP3321416 B2 JP 3321416B2 JP 23849098 A JP23849098 A JP 23849098A JP 23849098 A JP23849098 A JP 23849098A JP 3321416 B2 JP3321416 B2 JP 3321416B2
Authority
JP
Japan
Prior art keywords
integer
input
selecting
arithmetic unit
value
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 - Lifetime
Application number
JP23849098A
Other languages
Japanese (ja)
Other versions
JP2000066591A (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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP23849098A priority Critical patent/JP3321416B2/en
Publication of JP2000066591A publication Critical patent/JP2000066591A/en
Application granted granted Critical
Publication of JP3321416B2 publication Critical patent/JP3321416B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、例えば情報セキ
ュリティにおける剰余演算装置に適用され、特に最上位
桁(ビット)が1の変数M入力に制限され、変数Mのビ
ット長を任意に選択できない演算装置において、変数M
よりビット長の短いパラメータNが入力されるときでも
演算処理を実行可能とする補正処理付演算装置およびそ
のプログラム記録媒体に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention is applied to, for example, a modulo operation device in information security. In particular, an operation in which the most significant digit (bit) is limited to a variable M input of 1 and the bit length of the variable M cannot be arbitrarily selected. In the device, the variable M
The present invention relates to an arithmetic unit with a correction process that can execute an arithmetic process even when a parameter N having a shorter bit length is input, and a program recording medium thereof.

【0002】[0002]

【従来の技術】R/2M<R,R=2m なる2べきの
値で変数Mの範囲が制限される演算装置(Mが与えられ
るとRが決まる)において、NがR/2M<RなるM
に代入できる条件を満たさないN<R/2なるNに対し
て、2べきの値S=2n でNの範囲がS/2N<Sと
表現できるとき、簡単なビットシフトで補正処理を行う
こととし、具体的にはr=R/S=2m-n としM=Nr
なる補正を行うことが一般的であった。このため、例え
ば、演算装置が除算装置で、その変数Mの範囲がR/2
M<R,R=2m に制限されているものに対しA/N
なる結果を得たい場合、Nの代わりにMを代入し、Aの
代わりにArを代入し、その除算装置で得られた結果A
r/Mにより、結果A/Nを得ていた。なお、一般にM
は範囲が限定されるだけで、具体的な値は、Nによって
確定する。
2. Description of the Related Art In an arithmetic device in which the range of a variable M is limited by a power of 2 such that R / 2 < M <R, R = 2 m (R is determined when M is given), N is R / 2. < M <R M
If N <R / 2, which does not satisfy the condition that can be substituted into N, the value of 2 is S = 2 n and the range of N can be expressed as S / 2 < N <S, the correction processing is performed by a simple bit shift Specifically, r = R / S = 2 mn and M = Nr
It was common to make some corrections. Therefore, for example, the arithmetic unit is a division unit, and the range of the variable M is R / 2.
A / N for those limited to < M <R, R = 2 m
If it is desired to obtain a result, M is substituted for N, Ar is substituted for A, and the result A obtained by the division device is obtained.
The result A / N was obtained by r / M. In general, M
Is only limited in range, and a specific value is determined by N.

【0003】例えばN=7,m=4であれば、n=3,
S=8=23 ,R=16=24 であり、r=24-3 =2
より、M=14となる。また、演算装置が剰余装置で、
Amod Nなる結果を得たい場合、Nの代わりにMを代入
し、その剰余装置で得られた結果Amod Mを更にmod N
なる補正処理を加えて、Amod Nを得た。この時、単な
る剰余をとる演算装置の場合、演算装置内部の処理と後
の補正処理が同一なので意味が無いが、この拡張とし
て、AB mod M,ABmod Mなどの演算を効率的に行う
剰余装置を利用する場合、後処理として得られた結果を
更に法Nによって剰余を求める補正により、真に欲しい
Bmod N,ABmod Nを得ていた。従って、この様に
法などをシフトして補正する方法は有効であった。
For example, if N = 7 and m = 4, n = 3
S = 8 = 2 3 , R = 16 = 2 4 , and r = 2 4−3 = 2
Thus, M = 14. The arithmetic unit is a remainder unit,
If it is desired to obtain a result Amod N, M is substituted for N, and the result Amod M obtained by the remainder device is further modified by mod N
Amod N was obtained by performing some correction processing. At this time, if the computing device taking mere remainder, but no sense since correction processing after an arithmetic unit inside the processing is the same as the extension, the remainder of performing A B mod M, the computation of such ABMOD M efficient when using a device, the correction for obtaining a remainder by further modulo N the results obtained are shown as post-treatment, what they really want a B mod N, was getting ABMOD N. Therefore, the method of correcting by shifting the method is effective.

【0004】しかしながら、剰余装置の場合、入力Mに
一定の制限があることが多い。例えば、高速化には、中
国人の剰余定理を使うRNS(Residue Num
ber System)で知られる剰余数系で組み立て
る演算や、Montgomery Reduction
を使う剰余演算の高速化処理がある。そこで、データを
シフトすることで、2べきの数でかけたり、割ったりす
ることが、高速化技法として活用されることが多い。し
かし、途中演算として、Mに2の因子が含まれると、M
=Nrのrは2の因子であるので演算自体が成り立たな
いので、即ち、2とMの最大公約数gcd(2,M)=2を
許容しないことがある。
[0004] However, in the case of the remainder device, the input M often has a certain limit. For example, for speeding up, RNS (Residue Num) using the Chinese remainder theorem
ber System), an operation to assemble with a remainder system, and a Montgomery Reduction
There is a high-speed processing of the remainder operation using. Therefore, multiplying or dividing by a power of 2 by shifting data is often used as a speed-up technique. However, if the factor of 2 is included in M as an intermediate operation, M
Since r of = Nr is a factor of 2, the operation itself does not hold, that is, the greatest common divisor gcd (2, M) of 2 and M may not be allowed.

【0005】例えば、XR-1mod Mを実行したいモンゴ
メリ演算装置の場合、Xmod MR=(XM-1mod R)M
+(XR-1mod M)Rなるいわゆる中国人剰余定理を活
用するには、MとRが互いに素になる必要がある。従っ
て、((Xmod MR)−(XM-1mod R)M)/Rなる
2べきシフトや2べきの剰余演算によって、XR-1mod
Mの演算が構成されるが、Rは2べきであるので、Mに
2の因子を含めることはできない。従って、上記の様な
2べきの補正項rでNを補正してMを作り出すことは困
難になる。
[0005] For example, in the case of a Montgomery arithmetic unit that wants to execute XR -1 mod M, X mod MR = (XM -1 mod R) M
In order to utilize the so-called Chinese Remainder Theorem of + (XR -1 mod M) R, M and R must be disjoint. Therefore, the XR -1 mod is obtained by a shift by 2 power of ((Xmod MR)-(XM -1 mod R) M) / R and a remainder operation of 2 power.
Although the operation of M is configured, R cannot be a factor of 2 because R is power of 2. Therefore, it is difficult to correct M with the above-mentioned power-of-two correction term r to generate M.

【0006】[0006]

【発明が解決しようとする課題】この発明の目的は与え
られた演算装置の入力Mより短いビット長のパラメータ
Nをr倍することで補正して、ビット長を演算装置の許
容ビット長とする補正処理付演算装置を提供することに
あり、この発明の他の目的に2の因子など演算装置が許
容できない因子を包含しない補正項rの選択手段を有す
る補正処理付演算装置を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to correct a parameter N having a bit length shorter than an input M of a given arithmetic unit by multiplying it by r to make the bit length an allowable bit length of the arithmetic unit. Another object of the present invention is to provide an arithmetic unit with correction processing, and another object of the present invention is to provide an arithmetic unit with correction processing having means for selecting a correction term r that does not include a factor that the arithmetic unit cannot accept, such as a factor of 2. is there.

【0007】[0007]

【課題を解決するための手段】R/2M<R,R=2
m なる2べきの値で入力変数Mの範囲が制限される演算
装置において、Nが、R/2M<RなるMの入力条件
を満たさないN<R/2なるNがあったとき、2べきの
値S=2n でNの範囲がS/2N<Sと表現すると
き、3S/4とNを大小比較し、場合分けすることで、
rに2べき以外の選択範囲を与えることをこの発明は特
徴とする。即ち、3S/4N<Sならば、M=Nrが
R/2M<Rになる為の必要十分条件が、R/2
Sr/4かつSrRであるから、2m-n+1 /3
m-n なる範囲の整数を補正項rとできる。一方、S/
N<3S/4ならば、R/2M<Rなる為の必要
十分条件は、R/2Sr/2かつ3Sr/4Rであ
るから、2 m-n m-n+ 2 /3なる範囲の整数を補
正項rとできる。
[MEANS FOR SOLVING THE PROBLEMS] R / 2 < M <R, R = 2
In an arithmetic device in which the range of the input variable M is limited by a value of 2 to m , when N is N <R / 2 that does not satisfy the input condition of R / 2 < M <R, When the range of N is expressed as S / 2 < N <S when the value of 2 is S = 2 n , 3S / 4 and N are compared in magnitude and classified into cases.
The present invention is characterized by giving r a selection range other than 2 powers. That is, if 3S / 4 < N <S, the necessary and sufficient condition for M = Nr to be R / 2 < M <R is R / 2 < 3.
Since Sr / 4 and Sr < R, 2 m−n + 1/3 < r <
An integer in the range of 2 mn can be used as the correction term r. On the other hand, S /
If 2 < N <3S / 4, the necessary and sufficient conditions for R / 2 < M <R are R / 2 < Sr / 2 and 3Sr / 4 < R, so that 2 mn < r < 2 m− an integer of n + 2/3 scope can correction term r.

【0008】補正項は一定の範囲を持っているので、こ
の結果、rに2の因子を含めないなどの要請に対して、
rの値を選択することにより、欲しい補正項を決定でき
る。
Since the correction term has a certain range, as a result, in response to a request not to include the factor of 2 in r, for example,
By selecting the value of r, a desired correction term can be determined.

【0009】[0009]

【発明の実施の形態】以下図面を用いてこの発明の実施
例について詳しく説明する。以下の実施例において、演
算装置30は、入力変数MがR/2M<R,R=2m
なる2べきの値の範囲に制限されたものであり、入力値
Nは2べきの値S=2n でS/2N<Sの範囲で表現
できるものとする。 第一の実施例 レジスタのような入力手段10により入力値Nが入力さ
れる。第1の補正処理手段20において入力値Nに対し
て以下の補正処理がなされる。まず判断手段21でN
3S/4か否かが判断され、3S/4N<Sならば、
整数選択手段22で2m-n+1 /3m-n なる範囲
の整数が補正項rとして選択され、一方判断手段22で
S/2N<3S/4と判断されるならば、整数選択手
段23で2 m-n m-n+2 /3なる範囲の整数が補
正項rとして選択される。このrの選択は例えば、2進
数表示した時に1の数が少ないものを選ぶとNrの演算
でシフト回数が少なくて済む、このように例えば演算処
理に都合がよいようにrを自動的に選ぶようにすればよ
い。補正手段24で整数選択手段22又は23で選択さ
れたrでNに対応する補正がNrとしてなされ、M=N
rとして演算装置30に入力される。演算装置30はそ
のMに対して、演算を実行する。
Embodiments of the present invention will be described below in detail with reference to the drawings. In the following embodiment, the arithmetic unit 30 determines that the input variable M is R / 2 < M <R, R = 2 m
It is assumed that the input value N is limited to the range of a power of 2 and that the input value N can be expressed in the range of S / 2 < N <S with the value of the power of 2 S = 2 n . First Embodiment An input value N is input by input means 10 such as a register. The first correction processing means 20 performs the following correction processing on the input value N. First, N >
It is determined whether or not 3S / 4, and if 3S / 4 < N <S,
If the integer selecting means 22 selects an integer in the range of 2m −n + 1/3 < r < 2mn as the correction term r, while the determining means 22 determines that S / 2 < N <3S / 4 The integer selection means 23 selects an integer in the range of 2 mn < r < 2 m−n + 2/3 as the correction term r. For the selection of r, for example, if a value with a small number of 1s is selected in binary notation, the number of shifts can be reduced in the calculation of Nr. Thus, for example, r is automatically selected so as to be convenient for the calculation processing. What should I do? Correction corresponding to N with r selected by the integer selection means 22 or 23 by the correction means 24 is made as Nr, and M = N
It is input to the arithmetic unit 30 as r. The arithmetic unit 30 performs an arithmetic operation on the M.

【0010】具体例としては、演算装置30としてAを
除算する除算装置が想定され、補正処理により決まった
補正項rにより入力Aに対しArを出力し、演算装置3
0でAr/Mが実行され、A/Nの結果として出力手段
(例えばレジスタ)40へ入力される。なお、入力Aは
演算装置30内にある場合を想定しているが、外部から
入力するものであってもよい。 第二の実施例 演算装置30として、入力Mが法で処理結果をその法M
による剰余をとることを特徴とする剰余演算装置にこの
発明を適用した場合で、図1と対応する部分に同一符号
を付けてある。つまり入力値Nは図1の場合と同様にし
て第一の補正処理手段20で、整数rが選択され、Nに
対する補正がなされ、その補正値NrがMとして剰余演
算装置30に入力される。この場合は剰余演算装置30
から得られた結果Aを法Nで剰余をとる第二の補正処理
手段50で補正処理が行われる。この原理はAmod M=
(AN-1mod r)N+(Ar-1mod N)rなる中国人の
剰余定理から、この両辺をNで剰余をとると、(Amod
M)mod N=Amod Nとなる性質を利用している。
As a specific example, a division device that divides A is assumed as the arithmetic device 30, and Ar is output to the input A according to a correction term r determined by the correction processing.
At 0, Ar / M is executed, and the result is input to the output means (for example, a register) 40 as a result of A / N. The input A is assumed to be in the arithmetic unit 30, but may be input from the outside. Second Embodiment As an arithmetic unit 30, an input M is a modulo, and a processing result is modulo M
In the case where the present invention is applied to a remainder operation device characterized by taking a remainder by the following formula, parts corresponding to those in FIG. 1 are denoted by the same reference numerals. That is, the input value N is selected by the first correction processing means 20 in the same manner as in the case of FIG. 1, an integer r is selected, correction is made on N, and the correction value Nr is input to the remainder arithmetic unit 30 as M. In this case, the remainder arithmetic unit 30
The correction processing is performed by the second correction processing means 50 which takes the remainder of the result A obtained from the above by the modulus N. The principle is Amod M =
From the Chinese remainder theorem of (AN -1 mod r) N + (Ar -1 mod N) r, taking these two sides as a remainder by N, (A mod
M) Mod N = A mod N is used.

【0011】この時、単なる剰余をとる演算装置の場
合、演算装置と後の補正処理が同一なので意味が無い
が、このバリエーションとして、AB mod M,ABmod
Mの演算を効率的に行う剰余装置を利用する場合、後処
理として、得られた結果を法Nによる剰余を求める補正
だけで真に欲しいAB mod N,ABmod Nが得られる点
で利益が大きい。なお図2には示していないがA,Bも
演算装置30に入力される。 第三の実施例 第二の実施例における演算装置30が、XR-1mod Mの
代わりに、Xmod MR=(XM-1mod R)M+(XR-1
mod M)Rなるいわゆる中国人剰余定理を活用し、
((Xmod MR)−(XM-1mod R)M)/Rなる演算
を2べきシフトや2べきの剰余によって構成されるモン
ゴメリ演算装置とするとき、gcd(2,M)=1なる制限
条件に対して、同様にgcd(2,N)=1なる制限条件で
Nが制限されるとき、rの選択条件として、図3に示す
ようにgcd(2,r)=1の条件を、第一の補正処理手段
20中の整数選択手段22,23に加える。rの選択に
gcd(2,M)=1なる条件を付けているため、2の因子
など演算装置30が許容できない因子が包含されること
はない。 第四の実施例 上記第三の実施例の第一の補正処理手段20中の整数選
択手段22,23で、rの選択範囲を更に限定し、図4
に示すように3S/4N<Sならば、整数選択手段2
2でr=2m-n −1とし、S/2N<3S/4なら
ば、整数選択手段23でr=2m-n +1とし、補正手段
24でMを求める時、Nr=2m-n N−Nまたは、Nr
=2m-n N+Nなる2べきのシフトと加算処理だけから
構成できる。 第五の実施例 上記第一の実施例の第一の補正処理手段20で、Nに関
する3S/4N<Sまたは、S/2N<3S/4に
関する条件判定と等価な処理として、図5に示すように
判定手段21でNの最上位桁から2ビット目が1または
0かにより、整数選択手段22または23による整数選
択を行ってもよい。なお3S/4N<SまたはS/2
N<3S/4なる条件判定を2進数表示すると、図5
に示した条件判定となる。この図5に示した条件判定は
図2、図3、図4における条件判定N>3S/4の代わ
りにそれぞれ用いることもできる。
[0011] At this time, if the computing device taking mere remainder, but no sense since correction processing after the computation device is the same as the variation, A B mod M, ABmod
When using a modular device for performing calculation of M effectively, as a post-processing, what they really want only correction for obtaining a remainder by results obtained are modulo N A B mod N, the benefit in that ABMOD N is obtained large. Although not shown in FIG. 2, A and B are also input to the arithmetic unit 30. Arithmetic unit 30 in the third embodiment the second embodiment, in place of the XR -1 mod M, Xmod MR = (XM -1 mod R) M + (XR -1
mod M) Utilizing the so-called Chinese Remainder Theorem,
When the operation ((Xmod MR)-(XM -1 mod R) M) / R is a Montgomery arithmetic device constituted by a power-of-two shift and a power-of-two remainder, a limiting condition of gcd (2, M) = 1 On the other hand, when N is similarly restricted under the restriction condition of gcd (2, N) = 1, the condition of gcd (2, r) = 1 as shown in FIG. It is added to the integer selection means 22 and 23 in one correction processing means 20. In choosing r
Since the condition of gcd (2, M) = 1 is set, factors that the arithmetic unit 30 cannot tolerate, such as the factor of 2, are not included. Fourth Embodiment The selection range of r is further limited by the integer selection units 22 and 23 in the first correction processing unit 20 of the third embodiment.
If 3S / 4 < N <S as shown in FIG.
2, r = 2 mn −1, and if S / 2 < N <3S / 4, r = 2 mn +1 by the integer selection unit 23 and Nr = 2 mn N−N when M is obtained by the correction unit 24. Or Nr
= 2 mn N + N. Fifth Embodiment In the first correction processing means 20 of the first embodiment, as processing equivalent to the condition determination regarding 3S / 4 < N <S or S / 2 < N <3S / 4 regarding N, As shown in FIG. 5, the integer selecting means 22 or 23 may perform the integer selection by the determining means 21 depending on whether the second bit from the most significant digit of N is 1 or 0. 3S / 4 < N <S or S / 2
When the condition determination of < N <3S / 4 is displayed in a binary number, FIG.
The condition determination shown in FIG. The condition determination shown in FIG. 5 can be used instead of the condition determination N> 3S / 4 in FIGS. 2, 3, and 4.

【0012】[0012]

【発明の効果】上記各種実施例によれば、扱えるデータ
長が限定される演算装置に付加処理を施すことにより、
より汎用な値を扱える演算装置とすることができる。こ
の発明装置はコンピュータがプログラムを読出し解読実
行することによっても機能させることができる。
According to the above embodiments, the additional processing is performed on the arithmetic unit whose data length that can be handled is limited.
An arithmetic unit that can handle more general-purpose values can be provided. The apparatus of the present invention can also function by a computer reading and decoding a program.

【図面の簡単な説明】[Brief description of the drawings]

【図1】この発明の第一の実施例の機能構成を示すブロ
ック図。
FIG. 1 is a block diagram showing a functional configuration of a first embodiment of the present invention.

【図2】この発明の第二の実施例の機能構成を示すブロ
ック図。
FIG. 2 is a block diagram showing a functional configuration of a second embodiment of the present invention.

【図3】この発明の第三の実施例の機能構成を示すブロ
ック図。
FIG. 3 is a block diagram showing a functional configuration of a third embodiment of the present invention.

【図4】この発明の第四の実施例の機能構成を示すブロ
ック図。
FIG. 4 is a block diagram showing a functional configuration of a fourth embodiment of the present invention.

【図5】この発明の第五の実施例の機能構成を示すブロ
ック図。
FIG. 5 is a block diagram showing a functional configuration of a fifth embodiment of the present invention.

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G09C 1/00 650 G06F 7/552 G06F 7/72 JICSTファイル(JOIS)────────────────────────────────────────────────── ─── Continued on the front page (58) Field surveyed (Int. Cl. 7 , DB name) G09C 1/00 650 G06F 7/552 G06F 7/72 JICST file (JOIS)

Claims (12)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 入力変数値Mが、R/2M<R,R=
m なる2べき値の値の範囲に制限される演算装置を用
いて、2のべき値S=2n で範囲がS/2N<Sで表
現され、かつN<R/2なる入力値Nを入力して演算す
る装置であって、 N3S/4か否かを判定する判定手段と、 その判定手段が3S/4N<Sと判定すると、2
m-n+1 /3m-n なる範囲の整数rを選択する第
1整数選択手段と、 上記判定手段がS/2N<3S/4と判定すると、2
m-n m-n+2 /3なる範囲の整数rを選択する第
2整数選択手段と、 上記入力値Nを上記選択した整数r倍して上記演算装置
の入力Mとする補正手段とを備えることを特徴とする補
正処理付演算装置。
1. An input variable value M is R / 2 < M <R, R =
Use an arithmetic unit that is restricted to the range of 2 power values of 2 m
A range expressed by S / 2 < N <S with a power-of-two value S = 2 n and an input value N satisfying N <R / 2, and calculating by inputting: N > 3S / 4 Determination means for determining whether or not 3S / 4 < N <S;
first integer selecting means for selecting an integer r in a range of m−n + 1/3 < r < 2 mn; and when the determining means determines that S / 2 < N <3S / 4, 2
a second integer selecting means for selecting an integer r in a range of mn < r < 2m -n + 2/3; and a correcting means for multiplying the input value N by the selected integer r to obtain an input M of the arithmetic unit. And an arithmetic unit with a correction process.
【請求項2】 入力変数値Mが、R/2M<R,R=
m なる2べき値の値の範囲に制限される演算装置を用
いて、2のべき値S=2n で範囲がS/2N<Sで表
現され、かつN<R/2なる入力値Nを入力して演算す
る装置であって、 上記入力値Nの最上位桁から2ビット目が1であるか0
であるかを判定する判定手段と、 その判定手段が1と判定すると、2m-n+1 /3
m-n なる範囲から整数rを選択する第1整数選択手段
と、 上記判定手段が0と判定すると、2m-n m-n+2
/3なる範囲から整数rを選択する第2整数選択手段
と、 上記入力値Nを、上記選択した整数r倍して上記演算装
置の入力Mとする補正手段とを具備することを特徴とす
る補正処理付演算装置。
2. An input variable value M is R / 2 < M <R, R =
Use an arithmetic unit that is restricted to the range of 2 power values of 2 m
And a device for inputting and calculating an input value N satisfying a power of 2 S = 2 n and a range expressed by S / 2 < N <S, and N <R / 2. The second bit from the most significant digit is 1 or 0
Determination means for determining whether or not, and when the determination means determines 1, 2m−n + 1/3 < r < 2
first integer selecting means for selecting an integer r from a range of mn, and when the determining means determines 0, 2 mn < r < 2 m-n + 2
A second integer selection means for selecting an integer r from a range of / 3, and a correction means for multiplying the input value N by the selected integer r to obtain an input M of the arithmetic device. An arithmetic unit with correction processing.
【請求項3】 入力変数値Mが、R/2M<R,R=
m なる2べき値の値の範囲に制限される演算装置を用
いて、2のべき値S=2n で範囲がS/2N<Sで表
現され、かつN<R/2なる入力値Nを入力して演算す
る装置であって、 N3S/4か否かを判定する判定手段と、 その判定手段が3S/4N<Sと判定すると、r=2
m-n-1なる整数rを選択する第1整数選択手段と、 上記判定手段がS/2N<3S/4と判定すると、r
=2m-n +1なる整数rを選択する第2整数選択手段
と、 上記入力値Nを上記選択した整数r倍して上記演算装置
の入力Mとする補正手段とを備えることを特徴とする補
正処理付演算装置。
3. An input variable value M is R / 2 < M <R, R =
Using an arithmetic unit restricted to the range of 2 power values of 2 m, the input is expressed as S / 2 < N <S with a power of 2 value S = 2 n and N <R / 2. An apparatus for calculating by inputting a value N, and determining means for determining whether N > 3S / 4, and when the determining means determines 3S / 4 < N <S, r = 2
first integer selecting means for selecting an integer r of mn- 1; and when the determining means determines that S / 2 < N <3S / 4, r
= 2 mn +1. A second integer selection means for selecting an integer r, and a correction means for multiplying the input value N by the selected integer r to obtain an input M of the arithmetic unit. An arithmetic unit with processing.
【請求項4】 入力変数値Mが、R/2M<R,R=
m なる2べき値の値の範囲に制限される演算装置を用
いて、2のべき値S=2n で範囲がS/2N<Sで表
現され、かつN<R/2なる入力値Nを入力して演算す
る装置であって、 上記入力値Nの最上位桁から2ビット目が1であるか0
であるかを判定する判定手段と、 その判定手段が1と判定すると、r=2m-n-1なる整数
rを選択する第1整数選択手段と、 上記判定手段が0と判定すると、r=2m-n +1なる整
数rを選択する第2整数選択手段と、 上記入力値Nを、上記選択した整数r倍して上記演算装
置の入力Mとする補正手段とを具備することを特徴とす
る補正処理付演算装置。
4. An input variable value M is R / 2 < M <R, R =
Using an arithmetic unit restricted to the range of 2 power values of 2 m, the input is expressed as S / 2 < N <S with a power of 2 value S = 2 n and N <R / 2. A device for calculating by inputting a value N, wherein the second bit from the most significant digit of the input value N is 1 or 0
A first integer selecting means for selecting an integer r such that r = 2 mn -1 if the determining means determines 1; and r = 2 if the determining means determines 0. a second integer selecting means for selecting an integer r of mn + 1; and a correcting means for multiplying the input value N by the selected integer r to obtain an input M of the arithmetic unit. An arithmetic unit with processing.
【請求項5】 請求項1〜4の何れかに記載の補正処理
付演算装置において、 上記演算装置は、入力Mが法で処理結果をその法Mによ
る剰余をとる装置であり、 上記演算装置の出力結果を法Nで剰余をとる補正処理手
段を備えることを特徴とする補正処理付演算装置。
5. The arithmetic device with correction processing according to claim 1, wherein the arithmetic device is a device in which an input M is modulo and a processing result is obtained by the remainder of the modulus M. An arithmetic unit with correction processing, comprising: a correction processing means for taking a remainder of the output result of (i) by a modulus N.
【請求項6】 請求項記載の補正処理付演算装置にお
いて、 上記演算装置は、Rを2べきの整数とするとき、XR-1
mod Mを求める為に、中国人剰余定理により、((Xmo
d MR)−(XM-1mod R)M)/Rなる演算を2べき
シフトや2べきの剰余によって求めるモンゴメリ演算装
置であり、 上記第1、第2整数選択手段でgcd(2,r)=1も選択
条件とされていることを特徴とする補正処理付演算装
置。
6. The arithmetic unit with correction processing according to claim 5, wherein when the arithmetic unit is R as an integer of 2 power, XR -1
To find mod M, the Chinese Remainder Theorem gives ((Xmo
d MR)-(XM -1 mod R) M) / R is a Montgomery arithmetic device that obtains an operation by a power-of-two shift or a remainder of power-of-two, wherein gcd (2, r) is used by the first and second integer selection means. = 1 is also a selection condition.
【請求項7】 入力変数値Mが、R/2M<R,R=
m なる2べき値の値の範囲に制限される演算装置を用
いて、2のべき値S=2n で範囲がS/2N<Sで表
現され、かつN<R/2なる入力値Nを入力して演算す
る装置であって、 上記入力値Nを入力する手段と、 上記入力値がN3S/4であるか否か判定する判定
と、 上記判定手段が3S/4N<Sと判定すると、2
m-n+1 /3m-n なる範囲の整数rを選択する第
1選択手段と、 上記判定手段がS/2N<3S/4と判定すると、2
m-n m-n+2 /3なる範囲の整数rを選択する第
2選択手段と、 上記入力値Nを上記選択した整数r倍して上記演算装置
の入力Mとする手段とを備える演算装置としてコンピュ
ータを機能させるためのプログラムを記録したコンピュ
ータ読み取り可能な記録媒体。
7. An input variable value M is R / 2 < M <R, R =
Use an arithmetic unit that is restricted to the range of 2 power values of 2 m
There are two Nobekine S = range 2 n is expressed by S / 2 <N <S, and N <a equipment that calculates to input R / 2 becomes the input value N, the input value N means for inputting a whether determination hand the input value is N> 3S / 4
And the step, when the determining means determines that 3S / 4 <N <S, 2
first selecting means for selecting an integer r in a range of m−n + 1/3 < r < 2 mn; and when the determining means determines that S / 2 < N <3S / 4, 2
a second selection means for selecting mn <r <2 mn + 2 /3 Scope integer r, the input value N to an integer r multiplied selected above and means for receiving M of the arithmetic unit A computer that stores a program for causing a computer to function as an arithmetic device
Data readable recording medium.
【請求項8】 入力変数値Mが、R/2M<R,R=
m なる2べき値の値の範囲に制限される演算装置を用
いて、2のべき値S=2n で範囲がS/2N<Sで表
現され、かつN<R/2なる入力値Nを入力して演算す
る装置であって、 上記入力値Nの最上位桁から2ビット目が1であるか0
であるかを判定する判定手段と、 その判定手段が1と判定すると、2m-n+1 /3
m-n なる範囲から整数rを選択する手段と、 上記判定手段が0と判定すると、2m-n m-n+2
/3なる範囲から整数rを選択する手段と、 上記入力値Nを、上記選択した整数r倍して上記演算装
置の入力Mとする手段を備える演算装置としてコンピ
ュータを機能させるためのプログラムを記録したコンピ
ュータ読み取り可能な記録媒体。
8. An input variable value M is R / 2 < M <R, R =
Use an arithmetic unit that is restricted to the range of 2 power values of 2 m
There are two Nobekine S = range 2 n is expressed by S / 2 <N <S, and N <a equipment that calculates to input R / 2 becomes the input value N, the input value N Whether the second bit from the most significant digit is 1 or 0
Determination means for determining whether or not, and when the determination means determines 1, 2m−n + 1/3 < r < 2
a means for selecting an integer r from the range mn, and when the determination means determines 0, 2 mn < r < 2 m−n + 2
/ 3 Scope and means for selecting an integer r, the input value N, functional competent <br/> Yuta in integers r times the above selected as a calculation device and means for receiving M of the arithmetic unit Compiling a program for
A computer-readable recording medium.
【請求項9】 入力変数値Mが、R/2M<R,R=
m なる2べき値の値の範囲に制限される演算装置を用
いて、2のべき値S=2n で範囲がS/2N<Sで表
現され、かつN<R/2なる入力値Nを入力して演算す
る装置であって、 N3S/4か否かを判定する判定手段と、 その判定手段が3S/4N<Sと判定すると、r=2
m-n-1なる整数rを選択する第1整数選択手段と、 上記判定手段がS/2N<3S/4と判定すると、r
=2m-n +1なる整数rを選択する第2整数選択手段
と、 上記入力値Nを上記選択した整数r倍して上記演算装置
の入力Mとする補正手段とを備える補正処理付演算装置
としてコンピュータを機能させるためのプログラムを記
録したコンピュータ読み取り可能な記録媒体。
9. An input variable value M is R / 2 < M <R, R =
Using an arithmetic unit restricted to the range of 2 power values of 2 m, the input is expressed as S / 2 < N <S with a power of 2 value S = 2 n and N <R / 2. An apparatus for calculating by inputting a value N, and determining means for determining whether N > 3S / 4, and when the determining means determines 3S / 4 < N <S, r = 2
first integer selecting means for selecting an integer r of mn- 1; and when the determining means determines that S / 2 < N <3S / 4, r
= 2 mn +1 as a second integer selecting means for selecting an integer r, and a correcting means comprising a correction means for multiplying the input value N by the selected integer r to obtain an input M of the arithmetic device. A computer-readable recording medium on which a program for causing a computer to function is recorded.
【請求項10】 入力変数値Mが、R/2M<R,R
=2m なる2べき値の値の範囲に制限される演算装置を
用いて、2のべき値S=2n で範囲がS/2N<Sで
表現され、かつN<R/2なる入力値Nを入力して演算
する装置であって、 上記入力値Nの最上位桁から2ビット目が1であるか0
であるかを判定する判定手段と、 その判定手段が1と判定すると、r=2m-n-1なる整数
rを選択する第1整数選択手段と、 上記判定手段が0と判定すると、r=2m-n +1なる整
数rを選択する第2整数選択手段と、 上記入力値Nを、上記選択した整数r倍して上記演算装
置の入力Mとする補正手段とを具備する補正処理付演算
装置としてコンピュータを機能させるためのプログラム
を記録したコンピュータ読み取り可能な記録媒体。
10. An input variable value M is R / 2 < M <R, R
= 2 m , the range is expressed as S / 2 < N <S, and N <R / 2, with the power of 2 being S = 2 n , using an arithmetic device limited to the range of the value of 2 powers. A device for calculating by inputting an input value N, wherein the second bit from the most significant digit of the input value N is 1 or 0
A first integer selecting means for selecting an integer r such that r = 2 mn -1 if the determining means determines 1; and r = 2 if the determining means determines 0. a second integer selection means for selecting an integer r of mn + 1; and a correction means comprising a correction means for multiplying the input value N by the selected integer r to obtain an input M of the arithmetic device. A computer-readable recording medium on which a program for causing a computer to function is recorded.
【請求項11】 請求項7〜10記載の記録媒体におい
て、 上記演算装置は、入力Mが法で処理結果をその法Mによ
る剰余をとる剰余演算装置であり、 上記剰余演算装置の出力結果を、法Nで剰余をとる補正
手段を備えることを特徴とする記録媒体。
11. The recording medium according to claim 7, wherein the arithmetic unit is a remainder arithmetic unit that takes a processing result of the input M modulo and takes a remainder according to the modulus M, and outputs the output result of the remainder arithmetic unit. , Mod N to take the remainder
Recording medium characterized in that it comprises means.
【請求項12】 請求項11記載の記録媒体において、 上記演算装置は、Rを2べきの整数とするとき、XR-1
mod Mを求める為に、中国人剰余定理により、((Xmo
d MR)−(XM-1mod R)M)/Rなる演算を2べき
シフトや2べきの剰余によって構成されるモンゴメリ演
算装置であって上記第1、第2選択手段でgcd(2,r)
=1も選択条件とされていることを特徴とする記録媒
体。
12. The recording medium according to claim 11, wherein the arithmetic unit calculates XR −1 when R is an integer of 2 power.
To find mod M, the Chinese Remainder Theorem gives ((Xmo
d MR)-(XM -1 mod R) M) / R is a Montgomery arithmetic device configured by a power-of-two shift and a power-of-two remainder, wherein the first and second selecting means perform gcd (2, r )
= 1 also is a selected condition recording medium characterized Rukoto.
JP23849098A 1998-08-25 1998-08-25 Arithmetic device with correction processing and program recording medium therefor Expired - Lifetime JP3321416B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23849098A JP3321416B2 (en) 1998-08-25 1998-08-25 Arithmetic device with correction processing and program recording medium therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23849098A JP3321416B2 (en) 1998-08-25 1998-08-25 Arithmetic device with correction processing and program recording medium therefor

Publications (2)

Publication Number Publication Date
JP2000066591A JP2000066591A (en) 2000-03-03
JP3321416B2 true JP3321416B2 (en) 2002-09-03

Family

ID=17031030

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23849098A Expired - Lifetime JP3321416B2 (en) 1998-08-25 1998-08-25 Arithmetic device with correction processing and program recording medium therefor

Country Status (1)

Country Link
JP (1) JP3321416B2 (en)

Also Published As

Publication number Publication date
JP2000066591A (en) 2000-03-03

Similar Documents

Publication Publication Date Title
Zubik-Kowal et al. Waveform relaxation for functional-differential equations
Wenger et al. Evaluating 16-bit processors for elliptic curve cryptography
Gaudry et al. A gmp-based implementation of schönhage-strassen's large integer multiplication algorithm
Bos et al. Arithmetic considerations for isogeny-based cryptography
Karmakar et al. Efficient finite field multiplication for isogeny based post quantum cryptography
JP2502836B2 (en) Preprocessing device for division circuit
Nath et al. Security and efficiency trade-offs for elliptic curve Diffie–Hellman at the 128-bit and 224-bit security levels
US6609141B1 (en) Method of performing modular inversion
JP3321416B2 (en) Arithmetic device with correction processing and program recording medium therefor
US8909689B2 (en) Arithmetic device
JP4621162B2 (en) Finite commutative group operation method, apparatus and program thereof
JP2004166274A (en) Method and apparatus for basis conversion in finite field
Lou et al. Fast exponentiation by folding the signed-digit exponent in half
JPH0584928B2 (en)
JP4223819B2 (en) Power residue calculation apparatus and program
Becker et al. Efficient multiplication of somewhat small integers using number-theoretic transforms
US7539715B2 (en) Method and system for saturating a left shift result using a standard shifter
JP2003122251A (en) Method, device and program for generating cipher information, and recording medium
JP2007503036A (en) Method for performing modular multiplication and method for performing Euclidean multiplication using 2N-bit numbers
Lou et al. Parallel exponentiation using common-multiplicand-multiplication and signed-digit-folding techniques
US7480380B2 (en) Method for efficient generation of modulo inverse for public key cryptosystems
Zhao et al. Efficient Arithmetic for Polynomial Multiplication in Post-quantum Lattice-Based Cryptosystem on RISC-V Platform
JP3766250B2 (en) Product operation device and program recording medium thereof
JP2020166661A (en) Division device, division method and program
JP3390966B2 (en) Remainder arithmetic device modulo square number and program recording medium therefor

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090621

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20090621

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20100621

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20100621

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20110621

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20120621

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20130621

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20140621

Year of fee payment: 12

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

EXPY Cancellation because of completion of term