[go: up one dir, main page]

JP3515462B2 - Remainder arithmetic device and method - Google Patents

Remainder arithmetic device and method

Info

Publication number
JP3515462B2
JP3515462B2 JP2000014868A JP2000014868A JP3515462B2 JP 3515462 B2 JP3515462 B2 JP 3515462B2 JP 2000014868 A JP2000014868 A JP 2000014868A JP 2000014868 A JP2000014868 A JP 2000014868A JP 3515462 B2 JP3515462 B2 JP 3515462B2
Authority
JP
Japan
Prior art keywords
remainder
result
mod
addition
modulus
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
Application number
JP2000014868A
Other languages
Japanese (ja)
Other versions
JP2001202232A (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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2000014868A priority Critical patent/JP3515462B2/en
Publication of JP2001202232A publication Critical patent/JP2001202232A/en
Application granted granted Critical
Publication of JP3515462B2 publication Critical patent/JP3515462B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、暗号通信やデジタ
ル署名などに適用される公開鍵暗号の分野、あるいは素
因数分解などに適用される数論アルゴリズムの研究分野
など、多倍長整数を法とする加算もしくは減算を多数含
む演算処理を実現し得る剰余系演算装置及び方法に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to modulo large integers, such as in the field of public key cryptography applied to cryptographic communication and digital signatures, or in the field of number theory algorithms applied to prime factorization. The present invention relates to a remainder system arithmetic device and method capable of realizing arithmetic processing including a large number of additions or subtractions.

【0002】[0002]

【従来の技術】例えば、情報通信ネットワークや計算機
システム(以下、計算機システム等という)では、電子
的に情報が交換され、蓄積される。係る計算機システム
等は、大規模化により不特定多数のユーザに利用される
場合、悪意のユーザによる情報の盗聴や改ざんなどが問
題となる。よって、計算機システム等では、これらの問
題を阻止する観点から、通常、公開鍵暗号技術が用いら
れている。
2. Description of the Related Art For example, in an information communication network or a computer system (hereinafter referred to as a computer system), information is electronically exchanged and stored. When such a computer system or the like is used by an unspecified large number of users due to its large scale, there is a problem that a malicious user taps or falsifies information. Therefore, in computer systems and the like, public key cryptography is normally used from the viewpoint of preventing these problems.

【0003】この種の公開鍵暗号技術は、一般に、多倍
長の整数を法(モジュラス)とする演算で実現されてお
り、その演算速度に応じて性能が左右される。多倍長整
数の表現には基数を2とした通常の記数法(Radix repr
esentation)(いわゆる2進数表現)と剰余系表現(R
NS;Residue Number System、以下、RNS表現とい
う)がある。
This type of public key cryptography is generally realized by an arithmetic operation using a multiple integer as a modulus (modulus), and the performance depends on the operation speed. For the representation of multiple long integers, the standard number system with a radix of 2 (Radix repr
esentation) (so-called binary representation) and coset representation (R
NS; Residue Number System, hereinafter referred to as RNS expression).

【0004】RNS表現とは、多くの法a,a
…,a、を用い、整数xをそれらの法{a,a
…,a}による剰余値x,x,…,xの組で表
現する方式である。
The RNS representation is a number of modulo a 1 , a 2 ,
, A n , the integer x is their modulus {a 1 , a 2 ,
, A n } is a method of expressing by a set of residual values x 1 , x 2 , ..., X n .

【0005】例えばRNS表現では、整数x=(x
,…,x)と表現される。但し、x=x mo
d a,x=x mod a,…,x=x m
odaである。なお、以下の本明細書中では、RNS
表現で用いる法の集合{a ,a,…,a}を基底
Bという。RNS表現では、基底の各要素として、互い
に素な正整数が通常用いられる。また、中国剰余定理に
より、基底の各要素の積未満の正整数は一意に表現され
る旨が保証される。
For example, in the RNS representation, the integer x = (x1
xTwo, ..., xn) Is expressed. However, x1= X mo
da1, XTwo= X mod aTwo, ..., xn= X m
odanIs. In the following specification, RNS is used.
Set of mods used in expression {a 1, ATwo, ..., an} Is the basis
It is called B. In RNS representation, each element of the base is
A prime positive integer is usually used. In addition, the Chinese Remainder Theorem
Therefore, positive integers less than the product of each element of the base are uniquely expressed.
Is guaranteed.

【0006】例えば、基底B={a,a,…,
}とし、正整数A=a*a*…*aとしたと
き、RNS表現では、A未満の正整数が一意に表現され
る。以下、本明細書中では、このように基底BによりR
NS表現された整数xが<x>と表記される。
For example, the basis B = {a 1 , a 2 , ...,
a n } and a positive integer A = a 1 * a 2 * ... * a n , a positive integer less than A is uniquely expressed in the RNS expression. Hereinafter, in the present specification, R by R
The NS-expressed integer x is expressed as <x> A.

【0007】このようなRNS表現は、Aを法とした加
算、減算、乗算を簡単に実行できる利点を持っている。
すなわち、RNS表現では、次の(1)式〜(3)式に
示すように、演算対象<x>,<y>の各要素を基
底Bの各々の法により、個別に加算、減算、乗算した結
果が演算結果となる。
Such an RNS expression has an advantage that addition, subtraction and multiplication modulo A can be easily executed.
That is, in the RNS expression, as shown in the following expressions (1) to (3), each element of the operation target <x> A , <y> A is individually added or subtracted by each method of the base B. , The result of multiplication is the calculation result.

【0008】 <x>+<y>(mod A)=(x+y(mod a),x+y (mod a),…,x+y(mod a)) …(1) <x>−<y>(mod A)=(x−y(mod a),x−y (mod a),…,x−y(mod a)) …(2) <x>*<y>(mod A)=(x*y(mod a),x*y (mod a),…,x*y(mod a)) …(3) 従って、RNS表現は、n個の演算ユニットにより、各
々の法{a,a,…,a}による演算を並列処理
可能であるため、高速演算に向いている。
[0008] <X>A+ <Y>A(Mod A) = (x1+ Y1(Mod a1), XTwo+ Y Two (Mod aTwo), ..., xn+ Yn(Mod an))… (1) <X>A-<Y>A(Mod A) = (x1-Y1(Mod a1), XTwo-Y Two (Mod aTwo), ..., xn-Yn(Mod an))… (2) <X>A* <Y>A(Mod A) = (x1* Y1(Mod a1), XTwo* Y Two (Mod aTwo), ..., xn* Yn(Mod an))… (3) Therefore, the RNS representation is represented by each of n arithmetic units.
Each method {a1, ATwo, ..., an} Parallel processing
Since it is possible, it is suitable for high-speed calculation.

【0009】しかしながら、RNS表現は、例えば公開
鍵暗号に適用する場合、次のような問題が顕著に現れ
る。すなわち、公開鍵暗号で用いる法pは、多くの場
合、素数もしくは2〜3個の素数の積であるため、法p
の因数を基底Bの要素にすると、n=2〜3程度とな
り、並列処理による高速化の度合が低い。
However, when the RNS expression is applied to public key cryptography, for example, the following problem remarkably appears. That is, since the modulus p used in public key cryptography is often a prime number or a product of a few prime numbers, the modulus p
If the factor of is an element of the base B, then n = 2 to 3, and the degree of speedup by parallel processing is low.

【0010】このため、RNS表現において、基底B=
{a,a,…,a}を維持しつつ、各要素の積A
未満のp(:p<A)を公開鍵暗号の法pとしたい要望
がある。
Therefore, in the RNS representation, the basis B =
The product A of each element is maintained while maintaining {a 1 , a 2 , ..., A n }.
There is a demand for p (: p <A) below to be the p of public key cryptography.

【0011】これに伴い、法pでの剰余系加算<x>
+<y>(mod p)、剰余系減算<x>−<y
(mod p)及び剰余系乗算<x>*<y>
(mod p)の高速な演算方式の実現が望まれてい
る。但し、このうち、法pでの剰余系乗算は、モンゴメ
リ乗算に基づく高速な演算方式が考えられている。
Accordingly, the remainder addition <x> A in the modulus p is added.
+ <Y> A (mod p), remainder subtraction <x> A- <y
> A (mod p) and modular multiplication <x> A * <y> A
It is desired to realize a high-speed (mod p) arithmetic method. However, among these, the modular multiplication with the modulus p is considered to be a high-speed arithmetic method based on Montgomery multiplication.

【0012】しかしながら、法pでの剰余系加算並びに
剰余系減算は、依然として有効な方式が存在しない。そ
の理由は、RNS表現は、剰余値の集合であるため、与
えられた2数の大小比較が困難な性質をもつ一方、法p
での剰余系加算及び減算は、演算結果と法pとの大小比
較を必要とするからである。
However, there is still no effective method for the remainder addition and the remainder subtraction in the modulus p. The reason is that the RNS representation has a property that it is difficult to compare the magnitude of two given numbers because it is a set of residue values, while the modulus p
This is because the remainder addition and subtraction in (1) requires comparison of the calculation result and the modulus p.

【0013】すなわち、剰余系加算<x>+<y>
は、得られた加算結果が法pのRNS表現<p>より
も大きいとき、<p>を加算結果から引く必要があ
る。
That is, the remainder system addition <x> A + <y> A
Needs to subtract <p> A from the addition result when the obtained addition result is larger than the RNS expression <p> A of modulus p.

【0014】また、剰余系減算<x>−<y>は、
<x>よりも<y>の方が大きいとき、<p>
減算結果に足す必要がある。
The remainder subtraction <x> A- <y> A is
When <y> A is larger than <x> A , <p> A needs to be added to the subtraction result.

【0015】この種の2数の大小比較は、従来からRN
S表現の欠点とされるものの、未だ効率的な方式が存在
していない。このため、RNS表現は、基底要素の積A
とは異なる法pでの剰余系加算及び減算には不向きと考
えられている。
This kind of two-value comparison is based on the conventional RN.
Despite the drawbacks of S-expression, there is still no efficient method. Therefore, the RNS expression is the product A of the base elements.
It is considered unsuitable for modulo addition and subtraction with modulus p different from.

【0016】[0016]

【発明が解決しようとする課題】以上説明したように従
来の剰余系演算方式では、法AでRNS表現された2整
数<x>,<y>に対し、法Aとは異なる法pの下
での剰余系加算又は減算を行う効率的な方式が要望され
るものの、未だその要望を満たせない状況にある。
As described above, in the conventional coset arithmetic system, the two integers <x> A and <y> A represented by RNS in the modulus A are different from the modulus p in the modulus A. Although there is a demand for an efficient method of performing remainder addition or subtraction under the condition, there is still a situation where the demand cannot be satisfied.

【0017】本発明は上記実情を考慮してなされたもの
で、法Aで剰余系表現された2数に対し、法Aとは異な
る法pの下での剰余系加算を高効率に実行し得る剰余系
演算装置及び方法を提供することを目的とする。
The present invention has been made in consideration of the above-mentioned circumstances, and efficiently performs a remainder addition under a modulus p different from the modulus A for two numbers expressed by the modulus A in the modulus A. It is an object of the present invention to provide a residual coprocessor and method.

【0018】また、本発明の他の目的は、上記剰余系加
算の他に、同様の法pの下での剰余系減算を高効率に実
行し得る剰余系演算装置及び方法を提供することにあ
る。
Another object of the present invention is to provide a coset arithmetic unit and method capable of highly efficiently performing coset subtraction under the same method p, in addition to the coset addition. is there.

【0019】[0019]

【課題を解決するための手段】請求項1に対応する発明
は、法Aで剰余系表現された複数の剰余系データ<x>
,<y>同士を法p(:p<A)の下で加算するた
めの剰余系演算装置であって、予め混合基数表示で法p
をh倍(h=1〜hの正整数)した複数の倍数データ
(p,2p,…,hp)が設定される混合基数系倍数設
定手段と、予め前記剰余系表現で前記法pをh倍した複
数の倍数データ(<p>,2*<p>,…,h*<
p>)が設定される剰余系倍数設定手段と、入力され
た剰余系データ<x>,<y>を剰余系表現で加算
し、剰余系加算結果<z>を得る剰余系加算手段と、
前記剰余系加算手段により得られた剰余系加算結果<z
を混合基数表示に変換する表現変換手段と、前記表
現変換手段により得られた混合基数表示された加算結果
zと、前記混合基数系倍数設定手段内の各倍数データと
に基づいて、前記混合基数表示された加算結果zが最大
でj倍(0≦j≦h)の倍数データjpを含む旨(jp
≦z<(j+1)p)を判定し、倍数jを決定する倍数決定
手段と、前記倍数決定手段により得られた倍数jに基づ
いて、前記剰余系加算手段により得られた剰余系加算結
果<z>から前記剰余系倍数設定手段内のj倍の倍数
データj*<p>を減算し、得られた法pでの剰余系
加算結果<z>を出力する加算結果出力手段とを備え
た剰余系演算装置である。
The invention corresponding to claim 1 is to provide a plurality of coset data <x> represented by cosets in the modulus A.
A , <y> A coprocessor for adding A and A together under a modulus p (: p <A), which is a modulus p in a mixed radix representation in advance.
And a multiple radix data (p, 2p, ..., hp) obtained by multiplying h by (h = 1 to h is a positive integer) is set, and the modulus p is previously set to h by the remainder system expression. Multiple multiple data (<p> A , 2 * <p> A , ..., h * <
p> A ) is set and the inputted remainder system data <x> A , <y> A are added in a remainder system expression, and a remainder system addition result <z> A is obtained. Adding means,
Remainder system addition result <z obtained by the remainder system adding means
> Based on the expression conversion means for converting A into the mixed radix representation, the addition result z displayed by the mixed radix displayed by the expression conversion means, and each multiple data in the mixed radix system multiple setting means, The fact that the addition result z displayed in the mixed radix includes a maximum of j times (0 ≦ j ≦ h) multiples data jp (jp
≦ z <(j + 1) p) and a multiple determining means for determining a multiple j, and a remainder addition obtained by the remainder adding means based on the multiple j obtained by the multiple determining means. result <z> a multiple data j * <p> a of j times in the coset multiple setting means subtracts from a, coset addition in the obtained modulo p result <z> and outputs the a addition result output It is a coset system computing device including means.

【0020】また、請求項2に対応する発明は、法Aで
剰余系表現された複数の剰余系データ<x>,<y>
に関し、法p(:p<A)の下で前記<x>から前
記<y>を減算するための剰余系演算装置であって、
予め混合基数表示で法pをh倍(h=1〜hの正整数)
した複数の倍数データ(p,2p,…,hp)が設定さ
れる混合基数系倍数設定手段と、予め前記剰余系表現で
前記法pをh倍した複数の倍数データ(<p>,2*
<p>,…,h*<p>)が設定される剰余系倍数
設定手段と、前記法pの剰余系表現を<p>とすると
き、前記<y> の上限値を越える倍数データd*<p
を用い、前記d*<p>から前記<y>を剰余
系表現で減算し、正の剰余系減算結果<S>を得る剰
余系減算手段と、前記剰余系減算手段により得られた正
の剰余系減算結果<S>と前記<x>とを剰余系表
現で加算し、剰余系加算結果<z>を得る剰余系加算
手段と、前記剰余系加算手段により得られた剰余系加算
結果<z>を混合基数表示に変換する表現変換手段
と、前記表現変換手段により得られた混合基数表示され
た加算結果zと、前記混合基数系倍数設定手段内の各倍
数データとに基づいて、前記混合基数表示された加算結
果zが最大でj倍(0≦j≦h)の倍数データjpを含
む旨(jp≦z<(j+1)p)を判定し、倍数jを決定す
る倍数決定手段と、前記倍数決定手段により得られた倍
数jに基づいて、前記剰余系加算手段により得られた剰
余系加算結果<z>から前記剰余系倍数設定手段内の
j倍の倍数データj*<p>を減算し、得られた法p
での剰余系減算結果<z>を出力する減算結果出力手
段とを備えた剰余系演算装置である。
The invention according to claim 2 is method A
Multiple coset data <x>A, <Y>
AWith respect to <x> under the law p (: p <A)AFrom before
Note <y>AA coprocessor for subtracting,
Pre-mixed radix representation modulo p times (h = positive integer from 1 to h)
Multiple multiple data (p, 2p, ..., hp)
Mixed radix system multiple setting means, and the remainder system expression
Multiple multiple data (<p>A, 2 *
<P>A,…, H * <p>A) Is the remainder system multiple
The setting means and the remainder system expression of the modulus p are set to <p>.AAnd
The above <y> AData that exceeds the upper limit of d * <p
>AUsing the above d * <p>AFrom above <y>AThe remainder
Subtract by system expression, positive remainder subtraction result <S>ASurplus
The coset subtraction means and the positive subtraction means obtained by the coset subtraction means.
Remainder subtraction result <S>AAnd the above <x>AAnd the remainder system table
Current addition, remainder addition result <z>AModulo addition to obtain
Means and the remainder system addition obtained by the remainder system addition means
Result <z>ARepresentation conversion means for converting to mixed radix representation
And the mixed radix obtained by the expression conversion means is displayed.
Addition result z and each multiple in the mixed radix system multiple setting means
Based on the numerical data and the addition result displayed in the mixed radix
The result z contains the multiple data jp of j times (0 ≦ j ≦ h) at maximum.
Judgment (jp ≦ z <(j + 1) p) and determine the multiple j
And a multiple obtained by the multiple determining means.
The remainder obtained by the remainder adder based on the number j.
Coset addition result <z>AFrom the remainder system multiple setting means
j times multiple data j * <p>ATo obtain the modulo p
Remainder subtraction result <z>ASubtraction result output hand that outputs
It is a coset arithmetic unit including a stage.

【0021】さらに、請求項3に対応する発明は、法A
で剰余系表現された複数の剰余系データ<x>,<y
同士を法p(:p<A)の下で加算するための剰余
系演算装置であって、予め2進数表現で法pをh倍(h
=1〜hの正整数)した複数の倍数データのうち、上位
w桁を示す近似値データ(p’,2p’,…,hp’)
が設定される2進数系倍数設定手段と、予め前記剰余系
表現で前記法pをh倍した複数の倍数データ(<p
,2*<p>,…,h*<p>)が設定される
剰余系倍数設定手段と、入力された剰余系データ<x>
,<y>を剰余系表現で加算し、剰余系加算結果<
z>を得る剰余系加算手段と、前記剰余系加算手段に
より得られた剰余系加算結果<z>を上位w桁の近似
値で2進数表現に変換する近似変換手段と、前記近似変
換手段により得られた2進数表現の近似値データz’
と、前記2進数系倍数設定手段内の各近似値データとに
基づいて、前記加算結果の近似値データz’が最大でj
倍(0≦j≦h)の近似値データjp’を含む旨(j
p’<z’≦(j+1)p’)を判定し、倍数jを決定する
倍数決定手段と、前記倍数決定手段により得られた倍数
jに基づいて、前記剰余系加算手段により得られた剰余
系加算結果<z>から前記剰余系倍数設定手段内のj
倍の倍数データj*<p>を減算し、得られた法pで
の剰余系加算結果<z>を出力する加算結果出力手段
とを備えた剰余系演算装置である。
Furthermore, the invention corresponding to claim 3 is method A
Plural remainder data <x> A , <y expressed by the remainder system in
> A coprocessor for adding A to each other under a modulo p (: p <A).
= Positive integer of 1 to h), approximate value data (p ', 2p', ..., hp ') indicating the upper w digit among a plurality of multiple data
And binary number system multiple setting means, and a plurality of multiple data (<p
> A , 2 * <p> A , ..., h * <p> A ) and a remainder system data input <x>
A , <y> A is added by the remainder expression, and the remainder addition result <
z> A , a residue system addition means, an approximation conversion means for converting the residue system addition result <z> A obtained by the residue system addition means into a binary representation with an approximate value of the upper w digits, and the approximation conversion. Approximate value data z'represented by a binary number obtained by the means
And the approximate value data z ′ of the addition result based on the approximate value data in the binary system multiple setting means is j at the maximum.
Including that double (0 ≦ j ≦ h) approximate value data jp ′ is included (j
p ′ <z ′ ≦ (j + 1) p ′) is determined and a multiple determining means for determining a multiple j and a multiple j obtained by the multiple determining means are obtained by the remainder adder. From the remainder system addition result <z> A , j in the remainder system multiple setting means
This is a remainder system arithmetic device provided with addition result output means for subtracting the multiple data j * <p> A of double and outputting a remainder system addition result <z> A in the obtained modulus p.

【0022】また、請求項4に対応する発明は、法Aで
剰余系表現された複数の剰余系データ<x>,<y>
に関し、法p(:p<A)の下で前記<x>から前
記<y>を減算するための剰余系演算装置であって、
予め2進数表現で法pをh倍(h=1〜hの正整数)し
た複数の倍数データのうち、上位w桁を示す近似値デー
タ(p’,2p’,…,hp’)が設定される2進数系
倍数設定手段と、予め前記剰余系表現で前記法pをh倍
した複数の倍数データ(<p>,2*<p> ,…,
h*<p>)が設定される剰余系倍数設定手段と、前
記法pの剰余系表現を<p>とするとき、前記<y>
の上限値を越える倍数データd*<p>を用い、前
記d*<p>から前記<y>を剰余系表現で減算
し、正の剰余系減算結果<S>を得る剰余系減算手段
と、前記剰余系減算手段により得られた正の剰余系減算
結果<S>と前記<x>とを剰余系表現で加算し、
剰余系加算結果<z>を得る剰余系加算手段と、前記
剰余系加算手段により得られた剰余系加算結果<z>
を上位w桁の近似値で2進数表現に変換する近似変換手
段と、前記近似変換手段により得られた2進数表現の近
似値データz’と、前記2進数系倍数設定手段内の各近
似値データとに基づいて、前記加算結果の近似値データ
z’が最大でj倍(0≦j≦h)の近似値データjp’
を含む旨(jp’<z’≦(j+1)p’)を判定し、倍数
jを決定する倍数決定手段と、前記倍数決定手段により
得られた倍数jに基づいて、前記剰余系加算手段により
得られた剰余系加算結果<z>から前記剰余系倍数設
定手段内のj倍の倍数データj*<p>を減算し、得
られた法pでの剰余系減算結果<z>を出力する減算
結果出力手段とを備えた剰余系演算装置である。
The invention corresponding to claim 4 is the method A
Multiple coset data <x>A, <Y>
AWith respect to <x> under the law p (: p <A)AFrom before
Note <y>AA coprocessor for subtracting,
Preliminarily multiply the modulus p by a binary expression (h = 1 to a positive integer).
Approximate value data showing the upper w digit of multiple multiple data
A binary number system in which data (p ', 2p', ..., hp ') is set
With a multiple setting means, the modulus p is multiplied by h in advance with the remainder expression.
Multiple multiple data (<p>A, 2 * <p> A,… ,
h * <p>A) Is set to the remainder multiple setting means, and
<P> is the coset representation of the notation pAAnd the above <y>
AData that exceeds the upper limit value of d * <p>AUsing
Note d * <p>AFrom above <y>ASubtract with modulo expression
Then, the positive remainder subtraction result <S>ARemainder subtraction means for obtaining
And the positive remainder subtraction obtained by the remainder subtraction means
Result <S>AAnd the above <x>AAnd are added in the remainder expression,
Remainder system addition result <z>ARemainder system adding means for obtaining
Coset addition result <z> obtained by the coset addition meansA
Approximate converter that converts to the binary representation with the approximate value of the upper w digits
And the binary representation of the binary number obtained by the approximation conversion means.
The similar value data z'and each of the numbers in the binary system multiple setting means.
Approximate value data of the addition result based on similar value data
z'is maximum j times (0≤j≤h) approximate value data jp '
Is determined to include (jp '<z'≤ (j + 1) p'), and a multiple
a multiple determining means for determining j, and the multiple determining means
Based on the obtained multiple j, the remainder system adding means
Result of remainder addition <z>AFrom the remainder system multiple setting
J times multiple data j * <p> in the determining meansASubtract and get
Remainder subtraction result <z>ASubtract to output
It is a coset arithmetic unit having a result output means.

【0023】さらに、請求項5に対応する発明は、互い
に素なn個の整数の組{a,a,…,a}を基底
とし、A=a*a*…*aに対して条件0≦x,
y<Aを満たす2整数をx,yとし、前記整数xの剰余
系表現を(x,x,…,x)とし、前記整数yの
剰余系表現を(y,y,…,y)とするとき、p
<Aを満たす正整数pを法pとして前記x,yの剰余系
加算結果z=x+y(mod p)=(z,z
…,z)を算出するための剰余系演算方法であって、
剰余系加算の式z=x+y(mod a)(1
≦i≦n)に基づいて、法Aでの剰余系加算結果zを要
素z毎に算出する剰余系加算工程と、前記剰余系加算
工程で得られた要素z及び下記vの各式に基づい
て、前記剰余系加算結果zを混合基数表示(v
,…,v)に変換する表現変換工程と、前記表現
変換工程で得られた混合基数表示された加算結果zと、
混合基数表示された法pをj倍した値{p,2p,…,
jp,…,hp}(但し、1≦j≦h)とを比較する法
p比較工程と、前記法pの剰余系表現を(p,p
…,p)とするとき、前記法p比較工程の比較結果に
基づいて、(jp≦z<(j+1)pならばz=z−j
*p(mod a)(1≦i≦n)を実行し、hp
≦zならばz=z−h*p(mod a)(1
≦i≦n)を実行することにより、前記法pでの剰余系
加算結果zを算出する(mod p)実行工程とを含ん
でいる剰余系演算方法である。
Further, the invention according to claim 5 is based on a set of n disjoint integers {a 1 , a 2 , ..., An }, and A = a 1 * a 2 * ... * a condition 0 ≦ x for n ,
Let 2 integers that satisfy y <A be x, y, let the remainder system representation of the integer x be (x 1 , x 2 , ..., X n ), and let the remainder system representation of the integer y be (y 1 , y 2 , , Y n ), p
<A modulo p is a positive integer p that satisfies A, and the remainder addition result z = x + y (mod p) = (z 1 , z 2 ,
, Z n ), which is a residue system operation method for calculating
Expression of remainder addition z i = x i + y i (mod a i ) (1
≦ i ≦ n) on the basis, and the coset addition step of calculating the modulo sum z for each elements z i in the law A, each of said elements obtained in the residue system adds steps z i and below v i Based on the equation, the remainder addition result z is expressed as a mixed radix (v 1 ,
v 2, ..., a representation conversion step of converting the v n), the addition result z of the mixed radix obtained in representation conversion process,
A value obtained by multiplying the modulus p displayed in mixed radix by j {p, 2p, ...,
jp, ..., hp} (where 1 ≦ j ≦ h), and the remainder system expression of the method p is expressed by (p 1 , p 2 ,
, Pn ), based on the comparison result of the method p comparison step, if (jp ≦ z <(j + 1) p, then z i = z i −j
* P i (mod a i ) (1 ≦ i ≦ n) is executed, and hp
If ≦ z, then z i = z i −h * p i (mod a i ) (1
.Ltoreq.i.ltoreq.n) is performed to calculate the remainder system addition result z in the modulus p (mod p), and the remainder system operation method is included.

【0024】 v=z(mod a) v=(z−v)*C12(mod a) v=((z−v)*C13−v)*C23(mod a) : v=((z−v)*C1n−v)*C2n−……−v(n-1))*C(n-1)n( mod a) 但し、Cji=aj -1mod a、(j=1,2,…,i−1) また、請求項6に対応する発明は、互いに素なn個の整
数の組{a,a,…,a}を基底とし、A=a
*a*…*aに対して条件0≦x,y<Aを満たす
2整数をx,yとし、前記整数xの剰余系表現を
(x,x,…,x )とし、前記整数yの剰余系表
現を(y,y,…,y)とするとき、p<Aを満
たす正整数pを法pとして前記x,yの剰余系減算結果
z=x−y(mod p)=(z,z,…,z
を算出するための剰余系演算方法であって、前記pの剰
余系表現を(p,p,…,p)とするとき、前記
yの上限値を超えるpの倍数d*pを用い、剰余系減算
の式s=d*p−y(mod a)(1≦i≦
n)により、正の剰余系減算結果s=(s,s
…,s)を算出する剰余系減算工程と、前記剰余系減
算工程により得られた要素s を用い、剰余系加算の式
=s+x(mod a)(1≦i≦n)に基
づいて、法Aでの剰余系加算結果zを要素z毎に算出
する剰余系加算工程と、前記剰余系加算工程で得られた
要素z及び下記vの各式に基づいて、前記剰余系加
算結果zを混合基数表示(v,v,…,v)に変
換する表現変換工程と、前記表現変換工程で得られた混
合基数表示された加算結果zと、混合基数表示された法
pをj倍した値{p,2p,…,jp,…,hp}(但
し、1≦j≦h)とを比較する法p比較工程と、前記法
pの剰余系表現を(p,p,…,p)とすると
き、前記法p比較工程の比較結果に基づいて、(jp≦
z<(j+1)pならばz=z−j*p(mod a
)(1≦i≦n)を実行し、hp≦zならばz=z
−h*p(mod a)(1≦i≦n)を実行す
ることにより、前記法pでの剰余系減算結果zを算出す
る(mod p)実行工程とを含んでいる剰余系演算方
法である。
[0024] v1= Z1(Mod a1) vTwo= (ZTwo-V1) * C12(Mod aTwo) vThree= ((ZThree-V1) * C13-VTwo) * Ctwenty three(Mod aThree)     : vn= ((ZThree-V1) * C1n-VTwo) * C2n-...- v(n-1)) * C(n-1) n( mod an)   However, Cji= Aj -1mod ai, (J = 1, 2, ..., i-1) The invention corresponding to claim 6 is such that n disjoint integers.
A set of numbers {a1, ATwo, ..., an} As a base, and A = a1
* ATwo* ... * anSatisfies the condition 0 ≦ x, y <A
Let 2 be x and y be the remainder system representation of the integer x
(X1, XTwo, ..., x n) And the remainder system table of the integer y
Present (y1, YTwo, ..., yn), Satisfy p <A
The positive integer p modulo p and the remainder subtraction result of x and y
z = xy (mod p) = (z1, ZTwo,…, Zn)
Which is a residue system calculation method for calculating
Coset expression (p1, PTwo,,, pn) And the above
Modulo subtraction using multiple d * p of p that exceeds the upper limit of y
Expression si= D * pi-Yi(Mod ai) (1 ≦ i ≦
n), the positive remainder subtraction result s = (s1, STwo
…, Sn), The remainder subtraction step, and the remainder subtraction
The element s obtained by the arithmetic process iUsing the remainder addition formula
zi= Si+ Xi(Mod ai) (1 ≦ i ≦ n)
Then, the remainder system addition result z in the modulus A is set to the element z.iCalculated for each
Obtained by the remainder system addition step and the remainder system addition step
Element ziAnd the following viBased on each equation of
Calculation result z is displayed in mixed radix (v1, VTwo, ..., vn)
The expression conversion step for converting the expression and the mixture obtained in the expression conversion step.
Addition result z displayed in mixed radix and modulus displayed in mixed radix
A value obtained by multiplying p by j {p, 2p, ..., jp, ..., hp} (however,
And 1 ≦ j ≦ h), the method p comparing step, and the method
Represent the remainder system of p by (p1, PTwo,,, pn)
Then, based on the comparison result of the method p comparison step, (jp ≦
If z <(j + 1) p then zi= Zi-J * pi(Mod a
i) (1 ≦ i ≦ n), and if hp ≦ z, zi= Z
i-H * pi(Mod ai) (1 ≦ i ≦ n)
To calculate the remainder subtraction result z by the above method p
Modal execution method including a mod p execution process
Is the law.

【0025】 v=z(mod a) v=(z−v)*C12(mod a) v=((z−v)*C13−v)*C23(mod a) : v=((z−v)*C1n−v)*C2n−……−v(n-1))*C(n-1)n( mod a) 但し、Cji=aj -1mod a、(j=1,2,…,i−1) さらに、請求項7に対応する発明は、互いに素なn個の
整数の組{a,a,…,a}を基底とし、A=a
*a*…*aに対して条件0≦x,y<Aを満た
す2整数をx,yとし、前記整数xの剰余系表現を(x
,x,…,x)とし、前記整数yの剰余系表現を
(y,y,…,y)とするとき、p<Aを満たす
正整数pを法pとして前記x,yの剰余系加算結果z=
x+y(mod p)=(z,z,…,z)を算
出するための剰余系演算方法であって、剰余系加算の式
=x+y(mod a)(1≦i≦n)に基
づいて、法Aでの剰余系加算結果zを要素z毎に算出
する剰余系加算工程と、前記Aを前記aで除した値を
(=A/a)とし、A -1を法aにおける前記
の乗法逆元としたとき、前記剰余系加算工程で得ら
れた要素zに基づいて、下記Σの式を満たす正整数
kを算出するパラメータ算出工程と、前記剰余系加算工
程で得られた要素z、前記パラメータ算出工程で得ら
れた前記正整数k及び下記Σの式に基づいて、前記剰
余系加算結果zを2進数表現した値の上位wビット(但
し、wは演算装置本体の基本演算幅以下)の近似値z’
を算出する近似変換工程と、前記近似変換工程で得られ
た2進数表現の近似値z’と、2進数表現された法pを
j倍した値の上位wビットの近似値{p’,(2
p)’,…,(jp)’,…,(hp)’}(但し、1
≦j≦h)とを比較する法p比較工程と、前記法pの剰
余系表現を(p,p,…,p)とするとき、前記
法p比較工程の比較結果に基づいて、(jp)’<z’
≦((j+1)p)’ならばz=z−j*p(mod
)(1≦i≦n)を実行し、(hp)’<z’な
らばz=z−h*p(mod a)(1≦i≦
n)を実行することにより、前記法pでの剰余系加算結
果zを算出する(mod p)実行工程とを含んでいる
剰余系演算方法である。
V 1 = z 1 (mod a 1 ) v 2 = (z 2 −v 1 ) * C 12 (mod a 2 ) v 3 = ((z 3 −v 1 ) * C 13 −v 2 ) * C 23 (mod a 3): v n = ((z 3 -v 1) * C 1n -v 2) * C 2n - ...... -v (n-1)) * C (n-1) n (mod a n ) However, C ji = a j -1 mod a i , (j = 1, 2, ..., i-1) Furthermore, the invention corresponding to claim 7 is a set of n disjoint integers { Based on a 1 , a 2 , ..., A n }, A = a
Let 1 * a 2 * ... * a n be two integers that satisfy the condition 0 ≦ x, y <A, and let the remainder representation of the integer x be (x
1 , x 2 , ..., X n ) and the remainder system representation of the integer y is (y 1 , y 2 , ..., Y n ), a positive integer p satisfying p <A is assumed to be the modulus p and the x , Y remainder system addition result z =
This is a remainder system operation method for calculating x + y (mod p) = (z 1 , z 2 , ..., Z n ), and is a formula of remainder system addition z i = x i + y i (mod a i ) (1 ≦ i ≦ n) on the basis, and the coset addition step of calculating the modulo sum z for each elements z i in the law a, a value obtained by dividing the a at the a i a i (= a / a i) and then, when the multiplicative inverse of the a i and a i -1 in modulo a i, based on the element z i obtained in the residue system adding step, a positive integer k satisfying the following equation Σ Based on the parameter calculation step for calculating, the element z i obtained in the remainder system addition step, the positive integer k obtained in the parameter calculation step, and the formula of Σ below, the remainder system addition result z is a binary number. Approximate value z'of the upper w bits of the expressed value (however, w is less than the basic operation width of the arithmetic unit body)
And the approximate value z'in the binary number expression obtained in the approximate conversion step and the approximate value {p ', (w' of the upper w bits of the value obtained by multiplying the binary p expressed by the modulus p by j). Two
p) ', ..., (jp)', ..., (hp) '} (where 1
.Ltoreq.j.ltoreq.h), and when the remainder system expression of the method p is (p 1 , p 2 , ..., P n ), based on the comparison result of the method p comparison step. , (Jp) '<z'
If ≦ ((j + 1) p) ′, then z i = z i −j * p i (mod
a i ) (1 ≦ i ≦ n) is executed, and if (hp) ′ <z ', then z i = z i −h * p i (mod a i ) (1 ≦ i ≦
n) is executed to calculate a remainder system addition result z in the modulus p (mod p), and a remainder system operation method is included.

【0026】[0026]

【数4】 [Equation 4]

【0027】また、請求項8に対応する発明は、請求項
7に対応する剰余系演算方法において、前記パラメータ
算出工程としては、下記式に従って正整数kを算出する
剰余系演算方法である。
The invention corresponding to claim 8 is the residue system calculation method according to claim 7, wherein the parameter calculating step calculates a positive integer k according to the following equation.

【0028】[0028]

【数5】 [Equation 5]

【0029】さらに、請求項9に対応する発明は、請求
項7に対応する剰余系演算方法において、前記法p比較
工程としては、前記pのj倍に関する近似値に代えて、
M*pをj倍した値の上位wビットの近似値{(M*
p)’,(2M*p)’,…,(hM*p)’}(但
し、1≦j≦h)を用いて前記比較を行い、前記(mo
dp)実行工程としては、前記pのj倍に関する比較結
果に代えて、前記法p比較工程によるM*pのj倍に関
する比較結果に基づいて、(jM*p)’<z’≦((j
+1)M*p)’(但しj<h)ならばz=z−jM
*p(moda)(1≦i≦n)を実行し、(hM
*p)’<z’ならばz=z−(hM*p)(m
od a)(1≦i≦n)を実行することにより、前
記法pでの剰余系加算結果zを算出する剰余系演算方法
である。
Further, in the invention corresponding to claim 9, in the coset operation method according to claim 7, in the modulo p comparing step, instead of an approximate value for j times p,
Approximate value of upper w bits of a value obtained by multiplying M * p by j {(M *
p) ′, (2M * p) ′, ..., (hM * p) ′} (where 1 ≦ j ≦ h), and the above (mo)
In the execution step, (jM * p) ′ <z ′ ≦ ((based on the comparison result for j times M * p by the method p comparison step, instead of the comparison result for j times p. j
+1) M * p) '(where j <h), then z i = z i −jM
* P i (moda i ) (1 ≦ i ≦ n) is executed, and (hM
* P) '<z' if z i = z i - (hM * p i) (m
od a i ) (1 ≦ i ≦ n) to calculate the residue system addition result z in the modulus p.

【0030】また、請求項10に対応する発明は、互い
に素なn個の整数の組{a,a,…,a}を基底
とし、A=a*a*…*aに対して条件0≦x,
y<Aを満たす2整数をx,yとし、前記整数xの剰余
系表現を(x,x,…,x)とし、前記整数yの
剰余系表現を(y,y,…,y)とするとき、p
<Aを満たす正整数pを法pとして前記x,yの剰余系
減算結果z=x−y(mod p)=(z,z
…,z)を算出するための剰余系演算方法であって、
前記pの剰余系表現を(p,p,…,p)とする
とき、前記yの上限値を超えるpの倍数d*pを用い、
剰余系減算の式s=d*p−y(mod a
(1≦i≦n)により、正の剰余系減算結果s=
(s,s,…,s)を算出する剰余系減算工程
と、前記剰余系減算工程により得られた要素sを用
い、剰余系加算の式z=s+x(mod a
(1≦i≦n)に基づいて、法Aでの剰余系加算結果z
を要素z毎に算出する剰余系加算工程と、前記Aを前
記aで除した値をA(=A/a)とし、A -1
法aにおける前記Aの乗法逆元としたとき、前記剰
余系加算工程で得られた要素zに基づいて、下記Σ
の式を満たす正整数kを算出するパラメータ算出工程
と、前記剰余系加算工程で得られた要素z、前記パラ
メータ算出工程で得られた前記正整数k及び下記Σの
式に基づいて、前記剰余系加算結果zを2進数表現した
値の上位wビット(但し、wは演算装置本体の基本演算
幅以下)の近似値z’を算出する近似変換工程と、前記
近似変換工程で得られた2進数表現の近似値z’と、2
進数表現された法pをj倍した値の上位wビットの近似
値{p’,(2p)’,…,(jp)’,…,(h
p)’}(但し、1≦j≦h)とを比較する法p比較工
程と、前記法pの剰余系表現を(p,p,…,
)とするとき、前記法p比較工程の比較結果に基づ
いて、(jp)’<z’≦((j+1)p)’ならばz
−j*p(mod a)(1≦i≦n)を実行
し、(hp)’<z’ならばz=z−h*p(m
od a)(1≦i≦n)を実行することにより、前
記法pでの剰余系加算結果zを算出する(mod p)
実行工程とを含んでいる剰余系演算方法である。
Further, the invention according to claim 10 is based on a set of n disjoint integers {a 1 , a 2 , ..., An }, and A = a 1 * a 2 * ... * a condition 0 ≦ x for n ,
Let 2 integers that satisfy y <A be x, y, let the remainder system representation of the integer x be (x 1 , x 2 , ..., X n ), and let the remainder system representation of the integer y be (y 1 , y 2 , , Y n ), p
<A modulo p is a positive integer p that satisfies A, and the remainder subtraction result z = xy (mod p) = (z 1 , z 2 ,
, Z n ), which is a residue system operation method for calculating
When the remainder system expression of p is (p 1 , p 2 , ..., P n ), a multiple d * p of p that exceeds the upper limit of y is used,
Modulus subtraction formula s i = d * p i −y i (mod a i ).
(1 ≦ i ≦ n), the positive remainder subtraction result s =
Using the remainder subtraction process for calculating (s 1 , s 2 , ..., S n ) and the element s i obtained by the remainder subtraction process, the formula z i = s i + x i (mod a i )
Based on (1 ≦ i ≦ n), the remainder system addition result z in the modulus A
Is added to each element z i , and a value obtained by dividing A by the a i is A i (= A / a i ), and A i −1 is a multiplication of the A i in the modulus a i . When the inverse element, based on the element z i obtained in the remainder system addition step, the following Σ
Based on the parameter calculation step of calculating a positive integer k satisfying the equation, the element z i obtained in the remainder system addition step, the positive integer k obtained in the parameter calculation step, and the equation of Σ below. The approximation conversion step of calculating an approximation value z ′ of the upper w bits (where w is equal to or less than the basic operation width of the operation device main body) of the binary representation of the remainder addition result z, and the approximation conversion step. Approximate value z'in binary representation and 2
Approximate value of upper w bits {p ', (2p)', ..., (jp) ', ..., (h
p) ′} (where 1 ≦ j ≦ h) and the method p comparison step, and the coset expression of the method p is (p 1 , p 2 , ...,
p n ), based on the comparison result of the method p comparison step, if (jp) ′ <z ′ ≦ ((j + 1) p) ′, then z i =
z i −j * p i (mod a i ) (1 ≦ i ≦ n) is executed, and if (hp) ′ <z ′, then z i = z i −h * p i (m
od a i ) (1 ≦ i ≦ n) is executed to calculate the remainder addition result z in the modulus p (mod p)
It is a remainder system calculation method including an execution step.

【0031】[0031]

【数6】 [Equation 6]

【0032】(作用)従って、請求項1に対応する発明
は以上のような手段を講じたことにより、予め混合基数
表示で法pをh倍した複数の倍数データ(p,2p,
…,hp)が設定される混合基数系倍数設定手段と、予
め剰余系表現で法pをh倍した複数の倍数データ(<p
,2*<p>,…,h*<p>)が設定される
剰余系倍数設定手段とを設け、剰余系加算手段が、入力
された剰余系データ<x>,<y>を剰余系表現で
加算し、剰余系加算結果<z>を得ると、表現変換手
段が、剰余系加算手段により得られた剰余系加算結果<
z>を混合基数表示に変換し、倍数決定手段が、表現
変換手段により得られた混合基数表示された加算結果z
と、混合基数系倍数設定手段内の各倍数データとに基づ
いて、混合基数表示された加算結果zが最大でj倍の倍
数データjpを含む旨を判定して倍数jを決定し、加算
結果出力手段が、倍数決定手段により得られた倍数jに
基づいて、剰余系加算手段により得られた剰余系加算結
果<z>から剰余系倍数設定手段内のj倍の倍数デー
タj*<p>を減算し、得られた法pでの剰余系加算
結果<z>を出力する。
(Operation) Therefore, in the invention corresponding to claim 1, by taking the above means, a plurality of multiple data (p, 2p,
, Hp) is set, and a plurality of multiple data (<p
> A , 2 * <p> A , ..., h * <p> A ) is provided, and the remainder system addition means is provided, and the remainder system addition means inputs the remainder system data <x> A , < When y> A is added by a residue system expression and a residue system addition result <z> A is obtained, the expression conversion unit obtains a residue system addition result <the residue system addition result <
z> A is converted into the mixed radix representation, and the multiple determination means is the mixed radix represented addition result z obtained by the expression conversion means.
And the multiple data in the mixed radix system multiple setting means, it is determined that the addition result z displayed in the mixed radix includes a maximum of j multiple data jp, and the multiple j is determined. The output means, based on the multiple j obtained by the multiple determination means, from the remainder addition result <z> A obtained by the remainder addition means, the j-fold multiple data j * <p in the remainder multiple setting means. > A is subtracted, and the remainder addition result <z> A in the obtained modulus p is output.

【0033】このように、法Aでの剰余系加算結果を比
較の容易な混合基数表示に変換して法pのj倍に相当す
るかを調べ、この倍数jに従い、法Aの剰余系加算結果
を法pの剰余系加算結果に変換するので、法Aで剰余系
表現された2数に対し、法Aとは異なる法pの下での剰
余系加算を高効率に実行することができる。
In this way, it is checked whether the result of modular addition in modulo A is converted into a mixed radix representation that is easy to compare and corresponds to j times mod p, and the modular addition in modulo A is performed in accordance with this multiple j. Since the result is converted to the remainder addition result of the modulus p, the remainder addition under the modulus p different from the modulus A can be executed with high efficiency for the two numbers expressed by the modulus A. .

【0034】また、請求項2に対応する発明は、剰余系
減算手段が、法pの剰余系表現を<p>とするとき、
<y>の上限値を越える倍数データd*<p>を用
い、d*<p>から<y>を剰余系表現で減算し、
正の剰余系減算結果<S>を得ると、剰余系加算手段
が、剰余系減算手段により得られた正の剰余系減算結果
<S>と<x>とを剰余系表現で加算し、剰余系加
算結果<z>を得る。
In the invention according to claim 2, when the remainder subtraction means sets the remainder expression of the modulus p to <p> A ,
Using multiple data d * <p> A exceeds the upper limit of <y> A, the <y> A from d * <p> A subtracts the modulo system representation,
When the positive remainder subtraction result <S> A is obtained, the remainder adding means adds the positive remainder subtraction results <S> A and <x> A obtained by the remainder subtraction means by the remainder expression. Then, the remainder addition result <z> A is obtained.

【0035】以下、請求項1に対応する作用と同様に、
表現変換手段を介して倍数変換手段が、剰余系加算結果
<z>が法pのj倍に相当する旨を決定し、減算結果
出力手段が、倍数決定手段により得られた倍数jに基づ
いて、剰余系加算手段により得られた剰余系加算結果<
z>から剰余系倍数設定手段内のj倍の倍数データj
*<p>を減算し、得られた法pでの剰余系減算結果
<z>を出力する。
Hereinafter, similar to the operation corresponding to claim 1,
Through the expression conversion means, the multiple conversion means determines that the remainder addition result <z> A corresponds to j times the modulus p, and the subtraction result output means is based on the multiple j obtained by the multiple determination means. And the remainder system addition result obtained by the remainder system addition means <
From z> A, the multiple data j times j times in the remainder system multiple setting means
* <P> A is subtracted, and the remainder subtraction result <z> A in the obtained modulus p is output.

【0036】このように、始めに、引く数yの上限値を
超える値dpから引く数yを減算し、剰余系減算結果s
を必ず正の値として演算の正当性を確保した後、本来の
引かれる数xを剰余系減算結果に加算して法Aでの剰余
系減算結果を得て、以下請求項1と同様に、この法Aで
の剰余系減算結果を法pでの剰余系減算結果に変換する
ので、法Aで剰余系表現された2数に対し、法Aとは異
なる法pの下での剰余系減算を高効率に実行することが
できる。
Thus, first, the subtraction number y is subtracted from the value dp that exceeds the upper limit of the subtraction number y, and the remainder subtraction result s
After ensuring the correctness of the operation by always making a positive value, the original subtraction number x is added to the remainder subtraction result to obtain the remainder subtraction result in the modulus A. Since the remainder subtraction result in this method A is converted into the remainder subtraction result in the method p, the remainder subtraction under the method p different from the method A is applied to the two numbers expressed in the method A. Can be performed with high efficiency.

【0037】さらに、請求項3に対応する発明は、予め
2進数表現で法pをh倍した値の上位w桁を示す近似値
データ(p’,2p’,…,hp’)が設定される2進
数系倍数設定手段と、予め剰余系表現で法pをh倍した
倍数データ(<p>,2*<p>,…,h*<p>
)が設定される剰余系倍数設定手段とを設け、剰余系
加算手段が、入力された剰余系データ<x>,<y>
を剰余系表現で加算し、剰余系加算結果<z>を得
ると、近似変換手段が、剰余系加算手段により得られた
剰余系加算結果<z>を上位w桁の近似値で2進数表
現に変換し、倍数決定手段が、近似変換手段により得ら
れた2進数表現の近似値データz’と、2進数系倍数設
定手段内の各近似値データとに基づいて、加算結果の近
似値データz’が最大でj倍の近似値データjp’を含
む旨を判定して倍数jを決定し、加算結果出力手段が、
倍数決定手段により得られた倍数jに基づいて、剰余系
加算手段により得られた剰余系加算結果<z>から剰
余系倍数設定手段内のj倍の倍数データj*<p>
減算し、得られた法pでの剰余系加算結果<z>を出
力する。
Further, in the invention corresponding to claim 3, approximate value data (p ', 2p', ..., hp ') indicating the upper w digits of a value obtained by multiplying the modulus p by h in binary representation is set in advance. Binary number system multiple setting means, and multiple data (<p> A , 2 * <p> A , ..., H * <p> obtained by multiplying the modulus p by h in advance by the remainder system expression.
A ) is set, and the remainder system multiple setting means is provided, and the remainder system adding means uses the inputted remainder system data <x> A , <y>.
When A is added by a residue system expression and a residue system addition result <z> A is obtained, the approximation conversion means uses the residue system addition result <z> A obtained by the residue system addition means as an approximate value of the upper w digit. The addition result is converted into a binary number representation, and the multiple determination means determines the addition result based on the approximate value data z ′ in the binary number representation obtained by the approximation conversion means and each approximate value data in the binary number system multiple number setting means. It is determined that the approximate value data z ′ includes j times the approximate value data jp ′ at the maximum, the multiple j is determined, and the addition result output means
On the basis of the multiple j obtained by the multiple determining unit, the j-th multiple data j * <p> A in the remainder multiple setting unit is subtracted from the remainder addition result <z> A obtained by the remainder adding unit. Then, the obtained remainder addition result <z> A in the modulus p is output.

【0038】このように、法Aでの剰余系加算結果を近
似的に2進数表現に変換して近似的に法pのj倍に相当
するかを調べ、この倍数jに従い、法Aの剰余系加算結
果を法pの剰余系加算結果に変換するので、法Aで剰余
系表現された2数に対し、法Aとは異なる法pの下での
剰余系加算を高効率に実行することができる。
As described above, it is examined whether or not the residue system addition result in the modulus A is approximately converted into a binary number representation and approximately corresponds to j times the modulus p, and the remainder of the modulus A is calculated according to this multiple j. Since the system addition result is converted into the remainder system addition result of the modulus p, the remainder system addition under the modulus p different from the modulus A is efficiently performed for the two numbers represented by the modulus A in the modulus A. You can

【0039】また、請求項4に対応する発明は、請求項
2に対応する剰余系減算手法を請求項3に適用したもの
であるため、請求項3に対応する作用に加え、請求項2
に対応する作用と同様に、法Aで剰余系表現された2数
に対し、法Aとは異なる法pの下での剰余系減算を高効
率に実行することができる。
Since the invention corresponding to claim 4 applies the residue subtraction method corresponding to claim 2 to claim 3, in addition to the operation corresponding to claim 3,
Similar to the action corresponding to, the remainder subtraction under the modulus p different from the modulus A can be executed with high efficiency for the two numbers represented by the modulus A in the modulus A.

【0040】また、請求項5,6に対応する発明は、上
述した具体的な数式を含む各工程により、請求項1,2
に対応する作用を容易且つ確実に奏することができる。
Further, the invention corresponding to claims 5 and 6 is achieved by each step including the specific mathematical expressions described above.
The action corresponding to can be easily and reliably achieved.

【0041】さらに、請求項7に対応する発明は、上述
した具体的な数式を含む各工程により、請求項3に対応
する作用を容易且つ確実に奏することができる。また、
上述した数式が並列演算に適した形式であるので、並列
演算の実行により、剰余系演算の処理時間の短縮化を図
ることができる。
Furthermore, the invention according to claim 7 can easily and surely achieve the action corresponding to claim 3 by each step including the above-mentioned specific mathematical expression. Also,
Since the above-mentioned mathematical expression is in a form suitable for parallel calculation, it is possible to reduce the processing time of coset operation by executing parallel calculation.

【0042】また、請求項8に対応する発明は、パラメ
ータ算出工程のより具体的な式を提供するので、請求項
7に対応する作用をより一層、容易且つ確実に奏するこ
とができる。
Further, the invention according to claim 8 provides a more specific formula of the parameter calculation step, so that the operation corresponding to claim 7 can be more easily and surely achieved.

【0043】さらに、請求項9に対応する発明は、法p
比較工程及び(mod p)実行工程が、pのj倍に関
する近似値に代えて、M*pをj倍した値の近似値
{(M*p)’,(2M*p)’,…,(hM*
p)’}を用いるので、請求項7に対応する作用の変形
例を得ることができる。
Furthermore, the invention corresponding to claim 9 is the method p
In the comparison step and the (mod p) execution step, instead of the approximation value for j times p, approximate values {(M * p) ′, (2M * p) ′, ... (HM *
Since p) ′} is used, it is possible to obtain a modification of the action corresponding to claim 7.

【0044】また、請求項10に対応する発明は、上述
した具体的な数式を含む各工程により、請求項4に対応
する作用を容易且つ確実に奏することができる。また、
請求項7に対応する作用と同様に、剰余系演算の処理時
間の短縮化を図ることができる。
Further, the invention according to claim 10 can easily and surely obtain the action corresponding to claim 4 by each step including the above-mentioned specific mathematical expression. Also,
Similar to the operation corresponding to claim 7, it is possible to shorten the processing time of the coset operation.

【0045】[0045]

【発明の実施の形態】以下、本発明の各実施形態につい
て図面を参照して説明する。なお、以下の各実施形態
は、同様の装置構成を前提としたRNS表現での剰余系
乗算法と組合せが可能であり、例えばRNS表現の下で
の楕円曲線暗号などが効率的に実装可能であって、具体
的には、RNS表現された2数x,yの法pでの効率的
な演算手順を提供する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below with reference to the drawings. It should be noted that each of the following embodiments can be combined with the remainder multiplication method in the RNS representation assuming the same device configuration, and for example, elliptic curve cryptography under the RNS representation can be efficiently implemented. Therefore, specifically, it provides an efficient operation procedure in the modulo p of the two numbers x and y expressed in RNS.

【0046】ここで、以下の各実施形態では、前述した
通り、RNS表現で用いる基底をB={a,a
…,a}とし、基底要素の積をA=a*a*…*
とする。なお、演算結果をRNS表現で一意な値に
表現するため、p<Aの関係がある。また、2整数x,
yは、条件0≦x,y<Aを満たす。
Here, in each of the following embodiments, as described above, the basis used in the RNS expression is B = {a 1 , a 2 ,
, A n }, and the product of the base elements is A = a 1 * a 2 * ... *
Let an. Since the calculation result is expressed as a unique value in RNS expression, there is a relation of p <A. Also, 2 integers x,
y satisfies the conditions 0 ≦ x and y <A.

【0047】なお、公開鍵暗号は、多くの場合、法pで
のべき乗計算や加減乗算の組合せを経て最終的な演算結
果を得るようなアルゴリズムとなっている。係るアルゴ
リズムは、途中の演算結果をp未満にする必要が無く、
演算結果が2p未満(法pでの正確な剰余値よりpだけ
大の場合を含む)であれば、次の演算に入力可能となっ
ている。
In many cases, public key cryptography is an algorithm that obtains a final calculation result through a combination of exponentiation and addition / subtraction multiplication in the modulus p. Such an algorithm does not require the calculation result in the middle to be less than p,
If the calculation result is less than 2p (including the case where it is larger than the exact remainder value by the modulus p by p), it can be input to the next calculation.

【0048】すなわち、種々の剰余系演算を組合せた一
連のアルゴリズムでは、最後の演算結果と法pとの大小
関係を比較し、演算結果から法pの倍数を引いて、最終
的に法pでの正確な剰余値を得る構成であれば、途中の
演算結果が2p未満でも構わない性質を持つ。なお、正
確な剰余値が必要なときのみ、演算結果をp未満に制約
すればよい性質は、公開鍵暗号に限らず、一般の数論ア
ルゴリズムでも同様である。
That is, in a series of algorithms in which various coset arithmetic operations are combined, the magnitude relation between the final arithmetic result and the modulus p is compared, the multiple of the modulus p is subtracted from the arithmetic result, and finally the modulus p is obtained. If the structure is such that an accurate remainder value of 1 is obtained, the intermediate calculation result may be less than 2p. Note that the property that the operation result may be restricted to less than p only when an accurate remainder value is required is not limited to public key cryptography, and is the same in general number theory algorithms.

【0049】従って、以下の各実施形態では、2p未満
(当然、p未満を含む)の演算結果を保証する剰余系加
減算を実行可能な剰余系演算装置及び方法について述べ
る。
Therefore, in each of the following embodiments, a coset arithmetic unit and method capable of executing coset addition / subtraction that guarantees an arithmetic result of less than 2p (including naturally less than p) will be described.

【0050】(第1の実施形態)図1は本発明の第1の
実施形態に係る剰余系演算装置の構成を示すブロック図
である。この剰余系演算装置は、演算コントローラ10
及びm個の演算回路20 〜20がバス30を介して
互いに接続されている。
(First Embodiment) FIG. 1 shows a first embodiment of the present invention.
FIG. 3 is a block diagram showing the configuration of a coset arithmetic unit according to the embodiment.
Is. This remainder-based arithmetic device is provided with an arithmetic controller 10
And m arithmetic circuits 20 1~ 20mVia bus 30
Connected to each other.

【0051】ここで、演算コントローラ10は、各演算
回路20〜20との間でデータを授受する機能と、
各演算回路20〜20の演算内容(剰余系加算、剰
余系減算、剰余系乗算)を制御する機能とを有し、各演
算回路に夫々所望の演算を実行させる機能をもってい
る。なお、演算内容の制御としては、例えば、演算回路
20〜20内にセレクタを設け、該セレクタに制御
信号を与えて演算回路20〜20内の加算回路や乗
算回路を選択することにより実現可能となっている。
Here, the arithmetic controller 10 has a function of exchanging data with the arithmetic circuits 20 1 to 20 m, and
It has a function of controlling the operation contents (remainder system addition, remainder system subtraction, remainder system multiplication) of each of the arithmetic circuits 20 1 to 20 m , and has a function of causing each arithmetic circuit to execute a desired arithmetic operation. As the control of the content of operation, for example, that the selector is provided to select the adder circuit and the multiplier circuit of the arithmetic circuit 20 1 in to 20 m gives a control signal to the selector to the arithmetic circuit 20 within one to 20 m Can be realized by.

【0052】具体的には、演算コントローラ10は、各
演算回路20〜20に対し、RNS表現された2整
数<x>,<y>の剰余系加算を実行させる機能
と、図2に示すように各演算回路20〜20を制御
し、剰余系加算結果<z>をGarnerのアルゴリズムを
途中まで用いて混合基数表示に変換させる機能と、各演
算回路20〜20に対し、混合基数表示された加算
結果zと混合基数表示された法pの倍数{p,2p,
…,(jp),…,(hp)}との大小関係を比較させ
て倍数jを決定する機能と、倍数jに基づいて、各演算
回路20〜20に対し、剰余系加算結果<z>
ら法pをj倍した<jp>を減算させる機能と、得ら
れた法pでの剰余系加算結果<z>を出力する機能と
をもっている。
Specifically, the arithmetic controller 10 has a function of causing each of the arithmetic circuits 20 1 to 20 m to perform remainder system addition of two integers <x> A and <y> A represented by RNS. as shown in 2 controls each arithmetic circuits 20 1 to 20 m, and a function for converting the mixed radix displayed using modulo sum <z> a halfway algorithm Garner, the arithmetic circuit 20 1 to 20 For m , the addition result z displayed in mixed radix and the multiple p of the modulus p displayed in mixed radix {p, 2p,
, (Jp), ..., (hp)} are compared with each other to determine the multiple j, and based on the multiple j, the remainder addition result <for each arithmetic circuit 20 1 to 20 m z> has a function of subtracting the <uk> a the modulus p and j times from a, and a function of outputting a coset addition result <z> a in the resulting modulus p.

【0053】一方、各演算回路20〜20は、互い
に電気的に並列に配置されており、互いに同一構成を有
するものである。このため、以下の説明は、任意の演算
回路20(但し、i=1,2,…,m)を代表例とし
て述べる。
On the other hand, the arithmetic circuits 20 1 to 20 m are electrically arranged in parallel with each other and have the same configuration. Therefore, in the following description, an arbitrary arithmetic circuit 20 i (where i = 1, 2, ..., M) will be described as a typical example.

【0054】すなわち、演算回路20は、RAM21
及び演算ユニット22を備えた構成であり、例えば
周知のパソコンに搭載された32ビットCPUが使用可
能となっている。また、並列処理による演算の高速化を
図る観点から、各演算回路20〜20の個数mは、
基底要素の個数nと同数であることが好ましい。
That is, the arithmetic circuit 20 i includes the RAM 21
i and the arithmetic unit 22 i , for example, a 32-bit CPU mounted on a well-known personal computer can be used. From the viewpoint of increasing the speed of computation by parallel processing, the number m of the arithmetic circuits 20 1 to 20 m is
It is preferably the same as the number n of base elements.

【0055】演算ユニット22は、演算コントローラ
10からの制御に従い、RAM21 内のwビット同士
の整数の加減乗算、wビットの法における剰余系の加減
乗算を実行し、実行結果をRAM21に書込む機能を
有し、且つRAM21を介して演算コントローラ10
や他の演算回路20〜20i-1,20i+1〜20と互
いにデータを交換しながら並列演算を実行する機能をも
っている。
Operation unit 22iIs the arithmetic controller
RAM21 according to the control from 10. iW bits in each other
Addition and subtraction of integers, addition and subtraction of remainder system in w-bit modulus
The multiplication is executed and the execution result is stored in the RAM 21.iThe ability to write to
Has and RAM 21iThrough the arithmetic controller 10
And other arithmetic circuits 201~ 20i-1, 20i + 1~ 20mMutual
It also has a function to execute parallel operations while exchanging data.
ing.

【0056】次に、以上のように構成された剰余系演算
装置による剰余系演算方法を図3のフローチャートを用
いて説明する。いま、例えば公開鍵暗号アルゴリズムの
実行途中で2数x,yの剰余系の加算処理が必要になっ
たとする。各演算ユニット22〜22は、夫々外部
のCPU(図示せず)からバス30を介して、RNS表
現の基底Bである法の値aiが設定されると共に、基底
依存パラメータC(i-1)iが設定される(ST1)。
Next, the coset operation method by the coset operation device configured as described above will be described with reference to the flowchart of FIG. Now, for example, it is assumed that it is necessary to perform addition processing of the remainder system of two numbers x and y while executing the public key encryption algorithm. In each of the arithmetic units 22 1 to 22 m , a modulus value ai that is the basis B of the RNS expression is set via an external CPU (not shown) via a bus 30, and the basis-dependent parameter C (i- 1) i is set (ST1).

【0057】また、演算コントローラ10は、外部のC
PUから法の値pとその倍数p,2p,…,hpが入力
されると、これらを各演算ユニット22〜22に設
定する。但し、演算コントローラ10を介さずに、直
接、各演算ユニット22〜22に設定してもよい。
Further, the arithmetic controller 10 is an external C
When the modulo value p and its multiples p, 2p, ..., hp are input from the PU, these are set in the arithmetic units 22 1 to 22 m . However, it may be directly set in each of the arithmetic units 22 1 to 22 m without going through the arithmetic controller 10.

【0058】各演算ユニット22〜22は、これら
法pに関する設定値のうち、i*pを混合基数表示とし
(大小比較用)、p,2p,…,hpを法aで除して
RNS表現とし(j倍の減算用)、これら両表現による
値を保持する(ST2)。
Of the set values related to the modulus p, each of the arithmetic units 22 1 to 22 m displays i * p as a mixed radix representation (for comparison of magnitude), and divides p, 2p, ..., hp by the modulus a i. RNS expression (for j-fold subtraction) and hold the values by both expressions (ST2).

【0059】さらに、各演算ユニット22〜22
は、外部のCPUから2数x,yが入力されると、こ
れらx,yを法aで除してRNS表現された要素
,yに変換して保持する(ST3)。
Further, each of the arithmetic units 22 1 to 22
m is the number of 2 x from an external CPU, y is input, these x, by dividing y by law a i RNS representation by elements x i, holds converted to y i (ST3).

【0060】以上のステップST1〜ST3は事前に一
度だけ行うフェーズであり、既にRNS表現されたデー
タが剰余系加算される場合、ステップST3は不要であ
る。以上の準備のもと、以下で実際に剰余系加算を実行
する。
The above steps ST1 to ST3 are phases which are performed only once in advance, and when the data already expressed in RNS is added to the remainder system, step ST3 is unnecessary. Based on the above preparations, the remainder addition is actually executed below.

【0061】剰余系加算は、前述した通り、x+y<A
の前提の下で、各要素xi,yi毎に法aでの加算を
行う処理である。
As described above, the remainder addition is x + y <A
Under the premise of, the processing is performed for each element xi, yi by addition with the modulus a i .

【0062】すなわち、剰余系加算は、<z>=<x
>A+<y>Aとしたとき、<z>=<x>A+<y
>A(mod A)=(x+y(mod a),
+y(mod a),…,x+y(mod
))=(z,z,…,z)とする処理であ
る。
That is, the remainder addition is <z> A = <x
> A + <y> A, <z> A = <x> A + <y
> A (mod A) = (x 1 + y 1 (mod a 1 ),
x 2 + y 2 (mod a 2 ), ..., X n + y n (mod
a n )) = (z 1 , z 2 , ..., Z n ).

【0063】従って、各演算ユニット22〜22
は、演算コントローラ10の制御により、各要素
,y毎に法aでの加算を実行し(ST4)、夫
々加算結果z をRAM22〜22に出力する。演
算コントローラ10は、各RAM22 〜22内の結
果z〜zを順次読み出し、剰余系加算結果<z>
を得る。
Therefore, each arithmetic unit 221~ 22
mAre controlled by the arithmetic controller 10
xi, YiMethod a for eachi(ST4), the husband
Each addition result z iRAM221~ 22mOutput to. Performance
The arithmetic controller 10 has each RAM 22. 1~ 22mInner connection
Fruit z1~ ZnAre sequentially read and the remainder addition result <z>A
To get

【0064】但し、剰余系加算<x>+<y>にお
いては、得られた加算結果<z>が法pのRNS表現
<p>よりも大きいとき、<p>を加算結果から引
く必要がある。一方、加算結果<z>は、剰余値の集
合からなるRNS表現のため、与えられた2数の大小比
較が困難な性質をもつ。
However, in the remainder addition <x> A + <y> A , when the obtained addition result <z> A is larger than the RNS expression <p> A of modulus p, <p> A is added. You need to subtract from the result. On the other hand, the addition result <z> A has a property that it is difficult to compare the given two numbers, because the addition result <z> A is an RNS expression composed of a set of remainder values.

【0065】従って、加算結果<z>と法pとを大小
比較するため、一旦、加算結果<z>を混合基数表示
に変換する。
Therefore, in order to compare the addition result <z> A with the modulus p, the addition result <z> A is once converted into the mixed radix representation.

【0066】具体的には演算コントローラ10は、図2
に示すように各演算ユニット22〜22を順に制御
し、周知のGarnerのアルゴリズムを途中まで用い、加算
結果<z>Aを混合基数表示(v,v,…,v
に変換する(ST5)。
Specifically, the arithmetic controller 10 is shown in FIG.
As shown in FIG. 5, each arithmetic unit 22 1 to 22 m is controlled in order, the well-known Garner algorithm is used halfway, and the addition result <z> A is displayed as a mixed radix (v 1 , v 2 , ..., V n ).
(ST5).

【0067】なお、Garnerのアルゴリズムは、以下のv
〜vを示す各式に示す通りである。
Garner's algorithm is
It is as shown in the equation showing a 1 to v n.

【0068】 v=z(mod a) v=(z−v)*C12(mod a) v=((z−v)*C13−v)*C23(mod a) : v=((z−v)*C1n−v)*C2n−……−v(n-1))*C(n-1)n( mod a) 但し、Cji=aj -1mod a、(j=1,2,…,i−1) ここで、各演算ユニット22は、図2に示すように、
自己の添字iより小さい添字i-1をもつ演算ユニット2
i-1の演算結果vi-1を利用しながら自己の演算処理を
実行し、演算結果vをRAM21に書込む。
V 1 = z 1 (mod a 1 ) v 2 = (z 2 −v 1 ) * C 12 (mod a 2 ) v 3 = ((z 3 −v 1 ) * C 13 −v 2 ) * C 23 (mod a 3): v n = ((z 3 -v 1) * C 1n -v 2) * C 2n - ...... -v (n-1)) * C (n-1) n (mod a n ) However, C ji = a j −1 mod a i , (j = 1, 2, ..., i−1) Here, each arithmetic unit 22 i is, as shown in FIG.
Arithmetic unit 2 with subscript i-1 less than its own subscript i
While using the 2 i-1 of the operation result v i-1 performs its own processing, writes the computation result v i in RAM 21 i.

【0069】また、最大の添字mをもつ演算ユニット2
が演算結果vをRAM21に書込むと、混合基
数表示への変換処理が完了する。
The arithmetic unit 2 having the maximum subscript m
When 2 m writes the calculation result v n in the RAM 21 m , the conversion process to the mixed radix display is completed.

【0070】次に、各演算ユニット22は、得られた
混合基数表示z=(v,v,…,v)を用い、法
pの倍数(の混合基数表示)との大小比較を行う。な
お、混合基数表示では、2つの混合基数表示の数
(v,v,…,v),(p,p,…,p
の間において、添字の大きい側(右側)から要素を大小
比較し、先に大きい要素の検出された方が2進数表示で
も大きいことになる。
Next, each arithmetic unit 22 i uses the obtained mixed radix representation z = (v 1 , v 2 , ..., V n ) and compares it with the multiple of modulo p (the mixed radix representation thereof). I do. In the mixed radix display, the numbers (v 1 , v 2 , ..., V n ) of the two mixed radix displays, (p 1 , p 2 , ..., P n ).
In between, the elements are compared in size from the side with the larger subscript (right side), and the detected larger element is larger in binary notation.

【0071】なお、ここで、法pの倍数jpは、以下の
関係式で決定される(ST6)。
The multiple jp of the modulus p is determined by the following relational expression (ST6).

【0072】jp≦z<(j+1)p、を満たすj、
(但し、0≦j<h) なお、hp≦zのとき、j=hとする。
J satisfying jp ≦ z <(j + 1) p,
(However, 0 ≦ j <h) When hp ≦ z, j = h.

【0073】次に、倍数jが決定されると、演算コント
ローラ10は、各演算ユニット22 〜22の制御に
より、ステップST4での加算結果<z>から次の
(4)式のように法pのj倍を引き、法pでの剰余系加
算結果<z>を得る。
Next, when the multiple j is determined, the arithmetic control
The roller 10 is provided in each arithmetic unit 22. 1~ 22mTo control
Therefore, the addition result in step ST4 <z>AFrom next
Subtract j times the modulus p as shown in equation (4), and add the remainder system with the modulus p.
Calculation result <z>ATo get

【0074】 <z>=<z>−j*<p> …(4) このとき、各演算ユニット22〜22は、演算コン
トローラ10の制御により、各要素z,jp毎に法
での減算を実行し(ST7)、夫々減算結果z
RAM22〜22に出力する。演算コントローラ1
0は、各RAM22〜22内の結果z〜zを順
次読み出し、法pでの剰余系加算結果<z>を得る。
<Z> A = <z> A- j * <p> A (4) At this time, each of the arithmetic units 22 1 to 22 m is controlled by the arithmetic controller 10 and each element z i , jp i. The subtraction by the modulus a i is executed every time (ST7), and the subtraction results z i are output to the RAMs 22 1 to 22 m , respectively. Arithmetic controller 1
0 sequentially reads the results z 1 to z n in the RAMs 22 1 to 22 m , and obtains the remainder addition result <z> A in the modulus p.

【0075】上述したように本実施形態によれば、剰余
系加算結果<z>を、比較の容易な混合基数表示のz
に変換して法pの倍数と比較し、この比較結果に基づい
て剰余系加算結果<z>から法pの倍数j<p>を減
算し、法pでの剰余系加算結果<z>を求めるので、
法Aで剰余系表現された2数に対し、法Aとは異なる法
pの下での剰余系加算を高効率に実行することができ
る。
As described above, according to the present embodiment, the residue system addition result <z> A is represented by z in the mixed radix representation for easy comparison.
And the result is compared with the multiple of the modulus p, and the remainder j <p> of the modulus p is subtracted from the remainder addition result <z> A based on the comparison result, and the remainder addition result <z> of the modulus p is obtained. Since I ask for A ,
It is possible to efficiently perform remainder addition under the modulus p different from the modulus A for two numbers expressed in the modulus A by the modulus A.

【0076】なお、本実施形態は、Garnerのアルゴリズ
ムを各演算回路20〜20に並列に演算させるの
で、各演算ユニット22にて、(z(i-1)−vi)*c
(i-1)i(mod a)という剰余系の減算と乗算が処
理単位となる。すなわち、混合基数表示への変換に要す
るサイクルは、各処理単位を1サイクルとして合計n−
1サイクルとなる。
In this embodiment, the Garner's algorithm is operated in parallel by each of the arithmetic circuits 20 1 to 20 m , so that in each arithmetic unit 22 i , (z (i-1) −v i ) * c
The subtraction and multiplication of the remainder system of (i-1) i (mod a i ) is the processing unit. That is, the number of cycles required for conversion to the mixed radix display is n− as each processing unit is one cycle.
It becomes one cycle.

【0077】なお、変換処理の変形例として、zの混合
基数表示(v,v,…,v)を次の(5)式によ
り記数法に表現し、2進数表現を用いて法pの倍数との
大小比較を行ってもよい。
As a modification of the conversion process, the mixed radix representation of z (v 1 , v 2 , ..., V n ) is expressed in the notation system by the following equation (5) and expressed in binary notation. A magnitude comparison with a multiple of the modulus p may be performed.

【0078】 また、ステップST2で予めpの倍数を算出したので、
加算結果と、複数のpの倍数との大小比較を容易に実行
することができる。
[0078] Further, since the multiple of p is calculated in advance in step ST2,
It is possible to easily perform a magnitude comparison between the addition result and a plurality of multiples of p.

【0079】(第2の実施形態)次に、本発明の第2の
実施形態に係る剰余系演算装置について説明する。な
お、本実施形態は、前述した図1〜図3のうちの同一部
分には同一符号を付してその詳しい説明を省略し、ここ
では異なる部分について主に述べる。また、以下の各実
施形態も同様にして重複した説明を省略する。
(Second Embodiment) Next, a coset arithmetic unit according to a second embodiment of the present invention will be described. In this embodiment, the same parts in FIGS. 1 to 3 described above are denoted by the same reference numerals, and detailed description thereof will be omitted. Here, different parts will be mainly described. Also, in each of the following embodiments, duplicate description will be omitted in the same manner.

【0080】すなわち、本実施形態は、第1の実施形態
の剰余系加算に加え、法AでRNS表現された2数<x
,<y>を対象とし、法pの剰余系減算結果<z
>=<x>−<y>を得るためのものである(但
し、p<A)。
That is, in the present embodiment, in addition to the remainder addition of the first embodiment, 2 number <x expressed by RNS in modulus A
> A , <y> A target, modulo p subtraction result <z
> = <X> A − <y> A (however, p <A).

【0081】始めに、本実施形態の原理を説明する。い
ま、RNS表現での法Aは、対象とする法pではなく基
底の積Aであることに注意する。剰余系減算では、x≧
yの場合にはx−y(mod A)=x−y(mod
p)となって正しい結果を得るが、x<yの場合にはx
−y(modA)≠x−y(mod p)となり、結果
に誤りを生じる。
First, the principle of this embodiment will be described. Note that the modulus A in the RNS representation is now the product A of the basis, not the modality p of interest. For modulo subtraction, x ≧
In the case of y, xy (mod A) = xy (mod
p) and get the correct result, but if x <y then x
-Y (modA) ≠ xy (mod p), resulting in an error.

【0082】なお、x<yの場合、x+(p−y)(m
od A)=x−y(mod p)となるので、普通に
考えると、始めにx,yを大小比較し、x≧yであれば
減算、x<yであればzと(p−y)との剰余系加算、
を行えばよい。しかしながら、このような普通の考えで
は、減算結果zとpとの大小比較に加え、減算前にxと
yの大小比較が必要となる。
When x <y, x + (py) (m
od A) = x−y (mod p), therefore, normally, x and y are first compared in magnitude, and if x ≧ y, subtraction is performed, and if x <y, z and (py) are obtained. ) And modulo addition,
Should be done. However, in such an ordinary idea, in addition to the magnitude comparison of the subtraction results z and p, the magnitude comparison of x and y is necessary before the subtraction.

【0083】本実施形態は、このような実情を考慮し、
x,yの大小比較をせずに一義的に、予め入力yの上限
値を超えた値dp(:法pのd倍)を−<y>に加算
し、確実に減算結果を正の値にした状態で、第1実施形
態の剰余系加算によりxを加え、得られた加算値から最
終的に法pの倍数を引いて、法pの剰余系減算を実行す
る方式である。但し、この剰余系減算は、入力yの上限
がy<dpである旨を前提とする。
In the present embodiment, considering such a situation,
The value dp (: d times the modulus p) that exceeds the upper limit of the input y is uniquely added to-<y> A without comparing the magnitudes of x and y, and the subtraction result is positive. In this state, x is added by the remainder addition of the first embodiment in the state of being a value, and finally the multiple of the modulus p is subtracted from the obtained addition value, and the remainder subtraction of the modulus p is executed. However, this remainder subtraction is based on the premise that the upper limit of the input y is y <dp.

【0084】ここで、演算コントローラ10は、前述し
た機能に加え、各演算ユニット22 の制御機能によ
り、剰余系減算を実行する際に、予め減算する入力<y
の上限値を越える値d*<p>から<y>を要
素z毎に減算させる機能と、この減算結果に対し、被
減算対象の<x>を要素x毎に加算させる機能とを
備えたものである。
Here, the arithmetic controller 10 is described above.
In addition to the functions iControl function of
Input <y to be subtracted in advance when performing modular subtraction
>AValue that exceeds the upper limit of d * <p>AFrom <y>ARequires
Element ziThe function to subtract each time and the subtraction result
<X> to be subtractedAThe element xiWith the function to add each
Be prepared.

【0085】次に、以上のように構成された剰余系演算
装置による剰余系演算方法を図4のフローチャートを用
いて説明する。いま、前述同様にステップST1〜ST
2が完了し、各演算回路20〜20 には演算パラメ
ータ(法ai,基底依存パラメータC(i-1)i,法pの倍
数p〜hp)が設定済みであるとする。
Next, the remainder operation performed as described above
The remainder system calculation method by the device uses the flowchart of FIG.
And explain. Now, as described above, steps ST1 to ST
2 is completed, each arithmetic circuit 201~ 20 mCalculation parameter
Data (method ai, basis-dependent parameter C(i-1) i, Mod p times
It is assumed that the numbers p to hp) have already been set.

【0086】また同様に、各演算ユニット22〜22
は、外部のCPUから2数x,yが入力されると(但
し、x,y<dp)、これらx,yを法aiで除してR
NS表現された要素xi,yiに変換して保持する(S
T3−S)。
Similarly, each of the arithmetic units 22 1 to 22
When two numbers x and y are input from an external CPU (however, x, y <dp), m is divided by the modulus ai to obtain R.
It is converted into the elements xi and yi expressed in NS and held (S
T3-S).

【0087】以上のステップST1〜ST3−Sは事前
に一度だけ行うフェーズであり、既にRNS表現された
データが剰余系減算される場合、ステップST3−Sは
不要である。以上の準備のもと、以下で実際に剰余系減
算を実行する。
The above steps ST1 to ST3-S are the phases to be performed only once in advance, and when the data already expressed in RNS is subjected to the remainder subtraction, step ST3-S is unnecessary. With the above preparations, the remainder subtraction is actually executed below.

【0088】なお、剰余系減算では、前述した通り、x
−y<Aの前提の下で、各要素xi,yi毎に法a
の減算を行う。すなわち、剰余系減算は、基本的には、
<z>=<x>A−<y>Aとしたとき、<z>
<x>A−<y>A(mod A)=(x−y(m
oda),x−y(mod a),…,x
(mod a))=(z,z,…,z)と
する処理である。
In the remainder subtraction, as described above, x
Under the premise of −y <A, the subtraction by the modulus a i is performed for each element xi, yi. That is, the remainder subtraction is basically
<Z> A = <x> A- <y> A, <z> A =
<X> A- <y> A (mod A) = (x 1 −y 1 (m
oda 1 ), x 2 −y 2 (mod a 2 ), ..., X n
This is a process of setting y n (mod a n )) = (z 1 , z 2 , ..., Z n ).

【0089】但し、x<yのときの結果誤りを阻止する
観点から、次の(6)式のように、予めy<d*pの関
係をもつd*<p>を、−<y>に加算する(ST
4−S1)。
However, from the viewpoint of preventing a result error when x <y, as shown in the following expression (6), d * <p> A having a relation of y <d * p is previously defined as-<y. > Add to A (ST
4-S1).

【0090】 <S>=d*<p>−<y> …(6) すなわち、各演算ユニット22〜22は、演算コン
トローラ10の制御により、各要素d*p,y毎に
法aでの減算を実行し、夫々減算結果sをRAM2
〜21に出力する。演算コントローラ10は、各
RAM21〜21内の結果s〜sを順次読み出
し、減算結果としての正の値<S>を得る。つまり、
入力yが0<y<d*pを満たすので、d*p−yの結
果をSとすると、0<S<d*pという正の値となる。
<S> A = d * <p> A− <y> A (6) That is, each of the arithmetic units 22 1 to 22 m is controlled by the arithmetic controller 10, and each element d * p i , y. performs subtraction of by law a i for each i, respectively subtraction result s i RAM2
Output to 1 1 to 21 m . Operation controller 10 sequentially reads the result s 1 ~s n in each RAM 21 1 through 21 m, to obtain a positive value <S> A as a subtraction result. That is,
Since the input y satisfies 0 <y <d * p, a positive value of 0 <S <d * p is obtained, where S is the result of d * py.

【0091】ここで、<S>≡d*p−y(mod
p)≡−y(mod p)であることに注意すると、S
とxに対し、本発明の剰余系加算を行うことでz≡S+
x(mod p)=x−y(mod p)なる結果zが
得られる。
Here, <S> A ≡d * p−y (mod
Note that if p) ≡−y (mod p), then S
By performing the remainder addition of the present invention on x and x, z≡S +
The result z is obtained such that x (mod p) = xy (mod p).

【0092】従って、この正の値<S>に対し、本来
の演算対象の<x>を同様に各演算ユニット22
22により要素si,xi毎に加算し(ST4−S
2)、剰余系減算結果<z>を得る。
Therefore, with respect to this positive value <S> A , the original calculation target <x> A is similarly calculated in each of the calculation units 22 1- .
22 m , add for each element si and xi (ST4-S
2) Obtain the remainder subtraction result <z> A.

【0093】以下、前述したステップST5〜ST7と
同様に、減算結果を混合基数表示に変換し、変換結果が
法pをj個含む旨を判定し、判定結果に基づき、減算結
果<z>から法pの倍数j*<p>を減算し、最終
的に<z>Aを得る。
In the same manner as in steps ST5 to ST7 described above, the subtraction result is converted into the mixed radix representation, it is determined that the conversion result includes j mod p, and the subtraction result <z> A is determined based on the determination result. Then, a multiple j * <p> A of the modulus p is subtracted from to finally obtain <z> A.

【0094】上述したように本実施形態によれば、始め
に、引く数yの上限値を超える値dpから引く数yを減
算し、剰余系減算結果sを必ず正の値として演算の正当
性を確保した後、本来の引かれる数xを剰余系減算結果
に加算して法Aでの剰余系減算結果を得て、以下、第1
の実施形態と同様に、この法Aでの剰余系減算結果を法
pでの剰余系減算結果に変換するので、第1の実施形態
と同様の効果に加え、法Aで剰余系表現された2数に対
し、法Aとは異なる法pの下での剰余系減算を高効率に
実行することができる。
As described above, according to the present embodiment, first, the subtraction number y is subtracted from the value dp that exceeds the upper limit value of the subtraction number y, and the remainder subtraction result s is always a positive value. Then, the original subtraction number x is added to the remainder subtraction result to obtain the remainder subtraction result in the modulus A.
As in the first embodiment, since the remainder subtraction result in the method A is converted into the remainder subtraction result in the method p, the remainder system is represented by the modulus A in addition to the effect similar to the first embodiment. The remainder subtraction under the modulus p different from the modulus A can be executed with high efficiency for two numbers.

【0095】(第3の実施形態)次に、本発明の第3の
実施形態について説明するが、始めに原理を述べる。本
実施形態は、第1及び第2の実施形態とは異なるアルゴ
リズムにより、法Aでの剰余系加算結果をRNS表現か
ら2進数表現に変換して法pとの大小比較を行ない、比
較結果に従って、法Aの剰余系加算結果を法pの剰余系
加算結果に変換するものである。具体的には、以下のよ
うな原理に従い、実現されている。法AのRNS表現を
2進数表現に変換する式としては、次の(7)式が知ら
れており、(7)式中、n個の項が各々の法aに対し
て対称構造を持っている。
(Third Embodiment) Next, a third embodiment of the present invention will be described. First, the principle will be described. In this embodiment, an algorithm different from those in the first and second embodiments is used to convert the residue system addition result in the modulus A from the RNS expression to the binary number representation, perform the magnitude comparison with the modulus p, and perform the comparison according to the comparison result. , The modulo A remainder addition result is converted to the modulo p remainder addition result. Specifically, it is realized according to the following principle. The following equation (7) is known as an equation for converting the RNS expression of the modulus A into a binary number expression. In the equation (7), n terms have a symmetric structure with respect to each modulus a i . have.

【0096】 z=z*N*A+z*N*A+…+z*N*A(mod A ) …(7) 但し、A=A/a,N=A -1(mod a),(1≦i≦n) この式を変形した次の(8)式も等価である。Z = z 1 * N 1 * A 1 + z 2 * N 2 * A 2 + ... + z n * N n * A n (mod A) (7) where A i = A / a i , N i = A i −1 (mod a i ), (1 ≦ i ≦ n) The following formula (8) obtained by modifying this formula is also equivalent.

【0097】 z=g*A+g*A+…+g*A(mod A) …(8) 但し、g=z*(A -1(mod a))(mod a) ここで(8)式中、gは、zとA -1の両者がa
未満(mod a)であるから各演算回路50〜5
により並列に算出できる。しかしながら、A(=
*a*…*a/a)と、法A(=a*a
*…*a)とは、各々多倍長整数であり、値が非常に
大きいため、(8)式のままでは計算不可能である。
Z = g 1 * A 1 + g 2 * A 2 + ... + g n * A n (mod A) (8) where g i = z i * (A i -1 (mod a i )) ( mod a i ) Here, in formula (8), g i is a i for both z i and A i -1.
Since it is less than (mod a i ), the arithmetic circuits 50 1 to 5 5
It can be calculated in parallel by 0 m . However, A i (=
a 1 * a 2 * ... * a n / a i ) and the method A (= a 1 * a 2).
* ... * a n ) are multiple long integers, respectively, and their values are very large. Therefore, it is impossible to calculate them using the equation (8).

【0098】しかしながら、本発明では(8)式を以下
のように変形し、zを算出可能とした。すなわち、g
がa未満であるため、g*AはA未満の整数とな
る。従って、次の(9)式が成立つ。
However, in the present invention, the equation (8) is modified as follows so that z can be calculated. That is, g i
Is less than a i , g i * A i is an integer less than A. Therefore, the following expression (9) is established.

【0099】[0099]

【数7】 [Equation 7]

【0100】このkを正確に得られるとき、zの上位w
ビットの値は、AやAの上位wビットの値を用いて近
似計算できる。
When this k can be obtained accurately, the upper w of z
The value of the bit can be approximated using the value of the upper w bits of A i and A.

【0101】ここで、k(正整数)の算出方法を述べ
る。
Here, a method of calculating k (a positive integer) will be described.

【0102】上の(9)式を変形し、次の(10)式を
得る。
By transforming the above equation (9), the following equation (10) is obtained.

【0103】[0103]

【数8】 [Equation 8]

【0104】0≦z<Aであるので、左辺の整数部がk
であり、小数部がz/Aである。従って、kは次の(1
1)式のように算出される([ ]は小数部切捨てによ
る整数化)。
Since 0 ≦ z <A, the integer part on the left side is k.
And the fractional part is z / A. Therefore, k is
It is calculated as in the equation 1) ([] is converted to an integer by truncating the decimal part).

【0105】[0105]

【数9】 [Equation 9]

【0106】各演算ユニットが法aでの除算を実行可
能なとき、(11)式をそのまま用いてkを算出でき
る。また、法aiの除算の実行可否に関わらず、g
を次の(12)式に示すように変形し、1+α/
(2wi−α)を事前計算して各演算ユニットに設定す
れば、kの計算を法aでの除算を用いずに乗算と加算
計算のみで実現できる。
When each arithmetic unit can perform division by the modulus a i , k can be calculated by directly using the equation (11). In addition, regardless of whether or not the division of the modulus ai can be performed, g i /
By transforming a i as shown in the following equation (12), 1 + α i /
If (2 wi −α i ) is calculated in advance and set in each arithmetic unit, the calculation of k can be realized only by multiplication and addition calculation without using division by the modulus a i .

【0107】 g/a=(g/2wi)*(2wi/a) =(g/2wi)*(1+α/(2wi−α)) …(12) 但し、a=2wi−α(:αは2wiに比べて十分に小さい整数。この形式 の場合、法aの剰余演算が効率化される) 以上のように、kの算出方法を説明した。続いて、zの
上位wビットの値を近似計算する方法を述べる。
G i / a i = (g i / 2 wi ) * (2 wi / a i ) = (g i / 2 wi ) * (1 + α i / (2 wi −α i )) (12) However, , A i = 2 wi −α i (: α i is an integer that is sufficiently smaller than 2 wi . In the case of this format, the modulo a i modulo operation is made more efficient.) As described above, k is calculated. Explained. Next, a method of approximating the value of the upper w bits of z will be described.

【0108】ここで、近似計算に用いるA,A,g
の上位ビットの近似値を各々A’、A’,g’と表
し、|A’|でA’のビット長を表すとする。具体的に
は次の(13)式〜(15)式に示すように、近似値g
’,A’を、g,Aの下位側c,cビット
を切捨てた上位ビットの値とし、近似値A’を、Aの下
位側cビットを切捨てた上位ビットの値に1を加えた値
とする。
Here, A i , A, g i used for the approximate calculation
It is assumed that the approximate value of the higher order bits of A'is represented by A i ′, A ′, g i ′, and | A ′ | represents the bit length of A ′. Specifically, as shown in the following equations (13) to (15), the approximate value g
Let i ', A i ' be the value of the upper bit obtained by cutting off the lower c 1 and c 2 bits of g i , A i , and the approximate value A ', the value of the upper bit obtained by cutting the lower c bit of A 1 is added to.

【0109】g’=[g/2c1] …(13) A’=[A/2c2] …(14) A’=[A/2c]+1 …(15) 但し、c=c+c ここで、|A’|=|A’|=|g’|≦wの場
合、n個の演算ユニットを用いて、zの上位wビットの
近似値z’をz≒z’*2(cはzの下位側ビットの
切捨てビット数)と算出できる。
G i '= [g i / 2 c1 ] ... (13) A i ' = [A i / 2 c2 ] ... (14) A '= [A / 2 c ] +1 (15) where c = C 1 + c 2 where | A i ′ | = | A i ′ | = | g i ′ | ≦ w, n arithmetic units are used to obtain an approximate value z ′ of the upper w bits of z. It can be calculated as z≈z ′ * 2 c (c is the number of bits truncated to the lower bits of z).

【0110】具体的には、近似値z’は、次の(16)
式により算出される。
Specifically, the approximate value z ′ is calculated by the following (16)
It is calculated by a formula.

【0111】[0111]

【数10】 [Equation 10]

【0112】ここで、z’*2は、切り捨て値である
第1項(g*A)から切り上げ値である第2項(k
*A)を引いた値のため、前述した(9)式による真の
値zに比べ、必ず等しいか小さい値(z’*2≦z)
となる。
Here, z ′ * 2 c is the first term (g i * A i ) which is a rounded down value, and the second term (k is a rounded up value).
Since it is the value obtained by subtracting * A), the value is always equal to or smaller than the true value z according to the equation (9) described above (z '* 2 c ≤z).
Becomes

【0113】すなわち、近似誤差の最大値がeのとき、
z−e<z’*2≦zとなる。
That is, when the maximum value of the approximation error is e,
z−e <z ′ * 2 c ≦ z.

【0114】なお、eは、次の(17)式のように評価
できる。
It should be noted that e can be evaluated as in the following expression (17).

【0115】 e<2*n*(2t+1+2) …(17) (tは、|g’|,|A’|(1≦i≦n)の最大
のビット長) すなわち、切捨てビット数c,c,cの適切な設定
により、g’,A’の最大のビット長tが決まり、
上の(17)式のように、e<pといった所望の近似誤
差を設定できる。
E <2 c * n * (2 t + 1 +2) (17) (t is the maximum bit length of | g i ′ |, | A i ′ | (1 ≦ i ≦ n)) , The maximum bit length t of g i ′, A i ′ is determined by appropriate setting of the truncation bit numbers c, c 1 and c 2 ,
A desired approximation error such as e <p can be set as in the above equation (17).

【0116】さて以上のように、加算結果zの上位桁が
近似値z’として2進数表現されたとする。次に、法A
での剰余系加算結果zを法pでの剰余系加算結果に変換
するため、zの近似値z’と、法pの1〜h倍(p,2
p,…,hp)の上位ワード(:下位側cビットを除い
た残り)とを比較し、pの倍数を決定する。
As described above, it is assumed that the upper digit of the addition result z is represented in the binary number as the approximate value z '. Next, method A
In order to convert the residue system addition result z in z into the residue system addition result in the method p, the approximate value z ′ of z and 1 to h times the method p (p, 2
p, ..., hp) is compared with the upper word (: the rest excluding the lower c bits) to determine the multiple of p.

【0117】ここで、法pの上位ワードをp’と表記
し、法pの2倍の上位ワードを(2p)’と表記し、以
下同様に、法pのh倍の上位ワードを(hp)’と表記
する。
Here, the upper word of the modulus p is represented by p ′, the upper word twice the modulus p is represented by (2p) ′, and the upper word of the modulus p times h is represented by (hp ) '.

【0118】具体的には、 という近似値である。但し、[ ]は、[ ]内の値を
その小数部切捨てにより整数化した値を表す。
Specifically, Is an approximate value. However, [] represents a value obtained by converting the value in [] into an integer by truncating the decimal part.

【0119】このとき、z’と(jp)’とを大小比較
し(但し、0≦j<h)、(jp)’<z’≦((j+
1)p)’のとき、zからj*pを引く。また、(h
p)’<z’のとき、zからh*pを引く。また、z’
<p’のとき、pの倍数を引かない。
At this time, z'and (jp) 'are compared in size (where 0≤j <h) and (jp)'<z'≤ ((j +
1) When p) ', subtract j * p from z. Also, (h
p) When '<z', subtract h * p from z. Also, z '
When <p ', do not subtract a multiple of p.

【0120】ここで、zの範囲を近似誤差(z−z’*
)の最大値eと共に述べる。(jp)’<z’≦
((j+1)p)’のとき(0≦j<h)、z−e<
z’*2≦((j+1)p)’*2が成立するの
で、 z<((j+1)p)’*2+e<(j+1)p+e 、となる。次に、z−j*pとされるが、zが負になる
か否かを検討する。
Here, the range of z is approximated by an error (z−z ′ *).
2 c ) with the maximum value e. (Jp) '<z' ≦
When ((j + 1) p) ′ (0 ≦ j <h), ze <
Since z ′ * 2 c ≦ ((j + 1) p) ′ * 2 c holds, z <((j + 1) p) ′ * 2 c + e <(j + 1) p + e. Next, z-j * p is set, but it is examined whether z becomes negative.

【0121】jp’<z’のとき、(jp)’+1≦
z’であり、(jp)’*2≦j*p<((jp)’
+1)*2となるので、j*p<((jp)’+1)
*2≦zが成立つ。このため、法pの引き過ぎは生じ
ない。従って、zからj*pが引かれ、0<z<p+e
となる。
When jp '<z', (jp) '+ 1≤
z ′, and (jp) ′ * 2 c ≦ j * p <((jp) ′
+1) * 2 c , so j * p <((jp) ′ + 1)
* 2 c ≤ z holds. Therefore, the modulus p is not overdrawn. Therefore, j * p is subtracted from z, and 0 <z <p + e
Becomes

【0122】次に、(hp)’<z’のとき、入力x,
y<((h+1)/2)*pの制約があれば、z<(h+
1)*pとなり、zからh*pが引かれ、z<pとな
る。
Next, when (hp) '<z', the input x,
If there is a constraint of y <((h + 1) / 2) * p, z <(h +
1) * p, and h * p is subtracted from z, and z <p.

【0123】通常、入力サイズの制約から、予め比較用
の法pの倍数の個数hを決定するので、出力に対する制
約が設定される。以上のように(jp)’<z’≦
((j+1)p)’、あるいは(hp)’<z’の何れ
にしても、結果zは、p+e未満(:z<p+e)が保
証される。
Usually, since the number h of multiples of the modulus p for comparison is determined in advance from the constraint of the input size, the constraint on the output is set. As described above, (jp) '<z' ≦
In either case of ((j + 1) p) 'or (hp)'<z', the result z is guaranteed to be less than p + e (: z <p + e).

【0124】例えばe<pとなるようにパラメータc,
c1,c2を設定すると、出力zが2p未満となり、入
力x,yも共に2p未満とすれば本アルゴリズムの出力
をそのまま次段に入力可能である。この場合,z’と、
p’,(2p)’との大小比較をすれば良い(h=2で
良い)。
For example, the parameter c, so that e <p,
If c1 and c2 are set, the output z becomes less than 2p, and if the inputs x and y are also less than 2p, the output of this algorithm can be directly input to the next stage. In this case, z ',
It is sufficient to make a size comparison with p ′ and (2p) ′ (h = 2 is sufficient).

【0125】次に、以上のように倍数jが決定される
と、z−j*pの剰余系減算(倍数jは、1〜hのいず
れか)が、次の(18)式のように、各要素毎に行われ
る。
Next, when the multiple j is determined as described above, the remainder subtraction of z−j * p (multiple j is one of 1 to h) is given by the following equation (18). , For each element.

【0126】 z=z−j*p(mod A)=(z−j*p(mod a),z−j *p(mod a),…,z−j*p(mod a)) …(18) この減算結果zが、求めていた法pでの剰余系加算結果
zである。
Z = z−j * p (mod A) = (z 1 −j * p 1 (mod a 1 ), z 2 −j * p 2 (mod a 2 ), ..., Z n −j * p n (mod a n )) (18) This subtraction result z is the remainder addition result z in the obtained modulus p.

【0127】さて以上の原理に従い、本実施形態は具体
的には以下の構成を備えている。図5は本発明の第3の
実施形態に係る剰余系演算装置の構成を示すブロック図
である。この剰余系演算装置は、演算コントローラ40
及びm個の演算回路50 〜50がバス30を介して
互いに接続されている。
Now, according to the above principle, the present embodiment is
Specifically, it has the following configuration. FIG. 5 shows a third embodiment of the present invention.
FIG. 3 is a block diagram showing the configuration of a coset arithmetic unit according to the embodiment.
Is. This remainder-based arithmetic device is provided with an arithmetic controller 40.
And m arithmetic circuits 50 1~ 50mVia bus 30
Connected to each other.

【0128】ここで、演算コントローラ40は、基本的
には前述同様に、各演算回路50〜50との間でデ
ータを授受する機能と、各演算回路50〜50の演
算内容(剰余系加算、剰余系減算、剰余系乗算)を制御
する機能とを有し、各演算回路50〜50に夫々所
望の演算を実行させる機能をもっている。
[0128] Here, operation controller 40, as before is basically a function of exchanging data between the arithmetic circuits 50 1 to 50 m, content of operation of the arithmetic circuits 50 1 to 50 m ( It has a function of controlling a remainder system addition, a remainder system subtraction, a remainder system multiplication, and a function of causing each of the arithmetic circuits 50 1 to 50 m to execute a desired arithmetic operation.

【0129】但し具体的には、演算コントローラ40
は、各演算回路50〜50に対し、RNS表現され
た2整数<x>,<y>の剰余系加算を実行させる
機能と、各演算回路50〜50を制御し、剰余系加
算結果<z>を上述した原理のアルゴリズムを用いて
2進数表現での上位ビットの近似値z’に変換させる機
能と、各演算回路50〜50に対し、近似値z’
と、2進数表現された法pを整数倍した値の上位ビット
の近似値{p’,(2p)’,…,(jp)’,…,
(hp)’}との大小関係を比較させて倍数jを決定す
る機能と、倍数jに基づいて、各演算回路50〜50
に対し、剰余系加算結果<z>から法pをj倍した
j*<p>を減算させる機能と、得られた法pでの剰
余系加算結果<z>を出力する機能とをもっている。
However, specifically, the arithmetic controller 40
, For each arithmetic circuits 50 1 to 50 m, RNS representation has been 2 integer <x> A, and controls a function to execute a coset addition of <y> A, each arithmetic circuits 50 1 to 50 m, The function of converting the remainder addition result <z> A into an approximate value z ′ of the upper bit in the binary representation using the algorithm of the principle described above, and an approximate value z ′ for each of the arithmetic circuits 50 1 to 50 m.
And an approximate value {p ', (2p)', ..., (jp) ', ..., Of the upper bits of a value obtained by multiplying the binary representation of the modulus p by an integer.
(Hp) ′} and a function of determining the multiple j by comparing the magnitude relationship with (hp) ′}, and each of the arithmetic circuits 50 1 to 50 based on the multiple j.
A function of subtracting j * <p> A obtained by multiplying modulo p by j from m of the remainder system addition result m with respect to m , and a function of outputting the remainder system addition result <z> A of the obtained modulus p. Has.

【0130】一方、各演算回路50〜50は、前述
した各演算回路20と同様のものである。但し、各演
算ユニット52の機能が前述したものとは若干異な
る。
On the other hand, the arithmetic circuits 50 1 to 50 m are the same as the arithmetic circuits 20 i described above. However, the function of each arithmetic unit 52 i is slightly different from that described above.

【0131】すなわち、演算ユニット52は、基本的
には前述同様に、演算コントローラ40からの制御に従
い、RAM51内のwビット同士の整数の加減乗算、
wビットの法における剰余系の加減乗算を実行し、実行
結果をRAM51に書込む機能を有し、且つRAM5
を介して演算コントローラ40や他の演算回路50
〜50i-1,50i+1〜50と互いにデータを交換し
ながら並列演算を実行する機能をもっている。
That is, the arithmetic unit 52 i basically performs the addition / subtraction of integers of w bits in the RAM 51 i under the control of the arithmetic controller 40, as described above.
The RAM 5 i has a function of executing addition / subtraction multiplication of the remainder system in the w-bit modulus and writing the execution result in the RAM 51 i.
1 i via the arithmetic controller 40 and other arithmetic circuit 50
It has a function of executing parallel operation while exchanging data with each other with 1 to 50 i−1 and 50 i + 1 to 50 m .

【0132】但し、各演算ユニット52〜52は、
前述した各演算ユニット52〜52とは異なり、混
合基数表示に関する処理機能を省略可能となっている。
次に、以上のように構成された剰余系演算装置による剰
余系演算方法を図6のフローチャートを用いて説明す
る。いま、例えば公開鍵暗号アルゴリズムの実行途中で
2数x,yの剰余系の加算処理が必要になったとする。
夫々外部のCPU(図示せず)からバス30を介し、各
演算ユニット52〜52にはRNS表現の基底Bで
ある法の値aiと、Aの上位桁の近似値A’=[A
/2]と、その乗法逆元A -1(mod a)と
が設定される一方、演算コントローラ40には法Aの上
位桁の近似値A’=[A/2]+1が設定され(ST
11)、このA’は演算コントローラ40を介し、後述
するk*A’を算出する演算ユニット52に設定され
る。なお、近似値A’は、演算コントローラ40を介さ
ずに、直接、演算ユニット52に設定してもよい。
However, the arithmetic units 52 1 to 52 m are
Unlike the above-described arithmetic units 52 1 to 52 m , the processing function regarding the display of the mixed radix can be omitted.
Next, a coset system computing method by the coset system computing device configured as described above will be described with reference to the flowchart of FIG. Now, for example, it is assumed that it is necessary to perform addition processing of the remainder system of two numbers x and y while executing the public key encryption algorithm.
Each of the arithmetic units 52 1 to 52 m is supplied from an external CPU (not shown) via the bus 30 to each arithmetic unit 52 1 to 52 m, which is a base value B i of the RNS expression and an approximation value A i ′ = A i ′ = [A
i / a 2 c], while its multiplicative inverse A i -1 (mod a i) is set, the upper digit of the approximate value A of the law A to operation controller 40 '= [A / 2 c ] +1 Is set (ST
11), this A ′ is set via the arithmetic controller 40 to the arithmetic unit 52 1 for calculating k * A ′ described later. The approximate value A ′ may be directly set in the arithmetic unit 52 1 without going through the arithmetic controller 40.

【0133】また、演算コントローラ40は、外部のC
PUから法の値pとその倍数p,2p,…,hpが入力
されると、これらを各演算ユニット52〜52に設
定する。また同様に、法pとその倍数は、演算コントロ
ーラ40を介さずに、直接、各演算ユニット52〜5
に設定してもよい。
Further, the arithmetic controller 40 uses an external C
When the modulo value p and its multiples p, 2p, ..., hp are input from the PU, these are set in the respective arithmetic units 52 1 to 52 m . Similarly, the modulus p and its multiples are directly calculated by the arithmetic units 52 1 to 5 5 without passing through the arithmetic controller 40.
It may be set to 2 m .

【0134】各演算ユニット52〜52は、これら
法pの倍数のうち、(i*p)’を2進数表現のままと
し(大小比較用)、p,2p,…,hpを法aで除し
てRNS表現とし(j倍の減算用)、これら両表現によ
る値を保持する(ST12)。
Of the multiples of these modulo p, each of the arithmetic units 52 1 to 52 m leaves (i * p) 'as a binary representation (for comparison of magnitude) and p, 2p, ..., hp modulo a. It is divided by i to be an RNS expression (for j-fold subtraction), and the values of both expressions are held (ST12).

【0135】さらに、各演算ユニット52〜52
は、外部のCPUから2数x,yが入力されると、こ
れらx,yを法aで除してRNS表現された要素
,yに変換して保持する(ST13)。
Further, each of the arithmetic units 52 1 to 52
m is the number of 2 x from an external CPU, y is input, these x, by dividing y by law a i RNS representation by elements x i, holds converted to y i (ST13).

【0136】以上のステップST11〜ST13は事前
に一度だけ行うフェーズであり、既にRNS表現された
データが剰余系加算される場合、ステップST13は不
要である。以上の準備のもと、以下で実際に剰余系加算
を実行する。
The above steps ST11 to ST13 are the phases to be performed only once in advance, and when the data already expressed in the RNS is subjected to the remainder system addition, the step ST13 is unnecessary. Based on the above preparations, the remainder addition is actually executed below.

【0137】すなわち、各演算ユニット52〜52
は、演算コントローラ40の制御により、各要素x
毎に法aでの加算を実行し(ST14)、夫々加
算結果zをRAM52〜52に出力する。演算コ
ントローラ40は、各RAM52〜52内の結果z
〜zを順次読み出し、剰余系加算結果<z>を得
る。
That is, each of the arithmetic units 52 1 to 52 m
Under the control of the arithmetic controller 40, each element x i ,
The addition by the modulus a i is executed for each y i (ST14), and the addition results z i are output to the RAMs 52 1 to 52 m , respectively. The arithmetic controller 40 uses the result z in each of the RAMs 52 1 to 52 m .
1 to z n are sequentially read to obtain the remainder addition result <z> A.

【0138】続いて、加算結果<z>と法pとを大小
比較するため、一旦、加算結果<z>を2進数表示に
変換する。
Then, in order to compare the addition result <z> A with the modulus p, the addition result <z> A is once converted into a binary number representation.

【0139】具体的には演算コントローラ40は、図7
にn=8の例を示すように、各演算ユニット52〜5
を順に制御し、(11)式のkを算出させる(ST
15)。
Specifically, the arithmetic controller 40 is shown in FIG.
As an example of n = 8, the arithmetic units 52 1-5
2 m are controlled in order to calculate k in the equation (11) (ST
15).

【0140】このステップST15は、図7中、サブス
テップ1〜5の手順で実行される。まず、g=z
-1(mod a)を各演算ユニット52で並列
に算出し(サブステップ1)、次に、g/aを各演
算ユニット52で並列に計算し(サブステップ2)、
次いで各g/aの総和によりkを求める(サブステ
ップ3〜5)。
This step ST15 is executed by the procedure of substeps 1 to 5 in FIG. First, g i = z i *
A i -1 (mod a i ) is calculated in parallel in each arithmetic unit 52 i (substep 1), and then g i / a i is calculated in parallel in each arithmetic unit 52 i (substep 2) ,
Then, k is obtained from the sum of each g i / a i (substeps 3 to 5).

【0141】各g/aの総和からkを得る処理は、
最大n/2個の各演算ユニット52 〜52n/2によ
り、深さlognのトーナメント式の加算処理によって実
行される。次に、演算コントローラ40は、各演算ユニ
ット52〜52を順に制御し、(16)式のz’を
算出させる(ST16)。
Each gi/ AiThe process of obtaining k from the sum of
N / 2 maximum operation units 52 1~ 52n / 2By
The depth of the logn tournament formula
Done. Next, the arithmetic controller 40 determines each arithmetic unit.
521~ 52mAre controlled in order, and z ′ in the equation (16) is changed to
It is calculated (ST16).

【0142】このステップST16は、図7中、サブス
テップ6〜11の手順で実行される。まず、サブステッ
プ1で計算したgの上位桁g’とA’の積を演算
ユニット52で並列に計算し(サブステップ6)、続
いて、得られたn個のg’・A’の総和を求める
(サブステップ7〜9)。
This step ST16 is executed by the procedure of substeps 6 to 11 in FIG. First, the g i calculated in substep 1 significant digit g i 'and A i' calculates the product of the parallel arithmetic unit 52 i (substep 6), followed by, n pieces obtained in g i ' -Calculate the sum of A i '(substeps 7-9).

【0143】総和を求める処理は、前述同様に、最大n
/2個の演算ユニット52〜52 n/2による深さlogn
のトーナメント式の加算処理で実行される。最後に1つ
の演算ユニット52を使ってk*A’を計算し(サブ
ステップ10)、求めた総和から引いて近似値z’を得
る(サブステップ11)。
As in the above, the process of obtaining the sum is n
/ 2 arithmetic units 521~ 52 n / 2Depth by logn
It is executed by the addition process of the tournament formula. One last
Arithmetic unit 521To calculate k * A '((sub
Step 10), subtracting from the obtained total sum to obtain an approximate value z '.
(Sub-step 11).

【0144】次に、各演算ユニット52は、得られた
近似値z’と、法pの倍数の近似値{p’,(2
p)’,…,(jp)’,…,(hp)’}との大小比
較を行う。
Next, each arithmetic unit 52 i obtains the obtained approximate value z ′ and the approximate value {p ′, (2
p) ', ..., (jp)', ..., (hp) '}.

【0145】なお、ここで、法pの倍数jpは、以下の
関係式で決定される(ST17)。
The multiple jp of the modulus p is determined by the following relational expression (ST17).

【0146】(jp)’<z’≦((j+1)p)’を
満たすj、(但し、0≦j<h) なお、(hp)’<z’のとき、j=hとする。
J satisfying (jp) '<z'≤ ((j + 1) p)' (where 0≤j <h) Note that when (hp) '<z', j = h. .

【0147】演算コントローラ40は、各演算ユニット
52の比較結果により、倍数jを決定すると、各演算
ユニット52〜52の制御により、ステップST4
での加算結果<z>から次の(19)式のように法p
のj倍を引き、法pでの剰余系加算結果<z>を得
る。
When the arithmetic controller 40 determines the multiple j based on the comparison result of the arithmetic units 52 i , the arithmetic controller 40 controls the arithmetic units 52 1 to 52 m to execute step ST4.
From the addition result <z> A in Eq.
To obtain the remainder addition result <z> A by the modulus p.

【0148】 <z>=<z>−j*<p>A …(19) このとき、各演算ユニット52〜52は、演算コン
トローラ40の制御により、各要素z,jp毎に法
での減算を実行し(ST18)、夫々減算結果z
をRAM52〜52に出力する。演算コントローラ
40は、各RAM52〜52内の結果z〜z
順次読み出し、法pでの剰余系加算結果<z>を得
る。但しz<p+e(eはステップST16での近似誤
差)。
<Z> A = <z> A- j * <p> A (19) At this time, each of the arithmetic units 52 1 to 52 m is controlled by the arithmetic controller 40 and each element z i , jp i. The subtraction with the modulus a i is executed for each time (ST18), and the subtraction result z i
Is output to the RAMs 52 1 to 52 m . The arithmetic controller 40 sequentially reads the results z 1 to z n in the RAMs 52 1 to 52 m , and obtains the remainder addition result <z> A in the modulus p. However, z <p + e (e is an approximation error in step ST16).

【0149】上述したように本実施形態によれば、法A
での剰余系加算結果を近似的に2進数表現に変換して近
似的に法pのj倍に相当するかを調べ、この倍数jに従
い、法Aの剰余系加算結果を法pの剰余系加算結果に変
換するので、法Aで剰余系表現された2数に対し、法A
とは異なる法pの下での剰余系加算を高効率に実行する
ことができる。
As described above, according to this embodiment, the method A
Approximately convert the remainder addition result in binary to a binary representation to check whether it is approximately j times the modulus p, and according to this multiple j, the remainder addition result of the modulus A is converted to the remainder system of the modulus p. Since it is converted to the addition result, the modulo A is applied to the 2
It is possible to highly efficiently perform coset addition under the modulus p different from.

【0150】なお、法Aでの剰余系加算結果zの2進数
表現での近似値z’を求める処理は、n個(n=m)の
演算ユニット50〜50の並列処理により、全体と
して2*logn+7ステップ程度となり、計算量がO(l
ogn)で済むので、第1実施形態(Garnerのアルゴリズ
ム)の計算量よりも、少ない計算量で実行することがで
きる。このため、第1実施形態よりも、全体的に処理時
間を短縮できる。
The process of obtaining the approximate value z'in the binary representation of the remainder addition result z in the modulus A is performed as a whole by parallel processing of n (n = m) arithmetic units 50 1 to 50 m. 2 * logn + 7 steps, and the calculation amount is O (l
Since it is sufficient, it can be executed with a smaller calculation amount than the calculation amount of the first embodiment (Garner's algorithm). Therefore, the processing time can be shortened as a whole compared to the first embodiment.

【0151】また、本実施形態は、アルゴリズムを変形
し、h個のpの倍数の近似値との大小比較を行う代わり
に、M*pのh個の倍数それぞれの上位ワード(M*
p)’,(2M*p)’,…,(hM*p)’との大小
比較を行ってもよい。
Further, in the present embodiment, the algorithm is modified so that instead of performing the magnitude comparison with the approximate value of the multiple of h, the upper word (M *) of each of the multiple of h of M * p.
p) ', (2M * p)', ..., (hM * p) 'may be compared.

【0152】すなわち、(jM*p)’<z’≦((j
+1)M*p)’(但しj<h)ならばzからjM*p
を引き、(hM*p)’<z’ならばzからhM*pを
引く。
That is, (jM * p) '<z'≤ ((j
+1) M * p) '(where j <h), then z to jM * p
, And if (hM * p) '<z', subtract hM * p from z.

【0153】(jM*p)’<z’≦((j+1)M*
p)’の場合(但しj<h)、z−e<z’*2
((j+1)M*p)’*2となるので、z<(j+
1)M*p+eが成立する。このとき、zからjM*p
を引くので結果として、z<M*p+eとなる。
(JM * p) '<z'≤ ((j + 1) M *
p) ′ (where j <h), z−e <z ′ * 2 c
((J + 1) M * p) '* 2 c , so z <(j +
1) M * p + e holds. At this time, from z to jM * p
As a result, z <M * p + e.

【0154】この場合、出力サイズは元のアルゴリズム
よりも大きくなる。但し、入力サイズの制約が元のアル
ゴリズムと同じとすれば判定に必要なM*pの倍数の個
数を低減できる。
In this case, the output size becomes larger than that of the original algorithm. However, if the input size constraint is the same as the original algorithm, the number of multiples of M * p required for the determination can be reduced.

【0155】さらに、本実施形態では、各演算ユニット
52が法pの倍数との大小比較を行なったが、これに
限らず、各演算ユニット52に代えて、演算コントロ
ーラ40が法pの倍数との大小比較を行なってもよい。
例えば近似誤差の設定により、h=2程度となる場合な
どは、演算コントローラ40と、2つの演算ユニット5
〜52とのいずれが大小比較を行っても、処理時
間に大差が生じないと考えられる。
Furthermore, in the present embodiment, each arithmetic unit 52 i performs a magnitude comparison with a multiple of the modulus p. However, the present invention is not limited to this, and the arithmetic controller 40 replaces each arithmetic unit 52 i with the modulus p. A magnitude comparison with a multiple may be made.
For example, when h = 2 due to the setting of the approximation error, the arithmetic controller 40 and the two arithmetic units 5
Also which of the 2 1-52 2 performs magnitude comparison, significant difference is considered to not occur in the processing time.

【0156】(第4の実施形態)次に、本発明の第4の
実施形態に係る剰余系演算装置について図5に示す装置
により説明する。この剰余系演算装置は、第3の実施形
態の変形例であり、並列演算の分担を変更させることに
より、処理時間の短縮を図るものであり、具体的には図
6に示すステップST15とステップST16に代え
て、図8に示すように、両ステップST15,ST16
の処理手順を融合させたステップST20(図9;サブ
ステップ1S〜8S)を実行する構成となっている。
(Fourth Embodiment) Next, a coset arithmetic unit according to a fourth embodiment of the present invention will be described with reference to the device shown in FIG. This remainder system arithmetic device is a modification of the third embodiment, and is intended to shorten the processing time by changing the sharing of parallel arithmetic operations. Specifically, step ST15 and step ST15 shown in FIG. Instead of ST16, as shown in FIG. 8, both steps ST15, ST16
The configuration is such that step ST20 (FIG. 9; substeps 1S to 8S), which is a combination of the above processing procedures, is executed.

【0157】ここで、演算コントローラ40は、前述し
た機能のうち、各演算ユニット52 に対する並列演算
の分担制御を変えた構成となっている。
Here, the arithmetic controller 40 has been described above.
Among the functions, each arithmetic unit 52 iParallel operation on
It has a configuration in which the sharing control of is changed.

【0158】具体的には、演算コントローラ40は、図
7に示した最大n/2個(=4)の演算ユニット52
〜52n/2による総和処理(g/aの総和(図7;
サブステップ3〜5)及びg’*A’の総和(図
7;サブステップ7〜9))を直列に実行させる制御機
能に代えて、図9のサブステップ4S〜6Sに示すよう
に、これら2つの総和処理を最大n個(=8)の演算ユ
ニット52〜52n/2に並列に実行させる制御機能を
有している。
Specifically, the arithmetic controller 40 has a maximum of n / 2 (= 4) arithmetic units 52 1 shown in FIG.
~ 52 n / 2 summation processing (sum of g i / a i (FIG. 7;
As shown in substeps 4S to 6S of FIG. 9, instead of the control function of performing the substeps 3 to 5) and the sum of g i '* A i ' (FIG. 7; substeps 7 to 9)) in series. , And has a control function of causing a maximum of n (= 8) arithmetic units 52 1 to 52 n / 2 to execute these two summing processes in parallel.

【0159】次に、以上のように構成された剰余系演算
装置による剰余系演算方法を図8のフローチャートを用
いて説明する。いま、前述同様に、ステップST11〜
ST14が終了したとする。次に、演算コントローラ4
0は、ステップST20として、図9に示すように、各
演算コントローラ52〜52に並列演算を実行させ
る。
Next, a coset system computing method by the coset system computing device configured as described above will be described with reference to the flowchart of FIG. Now, similarly to the above, steps ST11 to ST11
It is assumed that ST14 ends. Next, the arithmetic controller 4
0, at Step ST20, as shown in FIG. 9, to perform a parallel operation on the operation controller 52 1-52 8.

【0160】すなわち、サブステップ1S〜3Sによ
り、kの算出に要するg/aと、z’の算出に要す
るg’*A’とを並列に求める。次に、サブステッ
プ4S〜6Sにより、これらn個のg/aと、n個
のg’*A’とを各々トーナメント方式で並列に加
算させる。
[0160] That is, the sub-step 1S~3S, obtaining a g i / a i required for the calculation of k, and * A i '' g i required for the calculation of 'that z in parallel. Then, the sub-step 4S~6S, these and the n g i / a i, the n g i '* A i' and each is added in parallel tournament a.

【0161】しかる後、サブステップ7S,8Sによ
り、近似値z’=r−kA’を算出させる。これによ
り、ステップST20全体では、実行する処理をlogn
+5ステップに短縮できる。
Then, in substeps 7S and 8S, an approximate value z '= r-kA' is calculated. As a result, in the entire step ST20, the logn processing is executed.
Can be shortened to +5 steps.

【0162】以下、同様にステップST17〜ST18
の実行により、法pでの剰余系加算結果が得られる。な
お、全体の処理としては、logn+8ステップを要する
が、nが大きい場合には第3の実施形態と比べ、処理時
間を約半分に短縮することができる。
Thereafter, similarly, steps ST17 to ST18 are performed.
By executing, the remainder addition result in the modulus p is obtained. It should be noted that although the logn + 8 steps are required for the entire processing, the processing time can be reduced to about half as compared with the third embodiment when n is large.

【0163】上述したように本実施形態によれば、2進
数表現への変換処理のうち、図7の如き最大n/2個の
演算ユニット52〜52n/2を要する2種類のトーナ
メント方式の加算処理を、図9に示すように最大n個の
演算ユニット52〜52により並列処理する構成と
したので、第3の実施形態の効果に加え、nが大きい場
合には処理時間を約半分に短縮することができる。
As described above, according to the present embodiment, in the conversion processing into the binary number representation, the two types of tournament methods that require a maximum of n / 2 arithmetic units 52 1 to 52 n / 2 as shown in FIG. of the addition process, since a parallel processing configuration with up to n arithmetic units 52 1 to 52 n as shown in FIG. 9, in addition to the effects of the third embodiment, the processing time when n is greater It can be reduced to about half.

【0164】(第5の実施形態)次に、本発明の第5の
実施形態に係る剰余系演算装置について図5に示す装置
により説明する。本実施形態は、第3の実施形態の剰余
系加算に加え、法AでRNS表現された2数<x>
<y>を対象とし、法pの剰余系減算結果<z>=<
x>−<y>を得るためのものである(但し、p<
A)。具体的な原理は、第2の実施形態に述べた原理と
同様である。ここで、演算コントローラ40は、第3実
施形態で述べた機能に加え、各演算ユニット52の制
御機能により、剰余系減算を実行する際に、予め減算す
る入力<y>の上限値を越える値d*<p>から<
y>を要素z毎に減算させる機能と、この減算結果
に対し、被減算対象の<x>を要素x毎に加算させ
る機能とを備えたものである。
(Fifth Embodiment) Next, a coset arithmetic unit according to a fifth embodiment of the present invention will be described with reference to the device shown in FIG. In the present embodiment, in addition to the remainder addition of the third embodiment, two numbers <x> A represented by RNS in the modulus A ,
<Y> A target, modulo p subtraction result <z> = <
x> A − <y> A (where p <
A). The specific principle is the same as the principle described in the second embodiment. Here, the arithmetic controller 40 uses the control function of each arithmetic unit 52 i in addition to the functions described in the third embodiment to set the upper limit value of the input <y> A to be subtracted in advance when performing the remainder subtraction. Exceeding value d * <p> From A <
It has a function of subtracting y> A for each element z i and a function of adding <x> A to be subtracted for each element x i to the subtraction result.

【0165】次に、以上のように構成された剰余系演算
装置による剰余系演算方法を図10のフローチャートを
用いて説明する。いま、前述同様にステップST11〜
ST12が完了し、演算コントローラ40には近似値
A’が設定済みであり、各演算回路50〜50には
演算パラメータ(法a,近似値A’,乗法逆元A
-1,法pの倍数p〜hp)が設定済みであるとする。
Next, the coset system computing method by the coset system computing device configured as described above will be described with reference to the flowchart of FIG. Now, similarly to the above, steps ST11 to ST11
ST12 is completed, the approximate value A'has been set in the arithmetic controller 40, and the arithmetic parameters (modulus a i , approximate value A i ′, multiplicative inverse element A i) are assigned to the arithmetic circuits 50 1 to 50 m.
-1 , the multiple p to hp of the modulus p) is set.

【0166】また同様に、各演算ユニット52〜52
は、外部のCPUから2数x,yが入力されると(但
し、x,y<d*p)、これらx,yを法aで除して
RNS表現された要素x,yに変換して保持する
(ST13−S)。
Similarly, each of the arithmetic units 52 1 to 52 1
When two numbers x and y are input from an external CPU (where x, y <d * p), m is an element x i , y expressed in RNS by dividing these x and y by the modulus a i. It is converted to i and held (ST13-S).

【0167】以上のステップST11〜ST13−Sは
事前に一度だけ行うフェーズであり、既にRNS表現さ
れたデータが剰余系減算される場合、ステップST13
−Sは不要である。以上の準備のもと、以下の手順で剰
余系減算を実行する。
The above steps ST11 to ST13-S are the phases to be performed only once in advance, and when the data already expressed in RNS is subjected to remainder subtraction, step ST13.
-S is unnecessary. Based on the above preparations, the remainder subtraction is executed in the following procedure.

【0168】なお、剰余系減算では、前述した通り、x
−y<Aの前提の下で、各要素x,y毎に法a
の減算を行う。但し、x<yのときの結果誤りを阻止す
る観点から、次の(20)式のように、予めy<d*p
の関係をもつd*<p>を、−<y>に加算する
(ST14−S1)。
In the remainder subtraction, as described above, x
Under the premise of −y <A, the subtraction by the modulus a i is performed for each element x i , y i . However, from the viewpoint of preventing a result error when x <y, y <d * p
The d * <p> A having the relationship of is added to-<y> A (ST14-S1).

【0169】 <S>=d*<p>−<y> …(20) すなわち、各演算ユニット52〜52は、演算コン
トローラ40の制御により、各要素d*p,y毎に
法aでの減算を実行し、夫々減算結果sをRAM5
〜51に出力する。演算コントローラ10は、各
RAM51〜51内の結果s〜sを順次読み出
し、減算結果としての正の値<S>を得る。つまり、
入力yが0<y<d*pを満たすので、d*p−yの結
果をSとすると、0<S<d*pという正の値となる。
<S> A = d * <p> A− <y> A (20) That is, each of the arithmetic units 52 1 to 52 m is controlled by the arithmetic controller 40, and each element d * p i , y. performs subtraction of by law a i for each i, respectively subtraction result s i RAM5
Output to 1 1 to 51 m . Operation controller 10 sequentially reads the result s 1 ~s n in each RAM 51 1 to 51 m, to obtain a positive value <S> A as a subtraction result. That is,
Since the input y satisfies 0 <y <d * p, a positive value of 0 <S <d * p is obtained, where S is the result of d * py.

【0170】ここで、<S>≡d*p−y(mod
p)≡−y(mod p)であることに注意すると、S
とxに対し、本発明の剰余系加算を行うことでz≡S+
x(mod p)=x−y(mod p)なる結果zが
得られる。
[0170] In this case, <S> A ≡d * p -y (mod
Note that if p) ≡−y (mod p), then S
By performing the remainder addition of the present invention on x and x, z≡S +
The result z is obtained such that x (mod p) = xy (mod p).

【0171】従って、この正の値<S>に対し、本来
の演算対象の<x>を同様に各演算ユニット52
52により要素s,x毎に加算し(ST14−S
2)、剰余系減算結果<z>を得る。
Therefore, with respect to this positive value <S> A , the original operation target <x> A is similarly calculated in each of the operation units 52 1 to 52 1 .
52 m add for each element s i , x i (ST14-S
2) Obtain the remainder subtraction result <z> A.

【0172】以下、前述したステップST15〜ST1
7と同様に、減算結果を2進数表現に変換し、変換結果
が法pをj個含む旨を判定し、判定結果に基づき、減算
結果<z>から法pの倍数j*<p>を減算し、最
終的に<z>を得る。
Hereinafter, the above-mentioned steps ST15 to ST1
Similar to 7, the subtraction result is converted into a binary number representation, it is determined that the conversion result includes j mod p, and based on the determination result, the subtraction result <z> A to the multiple p of mod p j * <p> Subtract A to finally obtain <z> A.

【0173】なお、結果zのサイズの上限は、剰余系加
算方式の性質から0≦z<p+e<2pを満たす。(但
し、近似誤差e<pの場合)。
The upper limit of the size of the result z satisfies 0 ≦ z <p + e <2p due to the nature of the remainder addition method. (However, when the approximation error e <p).

【0174】上述したように本実施形態によれば、始め
に、引く数yの上限値を超える値dpから引く数yを減
算し、剰余系減算結果sを必ず正の値として演算の正当
性を確保した後、本来の引かれる数xを剰余系減算結果
に加算して法Aでの剰余系減算結果を得て、以下、第3
の実施形態と同様に、この法Aでの剰余系減算結果を法
pでの剰余系減算結果に変換するので、第3の実施形態
の効果に加え、法Aで剰余系表現された2数に対し、法
Aとは異なる法pの下での剰余系減算を高効率に実行す
ることができる。
As described above, according to this embodiment, first, the subtraction number y is subtracted from the value dp that exceeds the upper limit value of the subtraction number y, and the remainder subtraction result s is always set to a positive value. Then, the original subtracted number x is added to the remainder subtraction result to obtain the remainder subtraction result in the modulus A.
In the same manner as in the above embodiment, since the remainder subtraction result in the modulus A is converted into the remainder subtraction result in the modulus p, in addition to the effect of the third embodiment, the remainder system represented by the modulus A is represented by two numbers. On the other hand, the remainder subtraction under the method p different from the method A can be executed with high efficiency.

【0175】また、本実施形態の処理は全体として2*
logn+8ステップ程度となり、n個の演算ユニットの並
列処理を前提としてO(logn)であり、第2の実施形
態(Garnerのアルゴリズム)よりも計算量を少なく抑え
られる利点がある。
The processing of this embodiment is 2 * as a whole.
It becomes about logn + 8 steps, which is O (logn) on the premise of parallel processing of n arithmetic units, and has an advantage that the amount of calculation can be suppressed smaller than that of the second embodiment (Garner's algorithm).

【0176】なお、本実施形態は、図8に示した変形手
順と同様にステップST15とステップST16を融合
させたステップST20を用いても実現でき、この場
合、前述同様に、nが大きい場合には処理時間を約半分
に短縮することができる。
The present embodiment can be realized also by using step ST20 which is a combination of step ST15 and step ST16 as in the modification procedure shown in FIG. 8. In this case, as described above, when n is large. Can reduce the processing time to about half.

【0177】その他、本発明はその要旨を逸脱しない範
囲で種々変形して実施できる。
In addition, the present invention can be variously modified and implemented without departing from the scope of the invention.

【0178】[0178]

【発明の効果】以上説明したように本発明によれば、法
Aで剰余系表現された2数に対し、法Aとは異なる法p
の下での剰余系加算を高効率に実行できる剰余系演算装
置及び方法を提供できる。また、上記剰余系加算の他
に、同様の法pの下での剰余系減算を高効率に実行でき
る剰余系演算装置及び方法を提供できる。
As described above, according to the present invention, a modulus p different from the modulus A is used for the two numbers expressed by the modulus A in the modulus A.
It is possible to provide a remainder system operation device and method capable of performing remainder system addition under high efficiency with high efficiency. Further, it is possible to provide a remainder system arithmetic device and method capable of highly efficiently performing remainder system subtraction under the same modulus p in addition to the above remainder system addition.

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

【図1】本発明の第1の実施形態に係る剰余系演算装置
の構成を示すブロック図
FIG. 1 is a block diagram showing a configuration of a coset arithmetic unit according to a first embodiment of the present invention.

【図2】同実施形態における各演算回路の制御方式を示
す模式図
FIG. 2 is a schematic diagram showing a control system of each arithmetic circuit in the same embodiment.

【図3】同実施形態における剰余系演算方法を説明する
ためのフローチャート
FIG. 3 is a flowchart for explaining a remainder system calculation method in the same embodiment.

【図4】本発明の第2の実施形態に係る剰余系演算装置
による剰余系演算方法を説明するためのフローチャート
FIG. 4 is a flowchart for explaining a coset arithmetic method by a coset arithmetic unit according to the second embodiment of the present invention.

【図5】本発明の第3の実施形態に係る剰余系演算装置
の構成を示すブロック図
FIG. 5 is a block diagram showing a configuration of a coset arithmetic unit according to a third embodiment of the present invention.

【図6】同実施形態における剰余系演算方法を説明する
ためのフローチャート
FIG. 6 is a flowchart for explaining a remainder system calculation method in the same embodiment.

【図7】同実施形態における各演算回路の制御方式を示
す模式図
FIG. 7 is a schematic diagram showing a control system of each arithmetic circuit in the same embodiment.

【図8】本発明の第4の実施形態に係る剰余系演算装置
による剰余系演算方法を説明するためのフローチャート
FIG. 8 is a flowchart for explaining a coset arithmetic method by a coset arithmetic device according to a fourth embodiment of the present invention.

【図9】同実施形態における各演算回路の制御方式を示
す模式図
FIG. 9 is a schematic diagram showing a control system of each arithmetic circuit in the same embodiment.

【図10】本発明の第5の実施形態に係る剰余系演算装
置による剰余系演算方法を説明するためのフローチャー
FIG. 10 is a flowchart for explaining a coset arithmetic method by a coset arithmetic unit according to a fifth embodiment of the present invention.

【符号の説明】[Explanation of symbols]

10,40…演算コントローラ 20〜20,50〜50…演算回路 21〜21,51〜51…RAM 22〜22,52〜52…演算ユニット 30…バス10, 40 ... Arithmetic controller 20 1 to 20 m , 50 1 to 50 m ... Arithmetic circuit 21 1 to 21 m , 51 1 to 51 m ... RAM 22 1 to 22 m , 52 1 to 52 m ... Arithmetic unit 30 ... Bus

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭52−116126(JP,A) 特開 平11−340817(JP,A) 特開 平1−149129(JP,A) 特開 昭64−30332(JP,A) 特開 平1−99325(JP,A) K.C.Posch et al., Modulo reduction i n residue number s ystems,IEEE Trans. on Parallel and D istributed System s,米国,IEEE,1995年 5月,V ol.6, No.5,pp.449−454 (58)調査した分野(Int.Cl.7,DB名) G06F 7/72 ─────────────────────────────────────────────────── ─── Continuation of the front page (56) Reference JP-A 52-116126 (JP, A) JP-A 11-340817 (JP, A) JP-A 1-149129 (JP, A) JP-A 64- 30332 (JP, A) JP-A-1-99325 (JP, A) K.K. C. Posch et al. , Modulo reduction in residue number systems, IEEE Trans. On Parallel and D Distributed Systems, USA, IEEE, May 1995, Vol. 6, No. 5, pp. 449-454 (58) Fields surveyed (Int.Cl. 7 , DB name) G06F 7/72

Claims (10)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 法Aで剰余系表現された複数の剰余系デ
ータ<x>,<y>同士を法p(:p<A)の下で
加算するための剰余系演算装置であって、 予め混合基数表示で法pをh倍(h=1〜hの正整数)
した複数の倍数データ(p,2p,…,hp)が設定さ
れる混合基数系倍数設定手段と、 予め前記剰余系表現で前記法pをh倍した複数の倍数デ
ータ(<p>,2*<p>,…,h*<p>)が
設定される剰余系倍数設定手段と、 入力された剰余系データ<x>,<y>を剰余系表
現で加算し、剰余系加算結果<z>を得る剰余系加算
手段と、 前記剰余系加算手段により得られた剰余系加算結果<z
を混合基数表示に変換する表現変換手段と、 前記表現変換手段により得られた混合基数表示された加
算結果zと、前記混合基数系倍数設定手段内の各倍数デ
ータとに基づいて、前記混合基数表示された加算結果z
が最大でj倍(0≦j≦h)の倍数データjpを含む旨
(jp≦z<(j+1)p)を判定し、倍数jを決定する倍
数決定手段と、 前記倍数決定手段により得られた倍数jに基づいて、前
記剰余系加算手段により得られた剰余系加算結果<z>
から前記剰余系倍数設定手段内のj倍の倍数データj
*<p>を減算し、得られた法pでの剰余系加算結果
<z>を出力する加算結果出力手段とを備えたことを
特徴とする剰余系演算装置。
1. A remainder system arithmetic unit for adding a plurality of remainder system data <x> A , <y> A represented by the remainder system by the modulus A under the modulus p (: p <A). In advance, in the mixed radix notation, the modulus p is multiplied by h (h = 1 to a positive integer)
Mixed radix system multiple setting means for setting a plurality of multiple data (p, 2p, ..., hp), and a plurality of multiple data (<p> A , 2 obtained by multiplying the modulus p by h in advance by the remainder system expression). * <P> A , ..., h * <p> A ) and the remainder system data <x> A , <y> A that is input and the remainder system multiple setting means are set by the remainder system expression to obtain the remainder. System addition result <z> remainder system addition means for obtaining A , and remainder system addition result <z obtained by the remainder system addition means
> Based on the expression conversion means for converting A into the mixed radix representation, the addition result z displayed by the mixed radix displayed by the expression conversion means, and each multiple data in the mixed radix system multiple setting means, Addition result z displayed in mixed radix
Is determined to include the multiple data jp of j times (0 ≦ j ≦ h) at the maximum (jp ≦ z <(j + 1) p), and the multiple determination means determines the multiple j, and the multiple determination means. Based on the obtained multiple j, the remainder addition result <z> obtained by the remainder addition means
Multiple data j from A to j times in the remainder system multiple setting means
* <P> A subtraction system, and an addition result output means for outputting a remainder system addition result <z> A in the obtained modulus p.
【請求項2】 法Aで剰余系表現された複数の剰余系デ
ータ<x>,<y>に関し、法p(:p<A)の下
で前記<x>から前記<y>を減算するための剰余
系演算装置であって、 予め混合基数表示で法pをh倍(h=1〜hの正整数)
した複数の倍数データ(p,2p,…,hp)が設定さ
れる混合基数系倍数設定手段と、 予め前記剰余系表現で前記法pをh倍した複数の倍数デ
ータ(<p>,2*<p>,…,h*<p>)が
設定される剰余系倍数設定手段と、 前記法pの剰余系表現を<p>とするとき、前記<y
の上限値を越える倍数データd*<p>を用い、
前記d*<p>から前記<y>を剰余系表現で減算
し、正の剰余系減算結果<S>を得る剰余系減算手段
と、 前記剰余系減算手段により得られた正の剰余系減算結果
<S>と前記<x> とを剰余系表現で加算し、剰余
系加算結果<z>を得る剰余系加算手段と、 前記剰余系加算手段により得られた剰余系加算結果<z
を混合基数表示に変換する表現変換手段と、 前記表現変換手段により得られた混合基数表示された加
算結果zと、前記混合基数系倍数設定手段内の各倍数デ
ータとに基づいて、前記混合基数表示された加算結果z
が最大でj倍(0≦j≦h)の倍数データjpを含む旨
(jp≦z<(j+1)p)を判定し、倍数jを決定する倍
数決定手段と、 前記倍数決定手段により得られた倍数jに基づいて、前
記剰余系加算手段により得られた剰余系加算結果<z>
から前記剰余系倍数設定手段内のj倍の倍数データj
*<p>を減算し、得られた法pでの剰余系減算結果
<z>を出力する減算結果出力手段とを備えたことを
特徴とする剰余系演算装置。
2. A plurality of coset systems represented by cosets by the method A.
Data <x>A, <Y>AWith respect to the law p (: p <A)
And the above <x>AFrom above <y>ARemainder for subtracting
System arithmetic device, Pre-mixed radix representation modulo p times (h = positive integer from 1 to h)
Multiple multiple data (p, 2p, ..., hp)
Mixed radix system multiple setting means, In advance, a plurality of multiple d
Data (<p>A, 2 * <p>A,…, H * <p>A)But
Remainder system multiple setting means to be set, <P> is the remainder system representation of the modulus pAAnd then <y
>AData that exceeds the upper limit value of d * <p>AUsing
D * <p>AFrom above <y>ASubtract with modulo expression
Then, the positive remainder subtraction result <S>ARemainder subtraction means for obtaining
When, Positive remainder subtraction result obtained by the remainder subtraction means
<S>AAnd the above <x> AAnd are added in the remainder system representation, and the remainder
System addition result <z>ARemainder system addition means for obtaining Remainder system addition result <z obtained by the remainder system adding means
>AExpression conversion means for converting to a mixed radix representation, The added number displayed by the mixed radix obtained by the expression conversion means.
The calculation result z and each multiple number in the mixed radix system multiple setting means.
And the addition result z displayed as the mixed radix based on
Contains a maximum of j times (0 ≦ j ≦ h) multiple data jp
(Jp ≦ z <(j + 1) p) is determined and the multiple j is determined.
Number determination means, Based on the multiple j obtained by the multiple determining means,
Remainder system addition result <z> obtained by the remainder system addition means
AFrom j to the multiple data j in the remainder system multiple setting means
* <P>AIs subtracted, and the remainder subtraction result by the obtained modulus p
<Z>AAnd a subtraction result output means for outputting
Characteristic remainder arithmetic unit.
【請求項3】 法Aで剰余系表現された複数の剰余系デ
ータ<x>,<y>同士を法p(:p<A)の下で
加算するための剰余系演算装置であって、 予め2進数表現で法pをh倍(h=1〜hの正整数)し
た複数の倍数データのうち、上位w桁を示す近似値デー
タ(p’,2p’,…,hp’)が設定される2進数系
倍数設定手段と、 予め前記剰余系表現で前記法pをh倍した複数の倍数デ
ータ(<p>,2*<p>,…,h*<p>)が
設定される剰余系倍数設定手段と、 入力された剰余系データ<x>,<y>を剰余系表
現で加算し、剰余系加算結果<z>を得る剰余系加算
手段と、 前記剰余系加算手段により得られた剰余系加算結果<z
を上位w桁の近似値で2進数表現に変換する近似変
換手段と、 前記近似変換手段により得られた2進数表現の近似値デ
ータz’と、前記2進数系倍数設定手段内の各近似値デ
ータとに基づいて、前記加算結果の近似値データz’が
最大でj倍(0≦j≦h)の近似値データjp’を含む
旨(jp’<z’≦(j+1)p’)を判定し、倍数jを決
定する倍数決定手段と、 前記倍数決定手段により得られた倍数jに基づいて、前
記剰余系加算手段により得られた剰余系加算結果<z>
から前記剰余系倍数設定手段内のj倍の倍数データj
*<p>を減算し、得られた法pでの剰余系加算結果
<z>を出力する加算結果出力手段とを備えたことを
特徴とする剰余系演算装置。
3. A coset arithmetic unit for adding a plurality of coset data <x> A and <y> A represented by coset modulo A under modulo p (: p <A). Then, approximate value data (p ′, 2p ′, ..., hp ′) showing the upper w digit among a plurality of multiple data obtained by multiplying modulo p by a binary expression in advance (h = 1 to a positive integer). And a plurality of multiple data (<p> A , 2 * <p> A , ..., H * <p> A) obtained by multiplying the modulus p by h in advance by the remainder system representation. ) Is set, and the remainder system addition means that obtains the remainder system addition result <z> A by adding the inputted remainder system data <x> A , <y> A in a remainder system expression , The remainder addition result <z obtained by the remainder addition means
> An approximate conversion means for converting the A into a binary number expressed in the approximation of upper w positions, the approximate value of the binary representation to the data z 'obtained by the approximate conversion means, each of said binary number system multiple configuration means Based on the approximate value data, the fact that the approximate value data z ′ of the addition result includes the maximum j times (0 ≦ j ≦ h) approximate value data jp ′ (jp ′ <z ′ ≦ (j + 1) p ') is determined to determine the multiple j, and the remainder addition result <z> obtained by the remainder addition unit based on the multiple j obtained by the multiple determination means.
Multiple data j from A to j times in the remainder system multiple setting means
* <P> A subtraction system, and an addition result output means for outputting a remainder system addition result <z> A in the obtained modulus p.
【請求項4】 法Aで剰余系表現された複数の剰余系デ
ータ<x>,<y>に関し、法p(:p<A)の下
で前記<x>から前記<y>を減算するための剰余
系演算装置であって、 予め2進数表現で法pをh倍(h=1〜hの正整数)し
た複数の倍数データのうち、上位w桁を示す近似値デー
タ(p’,2p’,…,hp’)が設定される2進数系
倍数設定手段と、 予め前記剰余系表現で前記法pをh倍した複数の倍数デ
ータ(<p>,2*<p>,…,h*<p>)が
設定される剰余系倍数設定手段と、 前記法pの剰余系表現を<p>とするとき、前記<y
の上限値を越える倍数データd*<p>を用い、
前記d*<p>から前記<y>を剰余系表現で減算
し、正の剰余系減算結果<S>を得る剰余系減算手段
と、 前記剰余系減算手段により得られた正の剰余系減算結果
<S>と前記<x> とを剰余系表現で加算し、剰余
系加算結果<z>を得る剰余系加算手段と、 前記剰余系加算手段により得られた剰余系加算結果<z
を上位w桁の近似値で2進数表現に変換する近似変
換手段と、 前記近似変換手段により得られた2進数表現の近似値デ
ータz’と、前記2進数系倍数設定手段内の各近似値デ
ータとに基づいて、前記加算結果の近似値データz’が
最大でj倍(0≦j≦h)の近似値データjp’を含む
旨(jp’<z’≦(j+1)p’)を判定し、倍数jを決
定する倍数決定手段と、 前記倍数決定手段により得られた倍数jに基づいて、前
記剰余系加算手段により得られた剰余系加算結果<z>
から前記剰余系倍数設定手段内のj倍の倍数データj
*<p>を減算し、得られた法pでの剰余系減算結果
<z>を出力する減算結果出力手段とを備えたことを
特徴とする剰余系演算装置。
4. A plurality of cosets represented by cosets by method A
Data <x>A, <Y>AWith respect to the law p (: p <A)
And the above <x>AFrom above <y>ARemainder for subtracting
System arithmetic device, Preliminarily multiply the modulus p by a binary expression (h = 1 to a positive integer).
Approximate value data showing the upper w digit of multiple multiple data
A binary number system in which data (p ', 2p', ..., hp ') is set
Multiple setting means, In advance, a plurality of multiple d
Data (<p>A, 2 * <p>A,…, H * <p>A)But
Remainder system multiple setting means to be set, <P> is the remainder system representation of the modulus pAAnd then <y
>AData that exceeds the upper limit value of d * <p>AUsing
D * <p>AFrom above <y>ASubtract with modulo expression
Then, the positive remainder subtraction result <S>ARemainder subtraction means for obtaining
When, Positive remainder subtraction result obtained by the remainder subtraction means
<S>AAnd the above <x> AAnd are added in the remainder system representation, and the remainder
System addition result <z>ARemainder system addition means for obtaining Remainder system addition result <z obtained by the remainder system adding means
>AIs converted to a binary number with an approximate value of the upper w digits.
Exchange means, Approximate value data in binary representation obtained by the approximate conversion means
Data z'and the approximate value data in the binary system multiple setting means.
The approximate value data z ′ of the addition result based on
Includes maximum j times (0 ≦ j ≦ h) approximate value data jp ′
(Jp '<z' ≤ (j + 1) p ') is determined and the multiple j is determined.
A means for determining a multiple to be determined, Based on the multiple j obtained by the multiple determining means,
Remainder system addition result <z> obtained by the remainder system addition means
AFrom j to the multiple data j in the remainder system multiple setting means
* <P>AIs subtracted, and the remainder subtraction result by the obtained modulus p
<Z>AAnd a subtraction result output means for outputting
Characteristic remainder arithmetic unit.
【請求項5】 互いに素なn個の整数の組{a
,…,a}を基底とし、A=a*a*…*a
に対して条件0≦x,y<Aを満たす2整数をx,y
とし、前記整数xの剰余系表現を(x,x,…,x
)とし、前記整数yの剰余系表現を(y,y
…,y)とするとき、p<Aを満たす正整数pを法p
として前記x,yの剰余系加算結果z=x+y(mod
p)=(z ,z,…,z)を算出するための剰
余系演算方法であって、 剰余系加算の式z=x+y(mod a)(1
≦i≦n)に基づいて、法Aでの剰余系加算結果zを要
素z毎に算出する剰余系加算工程と、 前記剰余系加算工程で得られた要素z及び下記v
各式に基づいて、前記剰余系加算結果zを混合基数表示
(v,v,…,v)に変換する表現変換工程と、 前記表現変換工程で得られた混合基数表示された加算結
果zと、混合基数表示された法pをj倍した値{p,2
p,…,jp,…,hp}(但し、1≦j≦h)とを比
較する法p比較工程と、 前記法pの剰余系表現を(p,p,…,p)とす
るとき、前記法p比較工程の比較結果に基づいて、(j
p≦z<(j+1)pならばz=z−j*p(mod
)(1≦i≦n)を実行し、hp≦zならばz
=z−h*p (mod a)(1≦i≦n)を実
行することにより、前記法pでの剰余系加算結果zを算
出する(mod p)実行工程とを含んでいることを特
徴とする剰余系演算方法。 v=z(mod a) v=(z−v)*C12(mod a) v=((z−v)*C13−v)*C23(mod a) : v=((z−v)*C1n−v)*C2n−……−v(n-1))*C(n-1)n( mod a) 但し、Cji=aj -1mod a、(j=1,2,…,i−1)
5. A set of n disjoint integers {a1
aTwo, ..., an} As a base, and A = a1* ATwo* ... * a
nFor two integers that satisfy the condition 0 ≦ x, y <A
And the remainder system representation of the integer x is (x1, XTwo, ..., x
n) And the remainder system representation of the integer y is (y1, YTwo
…, Yn), A positive integer p satisfying p <A is modulo p
As the remainder system addition result of x and y, z = x + y (mod
  p) = (z 1, ZTwo,…, Zn) To calculate
A coset operation method, Remainder addition formula zi= Xi+ Yi(Mod ai) (1
≦ i ≦ n), the remainder system addition result z in Modulus A is required.
Element ziThe remainder system addition process calculated for each The element z obtained in the remainder system addition stepiAnd the following viof
Based on each formula, the remainder system addition result z is displayed as a mixed radix
(V1, VTwo, ..., vn) Expression conversion process, Addition result displayed in the mixed radix obtained in the expression conversion step
A value obtained by multiplying the result z and the modulus p displayed in the mixed radix by j {p, 2
p, ..., jp, ..., hp} (where 1 ≦ j ≦ h)
Comparing method p comparing step, The remainder system representation of the modulus p is (p1, PTwo,,, pn)
Based on the comparison result of the method p comparison step, (j
If p ≦ z <(j + 1) p, zi= Zi-J * pi(Mod
 ai) (1 ≦ i ≦ n), and if hp ≦ z, zi
= Zi-H * p i(Mod ai) (1 ≤ i ≤ n)
By executing the calculation, the remainder addition result z in the modulus p is calculated.
And the execution process to be executed (mod p).
Remainder system calculation method. v1= Z1(Mod a1) vTwo= (ZTwo-V1) * C12(Mod aTwo) vThree= ((ZThree-V1) * C13-VTwo) * Ctwenty three(Mod aThree)     : vn= ((ZThree-V1) * C1n-VTwo) * C2n-...- v(n-1)) * C(n-1) n( mod an)   However, Cji= Aj -1mod ai, (J = 1, 2, ..., i-1)
【請求項6】 互いに素なn個の整数の組{a
,…,a}を基底とし、A=a*a*…*a
に対して条件0≦x,y<Aを満たす2整数をx,y
とし、前記整数xの剰余系表現を(x,x,…,x
)とし、前記整数yの剰余系表現を(y,y
…,y)とするとき、p<Aを満たす正整数pを法p
として前記x,yの剰余系減算結果z=x−y(mod
p)=(z ,z,…,z)を算出するための剰
余系演算方法であって、 前記pの剰余系表現を(p,p,…,p)とする
とき、前記yの上限値を超えるpの倍数d*pを用い、
剰余系減算の式s=d*p−y(moda
(1≦i≦n)により、正の剰余系減算結果s=
(s,s,…,s )を算出する剰余系減算工程
と、 前記剰余系減算工程により得られた要素sを用い、剰
余系加算の式z=s +x(mod a)(1≦
i≦n)に基づいて、法Aでの剰余系加算結果zを要素
毎に算出する剰余系加算工程と、 前記剰余系加算工程で得られた要素z及び下記v
各式に基づいて、前記剰余系加算結果zを混合基数表示
(v,v,…,v)に変換する表現変換工程と、 前記表現変換工程で得られた混合基数表示された加算結
果zと、混合基数表示された法pをj倍した値{p,2
p,…,jp,…,hp}(但し、1≦j≦h)とを比
較する法p比較工程と、 前記法pの剰余系表現を(p,p,…,p)とす
るとき、前記法p比較工程の比較結果に基づいて、(j
p≦z<(j+1)pならばz=z−j*p(mod
)(1≦i≦n)を実行し、hp≦zならばz
=z−h*p (mod a)(1≦i≦n)を実
行することにより、前記法pでの剰余系減算結果zを算
出する(mod p)実行工程とを含んでいることを特
徴とする剰余系演算方法。 v=z(mod a) v=(z−v)*C12(mod a) v=((z−v)*C13−v)*C23(mod a) : v=((z−v)*C1n−v)*C2n−……−v(n-1))*C(n-1)n( mod a) 但し、Cji=aj -1mod a、(j=1,2,…,i−1)
6. A disjoint set of n integers {a1
aTwo, ..., an} As a base, and A = a1* ATwo* ... * a
nFor two integers that satisfy the condition 0 ≦ x, y <A
And the remainder system representation of the integer x is (x1, XTwo, ..., x
n) And the remainder system representation of the integer y is (y1, YTwo
…, Yn), A positive integer p satisfying p <A is modulo p
As the remainder subtraction result of x and y, z = xy (mod
  p) = (z 1, ZTwo,…, Zn) To calculate
A coset operation method, The remainder system representation of p is (p1, PTwo,,, pn) And
At this time, using a multiple d * p of p that exceeds the upper limit of y,
Cosmic subtraction formula si= D * pi-Yi(Modai)
(1 ≦ i ≦ n), the positive remainder subtraction result s =
(S1, STwo,…, S n) Calculating remainder system subtraction process
When, The element s obtained by the remainder subtraction stepiUsing
Formula z of coset additioni= S i+ Xi(Mod ai) (1 ≤
i ≤ n) based on the remainder system addition result z in the modulus A
ziThe remainder system addition process calculated for each The element z obtained in the remainder system addition stepiAnd the following viof
Based on each formula, the remainder system addition result z is displayed as a mixed radix
(V1, VTwo, ..., vn) Expression conversion process, Addition result displayed in the mixed radix obtained in the expression conversion step
A value obtained by multiplying the result z and the modulus p displayed in the mixed radix by j {p, 2
p, ..., jp, ..., hp} (where 1 ≦ j ≦ h)
Comparing method p comparing step, The remainder system representation of the modulus p is (p1, PTwo,,, pn)
Based on the comparison result of the method p comparison step, (j
If p ≦ z <(j + 1) p, zi= Zi-J * pi(Mod
 ai) (1 ≦ i ≦ n), and if hp ≦ z, zi
= Zi-H * p i(Mod ai) (1 ≤ i ≤ n)
By executing the calculation, the remainder subtraction result z in the modulus p is calculated.
And the execution process to be executed (mod p).
Remainder system calculation method. v1= Z1(Mod a1) vTwo= (ZTwo-V1) * C12(Mod aTwo) vThree= ((ZThree-V1) * C13-VTwo) * Ctwenty three(Mod aThree)     : vn= ((ZThree-V1) * C1n-VTwo) * C2n-...- v(n-1)) * C(n-1) n( mod an)   However, Cji= Aj -1mod ai, (J = 1, 2, ..., i-1)
【請求項7】 互いに素なn個の整数の組{a
,…,a}を基底とし、A=a*a*…*a
に対して条件0≦x,y<Aを満たす2整数をx,y
とし、前記整数xの剰余系表現を(x,x,…,x
)とし、前記整数yの剰余系表現を(y,y
…,y)とするとき、p<Aを満たす正整数pを法p
として前記x,yの剰余系加算結果z=x+y(mod
p)=(z ,z,…,z)を算出するための剰
余系演算方法であって、 剰余系加算の式z=x+y(mod a)(1
≦i≦n)に基づいて、法Aでの剰余系加算結果zを要
素z毎に算出する剰余系加算工程と、 前記Aを前記aで除した値をA(=A/a)と
し、A -1を法aにおける前記Aの乗法逆元とした
とき、前記剰余系加算工程で得られた要素zに基づい
て、下記Σの式を満たす正整数kを算出するパラメー
タ算出工程と、 前記剰余系加算工程で得られた要素z、前記パラメー
タ算出工程で得られた前記正整数k及び下記Σの式に
基づいて、前記剰余系加算結果zを2進数表現した値の
上位wビット(但し、wは演算装置本体の基本演算幅以
下)の近似値z’を算出する近似変換工程と、 前記近似変換工程で得られた2進数表現の近似値z’
と、2進数表現された法pをj倍した値の上位wビット
の近似値{p’,(2p)’,…,(jp)’,…,
(hp)’}(但し、1≦j≦h)とを比較する法p比
較工程と、 前記法pの剰余系表現を(p,p,…,p)とす
るとき、前記法p比較工程の比較結果に基づいて、(j
p)’<z’≦((j+1)p)’ならばz=z −j*
(mod a)(1≦i≦n)を実行し、(h
p)’<z’ならばz=z−h*p(mod a
)(1≦i≦n)を実行することにより、前記法pで
の剰余系加算結果zを算出する(mod p)実行工程
とを含んでいることを特徴とする剰余系演算方法。 【数1】
7. A set of n disjoint integers {a1
aTwo, ..., an} As a base, and A = a1* ATwo* ... * a
nFor two integers that satisfy the condition 0 ≦ x, y <A
And the remainder system representation of the integer x is (x1, XTwo, ..., x
n) And the remainder system representation of the integer y is (y1, YTwo
…, Yn), A positive integer p satisfying p <A is modulo p
As the remainder system addition result of x and y, z = x + y (mod
  p) = (z 1, ZTwo,…, Zn) To calculate
A coset operation method, Remainder addition formula zi= Xi+ Yi(Mod ai) (1
≦ i ≦ n), the remainder system addition result z in Modulus A is required.
Element ziThe remainder system addition process calculated for each The A is the aiA divided byi(= A / ai)When
Then Ai -1The law aiIn AiMultiplicative inverse element of
Then, the element z obtained in the remainder addition stepiBased on
To calculate a positive integer k that satisfies the following Σ
Data calculation process, The element z obtained in the remainder system addition stepi, The parameter
The positive integer k obtained in the step of calculating
Based on the value obtained by expressing the remainder system addition result z in binary.
Higher-order w bits (however, w is less than the basic operation width of the arithmetic unit body
An approximation conversion step of calculating an approximation value z ′ of (below), Approximate value z'in the binary representation obtained in the approximate conversion step
And the upper w bits of the value obtained by multiplying the binary representation modulo p by j
The approximate value of {p ', (2p)', ..., (jp) ', ...,
(Hp) ′} (where 1 ≦ j ≦ h)
Comparison process, The remainder system representation of the modulus p is (p1, PTwo,,, pn)
Based on the comparison result of the method p comparison step, (j
If p) '<z' ≤ ((j + 1) p) ', then zi= Z i-J *
pi(Mod ai) (1 ≦ i ≦ n), and (h
If p) '<z', then zi= Zi-H * pi(Mod a
i) (1 ≦ i ≦ n),
Execution step of calculating the remainder system addition result z (mod p)
A coset arithmetic method characterized by including and. [Equation 1]
【請求項8】 請求項7に記載の剰余系演算方法におい
て、 前記パラメータ算出工程は、下記式に従って正整数kを
算出することを特徴とする剰余系演算方法。 【数2】
8. The coset arithmetic method according to claim 7, wherein the parameter calculating step calculates a positive integer k according to the following equation. [Equation 2]
【請求項9】 請求項7に記載の剰余系演算方法におい
て、 前記法p比較工程は、前記pのj倍に関する近似値に代
えて、M*pをj倍した値の上位wビットの近似値
{(M*p)’,(2M*p)’,…,(hM*
p)’}(但し、1≦j≦h)を用いて前記比較を行
い、 前記(mod p)実行工程は、前記pのj倍に関する
比較結果に代えて、前記法p比較工程によるM*pのj
倍に関する比較結果に基づいて、(jM*p)’<z’
≦((j+1)M*p)’(但しj<h)ならばz=z
−jM*p(mod a)(1≦i≦n)を実行
し、(hM*p)’<z’ならばz=z −(hM*
)(mod a)(1≦i≦n)を実行すること
により、前記法pでの剰余系加算結果zを算出すること
を特徴とする剰余系演算方法。
9. The coset arithmetic method according to claim 7.
hand, The method p comparison step substitutes an approximate value for j times p.
Therefore, the approximate value of the upper w bits of the value obtained by multiplying M * p by j
{(M * p) ', (2M * p)', ..., (hM *
p) ′} (where 1 ≦ j ≦ h) is used to perform the comparison.
I The (mod p) execution step relates to j times the p.
Instead of the comparison result, j of M * p obtained by the method p comparison step is used.
(JM * p) '<z'
≤ ((j + 1) M * p) '(where j <h), zi= Zi
-JM * pi(Mod ai) (1 ≦ i ≦ n)
And if (hM * p) '<z', then zi= Z i-(HM *
pi) (Mod ai) (1 ≦ i ≦ n)
To calculate the remainder system addition result z by the above-mentioned method p
A coset arithmetic method characterized by.
【請求項10】 互いに素なn個の整数の組{a,a
,…,a}を基底とし、A=a*a*…*a
に対して条件0≦x,y<Aを満たす2整数をx,yと
し、前記整数xの剰余系表現を(x,x,…,
)とし、前記整数yの剰余系表現を(y,y
…,y)とするとき、p<Aを満たす正整数pを法p
として前記x,yの剰余系減算結果z=x−y(mod
p)=(z,z,…,z)を算出するための剰
余系演算方法であって、 前記pの剰余系表現を(p,p,…,p)とする
とき、前記yの上限値を超えるpの倍数d*pを用い、
剰余系減算の式s=d*p−y(moda
(1≦i≦n)により、正の剰余系減算結果s=
(s,s,…,s )を算出する剰余系減算工程
と、 前記剰余系減算工程により得られた要素sを用い、剰
余系加算の式z=s +x(mod a)(1≦
i≦n)に基づいて、法Aでの剰余系加算結果zを要素
毎に算出する剰余系加算工程と、 前記Aを前記aで除した値をA(=A/a)と
し、A -1を法aにおける前記Aの乗法逆元とした
とき、前記剰余系加算工程で得られた要素zに基づい
て、下記Σの式を満たす正整数kを算出するパラメー
タ算出工程と、 前記剰余系加算工程で得られた要素z、前記パラメー
タ算出工程で得られた前記正整数k及び下記Σの式に
基づいて、前記剰余系加算結果zを2進数表現した値の
上位wビット(但し、wは演算装置本体の基本演算幅以
下)の近似値z’を算出する近似変換工程と、 前記近似変換工程で得られた2進数表現の近似値z’
と、2進数表現された法pをj倍した値の上位wビット
の近似値{p’,(2p)’,…,(jp)’,…,
(hp)’}(但し、1≦j≦h)とを比較する法p比
較工程と、 前記法pの剰余系表現を(p,p,…,p)とす
るとき、前記法p比較工程の比較結果に基づいて、(j
p)’<z’≦((j+1)p)’ならばz=z −j*
(mod a)(1≦i≦n)を実行し、(h
p)’<z’ならばz=z−h*p(mod a
)(1≦i≦n)を実行することにより、前記法pで
の剰余系減算結果zを算出する(mod p)実行工程
とを含んでいることを特徴とする剰余系演算方法。 【数3】
10. A set of n disjoint integers {a1, A
Two, ..., an} As a base, and A = a1* ATwo* ... * an
For two integers that satisfy the condition 0 ≦ x, y <A
Then, the remainder system representation of the integer x is (x1, XTwo,… ,
xn) And the remainder system representation of the integer y is (y1, YTwo
…, Yn), A positive integer p satisfying p <A is modulo p
As the remainder subtraction result of x and y, z = xy (mod
  p) = (z1, ZTwo,…, Zn) To calculate
A coset operation method, The remainder system representation of p is (p1, PTwo,,, pn) And
At this time, using a multiple d * p of p that exceeds the upper limit of y,
Cosmic subtraction formula si= D * pi-Yi(Modai)
(1 ≦ i ≦ n), the positive remainder subtraction result s =
(S1, STwo,…, S n) Calculating remainder system subtraction process
When, The element s obtained by the remainder subtraction stepiUsing
Formula z of coset additioni= S i+ Xi(Mod ai) (1 ≤
i ≤ n) based on the remainder system addition result z in the modulus A
ziThe remainder system addition process calculated for each The A is the aiA divided byi(= A / ai)When
Then Ai -1The law aiIn AiMultiplicative inverse element of
Then, the element z obtained in the remainder addition stepiBased on
To calculate a positive integer k that satisfies the following Σ
Data calculation process, The element z obtained in the remainder system addition stepi, The parameter
The positive integer k obtained in the step of calculating
Based on the value obtained by expressing the remainder system addition result z in binary.
Higher-order w bits (however, w is less than the basic operation width of the arithmetic unit body
An approximation conversion step of calculating an approximation value z ′ of (below), Approximate value z'in the binary representation obtained in the approximate conversion step
And the upper w bits of the value obtained by multiplying the binary representation modulo p by j
The approximate value of {p ', (2p)', ..., (jp) ', ...,
(Hp) ′} (where 1 ≦ j ≦ h)
Comparison process, The remainder system representation of the modulus p is (p1, PTwo,,, pn)
Based on the comparison result of the method p comparison step, (j
If p) '<z' ≤ ((j + 1) p) ', then zi= Z i-J *
pi(Mod ai) (1 ≦ i ≦ n), and (h
If p) '<z', then zi= Zi-H * pi(Mod a
i) (1 ≦ i ≦ n),
Execution step of calculating the modulo subtraction result z (mod p)
A coset arithmetic method characterized by including and. [Equation 3]
JP2000014868A 2000-01-24 2000-01-24 Remainder arithmetic device and method Expired - Fee Related JP3515462B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000014868A JP3515462B2 (en) 2000-01-24 2000-01-24 Remainder arithmetic device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000014868A JP3515462B2 (en) 2000-01-24 2000-01-24 Remainder arithmetic device and method

Publications (2)

Publication Number Publication Date
JP2001202232A JP2001202232A (en) 2001-07-27
JP3515462B2 true JP3515462B2 (en) 2004-04-05

Family

ID=18542253

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000014868A Expired - Fee Related JP3515462B2 (en) 2000-01-24 2000-01-24 Remainder arithmetic device and method

Country Status (1)

Country Link
JP (1) JP3515462B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4279626B2 (en) * 2003-07-31 2009-06-17 株式会社アドバンテスト Remainder calculation system, scaling calculator, scaling calculation method, program thereof and recording medium
US8611530B2 (en) * 2007-05-22 2013-12-17 Harris Corporation Encryption via induced unweighted errors

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
K.C.Posch et al.,Modulo reduction in residue number systems,IEEE Trans. on Parallel and Distributed Systems,米国,IEEE,1995年 5月,Vol.6, No.5,pp.449−454

Also Published As

Publication number Publication date
JP2001202232A (en) 2001-07-27

Similar Documents

Publication Publication Date Title
US7904498B2 (en) Modular multiplication processing apparatus
TW550498B (en) Method and apparatus for modular multiplying and calculating unit for modular multiplying
JPS6347874A (en) Arithmetic unit
JPH0612229A (en) Multiplication and accumulation circuit
JP3532860B2 (en) Arithmetic device, method, and program using remainder representation
CN113467752B (en) Division operation device, data processing system and method for private calculation
EP1672481B1 (en) Division and square root arithmetic unit
JP3515462B2 (en) Remainder arithmetic device and method
TWI274291B (en) Apparatus and method for alpha blending of digital images
JP4182226B2 (en) Remainder calculation method, apparatus and program
JP4202701B2 (en) Polynomial residue arithmetic unit, method and program
JP3787075B2 (en) Subgroup origin determination device of rational point group on curve, program thereof, and recording medium thereof
WO2022124010A1 (en) Arithmetic and control device, arithmetic and control method, and recording medium
JPH0831024B2 (en) Arithmetic processor
Kaihara et al. A hardware algorithm for modular multiplication/division based on the extended Euclidean algorithm
Krishnamurthy On the conversion of Hensel codes to Farey rationals
US20100030836A1 (en) Adder, Synthesis Device Thereof, Synthesis Method, Synthesis Program, and Synthesis Program Storage Medium
JP3335769B2 (en) Fixed-point square root arithmetic unit
JP3390966B2 (en) Remainder arithmetic device modulo square number and program recording medium therefor
JP3136709B2 (en) Exponentiation unit
JP3766250B2 (en) Product operation device and program recording medium thereof
JPH0314128A (en) Arithmetic unit utilizing logarithmic expression numerical value
JP4197245B2 (en) Elliptic curve calculation device, conversion device, elliptic curve calculation method and program for elliptic curve calculation device, and computer-readable recording medium
JP4080754B2 (en) Remainder calculation apparatus and method
JP2000010763A (en) Division circuit

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040113

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040115

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

Free format text: PAYMENT UNTIL: 20080123

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090123

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100123

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110123

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees