JPH05324277A - Code communication method - Google Patents

Code communication method

Info

Publication number
JPH05324277A
JPH05324277A JP4124982A JP12498292A JPH05324277A JP H05324277 A JPH05324277 A JP H05324277A JP 4124982 A JP4124982 A JP 4124982A JP 12498292 A JP12498292 A JP 12498292A JP H05324277 A JPH05324277 A JP H05324277A
Authority
JP
Japan
Prior art keywords
mod
input
output
multiplication
modular
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.)
Granted
Application number
JP4124982A
Other languages
Japanese (ja)
Other versions
JP3302043B2 (en
Inventor
Keiichi Iwamura
恵市 岩村
Takahisa Yamamoto
貴久 山本
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP12498292A priority Critical patent/JP3302043B2/en
Priority to US07/941,236 priority patent/US5321752A/en
Priority to DE69229766T priority patent/DE69229766T2/en
Priority to EP92308056A priority patent/EP0531158B1/en
Priority to AT92308056T priority patent/ATE183315T1/en
Publication of JPH05324277A publication Critical patent/JPH05324277A/en
Priority to HK98112269A priority patent/HK1011430A1/en
Application granted granted Critical
Publication of JP3302043B2 publication Critical patent/JP3302043B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To provide the circuit executing the power residue arithmetic operation and the residue multiplication at high speed with smaller circuit by repeatedly executing the residue multiplication using both modulo N and prime R of the residue. CONSTITUTION:In the residue arithmetic circuit, the outputs for input pairs (A, RR), (B, RR), (AR, BR) (TR, 1) are AR, BR, TR, and Q. In this case, the power residue arithmetic operation and the residue multiplication are executed by repeating the operation of Z=X.Y.R<-1>mod N. Therefore, the required arithmetic operation is executed by the same or similar type arithmetic circuit. In performing the arithmetic operation with the use of the Montgomery residue multiplication Z=X.Y.R<-1>modN=(X.Y+S.N)/R, in this case, S=X.Y.N'modN, the residue multiplication and the power residue arithmetic operation can be executed while simply repeating the Montgomery residue multiplication by using the input value satisfying the condition.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はコンピュータネットワー
クにおけるホームバンク、ファームバンク、電子メール
及び電子会議などの様々な通信サービスに用いられる暗
号化技術に関する。特にべき乗剰余演算及び剰余乗算を
用いる暗号方式(RSA暗号、エルガマル暗号等)、鍵
共有方式(DH型鍵共有方式、ID-based鍵共有方式
等)、零知識証明方式等を用いて暗号通信を行うシステ
ムに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an encryption technique used for various communication services such as home bank, firm bank, electronic mail and electronic conference in a computer network. In particular, cryptographic communication using power-residue calculation and modular multiplication (RSA cryptography, Ergamal cryptography, etc.), key sharing schemes (DH type key sharing scheme, ID-based key sharing scheme, etc.), zero-knowledge proof scheme, etc. Regarding the system to do.

【0002】[0002]

【従来の技術】近年、コンピュータネットワークを用い
た情報通信システムの急速な進展とともに、データ内容
の保護を目的とする暗号技術の重要性が高まっている。
特に、コンピュータネットワークの高速化・大容量化が
進展する中で、高速な暗号技術が不可欠になりつつあ
る。
2. Description of the Related Art In recent years, with the rapid development of information communication systems using computer networks, the importance of encryption technology for protecting data contents is increasing.
In particular, as the speed and capacity of computer networks have increased, high-speed encryption technology has become indispensable.

【0003】かかる暗号技術において、べき乗剰余演算
及び剰余乗算は種々の暗号技術に用いられている重要な
演算であり、次のような利用例を挙げることができる。
In such cryptographic techniques, the modular exponentiation operation and the modular multiplication are important operations used in various cryptographic techniques, and the following usage examples can be given.

【0004】まず、暗号方式には秘密鍵暗号方式と公開
鍵暗号方式があることが知られている。公開鍵暗号方式
では暗号化鍵と復号鍵とが異なり、暗号化鍵は公開し、
復号鍵は受信者が秘密に保持するもので、公開された暗
号化鍵から復号鍵を推定するのが困難なようになってい
るものである。その公開鍵暗号方式としてRSA暗号や
エルガマル暗号などのべき乗剰余演算及び剰余乗算に基
づく暗号がよく用いられている。更にこれらの暗号は、
秘密通信機能の他に認証と呼ばれるもう1つの用途があ
ることが注目されている。認証とは、通信文の送信者が
正しいかどうかを検査する機能であり、ディジタル署名
とも呼ばれている。これらの暗号を用いたディジタル署
名では、送信者のみが知っている秘密鍵で署名でき、偽
造できないので安全であり認証通信として金融機関など
で多く用いられている。
First, it is known that there are a secret key cryptosystem and a public key cryptosystem as cryptosystems. In the public key cryptosystem, the encryption key and the decryption key are different, and the encryption key is open,
The decryption key is kept secret by the receiver, and it is difficult to deduce the decryption key from the publicly available encryption key. As the public key cryptosystem, a cipher based on a modular exponentiation operation and a modular multiplication such as RSA cipher and Ergamal cipher is often used. Furthermore, these ciphers
It is noted that there is another application called authentication besides the secret communication function. Authentication is a function of checking whether the sender of a message is correct, and is also called a digital signature. Digital signatures using these ciphers are safe because they can be signed with a private key known only to the sender and cannot be forged, and are widely used as authentication communication at financial institutions and the like.

【0005】また、同一の鍵を送信者と受信者が秘密に
共有する秘密鍵暗号方式として、乱数をデータに加える
バーナム暗号が知られているが、その乱数として平方剰
余と呼ばれるべき乗剰余演算及び剰余乗算に基づく乱数
が知られている。
As a secret key cryptosystem in which the same key is secretly shared by the sender and the receiver, the Vernam cipher which adds a random number to data is known, and as a random number, a modular exponentiation operation called a modular exponentiation and Random numbers based on modular multiplication are known.

【0006】また、以上の秘密鍵暗号方式及び公開鍵暗
号方式は、鍵配送方式または鍵共有方式と呼ばれる技術
とともに用いられることが多い。鍵配送方式としては、
DiffieとHellman によるDH型鍵配送方式がよく知られ
ているが、この方式もべき乗剰余演算及び剰余乗算を用
いて演算を行う。さらに、鍵共有方式としてID-based
鍵共有方式が注目されているが、この方式を含む種々の
鍵共有方式においてべき乗剰余演算及び剰余乗算が用い
られている。
Further, the secret key cryptosystem and the public key cryptosystem described above are often used together with a technique called a key distribution system or a key sharing system. As a key distribution method,
The DH-type key distribution system by Diffie and Hellman is well known, but this system also performs arithmetic using modular exponentiation and modular multiplication. Furthermore, ID-based is used as a key sharing method.
The key sharing system has been attracting attention, and exponentiation modular exponentiation and modular multiplication are used in various key sharing systems including this system.

【0007】他に、暗号技術には零知識証明と呼ばれる
ものがある。これは自分がある知識を持っていること
を、その内容をいっさい告げることなく(=零知識)、
相手に納得させる(=証明)方法である。これにも、べ
き乗剰余演算及び剰余乗算に基づく種々の手法がある。
Another cryptographic technique is called zero-knowledge proof. This tells me that I have some knowledge (= zero knowledge),
It is a method to convince the other party (= proof). Again, there are various techniques based on the modular exponentiation operation and the modular multiplication.

【0008】以上の暗号技術の詳細については池野信
一,小山謙二著“現代暗号理論”,電子情報通信学会
(1986)及び辻井重男,笠原正雄著“暗号と情報セキュ
リティ”,昭晃堂(1990)等に詳しく説明されている。
For details of the above cryptographic techniques, Shinichi Ikeno and Kenji Koyama “Modern Cryptography”, The Institute of Electronics, Information and Communication Engineers (1986) and Shigeo Tsujii, Masao Kasahara “Cryptography and Information Security”, Shokodo (1990) ) And the like.

【0009】従って、種々の暗号システムを効率よく構
成するために、効率的なべき乗剰余演算及び剰余乗算回
路の実現が望まれていた。更に、高速なべき乗剰余演算
及び剰余乗算回路が構成できれば、種々の暗号システム
の高速化が実現できる。
Therefore, in order to efficiently construct various cryptographic systems, it has been desired to realize an efficient modular exponentiation and modular multiplication circuit. Further, if a high-speed modular exponentiation and modular multiplication circuit can be configured, various cryptographic systems can be speeded up.

【0010】ところで、Nを法とする剰余乗算を演算す
る方法として、Nと素な整数Rを用いて演算を行う手法
がある。例えば、モンゴメリーによって提案された手法
〔モンゴメリー法〕(Montgomery,P.L.:“Modular mult
iplication without trial division, ”Math. of Comp
utation,Vol.44,1985,pp.519-521 )は、Q=A・ Bmod
Nの代わりにQ=A・ B・ R-1 mod Nを演算するこ
とで、除算を行うことなしに剰余乗算を計算することが
できる。
By the way, as a method of calculating a modular multiplication modulo N, there is a method of using an integer R prime to N. For example, the method proposed by Montgomery (Montgomery method) (Montgomery, PL: “Modular mult
iplication without trial division, ”Math. of Comp
utation, Vol.44,1985, pp.519-521), Q = A ・ B mod
By calculating Q = A · B · R −1 mod N instead of N, the remainder multiplication can be calculated without performing division.

【0011】一方、処理を高速化していく1つの手法と
して、並列処理がある。その代表的なアーキテクチャと
してシストリックアレイが知られている。シストリック
アレイは処理を数種類の演算素子(プロセッシング・エ
レメント:以後PE)によるパイプライン処理によって
実行し、高速処理を実現する。また、制御がPE単位の
局所的なものですみ容易である。従って、シストリック
アレイは全体構造の規則性とPE単位の局所性を有し、
VLSI等の大規模な処理の装置化を容易にするアーキ
テクチャとして知られている。このような並列処理的手
法は大規模な処理を必要とする大きな整数に対するべき
乗剰余演算及び剰余乗算の高速化にも適していると考え
られるが、従来の手法の中でシストリックアレイ等の並
列処理的手法をべき乗剰余演算及び剰余乗算に対して適
用したものは殆どなかった。
On the other hand, there is parallel processing as one method for speeding up the processing. A systolic array is known as a typical architecture. The systolic array realizes high-speed processing by executing processing by pipeline processing by several kinds of processing elements (processing elements: hereinafter PE). In addition, the control is local and is easy in PE units. Therefore, the systolic array has regularity of the whole structure and locality of PE unit,
It is known as an architecture that facilitates deviceization of large-scale processing such as VLSI. Such parallel processing method is considered to be suitable for speeding up modular exponentiation and modular multiplication for large integers that require large-scale processing, but among conventional methods, parallel processing such as systolic array Almost no processing techniques have been applied to modular exponentiation and modular multiplication.

【0012】そこで、本出願人は、先に特願平3-225986
号として、シストリックアレイを用いた剰余乗算回路を
提案したが、これはモンゴメリー法を用いたものではな
い。一方、モンゴメリー法を用いたアレイがイブンによ
って提案されている。( Shimon Even: “Systolic mod
ular multiplication,”Advances in Cryptology-CRYPT
O'90,pp.619-624,Springer-Verlag.)
Therefore, the applicant of the present invention has previously filed Japanese Patent Application No. 3-225986.
As the issue, we proposed a modular multiplication circuit using a systolic array, but it does not use the Montgomery method. On the other hand, an array using the Montgomery method has been proposed by Ibn. (Shimon Even: “Systolic mod
ular multiplication, ”Advances in Cryptology-CRYPT
O'90, pp.619-624, Springer-Verlag.)

【0013】[0013]

【発明が解決しようとしている課題】上述のような暗号
システムに用いられるべき乗剰余演算及び剰余乗算で用
いられる整数は、十分な安全性を確保するために512
ビット以上のビット数を持つことが要求される。このよ
うに大きな整数に対するべき乗剰余演算及び剰余乗算を
通常のコンピュータを用いて高速に演算することは困難
であった。
The integer used in the modular exponentiation operation and the modular multiplication used in the above-described cryptosystem is 512 in order to ensure sufficient security.
It is required to have more bits than bits. Thus, it has been difficult to perform high-speed modular exponentiation and modular multiplication for large integers using a normal computer.

【0014】また、モンゴメリー法を繰り返してべき乗
剰余演算を実行する場合、剰余乗算を繰り返す度に出力
の最大ビット数が大きくなり、同じ回路によってべき乗
剰余演算を実行することは困難であった。これについ
て、イブンのアレイは、剰余乗算出力のビット数が入力
値のビット数を越えた場合の処理を行うPEについて示
されておらず、べき乗剰余演算に対しては不十分なもの
になっている。
Further, when the modular exponentiation calculation is executed by repeating the Montgomery method, the maximum number of bits of the output increases each time the modular multiplication is repeated, and it is difficult to execute the modular exponentiation calculation by the same circuit. In this regard, Ibn's array is not shown for a PE that performs processing when the number of bits of the modular multiplication output exceeds the number of bits of the input value, and becomes insufficient for the modular exponentiation operation. There is.

【0015】さらに、従来のモンゴメリー法は後述する
ようにQ=A・ B・ R-1 mod Nの演算を行う前後に、
A,B及びQに対して別の演算を行う必要があり、数種
類の演算手段が必要であった。
Further, in the conventional Montgomery method, as described later, before and after the calculation of Q = A · B · R −1 mod N,
It is necessary to perform another calculation for A, B, and Q, and several kinds of calculation means are necessary.

【0016】また、特に、上述のイブンのアレイは、乗
算T=A・ Bを実行するアレイと、定数として扱われる
Rに対する剰余演算Q=T・ R-1 mod Nを実行するア
レイから構成されている。従って、イブンのシストリッ
クアレイは、Tを演算するアレイとQを演算するアレイ
が2種類必要であるために効率的ではなかった。さら
に、PE内で行なれる演算として1ビット毎の演算のみ
を提案しており、柔軟性に欠けていた。
Further, in particular, the above-mentioned Ibn array is composed of an array for performing multiplication T = A · B and an array for performing a remainder operation Q = T · R −1 mod N for R treated as a constant. ing. Therefore, the Ibn systolic array is not efficient because two types of arrays are required to calculate T and Q. Furthermore, only the operation for each bit is proposed as the operation that can be performed in the PE, which lacks flexibility.

【0017】[0017]

【課題を解決するための手段】そこで、本発明の目的
は、上述の欠点を除去し、暗号通信におけるべき乗剰余
演算及び剰余乗算を、剰余の法となるNと素であるRを
用いた剰余乗算を繰り返すだけで実行する方法を提供す
ることにある。
SUMMARY OF THE INVENTION Therefore, an object of the present invention is to eliminate the above-mentioned drawbacks, and to perform a modular exponentiation operation and a modular multiplication in cryptographic communication, using a modulo R that is a modulo N modulo R. It is to provide a method of executing only by repeating multiplication.

【0018】また、本発明の他の目的は、モンゴメリー
法を用いて、より小さな回路規模で高速にべき乗剰余演
算及び剰余乗算を実行する回路を実現することにある。
Another object of the present invention is to realize a circuit for executing a modular exponentiation operation and a modular multiplication at high speed with a smaller circuit scale by using the Montgomery method.

【0019】かかる課題を解決するために、本発明で
は、Nを法とする整数A、Bの剰余乗算Q=A・ B mod
Nを利用して、通信内容の暗号化または復号を行なう
暗号通信方法において、入力データU、Vに対して、N
と素である整数Rを用いて、Z=U・V・R-1 mod N
を演算して出力する演算部を1つ以上具える。
In order to solve such a problem, according to the present invention, a modular multiplication Q = A · B mod of integers A and B modulo N.
In an encrypted communication method for encrypting or decrypting communication contents by using N, N is applied to input data U and V.
Using an integer R which is prime to Z = U · V · R −1 mod N
It has one or more calculation units for calculating and outputting.

【0020】また、本発明の他の態様によれば、Nを法
とする整数M、eに関するべき乗剰余演算:C=Me mo
d Nを利用して、通信内容の暗号化または復号を行なう
暗号通信方法において、入力データU、Vに対して、N
と素である整数Rを用いて、Z=U・V・R-1 mod N
を演算して出力する演算部を1つ以上具える。
According to another aspect of the present invention, a modular exponentiation operation for integers M and e modulo N: C = M e mo
In the encrypted communication method for encrypting or decrypting communication contents using dN, N is applied to input data U and V.
Using an integer R which is prime to Z = U · V · R −1 mod N
It has one or more calculation units for calculating and outputting.

【0021】また、本発明の他の態様によれば、入力さ
れた整数A、Bに対するNを法とした剰余乗算Q=A・
B mod Nを利用して、通信内容の暗号化または復号を
行なう暗号通信方法において、Nと素である整数Rを用
いて、入力されたA及び前記RよりA・ R mod Nを演
算してその結果をAR とする演算工程と、入力されたB
及び前記RよりB・ R mod Nを演算してその結果をB
R とする演算工程と、前記演算結果AR 、BR 及び前記
Rに基づき、AR・BR ・ R-1 mod Nを求めてその結果
をTR とする演算工程と、前記TR と前記RとによりT
R・R-1 mod Nを演算し、その結果としてQを求める演
算工程とを有し、前記TR を求める演算工程に、Ai
任意の整数vによる前記AR のvビット毎の分割、Y=
v として、 Ti =( Ti-1 +Ai・BR・Y+Mi-1・N)/Y Mi-1 =( Ti-1 mod Y)・( −N-1 mod Y) mod Y の順次演算により実行する演算工程とを具える。
According to another aspect of the present invention, the modular multiplication Q = A.multiplied to the input integers A and B modulo N.
In an encrypted communication method for encrypting or decrypting communication contents using B mod N, an integer R which is a prime to N is used to calculate A · R mod N from the input A and R. The calculation process with the result as A R and the input B
And B · R mod N is calculated from R and the result is B
A calculation step of the R, based on the calculation result A R, B R and the R, a calculation step of the result with T R seeking A R · B R · R -1 mod N, said T R By R and T
Calculates the R · R -1 mod N, as a result and a calculation step of calculating Q, the computation step of obtaining the T R, divided for each v bits of the A R the A i by any integer v , Y =
2 v , T i = (T i-1 + A i · B R · Y + M i-1 · N) / Y M i-1 = (T i-1 mod Y) · (-N -1 mod Y) mod And a calculation step executed by sequential calculation of Y 1.

【0022】また、本発明の他の態様によれば、入力さ
れた整数A、Bに対するNを法とした剰余乗算Q=A・
B mod Nを利用して、通信内容の暗号化または復号を
行なう暗号通信方法において、Nと素である整数Rを用
いて、入力されたA及び前記RよりA・ R mod Nを演
算してその結果をAR とする演算工程と、入力されたB
及び前記RよりB・ R mod Nを演算してその結果をB
R とする演算工程と、前記演算結果AR 、BR 及び前記
Rに基づき、AR・BR ・ R-1 mod Nを求めてその結果
をTR とする演算工程と、前記TR と前記RとによりT
R・R-1 mod Nを演算し、その結果としてQを求める演
算工程とを有し、前記TR を求める演算工程に、Ai
任意の整数vによる前記AR のvビット毎の分割、Y=
v として、 Ti =( Ti-1 /Y+Ai・BR )+Mi・N Mi-1 =((Ti-1 /Y+Ai・BR )mod Y)・( −N-1 mod Y) mod Y の順次演算により実行する演算工程を具える。
Further, according to another aspect of the present invention, a modular multiplication Q = A.multiplied to the input integers A and B modulo N.
In an encrypted communication method for encrypting or decrypting communication contents using B mod N, an integer R which is a prime to N is used to calculate A · R mod N from the input A and R. The calculation process with the result as A R and the input B
And B · R mod N is calculated from R and the result is B
A calculation step of the R, based on the calculation result A R, B R and the R, a calculation step of the result with T R seeking A R · B R · R -1 mod N, said T R By R and T
Calculates the R · R -1 mod N, as a result and a calculation step of calculating Q, the computation step of obtaining the T R, divided for each v bits of the A R the A i by any integer v , Y =
2 v , T i = (T i-1 / Y + A i · B R ) + M i · N M i-1 = ((T i-1 / Y + A i · B R ) mod Y) · (-N −1 mod Y) Computation step executed by sequential computation of mod Y.

【0023】[0023]

【作用】入力データU、Vに対して、Nと素である整数
Rを用いて、Z=U・V・R-1mod Nを演算して出力
する1つ以上の演算部に対して、Aと、RR =R2 mod
Nなる定数RR とを入力して、AR =A・ RR・R-1 mod
Nを出力させ、Bと、前記定数RR とを入力して、BR
=B・ RR・R-1 mod Nを出力させ、出力された前記A
R と前記BR とを入力して、TR =AR・BR ・ R-1 mod
Nを出力させ、出力された前記TR と定数1とを入力
して、TR・1・ R-1 mod NをQとして出力させること
により、前記剰余乗算Q=A・ B mod Nを実行する。
With respect to the input data U and V, using one or more integers R that are prime to N, Z = U · V · R −1 mod N is calculated and output to one or more calculation units. A and R R = R 2 mod
Input N constant R R and input A R = A ・ R R・ R -1 mod
N is output, B and the constant R R are input, and B R
= B · R R · R −1 mod N is output, and the output A
Enter and said and R B R, T R = A R · B R · R -1 mod
N is output, the output T R and constant 1 are input, and T R · 1 · R −1 mod N is output as Q, whereby the modular multiplication Q = A · B mod N is executed. To do.

【0024】入力データU、Vに対して、Nと素である
整数Rを用いて、Z=U・V・R-1mod Nを演算して
出力する1つ以上の演算部に対して、Mと、RR =R2
modNなる定数RR とを入力して、MR =M・ RR・R-1
modNを出力させ、eの2進表現をe=〔et,et-1,…,
1 〕とし、CR の初期値をCR =RR・R-1 modNと
して、順次高位ビットからのei の値に従って、ei
1なるときに、前記演算部に対してCR とMR とを入力
して、CR・MR・R-1 modNを新たなCR として出力さ
せ、更に、前記ei におけるiが1より大なるときに
は、前記演算部に対して2つの入力データとして共にC
R を入力して、CR・CR・R-1 mod Nを新たなCR とし
て出力させ、全ての前記ei に対する処理の終了後に、
前記演算部に対してCR と定数1とを入力して、C=C
R・1・ R-1 mod Nを出力させることにより、前記べき
乗剰余演算C=Me mod Nを実行する。
With respect to the input data U and V, using one or more integer R, which is a prime to N, Z = U · V · R −1 mod N is calculated and output to one or more calculation units, M and R R = R 2
Input the constant R R mod N and M R = M · R R · R −1
modN is output, and the binary representation of e is e = [e t , e t-1 , ...,
and e 1], the initial value of C R as C R = R R · R -1 modN, according to the value of e i from sequentially higher order bits, e i =
When it becomes 1, C R and M R are input to the arithmetic unit to output C R · M R · R −1 mod N as a new C R , and i in i i is 1 When it becomes larger, C is used as two input data to the arithmetic unit.
R is input and C R C R R -1 mod N is output as a new C R , and after the processing for all the e i is finished,
By inputting C R and a constant 1 to the arithmetic unit, C = C
By outputting R · 1 · R −1 mod N, the modular exponentiation operation C = M e mod N is executed.

【0025】入力データU、Vに対して、Nと素である
整数Rを用いて、Z=U・V・R-1mod Nを演算して
出力する1つ以上の演算部に対して、Mと、RR =R2
modNなる定数RR とを入力して、MR =M・ RR・R-1
modNを出力させ、eの2進表現をe=〔et,et-1,…,
1 〕とし、CR の初期値をCR =RR・R-1 modNと
して、順次低位ビットからのei の値に従って、ei
1なるときに、前記演算部に対してCR とMR とを入力
して、CR・MR・R-1 modNを新たなCR として出力さ
せ、更に、前記ei におけるiがtより小なるときに
は、前記演算部に対して2つの入力データとして共にM
R を入力して、MR・MR・R-1 mod Nを新たなMR とし
て出力させ、全ての前記ei に対する処理の終了後に、
前記演算部に対してCR と定数1とを入力して、C=C
R・1・ R-1 mod Nを出力させることにより、前記べき
乗剰余演算C=Me mod Nを実行する。
For the input data U and V, an integer R that is a prime to N is used, and Z = U · V · R −1 mod N is calculated and output to one or more calculation units. M and R R = R 2
Input the constant R R mod N and M R = M · R R · R −1
modN is output, and the binary representation of e is e = [e t , e t-1 , ...,
and e 1], the initial value of C R as C R = R R · R -1 modN, according to the value of e i from sequential low-order bits, e i =
When it becomes 1, C R and M R are input to the arithmetic unit to output C R · M R · R −1 mod N as a new C R , and further, i in e i is t. When it becomes smaller, M is used as two input data for the arithmetic unit.
R is input and M R , M R , R −1 mod N is output as a new M R , and after the processing for all the e i is finished,
By inputting C R and a constant 1 to the arithmetic unit, C = C
By outputting R · 1 · R −1 mod N, the modular exponentiation operation C = M e mod N is executed.

【0026】入力された整数A、Bに対するNを法とし
た剰余乗算Q=A・ B mod Nを、Nと素である整数R
を用いて、入力されたA及び前記RよりA・ R mod N
を演算してその結果をAR とし、入力されたB及び前記
RよりB・ R mod Nを演算してその結果をBR とし、
前記演算結果AR 、BR 及び前記Rに基づき、AR・BR
・ R-1 mod Nを求めてその結果をTR とし、前記TR
と前記RとによりTR・R-1 mod Nを演算し、その結果
としてQを求めるようにし、前記TR を求める演算を、
i を任意の整数vによる前記AR のvビット毎の分
割、Y=2v として、 Ti =( Ti-1 +Ai・BR・Y+Mi-1・N)/Y Mi-1 =( Ti-1 mod Y)・( −N-1 mod Y) mod Y の順次演算により実行する。
The remainder multiplication Q = A · B mod N modulo N to the input integers A and B is an integer R that is prime to N.
By using the input A and the R, A · R mod N
To calculate the result as A R , calculate B · R mod N from the input B and R, and set the result as B R ,
Based on the calculation results A R , B R and R, A R · B R
- seeking R -1 mod N to the result with T R, wherein T R
And R, T R · R −1 mod N is calculated, Q is obtained as a result, and the calculation of T R is performed as follows.
Assuming that A i is a v-bit division of A R by an arbitrary integer v, Y = 2 v , T i = (T i−1 + A i · B R · Y + M i-1 · N) / Y M i- 1 = (T i−1 mod Y) · (−N −1 mod Y) mod Y

【0027】入力された整数A、Bに対するNを法とし
た剰余乗算Q=A・ B mod Nを、Nと素である整数R
を用いて、入力されたA及び前記RよりA・ R mod N
を演算してその結果をAR とし、入力されたB及び前記
RよりB・ R mod Nを演算してその結果をBR とし、
前記演算結果AR 、BR 及び前記Rに基づき、AR・BR
・ R-1 mod Nを求めてその結果をTR とし、前記TR
と前記RとによりTR・R-1 mod Nを演算し、その結果
としてQを求めるようにし、前記TR を求める演算を、
i を任意の整数vによる前記AR のvビット毎の分
割、Y=2v として、 Ti =( Ti-1 /Y+Ai・BR )+Mi・N Mi-1 =((Ti-1 /Y+Ai・BR )mod Y)・( −N-1 mod Y) mod Y の順次演算により実行する。
The remainder multiplication Q = A · B mod N modulo N to the input integers A and B is an integer R that is prime to N.
By using the input A and the R, A · R mod N
To calculate the result as A R , calculate B · R mod N from the input B and R, and set the result as B R ,
Based on the calculation results A R , B R and R, A R · B R
- seeking R -1 mod N to the result with T R, wherein T R
And R, T R · R −1 mod N is calculated, Q is obtained as a result, and the calculation of T R is performed as follows.
Assuming that A i is a v-bit division of A R by an arbitrary integer v, Y = 2 v , T i = (T i-1 / Y + A i · B R ) + M i · N M i-1 = (( T i-1 / Y + A i · B R ) mod Y) · (−N −1 mod Y) mod Y is executed in sequence.

【0028】[0028]

【実施例】以下、Nを法とする剰余乗算を、Nと素であ
る整数Rを用いた値に対する剰余乗算として、モンゴメ
リーによって提案された手法(モンゴメリー法)を例に
とり説明を行う。まず、べき乗剰余演算及び剰余乗算を
用いる暗号システムについて示し、次にモンゴメリー法
を用いたべき乗剰余演算及び剰余乗算を行う場合の前後
の処理法とモンゴメリー法を用いた剰余乗算の入出力の
整合性について示す。さらに、モンゴメリー法を実行す
るPEを示し、それを複数並列に用いることによってべ
き乗剰余演算及び剰余乗算を効率的に実行する回路を示
す。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A modular multiplication modulo N will be described below as an example of a modular multiplication (Montgomery method) proposed by Montgomery as a modular multiplication for a value using an integer R that is a prime to N. First, we show a cryptographic system that uses modular exponentiation and modular multiplication, and then the processing before and after the modular exponentiation and modular multiplication using the Montgomery method and the input / output consistency of the modular multiplication using the Montgomery method. About. Furthermore, a PE that executes the Montgomery method is shown, and a circuit that efficiently uses the modular exponentiation operation and the modular multiplication by using the PEs in parallel is shown.

【0029】〔暗号システム〕まず、図1に示すn対n
の通信系における暗号システムについて説明する。図1
における結線はローカルエリアネットワーク(LAN)
のような局所的な通信網、または電話回線のような大域
的な通信網を表す。ここで、A〜Zは利用者であり、そ
れぞれに通信網につながるための通信機(通信端末)T
が割り当てられている。暗号装置は、入力された情報を
暗号化して出力するものであり、例えば、その通信機T
に内臓させ、通信機Tが暗号化情報を出力する構成とし
てもよいし、通信機Tと通信網の間に挿入させて、通信
機Tの出力を暗号化して通信網に出力するようにしても
よい。また、通信機に接続され、通信機に情報を出力す
る装置に内臓させることもできる。また、暗号装置が通
信機に常時接続されていなくても、ICカードのような
携帯用の装置に暗号装置を内蔵し、必要なときに通信機
または通信機に接続された装置と接続する構成としても
よい。このような暗号装置によって、秘密通信や認証通
信及び鍵共有,零知識証明などの暗号通信を行うことが
できる。
[Cryptographic System] First, n to n shown in FIG.
The cryptographic system in the communication system will be described. Figure 1
Local area network (LAN)
Or a global communication network such as a telephone line. Here, A to Z are users, and a communication device (communication terminal) T for connecting to each of the communication networks.
Has been assigned. The encryption device encrypts input information and outputs it. For example, the communication device T
The communication device T may output the encrypted information, or the communication device T may be inserted between the communication device T and the communication network so that the output of the communication device T is encrypted and output to the communication network. Good. Further, it can be incorporated in a device which is connected to the communication device and outputs information to the communication device. Further, even if the encryption device is not always connected to the communication device, the encryption device is built in a portable device such as an IC card and connected to the communication device or a device connected to the communication device when necessary. May be With such an encryption device, secret communication, authentication communication, key sharing, zero-knowledge proof, and other encrypted communication can be performed.

【0030】このような暗号装置で必要となる、剰余乗
算回路またはべき乗剰余演算回路の例としては、平文M
を入力し、e及びNを他の入力または記憶された値とし
て、暗号C=Me mod Nを出力するべき乗剰余演算回路
を考えることができる。この場合、べき乗剰余演算回路
が暗号装置そのものとなる。秘密通信の場合、同様の暗
号装置により、逆演算M=Cd mod Nによって復号を行
うこともある。また、剰余乗算回路またはべき乗剰余演
算回路を暗号装置の一部として、暗号装置への外部から
の入力あるいは暗号装置内の他の処理部の処理結果をこ
の回路に入力して、演算を実行し、演算結果を暗号装置
の外部への出力あるいは暗号装置内の他の処理部に対す
る入力とする構成をとることもできる。
As an example of the modular multiplication circuit or the modular exponentiation circuit required in such an encryption device, a plaintext M is used.
It is possible to consider a modular exponentiation operation circuit that outputs the cipher C = M e mod N, with E and N as other input or stored values. In this case, the modular exponentiation circuit is the encryption device itself. In the case of secret communication, the same encryption device may be used to perform decryption by the inverse operation M = C d mod N. In addition, the modular multiplication circuit or the modular exponentiation operation circuit is used as a part of the cryptographic device, and an external input to the cryptographic device or a processing result of another processing unit in the cryptographic device is input to this circuit to execute an operation. The calculation result may be output to the outside of the cryptographic device or input to another processing unit in the cryptographic device.

【0031】また、記憶媒体へのアクセスを通信と見な
した場合は、磁気ディスク等のような記憶媒体と、この
記録媒体へのアクセス装置が通信機に相当し、通信系と
同様に記憶系においても本発明による回路を用いた暗号
装置によって、暗号システムを利用することができる。
When the access to the storage medium is regarded as communication, the storage medium such as a magnetic disk and the access device to the recording medium correspond to a communication device, and the storage system is similar to the communication system. Also in the above, the cryptographic system can be utilized by the cryptographic device using the circuit according to the present invention.

【0032】〔モンゴメリーの剰余乗算〕次の定理がモ
ンゴメリーによって導かれた。
[Montgomery's modular multiplication] The following theorem was derived by Montgomery.

【0033】定理1:NとRを互いに素な整数、Tを任
意の整数とし、N' =−N-1 mod Rとし、M=T・
N' mod Rとするとき、次の関係を満足する。
Theorem 1: N and R are mutually prime integers, T is an arbitrary integer, N '=-N- 1 mod R, and M = T.
When N ′ mod R, the following relationship is satisfied.

【0034】 (T+M・ N)/R=T・ R-1 mod N (1) 証明:略 従って、剰余乗算:Q=A・ B mod Nを実行する場
合、Nに対して素である整数Rを用いて次のようにして
行うことができる。
(T + M · N) / R = T · R −1 mod N (1) Proof: Approximately therefore, when performing modular multiplication: Q = A · B mod N, an integer R that is a prime to N Can be performed as follows.

【0035】 AR =A・ R mod N (2) BR =B・ R mod N (3) T =AR・BR (4) TR =T・ R-1 mod N=(T+M・ N)/R (5) Q =TR・R-1 mod N (6) ここで、式(4),(5)の演算をモンゴメリーの剰余
乗算と呼ぶとすると、モンゴメリーの剰余乗算は次のよ
うに表すことができる。
A R = A · R mod N (2) B R = B · R mod N (3) T = A R · B R (4) T R = T · R −1 mod N = (T + M · N ) / R (5) Q = T R · R -1 mod N (6) Here, when the operations of the expressions (4) and (5) are called Montgomery's modular multiplication, Montgomery's modular multiplication is as follows. Can be expressed as

【0036】 TR =AR・BR・R-1 mod N =(AR・BR +M・ N)/R (7) ただし、M=AR・BR・N' mod R (8) モンゴメリーの剰余乗算においてNが奇数の場合、R=
n (nは任意の整数)と選べば、RはNに対して素な
整数になる。この場合、Rによる除算はビットシフトの
みで済むので、式(5)または式(7)のモンゴメリー
の剰余乗算は乗算のみによって実行できる。
T R = A R · B R · R −1 mod N = (A R · B R + M · N) / R (7) where M = A R · B R · N 'mod R (8) If N is odd in Montgomery's modular multiplication, R =
If 2 n (n is an arbitrary integer) is selected, R becomes an integer that is prime to N. In this case, since the division by R only requires a bit shift, the Montgomery's remainder multiplication of Expression (5) or Expression (7) can be executed only by multiplication.

【0037】このとき、式(2),(3)及び(6)の
前後の処理もまたモンゴメリーの剰余乗算によって次の
ように実行できる。
At this time, the processing before and after the equations (2), (3) and (6) can also be executed as follows by the Montgomery's modular multiplication.

【0038】 AR =A・ R mod N =A・ RR・R-1 mod N BR =B・ R mod N =B・ RR・R-1 mod N Q =TR・R-1 mod N=TR・1・ R-1 mod N ただし、RR =R2 mod N RR はNによって一意に定まる値であるので、Nを定め
たときに定まり、定数として扱うことができる。従っ
て、図2に示すようにZ=X・Y・R-1 mod Nを実行
する演算回路を用いて、式(2)〜(6)の演算が共通
に実行でき、求める剰余乗算:Q=A・ B mod Nが演
算される。図2は入力組(A,RR ),(B,RR ),
(AR ,BR ),(TR ,1)に対する出力が各々A
R ,BR ,TR ,Qであることを示している。
A R = A · R mod N = A · R R · R −1 mod N B R = B · R mod N = B · R R · R −1 mod N Q = T R · R −1 mod N = T R · 1 · R −1 mod N However, since R R = R 2 mod N RR is a value uniquely determined by N, it is determined when N is determined and can be treated as a constant. Therefore, as shown in FIG. 2, the arithmetic circuits for executing Z = X · Y · R −1 mod N can be commonly used to execute the arithmetic operations of Expressions (2) to (6), and the required modular multiplication: Q = A · B mod N is calculated. FIG. 2 shows input groups (A, RR ), (B, RR ),
The outputs for (A R , B R ) and (T R , 1) are A
R , B R , T R , and Q.

【0039】〔モンゴメリーのべき乗剰余演算1〕ま
た、モンゴメリー法を用いて、べき乗剰余演算:C=M
e mod Nも次のようにして実行される。
[Montgomery's modular exponentiation 1] Also, using the Montgomery method, the modular exponentiation: C = M
e mod N is also executed as follows.

【0040】 INPUT M,e,N,RRR =M・ RR・R-1 mod N (9) CR =1・ RR・R-1 mod N (10) FOR i=t TO 1 IF ei =1 THEN CR =CR・MR・R-1 mod N (11) IF i >1 THEN CR =CR・CR・R-1 mod N (12) NEXT C=CR・1・ R-1 mod N (13) 従って、べき乗剰余演算もモンゴメリーの剰余乗算のみ
によって実行できる。なお、式(10)に示すCR の初
期値は、RR とNによって定まるので定数として扱うこ
ともできる。以後、このようにモンゴメリーの剰余乗算
のみを用いたべき乗剰余演算をモンゴメリーのべき乗剰
余演算と呼ぶ。
INPUT M, e, N, R R M R = M · R R · R −1 mod N (9) C R = 1 · R R · R −1 mod N (10) FOR i = t TO 1 IF e i = 1 THEN C R = C R · M R · R -1 mod N (11) IF i> 1 THEN C R = C R · C R · R -1 mod N (12) NEXT C = C R 1 · R −1 mod N (13) Therefore, the modular exponentiation operation can be performed only by the Montgomery modular multiplication. The initial value of C R shown in equation (10) is determined by R R and N, so it can be treated as a constant. Hereinafter, the modular exponentiation operation using only the Montgomery modular exponentiation will be referred to as a Montgomery modular exponentiation operation.

【0041】ここで、以上のように、モンゴメリーのべ
き乗剰余演算を実行する場合、1つの演算結果を次の演
算の入力として乗算を繰り返すので、各乗算を同一の回
路構成で実現しようとするとき、出力の最大ビット数が
入力の最大ビット数を越えてしまうと実現が困難とな
る。
As described above, when the Montgomery's modular exponentiation operation is executed, one operation result is used as an input for the next operation, and the multiplication is repeated. Therefore, when each multiplication is to be realized with the same circuit configuration, If the maximum number of output bits exceeds the maximum number of input bits, it will be difficult to realize.

【0042】そこで、式(7)のモンゴメリーの剰余乗
算において、入力と出力の最大ビット数が等しくなるた
めの条件を以下に考察する。
Therefore, in the Montgomery remainder multiplication of the equation (7), the condition for the maximum number of bits of the input and the output to be equal will be considered below.

【0043】定理2:式(7),(8)においてAR
n+u ,BR <2n+u ,N<2n ,R=2n+ r としたと
き、TR <2n+u となるためには、u=1かつr>1、
または、u>1かつr=u+1ならば十分である。
Theorem 2: In equations (7) and (8), A R <
When 2 n + u , B R <2 n + u , N <2 n , and R = 2 n + r , in order to satisfy T R <2 n + u , u = 1 and r> 1,
Alternatively, it is sufficient if u> 1 and r = u + 1.

【0044】証明: R=2n+r とすると式(8)よりM<2n+r . AR <2n+u ,BR <2n+u ,N<2n とすると、 AR・BR <22(n+u),M・ N<22n+r. キャリーによる桁上がりを考慮して、 AR・BR +M・ N<max (22(n+u)+1,22n+r+1). よって、TR <max (2n+2u+1-r,2n+1 ). 従って、2n+2u+1-r≦2n+1 の場合:TR <2n+1 . ∴ u=1,r>1 (14) 2n+2u+1-r>2n+1 の場合:TR <2n+2u+1-r. ∴ u>1,r=u+1 (15) ただし、max (A,B)はA,Bのうち大きい方を選択
する関数である。
Proof: If R = 2 n + r , then M <2 n + r . If A R <2 n + u , B R <2 n + u , N <2 n , then A R · B R <2 2 (n + u) , M · N <2 2n + r . In consideration of carry by carry, A R · B R + M · N <max (2 2 (n + u) +1 , 2 2n + r + 1 ). Therefore, T R <max (2 n + 2u + 1-r , 2 n + 1 ). Therefore, if 2 n + 2u + 1-r ≦ 2 n + 1 : T R <2 n + 1 . ∴ u = 1, r> 1 (14) In the case of 2 n + 2u + 1-r > 2 n + 1 : T R <2 n + 2u + 1-r . ∴ u> 1, r = u + 1 (15) Here, max (A, B) is a function that selects the larger one of A and B.

【0045】このとき、式(14),(15)の条件を
満足していればモンゴメリーのべき乗剰余演算はすべて
モンゴメリーの剰余乗算の単純な繰り返しによって実現
することができる。従って、図3に示すように式(9)
〜(13)に対してセレクタSによって入力を選択する
だけでべき乗剰余演算が実行できる。
At this time, if the conditions of equations (14) and (15) are satisfied, all Montgomery modular exponentiation operations can be realized by simple repetition of Montgomery modular multiplication. Therefore, as shown in FIG.
The power-residue calculation can be executed only by selecting an input with respect to (13) by the selector S.

【0046】なお、図3の回路で、2つのセレクタS
は、選択可能なフィードバック入力として、一方にC
R 、他方にCR ,MR を一時蓄えるメモリを具えるもの
とする。このようなメモリは、2つのセレクタSの前に
設けて、両セレクタSが共通に利用できるようにしても
よいことはもちろんである。また、このようなセレクタ
Sにおける入力の切換のためには、例えば、eをシフト
レジスタに記憶させ、eiを上位ビットから順次出力さ
せ、その出力を受けて、ei =1であるか、およびi
>1であるかの判定を行い、切換信号を出力する制御部
(論理回路やカウンタなどにより構成できる)を設けれ
ばよい。
In the circuit of FIG. 3, the two selectors S
C as one of the selectable feedback inputs
R , and on the other hand, a memory for temporarily storing C R and M R shall be provided. It goes without saying that such a memory may be provided in front of the two selectors S so that both selectors S can be commonly used. In order to switch the input in the selector S as described above, for example, e is stored in the shift register, e i is sequentially output from the upper bit, and e i = 1 is received in response to the output. And i
It is only necessary to provide a control unit (which can be configured by a logic circuit, a counter, or the like) that determines whether> 1 and outputs a switching signal.

【0047】このとき、式(14),(15)の条件を
満足していればモンゴメリーのべき乗剰余演算はすべて
モンゴメリーの剰余乗算の単純な繰り返しによって実現
することができる。ただし、式(14),(15)から
u>0であるので、演算結果であるCだけは、C<Nと
なるように補正しなければならない。
At this time, if the conditions of equations (14) and (15) are satisfied, all Montgomery modular exponentiation operations can be realized by simple repetition of Montgomery modular multiplication. However, since u> 0 from the expressions (14) and (15), only the calculation result C must be corrected so that C <N.

【0048】従来のイブンの手法では、このような補正
をモンゴメリーの剰余乗算を行う度に行わなければなら
ないが、本方式はモンゴメリーのべき乗剰余演算の終了
後に1度だけ補正を行えばよい。また、この補正は簡単
な処理であるので、以下に示すモンゴメリーのべき乗剰
余演算のための回路規模や処理速度に比べてほとんど影
響しない。
In the conventional Ibn's method, such a correction must be performed every time Montgomery's modular multiplication is performed, but in this method, the correction needs to be performed only once after the completion of Montgomery's modular exponentiation. Further, since this correction is a simple process, it has almost no effect on the circuit scale and the processing speed for the Montgomery modular exponentiation operation described below.

【0049】〔モンゴメリーのべき乗剰余演算2〕ま
た、べき乗剰余演算:C=Me mod Nは次のようにして
も実行できる。
[Montgomery's modular exponentiation calculation 2] The modular exponentiation calculation: C = M e mod N can also be executed as follows.

【0050】 INPUT M,e,N,RRR =M・ RR・R-1 mod N CR =1・ RR・R-1 mod N FOR i=1 TO t IF ei =1 THEN CR =CR・MR・R-1 mod
N IF i <t THEN MR =MR・MR・R-1 mod
N NEXT C=CR・1・ R-1 mod N この場合も、式(14),(15)の条件を用いればモ
ンゴメリーの剰余乗算の単純な繰り返しによってCが演
算できることは明らかである。また、図3の回路で、2
つのセレクタSがそれぞれCR ,MR を選択可能とする
と共に、2つのセレクタSが、ともにMR を選択可能と
するだけで、同様にべき乗剰余演算が実行できることは
明らかである。
[0050] INPUT M, e, N, R R M R = M · R R · R -1 mod N C R = 1 · R R · R -1 mod N FOR i = 1 TO t IF e i = 1 THEN C R = C R · M R · R -1 mod
N IF i <t THEN M R = M R · M R · R −1 mod
N NEXT C = C R · 1 · R −1 mod N In this case as well, it is clear that C can be calculated by a simple iteration of Montgomery's remainder multiplication by using the conditions of equations (14) and (15). In addition, in the circuit of FIG.
It is obvious that the power-residue calculation can be similarly performed by only one selector S making C R and M R selectable and two selectors S making both M R selectable.

【0051】以上によって、べき乗剰余演算及び剰余乗
算が式(16)を演算する演算回路のみによって実行で
きることが示された。
From the above, it has been shown that the modular exponentiation operation and the modular multiplication can be executed only by the arithmetic circuit for calculating the equation (16).

【0052】 Z=X・ Y・ R-1 mod N (16) また、これを式(7)に示すモンゴメリーの剰余乗算を
用いて演算する場合には、式(14),(15)の条件
を満足する入力値を用いることによって、モンゴメリー
の剰余乗算の単純な繰り返しによって剰余乗算及びべき
乗剰余演算が実行できることも示された。
Z = X · Y · R −1 mod N (16) In addition, when this is calculated using the Montgomery's remainder multiplication shown in Expression (7), the conditions of Expressions (14) and (15) are satisfied. It was also shown that the remainder multiplication and the power-residue operation can be performed by simple iteration of the Montgomery's remainder multiplication by using input values satisfying

【0053】式(16)または式(7)は整数演算であ
るので、その演算回路及び方法は種々の手法によって実
現できる。例えば、CPU等を用いれば簡単に実現でき
ることは明らかである。
Since the expression (16) or the expression (7) is an integer operation, its operation circuit and method can be realized by various methods. For example, it is obvious that this can be easily realized by using a CPU or the like.

【0054】従って、式(16)または式(7)を実行
する共通の演算回路及び方法によって、剰余乗算及びべ
き乗剰余演算を用いた種々の暗号システムが効率的に構
成できる。
Therefore, various cryptographic systems using the modular multiplication and the modular exponentiation can be efficiently constructed by the common arithmetic circuit and method for executing the equation (16) or the equation (7).

【0055】〔モンゴメリーの剰余乗算及びべき乗剰余
回路の実施例1〕TR =AR・BR・R-1 mod N(AR
R <2n+u ,R=2n+r ,N<2n 整数,u,rは式
(14),(15)の条件を満たす)の剰余乗算を考え
る。ARをvビット毎、BR ,N,TR をdビット毎に
分割すると、次のように表せる。ただし、n+r≦m・
d,n+r≦k・ v,X=2d ,Y=2v (v≦d)。
[Example 1 of Montgomery's modular multiplication and modular exponentiation circuit] T R = A R · B R · R −1 mod N (A R ,
Consider the modular multiplication of B R <2 n + u , R = 2 n + r , N <2 n integer, u and r satisfy the conditions of the expressions (14) and (15). When A R is divided by v bits and B R , N, T R are divided by d bits, they can be expressed as follows. However, n + r ≦ m
d, n + r ≦ k · v, X = 2 d , Y = 2 v (v ≦ d).

【0056】 AR =Ak-1・Yk-1+Ak-2・Yk-2+・・・+A1・Y+ A0R =Bm-1・Xm-1+Bm-2・Xm-2+・・・+B1・X+ B0 N =Nm-1・Xm-1+Nm-2・Xm-2+・・・+N1・X+ N0R =Tm-1・Xm-1+Tm-2・Xm-2+・・・+T1・X+ T0 (17) ここで、Ai(i=0,…,k-1,n+u <i でAi =0) はAR
を下位桁からvビット毎に分割したビット系列を表し、
j ,Nj ,Tj(j=0,…,m-1) は各々BR ,N,TR
ついて下位桁からdビット毎に分割したビット系列を表
す。この場合、モンゴメリーの剰余乗算は次の演算をi=
0 からk まで繰り返すことよって求められる。ただし、
T_iはi回目の演算におけるTR の値を意味し、式(1
6)におけるTi とは異なる。
A R = A k-1 · Y k-1 + A k-2 · Y k-2 + ... + A 1 · Y + A 0 B R = B m-1 · X m-1 + B m-2・ X m-2 + ・ ・ ・ + B 1・ X + B 0 N = N m-1・ X m-1 + N m-2・ X m-2 + ・ ・ ・ + N 1・X + N 0 T R = T m-1 · X m-1 + T m-2 · X m-2 + ... + T 1 · X + T 0 (17) where A i (i = 0 , ..., k-1, n + u <i and A i = 0) is A R
Represents a bit sequence obtained by dividing each of the lower digits by v bits,
B j , N j , and T j (j = 0, ..., m-1) represent bit sequences obtained by dividing B R , N, and T R by d bits from the lower digit. In this case, Montgomery's modular multiplication does the following operation i =
It is calculated by repeating from 0 to k. However,
T_ i means the value of T R in the i-th calculation, and is expressed by the formula (1
Different from T i in 6).

【0057】 T_i=( T_i-1+Ai・BR・Y+Mi-1・N)/Y (18) ただし、Mi-1 =( T_i-1 mod Y)・N0' mod Y,T
_-1 =0,N0'=N'mod Y この演算を並列処理で実現するために、BR ,NをBj
,Nj を用いて表すと次のようになる。
[0057] T_ i = (T_ i-1 + A i · B R · Y + M i-1 · N) / Y (18) However, M i-1 = (T_ i-1 mod Y) · N 0 'mod Y , T
Bj To achieve at _ -1 = 0, N 0 ' = N'mod Y parallel processing of this operation, B R, a N
, Nj is expressed as follows.

【0058】アルゴリズム1: FOR i=0 TO k Mi-1 =dwv (dwv (Ti-1,0 )・ N0') FOR j=0 TO m−1 Ri,j =Ti-1,j +Li-2,j+1・X/ Y2 +Y・ Ai・Bj
+Mi-1・Nji,j =dwv (Ri,j ) Ti,j =(Ri,j −Li,j )/Y NEXT NEXT ただし、dwd (Z)=Z mod 2d upd (Z)=(Z−dwd (Z))/2d Ti,j ,Li,j の初期値は全て0 アルゴリズム1において、Y・ Ai・Bj ,Li-2,j+1・X
/ Y2 ,およびTi,j=(dwd+v (Ri,j )−Li,j
/Y等の定数X=2d ,Y=2v による乗除算は他の値
に対してビットをずらすことによって実現される。従っ
て、Ti,j に関する演算はRi,j のLSBに対してvビ
ット目からd+v−1ビット目までの値をTi,j とする
ことを意味する。ただし、Li,j はRi,j のLSBから
v−1ビット目までの値である。このようにTi,j を得
るための1/Y演算をRi,j 毎の下位へのビットシフト
によって実現しているので、Li-2,j+1 はRi,j を演算
するときに用いられ、X/ Y2 によって桁を合わせて演
算される。
Algorithm 1: FOR i = 0 TO k M i-1 = dw v (dw v (Ti-1,0) N 0 ') FOR j = 0 TO m-1 R i, j = T i- 1, j + L i-2, j + 1・ X / Y 2 + Y ・ A i・ B j
+ M i−1 · N j L i, j = dw v (R i, j ) T i, j = (R i, j −L i, j ) / Y NEXT NEXT However, dw d (Z) = Z mod 2 d up d (Z) = (Z-dw d (Z)) / 2 d T i, j, L i, the initial value of j in all 0 algorithm 1, Y · a i · B j, L i- 2, j + 1 x
/ Y 2 , and T i, j = (dw d + v (R i, j ) −L i, j ).
Multiplication / division by constants X = 2 d and Y = 2 v such as / Y is realized by shifting bits with respect to other values. Thus, operations on T i, j means that the value of the v-th bit with respect to R i, j of the LSB to d + v-1 th bit T i, and j. However, L i, j is a value from the LSB of R i, j to the v−1th bit. Since the 1 / Y operation for obtaining T i, j is realized by bit shifting to the lower order for each R i, j in this way, L i-2, j + 1 calculates R i, j . It is sometimes used, and it is calculated by adjusting the digits by X / Y 2 .

【0059】図2はアルゴリズム を行う回路である。
アルゴリズム1においてiはクロックを意味し、jは図
3におけるレジスタ(R)の位置に対応し、右から左に
i,0 からRi,m-1 のレジスタを示す。
FIG. 2 shows a circuit for executing the algorithm.
In Algorithm 1, i means a clock, j corresponds to the position of the register (R) in FIG. 3, and the registers from R i, 0 to R i, m−1 are shown from right to left.

【0060】以下、簡単のためにv=1の場合について
図2の回路と動作を説明する。図2においてBj ,N
j(j=0,…,m-1) 及びN0'は、各々に記された値を乗数と
して持つdビットの乗算器を示し、d個のアンドによっ
て実現できる。Nが奇数であれば、N0'=1であるの
で、Mi-1 を演算する乗算器は省略でき、Ti-1,0 のL
SBをとして出力する。また、+で示される加算器の入
力及び出力は次のようになる。下部の乗算器からの出力
i-1・Nj はdビット、上部の乗算器からの出力Ai・B
j もdビットであるが、その値を2倍するためにMi-1
j に対して1ビット上位桁にシフトして入力する。レ
ジスタからの入力Ti-1,j は、Ri-1,j のLSBから2
ビット目からを1ビット下位にシフトさせ、Mi-1・Nj
と同位の値として入力する。Li-2,j+1・2d-2 は2つ前
のPEからの1ビット出力Li-2,j+1をMi-1・Nj のL
SBからd−1ビット目に入力することを意味する。こ
の場合、Ti-1,j <2d+2 であれば、加算器からの出力
はd+3ビットとなる。従って、加算器からの出力を受
けるレジスタは各々d+3ビットレジスタとなる。
For simplicity, the circuit and operation of FIG. 2 will be described below for the case of v = 1. In FIG. 2, B j , N
j (j = 0, ..., M-1) and N 0 'represent a d-bit multiplier having the value written in each as a multiplier, and can be realized by d ANDs. If N is an odd number, N 0 ′ = 1, and therefore the multiplier for calculating M i−1 can be omitted, and L of T i−1,0 can be omitted.
SB is output as. The input and output of the adder indicated by + are as follows. The output M i−1 · N j from the lower multiplier is d bits, and the output A i · B from the upper multiplier.
j is also d bits, but in order to double that value, M i-1.
Shift 1 bit to N j and input it. The input T i−1 , j from the register is 2 from the LSB of R i−1 , j.
Shifts from the 1st bit to the lower bit by 1 and outputs M i-1 · N j
And enter as the value of the peer. L i-2, j + 1 · 2 d-2 is the 1-bit output L i-2, j + 1 from the immediately preceding PE, which is L of M i−1 · N j .
This means inputting from the SB to the d-1th bit. In this case, if T i−1 , j <2 d + 2 , the output from the adder is d + 3 bits. Therefore, the registers receiving the output from the adder are each a d + 3 bit register.

【0061】以上のようにして、図4の回路で式(1
8)の演算が実行でき、A0 からAまで入力すること
によってモンゴメリーの剰余乗算が実行できる。
As described above, in the circuit of FIG.
The operation of 8) can be executed, and Montgomery's remainder multiplication can be executed by inputting A 0 to A K.

【0062】また、図2はv=1として説明したが、v
≦dであるvに対しても同様の手法によってモンゴメリ
ーの剰余乗算を実行できることは明らかである。
Although FIG. 2 has been described with v = 1,
It is obvious that Montgomery's modular multiplication can be executed for v with ≤d by the same method.

【0063】本実施例によるモンゴメリーの剰余乗算回
路は非常に小さな回路規模で、高速処理を実現する。
The Montgomery remainder multiplication circuit according to this embodiment realizes high-speed processing with a very small circuit scale.

【0064】〔モンゴメリーの剰余乗算及びべき乗剰余
回路の実施例2〕この演算をシストリックアレイで実現
するために、B ,NをBj ,Nj を用いて表すと次
のようになる。
[0064] The operation EXAMPLE 2 modulo multiplication and modulo exponentiation circuit Montgomery] To achieve systolic array, B R, N and B j, expressed with N j as follows.

【0065】アルゴリズム2: FOR i=0 TO k Mi-1 =dwv (dwv(Ti-1,0 )・ N0') FOR j=0 TO m−1 Ri,j =Ti-1,j +Ci,j-1+Li-2,j+1・X/ Y2+Y・ A
i・Bj +Mi-1・Nji,j =dwv (Ri,j ) Ti,j =(dwd+v (Ri,j )−Li,j )/Y Ci,j =upd+v (Ri,j ) NEXT NEXT ただし、dwd (Z)=Z mod 2d upd (Z)=(Z−dwd (Z))/2di,j ,Ci,j ,Li,j の初期値は全て0 アルゴリズム2において、Ci,j-1 は桁上がりとしてR
i,j を演算する時に用いられる。また、Y・ Ai・Bj
i-2,j+1・X/ Y2 ,およびTi,j =(dwd+v(R
i,j )−Li,j )/Y等のX,Yを定数としてもつ演算
は他の値に対してビットをずらすことによって実現され
る。従って、Ti,j に関する演算はRi,j LSBに対し
てvビット目からd+v−1ビット目までの値をTi,j
とすることを意味する。
Algorithm 2: FOR i = 0 TO k M i−1 = dw v (dw v (T i-1,0 ) · N 0 ′) FOR j = 0 TO m−1 R i, j = T i -1 , j + C i , j-1 + L i-2, j + 1・ X / Y 2 + Y ・ A
i · B j + M i- 1 · N j L i, j = dw v (R i, j) T i, j = (dw d + v (R i, j) -L i, j) / Y C i , j = up d + v ( R i, j) NEXT NEXT however, dw d (Z) = Z mod 2 d up d (Z) = (Z-dw d (Z)) / 2 d T i, j, Initial values of C i, j and L i, j are all 0. In Algorithm 2, C i, j-1 is a carry and R
Used when computing i, j . In addition, Y · A i · B j ,
L i-2, j + 1 · X / Y 2 , and T i, j = (dw d + v (R
An operation having X and Y as constants such as i, j ) -L i, j ) / Y is realized by shifting bits with respect to other values. Thus, T i, operations on j is R i, the value of T i from v-th bit relative j LSB to d + v-1 th bit, j
Means to

【0066】ただし、Li,j はRi,j のLSBからv−
1ビット目までの値である。このようにTi,j を得るた
めの1/Y演算をRi,j 毎の下位へのビットシフトによ
って実現しているので、Li-2,j+1 はRi,j を演算する
ときに用いられ、X/ Y2 によって桁を合わせて演算さ
れる。
However, L i, j is v− from the LSB of R i, j.
It is a value up to the first bit. Since the 1 / Y operation for obtaining T i, j is realized by bit shifting to the lower order for each R i, j in this way, L i-2, j + 1 calculates R i, j . It is sometimes used, and it is calculated by adjusting the digits by X / Y 2 .

【0067】図5はアルゴリズム2においてRi,j ,L
i,j ,Ti,j ,Ci,j を演算する回路である。図6は図
5の回路を1つのPE(プロセッシング・エレメント)
として、それを縦列に接続したシストリックアレイであ
る。アルゴリズム2において、jはクロックを意味し、
iは図6におけるPEの位置に対応し、左から右にi=
0(#1)からi=k(#k+1)のPEを示す。
FIG. 5 shows that R i, j , L in Algorithm 2
This is a circuit for calculating i, j , T i, j , and C i, j . FIG. 6 shows the circuit of FIG. 5 as one PE (processing element).
As a, it is a systolic array in which it is connected in cascade. In Algorithm 2, j means a clock,
i corresponds to the position of PE in FIG. 6, and i = from left to right
PEs from 0 (# 1) to i = k (# k + 1) are shown.

【0068】図6において#i+1番目のPEはAi(i=
0,…,k) の値が内部レジスタに設定されており、PE間
はBinとBout ,DinとDout ,TinとTout ,Lin
out ,MinとMout ,NinとNout が各々接続されて
いる。また、#1のPEのBin,Ninには各々Bj ,N
j(j=0,…,m-1) が下位桁から順に入力され、Din
in,Lin,Minの入力には各々0が設定されている。
In FIG. 6, the # i + 1th PE is A i (i =
0, ..., k) is set in the internal register, and between PEs, B in and B out , D in and D out , T in and T out , L in and L out , M in and M out , N in and N out are connected to each other. Also, each B j is the B in, N in the # 1 of PE, N
j (j = 0, ..., m-1) are input in order from the lower digit, and D in ,
T in, L in, each 0 is set to the input of the M in.

【0069】以下、簡単のために、v=1の場合につい
て図5の回路と動作を説明する。図5において×は乗算
器を示し、d個のアンドによって実現できる。R1〜R
3は各々Ai ,Mi-1 ,N0'を保持する1ビットレジス
タである。Nが奇数であれば、N0'=1であるのでを演
算する乗算器とN0'を保持するR3は省略され、R2は
i-1,0 のLSBをとして保持する。また、R4,R5
はBin,Ninからの入力を1クロック遅らせて次のPE
に送るためのdビットレジスタである。+で示される加
算器の入力及び出力は次のようになる。下部の乗算器か
らの出力Mi-1・Nj はdビット、上部の乗算器からの出
力Ai・Bj もdビットであるが、その値を2倍するため
にMi-1・Nj に対して1ビット上位桁にシフトして入力
する。前PEからの入力Ti-1,j は、Ri-1,j のLSB
から2ビット目からd+1ビット目までのdビットを1
ビット下位にシフトさせ、Mi-1・Nj と同位の値として
入力する。Li-2,j+1・2d-2 は2つ前のPEからの1ビ
ット出力Li-2,j+1 をMi-1・Nj のLSBからd−1ビ
ット目に入力することを意味する。この場合、桁上がり
ビットであるCi,j-1 はCi,j-1 <2d+2 であれば、加
算器からの出力はd+3ビットとなるので、Ci,j-1
2ビットの値となる。従って、加算器からの出力を受け
るR6はd+3ビットレジスタとなる。
For simplification, the circuit and operation of FIG. 5 will be described below for the case of v = 1. In FIG. 5, x indicates a multiplier, which can be realized by d AND gates. R1-R
Reference numeral 3 is a 1-bit register that holds A i , M i-1 , and N 0 ′, respectively. If N is odd, R3 for holding the 'multipliers and N 0 for computing the so is = 1' N 0 is omitted, R2 is held as the LSB of the T i-1, 0. In addition, R4, R5
Is the next PE after delaying the input from B in and N in by 1 clock.
Is a d-bit register for sending to. The input and output of the adder indicated by + are as follows. Although the output M i-1 · N j from the bottom of the multiplier is the output A i · B j be d bits from d bits, the upper part of the multiplier, M i-1 · to doubling its value Shift 1 bit to N j and input it. The input T i−1 , j from the previous PE is the LSB of R i−1 , j .
From the 2nd bit to the d + 1th bit is 1
The value is shifted to the lower bit and input as a value equal to M i-1 · N j . L i-2, j + 1 · 2 d-2 is the 1-bit output L i-2, j + 1 from the previous PE, and is input to the d−1 bit from the LSB of M i−1 · N j. Means to do. In this case, if C i, j-1 which is a carry bit is C i, j-1 <2 d + 2 , the output from the adder is d + 3 bits, so C i, j-1 is 2 It is a bit value. Therefore, R6 receiving the output from the adder becomes a d + 3 bit register.

【0070】以上により、図5のPE1つで式(18)
の演算を実行できることがわかる。このPEを図6のよ
うにk+1個パイプライン状に接続し、クロックに同期
させて動作させることによってモンゴメリーの剰余乗算
が高速に実行できる。
From the above, one PE in FIG.
It can be seen that the calculation of can be performed. By connecting this PE in a pipeline form of k + 1 pieces as shown in FIG. 6 and operating in synchronization with the clock, the Montgomery remainder multiplication can be executed at high speed.

【0071】ただし、図6のアレイからの最終出力はk
+1番目のPEからの出力Tk,jk,j と、k番目のP
Eからの出力Lk-1,j+1 に分離されているので、アルゴ
リズム2の処理の後、次のような演算を行う。
However, the final output from the array of FIG. 6 is k
The output T k, j L k, j from the + 1st PE and the kth P
Since it is separated into the output L k-1, j + 1 from E, the following calculation is performed after the processing of Algorithm 2.

【0072】アルゴリズム3: FOR j=0 TO m−1 Rk+1,j =Tk,j+k+1,j-1+Lk-1,j+1・X/ Y2k+1,j =dwd (Rk+1,j ) Ck+1,j =upd (Rk+1,j ) Tk+2,j =Tk+1,j+k+2,j-1+Lk,j+1・X/ Y Ck+2,j =upd (Tk+2,j ) NEXT ここで、Tk+2,j がTR を分割したビット系列Tj(j=0,
…,m-1) となる。Rk+1,j の演算はアルゴリズム2にお
いてAi =Mi-1 =0とした場合の演算と同様であるの
で、図5のPEによって実現される。Tk+2,j の演算
は、ほぼRk+1,jの演算と同様であるが、Tk+1,j ,C
k+1,j は1/2演算が行われずLk,j+1 もLk-1,j+1
対して1ビット上位桁で加算される。従って、図7に示
すように図5のPEの加算器とレジスタR6のLSBの
下に1ビット分のハーフアダー(HA)とレジスタ(R
7)を用意し、HAには前PEの出力Ri-1,j のLSB
と、Ck+2,j-1 を入力し(この時、Ck+2,j-1 は高々1
ビットの値である)、その加算結果を新たに用意したレ
ジスタへ、キャリービットを加算器へのキャリーとして
入力する。このようにすればLk,j+1 は自動的に1ビッ
ト上位の桁として加算される。従って、Tk+2,j を演算
するPEは他のPEと異なるが、i=k+2の時のみ加
算器へのキャリーとしてハーフアダーからのキャリーを
選択する1ビットのセレクタを加えれば全てのPEを1
つのPEで実現できる。
Algorithm 3: FOR j = 0 TO m-1 R k + 1, j = T k, j + C k + 1, j-1 + L k-1 , j + 1.X / Y 2 T k + 1, j = dw d (R k + 1, j) C k + 1, j = up d (R k + 1, j) T k + 2, j = T k + 1, j + C k + 2, j −1 + L k, j + 1 · X / Y C k + 2, j = up d (T k + 2, j ) NEXT Here, T k + 2, j is a bit sequence T j obtained by dividing T R. (j = 0,
…, M-1). The calculation of R k + 1, j is the same as the calculation when A i = M i-1 = 0 in Algorithm 2, and thus is realized by the PE in FIG. The calculation of T k + 2, j is almost the same as the calculation of R k + 1, j , but T k + 1, j , C
For k + 1, j , 1/2 operation is not performed, and L k, j + 1 is also added to L k−1 , j + 1 in 1-bit upper digits. Therefore, as shown in FIG. 7, a half adder (HA) for one bit and a register (R) are added under the LSB of the PE adder and register R6 of FIG.
7) is prepared and HA outputs LSB of output R i−1 , j of the previous PE.
And input C k + 2, j-1 (at this time, C k + 2, j-1 is at most 1
(The value of the bit), and the carry bit is input as a carry to the adder to the newly prepared register. In this way, L k, j + 1 is automatically added as a 1-bit upper digit. Therefore, the PE that calculates T k + 2, j is different from the other PEs, but only when i = k + 2, add a 1-bit selector that selects the carry from the half adder as the carry to the adder. 1
It can be realized with two PEs.

【0073】従って、TR を得るには図6のPEとして
図7に示したPEを用い、さらに図6のアレイの後にP
Eを2個追加した計k+3個のPEを用いたアレイによ
ってモンゴメリーの剰余乗算が高速演算される。
Therefore, in order to obtain T R , the PE shown in FIG. 7 is used as the PE shown in FIG. 6, and P is added after the array shown in FIG.
Montgomery's modular multiplication is performed at high speed by an array using a total of k + 3 PEs with two Es added.

【0074】また、図5及び図7はv=1として説明し
たが、v≦dであるvに対しても同様の手法によってモ
ンゴメリーの剰余乗算を実行できることは明かである。
Although FIG. 5 and FIG. 7 have been described with v = 1, it is clear that Montgomery's modular multiplication can be executed for v with v ≦ d by a similar method.

【0075】〔モンゴメリーの剰余乗算及びべき乗剰余
回路の実施例3〕また、次のようなシストリックアレイ
を構成することができる。式(17)の演算を次のよう
なアルゴリズムによって実行する。
[Third Embodiment of Montgomery's Residual Multiplication and Power Residue Circuit] Further, the following systolic array can be constructed. The calculation of Expression (17) is executed by the following algorithm.

【0076】アルゴリズム4: FOR i=0 TO k Mi-1 =dwv (dwv (Ti-1,1 )・ N0') FOR j=0 TO m Ri,j =Ti-1,j+1 +Ci,j-1 +Ai・Bj-1 +Mi-1・N
ji,j =dwv (Ri,j ) Ci,j =upv (Ri,j ) NEXT NEXT アルゴリズム4におけるRi,j 演算のアルゴリズム2と
の違いは、Mi-1・Nj対するAi・Bj 及びTi-1,j の桁
の違いをビットずれではなく、用いるBj 及びTi,j
jに関する係数をずらすことによって実現している点で
ある。従って、アルゴリズム2でビットずれのために生
じる値Li,j はアルゴリズム4では生じない。
Algorithm 4: FOR i = 0 TO k M i−1 = dw v (dw v (T i−1 , 1 ) · N 0 ′) FOR j = 0 TO m R i, j = T i-1 , j + 1 + C i, j-1 + A i · B j-1 + M i-1 · N
j T i, j = dw v (R i, j ) C i, j = up v (R i, j ) NEXT NEXT Algorithm 4 differs from R i, j operation algorithm 2 in that M i−1. The difference between the digits of A i · B j and T i−1 , j with respect to N j is realized not by bit shift but by shifting the coefficient of j of B j and T i, j to be used. Therefore, the value L i, j generated in Algorithm 2 due to the bit shift does not occur in Algorithm 4.

【0077】アルゴリズム4のRi,j ,Ti,j ,Ci,j
の演算を実行するPE及びシストリックアレイを図8,
9に示す。アルゴリズム4のj,iもそれぞれ、クロッ
ク及びPEの位置に対応する。また、図9においても#
i+1のPEにはAi(i=0,…,k) の値が内部レジスタに
設定されており、PE間はBinとBout ,TinとT
out ,MinとMout ,NinとNout が各々接続されてい
る。また、#1のPEのTin,Minの入力には各々0が
設定されているが、Bin,Ninには各々Bj ,Nj(j=0,
…,m-1) が下位桁から順に入力される。ただし、アルゴ
リズムIの場合と異なりBj はNj に対して1クロック
遅れで入力される。
R i, j , T i, j , C i, j of Algorithm 4
The PE and the systolic array for executing the calculation of FIG.
9 shows. The j and i of the algorithm 4 also correspond to the positions of the clock and PE, respectively. Also in FIG.
The value of A i (i = 0, ..., k) is set in the internal register in the PE of i + 1, and B in and B out , and T in and T are between PEs.
out , M in and M out , and N in and N out are connected respectively. Further, although 0 is set to the input of T in and M in of PE of # 1, B j and N j (j = 0, j = 0, respectively) are set to B in and N in .
, M-1) are input in order from the lower digit. However, unlike the case of the algorithm I, B j is input with a delay of 1 clock with respect to N j .

【0078】以降、簡単のためにv=dの場合について
説明する。図8において、×はdビット・ dビットの乗
算器を示し、+は加算器を示す。加算器の入力及び出力
は次のようになる。上部の乗算器からの出力Ai・Bj-1
と下部の乗算器からの出力Mi-1・Nj は各々2・ dビッ
トであり、前PEからの出力Ti-1,j+1 はdビットの値
である。従って、Ci,j-1 がCi,j-1 <22・d+1 であれ
ば加算器からの出力は2・ d+2ビットの値である。ま
た、R1〜R7はdビットのレジスタであり、加算器か
らの出力を受けるR8は2・ d+2ビットのレジスタで
ある。レジスタR8は、LSBからdビット目までをT
i-1,j+1 として次のPEへ出力し、上位のd+2ビット
をCi,j-1 として加算器へフィードバックする。
For simplicity, the case of v = d will be described below. In FIG. 8, x indicates a d-bit / d-bit multiplier, and + indicates an adder. The input and output of the adder are as follows. Output from upper multiplier A i · B j-1
The outputs M i−1 · N j from the lower multiplier and the lower multiplier are 2 · d bits respectively, and the outputs T i−1 , j + 1 from the previous PE are d-bit values. Therefore, if C i, j-1 is C i, j-1 <2 2 · d + 1 , the output from the adder is a value of 2 · d + 2 bits. Further, R1 to R7 are d-bit registers, and R8 receiving the output from the adder is a 2 · d + 2 bit register. The register R8 sets T from the LSB to the d-th bit.
It is output to the next PE as i−1 , j + 1 , and the upper d + 2 bits are fed back to the adder as C i, j−1 .

【0079】図8ではNj はBj に比べて1クロック前
に入力されるのでAi・Bj-1 とMi-1・Nj が同時に演算
される。また、Ti-1,j+1 をAi・Bj-1 及びMi-1・Nj
と同時に演算するために、Bin,Ninから入力されるB
j ,Nj は2クロック遅らされて次のPEに出力され
る。
In FIG. 8, N j is input one clock before B j , so that A i · B j-1 and M i-1 · N j are calculated at the same time. In addition, T i−1 , j + 1 is A i · B j−1 and M i−1 · N j
In order to calculate at the same time, B input from B in and N in
j and N j are delayed by 2 clocks and output to the next PE.

【0080】従って、図8のPEによっても式(17)
の演算を行うことができ、図9のシストリックアレイに
よってモンゴメリーの剰余乗算が高速に実現できること
がわかる。この場合、アルゴリズム に相当する処理は
必要なく、図9に示すようにm+1個のPEによってア
レイが構成できる。
Therefore, according to the PE of FIG.
It can be seen that Montgomery's modular multiplication can be realized at high speed by the systolic array of FIG. In this case, the process corresponding to the algorithm is not necessary, and the array can be configured by m + 1 PEs as shown in FIG.

【0081】また、図8はv=dとして説明したが、v
<dであるvに対しても同様の手法によってモンゴメリ
ーの剰余乗算を実行できることは明らかである。
Although FIG. 8 has been described with v = d,
It is obvious that Montgomery's modular multiplication can be executed for v with d that is <d.

【0082】〔モンゴメリーの剰余乗算及びべき乗剰余
回路の実施例4〕また、実施例3に示したアルゴリズム
4を実行する場合、Ai は予めPEに設定している必要
はなく、図10のようにAinからAi(i=0,…,k-1) を下
位桁からNj に同期させて入力させ、図11のようにA
inとAout を接続して次のPEに送る構成にしてもよ
い。この場合、Ai(i=0,…,k-1) はBj(j=0,…,m-1) よ
りも1クロック先に入力されるので、#1のPEにおい
てA0 が入力されると同時にR1のレジスタにA0 を保
持すると、A0・Bj(j=0,…,m-1) を演算を全てのjに対
して実行することができる。また、Bj は2クロック遅
れて次のPEに入力されるが、Ai は1クロックしか遅
れないので、#i−1のPEにおいてAi がBj(j=0,
…,m-1) の前に入力され保持できたとすると、#iのP
EではAi+1 がBj(j=0,…,m-1) の前に入力され保持で
きる。従って、#iのPEにおいて無理なくAi+1・B
j(j=0,…,m-1) の演算が実行できる。従って、回路規模
及び処理速度を変えることなくアルゴリズム4を図1
0,11のPE及びシストリックアレイによっても実現
できる。
[Fourth Embodiment of Montgomery's Residual Multiplication and Power Residue Circuit] Further, when executing the algorithm 4 shown in the third embodiment, it is not necessary to set A i in the PE in advance, and as shown in FIG. , A i (i = 0, ..., k-1) from A in is input in synchronization with N j from the lower digit, and as shown in FIG.
The configuration may be such that in and A out are connected and sent to the next PE. In this case, A i (i = 0, ..., k-1) is input one clock ahead of B j (j = 0, ..., m-1), so A 0 is input in the # 1 PE. When A 0 is held in the register of R1 at the same time, the operation of A 0 · B j (j = 0, ..., m-1) can be executed for all j. Also, B j is input to the next PE after being delayed by 2 clocks, but A i is delayed by only 1 clock, so that A i is B j (j = 0,
..., m-1), and if it could be held before
In E, A i + 1 can be input and held before B j (j = 0, ..., m-1). Therefore, in PE of #i, A i + 1 · B can be easily
The operation of j (j = 0, ..., m-1) can be executed. Therefore, the algorithm 4 shown in FIG. 1 is used without changing the circuit scale and the processing speed.
It can be realized also by PE of 0 and 11 and a systolic array.

【0083】〔モンゴメリーの剰余乗算及びべき乗剰余
回路の実施例5〕モンゴメリーのべき乗剰余演算は式
(17)の演算の繰り返しによって実行できる。図10
及び図8,10に示したPEは式(17)の演算を行う
ことができるので、図12のようにメモリと組み合わせ
れば、1つのPEを( 3・ t/2+2)・q回(qはモン
ゴメリーの剰余乗算アレイを構成するために必要なPE
の数で、図7のPEではk+3個,図8,10のではk
−2個)用いてモンゴメリーのべき乗剰余演算を処理で
きる。もし、p個のPEを用いるならば、( 3・ t/2
+2)・q/p回の繰り返しでモンゴメリーのべき乗剰余
演算を処理できる。処理速度は繰り返し回数に反比例す
るので、この方式は処理速度をPEの数に比例させるこ
とができ、また、PEの数による処理速度の高速化また
は回路規模の小型化に対して同じ効率のべき乗剰余演算
回路を構成することができる。
[Embodiment 5 of Montgomery's modular multiplication and modular exponentiation circuit] Montgomery's modular exponentiation can be executed by repeating the calculation of equation (17). Figure 10
Since the PEs shown in FIGS. 8 and 10 can perform the operation of the equation (17), if one PE is combined with a memory as shown in FIG. 12, one PE is (3.t / 2 + 2) .q times (q Is the PE required to construct the Montgomery modular multiplication array
, The PE in FIG. 7 is k + 3, and in FIGS.
-2) can be used to process the Montgomery modular exponentiation operation. If p PEs are used, (3 · t / 2
It is possible to process Montgomery's modular exponentiation operation by repeating +2) · q / p times. Since the processing speed is inversely proportional to the number of repetitions, this method can make the processing speed proportional to the number of PEs, and the power of the same efficiency can be used for increasing the processing speed by the number of PEs or reducing the circuit size. A remainder arithmetic circuit can be configured.

【0084】従って、図13に示すような装置化が可能
になる。図13において、SYMC(Systolic Modular
Exponentiation Chip)と表されているのは、p個のP
Eを縦列接続したものをチップ化したものである。pは
1≦p≦( 3・ t/2+2)・qであれば任意であるの
で、任意の回路規模のチップを構成することができる。
また、SYMCは回路構成に規則性をもつので装置化及
びチップ化が非常に行いやすい。また、処理速度はSY
MCの数に比例して高速化できるので、図13に示すよ
うにSYMCを従属に接続するだけでよい。この場合、
SYMCの処理回数を変える必要があるが、これは制御
回路を外部からプログラミング可能なROM等によって
構成することによって容易に実現できる。
Therefore, the device as shown in FIG. 13 can be realized. In FIG. 13, SYMC (Systolic Modular
Exponentiation Chip) is represented by p P
This is a chip formed by connecting Es in cascade. Since p is arbitrary as long as 1 ≦ p ≦ (3 · t / 2 + 2) · q, a chip having an arbitrary circuit scale can be configured.
In addition, SYMC has a regular circuit structure, so that it is very easy to make a device and a chip. Also, the processing speed is SY
Since the speed can be increased in proportion to the number of MCs, it is only necessary to connect SYMCs to the subordinates as shown in FIG. in this case,
Although it is necessary to change the number of times of SYMC processing, this can be easily realized by configuring the control circuit with an externally programmable ROM or the like.

【0085】〔モンゴメリーの剰余乗算及びべき乗剰余
演算回路のその他の実施例〕上記実施例によるアルゴリ
ズムでは1つのPEで行う処理は簡単な整数演算である
ので、PEを別にチップ化しなくても通常のDSPやC
PU等によってもモンゴメリーのべき乗剰余演算を簡単
に実現することができる。
[Other Embodiments of Montgomery's Residual Multiplication and Exponentiation Residue Arithmetic Circuit] In the algorithm according to the above embodiment, the processing performed by one PE is a simple integer arithmetic operation, so that it is possible to perform a normal PE operation even if the PE is not separately chipped. DSP or C
It is possible to easily implement Montgomery's modular exponentiation by using PU or the like.

【0086】また、上記実施例はシストリックアレイを
基本としているので、回路構成が規則的であり、制御や
遅延も局所的であるのでVLSIによる実用化にも最適
である。
Since the above-described embodiment is based on the systolic array, the circuit configuration is regular and the control and delay are local, so that it is suitable for practical use by VLSI.

【0087】また、上記実施例のPEを従属に接続せず
独立した演算素子として用い、よく知られたマイクロプ
ログラミング的な手法によって制御して剰余乗算及びべ
き乗剰余演算を実現することも容易である。
It is also easy to realize the modular multiplication and the modular exponentiation operation by using the PE of the above-mentioned embodiment as an independent arithmetic element without being connected to the subordinates and controlling it by a well-known microprogramming method. ..

【0088】また、図5,7及び図8,10のPEは式
(18)の演算を一括して実行しているが、式(18)
を種々に分解した演算素子によって最終的に式(18)
の演算を実行する場合も本発明は含んでいる。
The PEs of FIGS. 5, 7 and 8 and 10 collectively execute the operation of the equation (18), but the equation (18)
The equation (18)
The present invention also includes the case of executing the calculation of.

【0089】また、本発明をシストリックアレイによっ
て実行する場合、制御信号もデータと同時に入力させる
ことができ、制御信号の伝送レジスタまで含んだものを
PEとすることもできる。
When the present invention is implemented by a systolic array, a control signal can be input at the same time as data, and a PE including a control signal transmission register can also be used.

【0090】以上によってシストリックアレイを用いた
べき乗剰余演算及び剰余乗算回路及び方法の構成法が示
された。この方式はイブンによる手法の欠点をすべて解
決した回路及び方法を提供する。それによって、次のよ
うな効果を持つ効率的な暗号システムを構成することが
できる。
As described above, the method of constructing the modular exponentiation and modular multiplication circuit and method using the systolic array has been shown. This scheme provides a circuit and method that overcomes all the drawbacks of the Iven approach. As a result, an efficient cryptographic system having the following effects can be constructed.

【0091】高速な暗号システムが必要な場合、本発明
によるべき乗剰余演算及び剰余乗算回路をVLSI等に
よって構成すればよい。この場合、本発明によるべき乗
剰余演算及び剰余乗算回路は簡単なPEによる規則構造
を持ち、かつ、PEの制御とPE内の遅延時間は局所的
であるので、VLSIに最適である。これによって、高
速な暗号システムが構成される。
When a high-speed cryptosystem is required, the exponentiation / residue calculation and the modular multiplication circuit according to the present invention may be configured by VLSI or the like. In this case, the modular exponentiation operation and modular multiplication according to the present invention have a simple PE rule structure, and the PE control and the delay time within the PE are local, which is optimal for VLSI. This constitutes a high speed encryption system.

【0092】また、高速性よりも小型回路による暗号シ
ステムが要求される場合は、本発明によるべき乗剰余演
算及び剰余乗算回路をPE数個で構成すればよい。この
場合も、PEによる規則構造と制御と遅延時間の局所性
といった特徴は失われず回路化しやすい。また、PE内
で行われる演算は簡単な整数演算であるので、本発明に
よる演算手順はCPUやDSP等のソフト的な手法によ
っても簡単な暗号システムを実現することができる。
When a cryptographic system using a small circuit is required rather than high speed, the power-residue calculation and the residue-multiplication circuit according to the present invention may be composed of several PEs. In this case as well, the features such as the regular structure by PE, the control, and the locality of the delay time are not lost, and the circuit can be easily formed. Further, since the operation performed in the PE is a simple integer operation, the operation procedure according to the present invention can realize a simple cryptographic system even by a software method such as a CPU or a DSP.

【0093】また、いくつかのPEからなる小型回路
(SYMC等)による暗号装置を構成した後で、高速性
が必要となっても図10のように、その小型回路を縦続
に接続して行けば、回路規模に比例した高速化が実現で
きる。従って、暗号装置を作り直すことなく、継ぎ足し
て行くだけで必要に応じた高速化が簡単に行える暗号シ
ステムを実現できる。
Further, even if high speed is required after the encryption device is composed of small circuits (SYMC etc.) consisting of several PEs, the small circuits should be connected in cascade as shown in FIG. If so, speeding up proportional to the circuit scale can be realized. Therefore, it is possible to realize an encryption system in which the speed can be easily increased as necessary simply by adding the encryption device without recreating the encryption device.

【0094】また、1度暗号システムを構成した後で、
暗号システムの強度を増すために演算する整数のビット
数を増す場合も、同一の回路または、PEの数を増した
同様の回路によって対応することができる。これは、本
発明のべき乗剰余演算及び剰余乗算回路が回路規模と処
理回数を簡単にトレードオフできるので、演算すべき整
数のビット数の違いを処理回数の違いに帰着できるため
である。従って、システムの暗号的な強度を増す場合に
も、暗号装置をつくり直す必要がない。また、演算する
整数のビット数を減少させる場合にも、暗号装置をつく
り直すことのない暗号システムを実現することができ
る。
After the encryption system is constructed once,
Even when the number of integer bits to be calculated for increasing the strength of the cryptosystem is increased, the same circuit or a similar circuit with an increased number of PEs can be used. This is because the modular exponentiation and modular multiplication circuit of the present invention can easily trade off the circuit scale and the number of processings, and thus the difference in the number of bits of the integers to be calculated can result in the difference in the number of processings. Therefore, even if the cryptographic strength of the system is increased, it is not necessary to remake the cryptographic device. Further, even when the number of bits of the integer to be calculated is reduced, it is possible to realize a cryptographic system without recreating the cryptographic device.

【0095】以上のような効果は、特願平3-225986号で
も述べているように従来のべき乗剰余演算及び剰余乗算
による暗号装置では実現できないものである。従って、
本発明によるべき乗剰余演算及び剰余乗算回路及び方法
を用いることによって柔軟で拡張性のある暗号システム
を構成することができる。
As described in Japanese Patent Application No. 3-225986, the above-mentioned effects cannot be realized by the conventional cryptographic device based on modular exponentiation and modular multiplication. Therefore,
By using the modular exponentiation operation and the modular multiplication circuit and method according to the present invention, it is possible to construct a flexible and expandable cryptographic system.

【0096】次に、特願平3-225986号のシストリックア
レイ(以後、アレイ0と呼ぶ)と本発明の実施例1に示
したシストリックアレイ(アレイ1),実施例2,3に
示したシストリックアレイ(アレイ2)の比較を行う。
Next, the systolic array of Japanese Patent Application No. 3-225986 (hereinafter referred to as array 0) and the systolic array (array 1) shown in the first embodiment of the present invention and the second and third embodiments are shown. Compare the systolic array (array 2).

【0097】アレイ0は除算を伴うために剰余テーブル
(ROM等)によって剰余演算を行うが、アレイ1,2
はすべて乗算によって剰余乗算が演算できるため1クロ
ックに必要な処理時間がアレイ0に比べて短いために高
速処理できる。また、アレイ1,2はROM等の剰余テ
ーブルを用いず、ANDゲートのような回路規模のくす
ることができる。また、アレイ0はキャリービットの処
理のためのPEを必要とするが、アレイ1,2は必要と
しないので必要なPEの数がアレイ0に比べて少ない。
従って、同じ程度の回路規模を用いた場合、アレイ1,
2はアレイ0に対して数倍の高速処理が行える。
Since the array 0 involves division, the remainder operation is performed by the remainder table (ROM or the like).
Since all can perform modular multiplication by multiplication, the processing time required for one clock is shorter than that of array 0, and therefore high-speed processing is possible. Further, the arrays 1 and 2 can be made to have a circuit scale like an AND gate without using a remainder table such as a ROM. Further, array 0 requires PEs for carrying bit processing, but arrays 1 and 2 do not require PEs, so the number of required PEs is smaller than that of array 0.
Therefore, using the same circuit scale, array 1,
2 can perform high speed processing several times as fast as array 0.

【0098】また、アレイ1はアレイ0に比べてPEの
種類が少なく図7に示したようにPEを共通化しやす
い。また、アレイ2は1種類のPEのみで構成できる。
従って、アレイ1,2はアレイ0よりも容易に回路化す
ることができ、アレイ0より無駄のない回路を構成する
ことができる。
The array 1 has a smaller number of PEs than the array 0, and the PEs can be commonly used as shown in FIG. Further, the array 2 can be composed of only one type of PE.
Therefore, the arrays 1 and 2 can be formed into a circuit more easily than the array 0, and a circuit with less waste than the array 0 can be configured.

【0099】また、アレイ0が剰余テーブルを用いてい
る場合、演算すべき各整数のビット数の増加に対してア
レイ1,2はアレイ0よりも柔軟性が高い。これは、ア
レイ0がROM等の剰余テーブルを用いている場合、テ
ーブルの最大容量によって各整数のビット数が制限され
るためである。これに対し、アレイ1,2は乗算によっ
て剰余が演算されるので剰余テーブルが必要なく演算す
る整数のビット数に制限がない。ただし、演算する整数
のビット数が減少する場合(中国人の剰余定理を用いる
場合等)には、アレイ0〜アレイ2の柔軟性は同じであ
り、制限がない。よって、演算する整数のビット数の変
化に対して、アレイ1,2はアレイ0と異なり制限がな
い。従って、アレイ1,2は演算する整数のビット数の
異なる演算に対してもSYMC等の回路を全く作り直す
必要がない。
When the array 0 uses the remainder table, the arrays 1 and 2 are more flexible than the array 0 with respect to the increase in the number of bits of each integer to be calculated. This is because, when the array 0 uses a remainder table such as a ROM, the maximum capacity of the table limits the number of bits of each integer. On the other hand, since the modulos are calculated by multiplication in the arrays 1 and 2, there is no need for the modulo table and there is no limit to the number of integer bits to be calculated. However, when the number of bits of the integer to be calculated decreases (such as when using the Chinese Remainder Theorem), the flexibility of Array 0 to Array 2 is the same and there is no limitation. Therefore, unlike the array 0, the arrays 1 and 2 are not limited to changes in the number of bits of the integer to be calculated. Therefore, in the arrays 1 and 2, it is not necessary to remake a circuit such as SYMC even for an operation in which the number of integer bits to be operated is different.

【0100】以上のことから、上記実施例による剰余乗
算及びべき乗剰余方式を用いた暗号装置は、上述の効果
を最も小さな回路で高速に、かつ柔軟に実現できる暗号
システムを提供することができる。
As described above, the cryptographic apparatus using the modular multiplication and the modular exponentiation method according to the above-described embodiment can provide a cryptographic system that can achieve the above-mentioned effects with high speed and flexibility with the smallest circuit.

【0101】〔モンゴメリーの剰余乗算及びべき乗剰余
回路の実施例6〕i回目の演算におけるTR の値T_
iを、式(18)におけるT_iとは異なり、 T_i=( T_i-1/Y+Ai・BR)+Mi・N (19) ただし、Mi =((T_i-1/Y+Ai・BR) mod Y)・N0'
mod Y, T_-1 =0,N0'=N' mod Y この演算を複数のPEによる並列処理で実現するため
に、BR ,NをBj ,Nj に分解して次のように表す。 アルゴリズム5: FOR i=0 TO k−1 FOR j=0 TO m−1 Si,j =Ti-1,j /Y+Ai・Bj +Ci,j-1i =dwv (dwv (Si,0 )・ N0') Ri,j =Si,j +Mi・Nj +Li-1,j+1・X Li,j =dwv (Ri,j ) Ti,j =dwd+v (Ri,j )−Li,ji,j =upd+v (Ri,j ) NEXT NEXT ただし、dwd (Z)=Z mod 2d upd (Z)=(Z−dwd (Z))/2di,j ,Ci,j ,Li,j の初期値は全て0 アルゴリズム5において、Ci,j-1 は桁上がりとしてS
i,j を演算する時に用いられる。また、Li-1,j+1・X,
およびTi-1,j /Y等のX,Yを定数としてもつ演算は
他の値に対してビットをずらすことによって実現でき
る。従って、Ti,j に関する演算はRi,j のLSBに対
してvビット目からd+v−1ビット目までの値をT
i,j とすることを意味する。ただし、Li,j はRi,j
LSBからv−1ビット目までの値である。このように
i,j を得るための1/Y演算をRi,j 毎の下位へのビ
ットシフトによって実現しているので、Li-1,j+1 はR
i,j 演算するときに用いられ、Xによって桁を合わせて
演算される。
[Embodiment 6 of Montgomery's modular multiplication and modular exponentiation circuit] The value T_ of T R in the i-th calculation
The i, unlike T_ i in equation (18), T_ i = ( T_ i-1 / Y + A i · B R) + M i · N (19) However, M i = ((T_ i -1 / Y + A i · B R) mod Y) · N 0 '
mod Y, in order to achieve parallel processing by T_ -1 = 0, N 0 ' = N' mod Y plurality this operation PE, B R, to decompose the N B j, the N j as follows Represent Algorithm 5: FOR i = 0 TO k-1 FOR j = 0 TO m-1 S i, j = T i-1 , j / Y + A i · B j + C i, j-1 M i = dw v (dw v (S i, 0 ) · N 0 ′) R i, j = S i, j + M i · N j + L i-1 , j + 1 · X L i, j = dw v (R i, j ) T i , j = dw d + v (R i, j ) −L i, j C i, j = up d + v (R i, j ) NEXT NEXT However, dw d (Z) = Z mod 2 d up d ( Z) = (Z−dw d (Z)) / 2 d Initial values of T i, j , C i, j , L i, j are all 0. In Algorithm 5, C i, j-1 is S as a carry.
Used when computing i, j . Also, L i−1 , j + 1 · X,
And operations having X, Y as constants such as T i−1 , j / Y can be realized by shifting bits with respect to other values. Therefore, in the operation regarding T i, j , the value from the v-th bit to the d + v−1-th bit with respect to the LSB of R i, j is T
It means i, j . However, L i, j is a value from the LSB of R i, j to the v−1th bit. In this way, the 1 / Y operation for obtaining T i, j is realized by the bit shift to the lower order for each R i, j, so that L i−1 , j + 1 is R
It is used when performing i, j calculations, and is calculated by matching the digits by X.

【0102】アルゴリズム5においてiを処理回数,j
をクロックと考えると各jに対して演算しなければなら
ないのはSi,j 及びRi,j のみであり(Li,j ,T
i,j ,Ci,j はビットシフトのみで実現される)、S
i,j 及びRi,j は次の同型の演算によって実現される。
In Algorithm 5, i is the number of processing times, j
Is a clock, it is only S i, j and R i, j that must be calculated for each j (L i, j , T
i, j and C i, j are realized only by bit shift), S
i, j and R i, j are realized by the following operations of the same type.

【0103】 f=d/y+a・ b+c・ x (20) ただし、yは2v または1,xは2d または1 x,yはビットシフトの有無であるので、式(20)は
図14に示すPEによって演算できる。
F = d / y + ab + cx (20) However, y is 2 v or 1, x is 2 d or 1 x, y is the presence or absence of bit shift, and therefore the equation (20) is shown in FIG. It can be calculated by the PE shown.

【0104】以下、簡単のためにv=1の場合について
図14の回路と動作を説明する。図14において×は乗
算器を示し、d個のアンドによって実現できる。R1は
aを保持する1ビットレジスタである。S1,S2は入
力d,cをyまたはxによってビットシフトさせるかど
うかを選択するセレクタである。+で示される加算器は
乗算器からの出力a・ bとセレクタからの出力d/y及
びc・ xの加算を行いfを演算する。R2は加算器から
の出力を保持するレジスタである。以上によって、図1
4のPEで式(20)が演算できることが分かる。
For simplicity, the circuit and operation of FIG. 14 will be described below for the case of v = 1. In FIG. 14, x indicates a multiplier, which can be realized by d AND gates. R1 is a 1-bit register that holds a. S1 and S2 are selectors for selecting whether to bit shift the inputs d and c by y or x. The adder indicated by + adds the outputs a and b from the multiplier and the outputs d / y and c and x from the selector to calculate f. R2 is a register that holds the output from the adder. By the above, FIG.
It can be seen that the equation (20) can be calculated with the PE of 4.

【0105】従って、アルゴリズム5の各演算は図15
のように図14のPEを2つ組み合わせれば求めること
ができる。ただし、図15のBin,Ninには各々Bj
j(j=0,…,m-1) が下位桁から順に入力されるとする。
この場合、左のPEでSi,jが演算され、右のPEでR
i,j が演算される。また、v=1であるのでNが奇数で
あれば、N0'=1となり、Si,0 のLSBがMi とな
り、右のPEのレジスタR1に保持される。また、R
i,j はCi,j ,Ti,j ,Li,j に分割されて表示されて
いる。よって、図15をk個または図14のPEを2・
k個用いればアルゴリズム5が実行できることは明らか
である。以上から、図14のPEによって式(19)を
効率的に並列処理できることがわかる。
Therefore, each operation of Algorithm 5 is shown in FIG.
It can be obtained by combining the two PEs shown in FIG. However, B j and N in in FIG.
It is assumed that N j (j = 0, ..., M-1) are input in order from the lower digit.
In this case, the left PE calculates S i, j and the right PE calculates R i
i, j are calculated. Further, since v = 1, if N is an odd number, N 0 ′ = 1, and the LSB of S i, 0 becomes M i , which is held in the register R1 of the right PE. Also, R
i, j is divided into C i, j , T i, j and L i, j for display. Therefore, k in FIG. 15 or 2 PE in FIG.
It is clear that the algorithm 5 can be executed by using k. From the above, it can be seen that the PE of FIG. 14 can efficiently perform the parallel processing of Expression (19).

【0106】また、図14,15はv=1として説明し
たが、v<dであるvに対しても同様の手法によってモ
ンゴメリーの剰余乗算を実行できることは明らかであ
る。
Although FIGS. 14 and 15 have been described with v = 1, it is clear that Montgomery's modular multiplication can be executed for v with v <d by the same method.

【0107】〔モンゴメリーの剰余乗算及びべき乗剰余
回路の実施例7〕また、次のようなシストリックアレイ
を構成することができる。式(14)の演算を次のよう
なアルゴリズムによって実行する。 アルゴリズム6: FOR i=0 TO k FOR j=0 TO m Si,j =Ti-1,j+1 +upv (Si,j-1 )+Ai・Bj Mi =dwv (dwv (Si,0 )・ N0') Ri,j =dwv (Si,j )+upv (Ri,j-1 )+Mi・Nji,j =dwv (Ri,j ) NEXT NEXT アルゴリズム6のアルゴリズム5に対する違いは、式
(19)のTi-1 /Yをビットずれではなく、クロック
のずれによって実現している点である。従って、アルゴ
リズム5でビットずれのために生じる値Li,j は、アル
ゴリズム6では生じない。
[Embodiment 7 of Montgomery's modular multiplication and modular exponentiation circuit] Further, the following systolic array can be constructed. The calculation of Expression (14) is executed by the following algorithm. Algorithm 6: FOR i = 0 TO k k FOR j = 0 TO m S i, j = T i-1 , j + 1 + up v (S i, j-1 ) + A i · B j Mi = dw v (dw v (S i, 0 ) · N 0 ′) R i, j = dw v (S i, j ) + up v (R i, j-1 ) + Mi · N j T i, j = dw v (R i, j ) The difference between the NEXT NEXT algorithm 6 and the algorithm 5 is that T i-1 / Y in the equation (19) is realized by a clock shift, not a bit shift. Therefore, the value L i, j generated in Algorithm 5 due to the bit shift does not occur in Algorithm 6.

【0108】アルゴリズム6を実行するPE及びシスト
リックアレイを図16,17に示す。アルゴリズム6の
j,iもまた、それぞれがクロック及び処理回数に対応
する。また、図17のBin,Ninには各々Bj ,Nj(j=
0,…,m-1) が下位桁から順に入力される。
A PE and systolic array implementing Algorithm 6 are shown in FIGS. Each of j and i in Algorithm 6 also corresponds to the clock and the number of times of processing. Further, each of the B in, N in the Figure 17 B j, N j (j =
0, ..., m-1) are input in order from the lower digit.

【0109】以降、簡単のためにv=dの場合について
説明をする。まず、図16において、×はdビット・ d
ビットの乗算器を示し、+は加算器を示す。R1はAi
またはMi を保持するレジスタであり、R2は加算器か
らの出力を保持するレジスタであり、そのvビット目以
上は桁上がりとして1クロック遅れで加算器にフィード
バック入力されている。これによって、図17では左の
PEにおいてSi,j が演算され、右のPEにおいてR
i,j が演算されることがわかる。このとき、Miは外部
にある乗算器によってN0'と乗算され右のPEへ出力さ
れる。従って、図7のPEはアルゴリズム6を並列処理
によって実現するための効率的な基本演算子になってい
ることがわかる。
Hereinafter, for simplicity, the case of v = d will be described. First, in FIG. 16, x is d bits · d
A bit multiplier is shown, and + is an adder. R1 is A i
Alternatively, R2 is a register that holds M i , and R2 is a register that holds the output from the adder. The v-th bit and above are carried as a carry and fed back to the adder with a delay of one clock. As a result, in FIG. 17, S i, j is calculated in the left PE and R i is calculated in the right PE.
It can be seen that i, j is calculated. At this time, M i is multiplied by N 0 'by an external multiplier and output to the right PE. Therefore, it is understood that the PE in FIG. 7 is an efficient basic operator for realizing the algorithm 6 by parallel processing.

【0110】また、図16,17はv=dとして説明し
たが、v<dであるvに対しても同様の手法によってモ
ンゴメリーの剰余乗算を実行できることは明らかであ
る。
Although FIGS. 16 and 17 have been described with v = d, it is clear that Montgomery's modular multiplication can be executed for v with v <d by the same method.

【0111】〔モンゴメリーの剰余乗算及びべき乗剰余
回路の実施例8〕モンゴメリーのべき乗剰余演算は式
(19)の演算の繰り返しによって実行できる。図14
及び図16に示したPEは式(19)の演算を行うこと
ができるので、図18のようにメモリと組み合わせれ
ば、1つのPEを( 3・ t/2+2)・q回(qはモンゴ
メリーの剰余乗算アレイを構成するために必要なPEの
数で、図14のPEでは2・ k個,図16のPEでは2
・(k+1) 個)用いてモンゴメリーのべき乗剰余演算を
処理できる。もし、p個のPEを用いるならば、( 3・
t/2+2)・q/p回の繰り返しでモンゴメリーのべき
乗剰余演算を処理できる。処理速度は繰り返し回数に反
比例するので、この方式は処理速度をPEの数に比例さ
せることができ、また、PEの数による処理速度の高速
化または回路規模の小型化に対して同じ効率のべき乗剰
余演算回路を構成することができる。
[Embodiment 8 of Montgomery's modular multiplication and modular exponentiation circuit] Montgomery's modular exponentiation can be executed by repeating the calculation of equation (19). 14
And since the PE shown in FIG. 16 can perform the operation of the equation (19), if it is combined with a memory as shown in FIG. 18, one PE will be (3 · t / 2 + 2) · q times (q is Montgomery). The number of PEs required to form the remainder multiplication array of 2k in the PE of FIG. 14 and 2 in the PE of FIG.
-(K + 1) pieces can be used to process the Montgomery modular exponentiation operation. If p PEs are used, (3.
It is possible to process Montgomery's modular exponentiation operation by repeating t / 2 + 2) · q / p times. Since the processing speed is inversely proportional to the number of repetitions, this method can make the processing speed proportional to the number of PEs, and the power of the same efficiency can be used for increasing the processing speed by the number of PEs or reducing the circuit size. A remainder arithmetic circuit can be configured.

【0112】従って、図19に示すような装置化が可能
になる。図19においてMEC(Modular Exponentiati
on Chip )と表されているのは、p個のPEを組み合わ
せてチップ化したものである。pは1≦p≦( 3・ t/
2+2)・qであれば任意であるので、任意の回路規模の
チップを構成することができる。また、MECは回路構
成に規則性をもつので装置化及びチップ化が非常に行い
やすい。また、処理速度はMECの数に比例して高速化
できるので、図7に示すようにMECを複数用いればよ
い。この場合、各MECの制御をチップ数に応じて変え
る必要があるが、これは制御回路を外部からプログラミ
ング可能なROM等によって構成することによって容易
に実現できる。
Therefore, a device as shown in FIG. 19 can be realized. In FIG. 19, MEC (Modular Exponentiati
On chip) is a chip formed by combining p PEs. p is 1 ≤ p ≤ (3 · t /
Since 2 + 2) · q is arbitrary, a chip having an arbitrary circuit scale can be configured. Further, since the MEC has regularity in the circuit configuration, it can be very easily made into a device and a chip. Further, since the processing speed can be increased in proportion to the number of MECs, a plurality of MECs may be used as shown in FIG. In this case, it is necessary to change the control of each MEC according to the number of chips, but this can be easily realized by configuring the control circuit with an externally programmable ROM or the like.

【0113】〔モンゴメリーの剰余乗算及びべき乗剰余
演算回路のその他の実施例〕本発明によるアルゴリズム
では1つのPEで行う処理は簡単な整数演算であるの
で、PEを別にチップ化しなくても通常のDSPやCP
U等によってもモンゴメリーのべき乗剰余演算を簡単に
実現することができる。
[Other Embodiments of Montgomery's Residual Multiplication and Exponentiation Residue Arithmetic Circuit] In the algorithm according to the present invention, the processing performed by one PE is a simple integer arithmetic operation. And CP
Even with U or the like, Montgomery's modular exponentiation operation can be easily realized.

【0114】また、本発明は回路構成が規則的であり、
制御や遅延も局所的であるのでVLSIによる実用化に
も最適である。
The present invention has a regular circuit configuration,
Since the control and delay are local, it is suitable for practical use by VLSI.

【0115】また、図14,16のPEを組み合わせた
ものを1つのPEとして構成することも可能である。
It is also possible to combine the PEs shown in FIGS. 14 and 16 into one PE.

【0116】以上によってPEを用いたべき乗剰余演算
及び剰余乗算回路及び方法の構成法が示された。それに
よって、次のような効果を持つ効率的な暗号システムを
構成することができる。
As described above, the method of constructing a modular exponentiation and modular multiplication circuit and method using PE has been shown. As a result, an efficient cryptographic system having the following effects can be constructed.

【0117】高速な暗号システムが必要な場合、本発明
によるべき乗剰余演算及び剰余乗算回路をVLSI等に
よって構成すればよい。この場合、本発明によるべき乗
剰余演算及び剰余乗算回路は簡単なPEによる規則構造
を持つので、VLSIに最適である。これによって、高
速な暗号システムが構成される。
When a high-speed cryptosystem is required, the exponentiation and modular multiplication and modular multiplication circuit according to the present invention may be configured by VLSI or the like. In this case, the modular exponentiation operation and the modular multiplication according to the present invention have a simple PE rule structure, and are therefore suitable for VLSI. This constitutes a high speed encryption system.

【0118】また、高速性よりも小型回路による暗号シ
ステムが要求される場合は、本発明によるべき乗剰余演
算及び剰余乗算回路をPE数個で構成すればよい。この
場合も、PEによる規則構造といった特徴は失われず回
路化しやすい。また、PE内で行われる演算は簡単な整
数演算であるので、本発明による演算手順はCPUやD
SP等のソフト的な手法によっても簡単な暗号システム
を実現することができる。
If a cryptographic system with a small circuit is required rather than high speed, the power-residue calculation and the residue-multiplication circuit according to the present invention may be configured by several PEs. Also in this case, the feature such as the regular structure of PE is not lost and it is easy to form a circuit. Further, since the operation performed in PE is a simple integer operation, the operation procedure according to the present invention is performed by the CPU or D.
A simple encryption system can be realized by a software method such as SP.

【0119】また、いくつかのPEからなる小型回路
(MEC等)による暗号装置を構成した後で、高速性が
必要となっても図19のように、その小型回路を複数用
いれば回路規模に比例した高速化が実現できる。従っ
て、暗号装置を作り直すことなく、回路を増して行くだ
けで必要に応じた高速化が簡単に行える暗号システムを
実現できる。
Further, even if high speed is required after the encryption device is constructed by a small circuit (MEC or the like) consisting of several PEs, the circuit scale can be increased by using a plurality of such small circuits as shown in FIG. A proportional increase in speed can be realized. Therefore, it is possible to realize an encryption system in which the required speed can be easily increased by simply increasing the number of circuits without recreating the encryption device.

【0120】また、1度暗号システムを構成した後で、
暗号システムの強度を増すために演算する整数のビット
数を増す場合も、同一の回路または、PEの数を増した
同様の回路によって対応することができる。これは、本
発明のべき乗剰余演算及び剰余乗算回路が回路規模と処
理回数を簡単にトレードオフできるので、演算すべき整
数のビット数の違いを処理回数の違いに帰着できるため
である。従って、システムの暗号的な強度を増す場合に
も、暗号装置をつくり直す必要がない。また、演算する
整数のビット数を減少させる場合にも、暗号装置をつく
り直すことのない暗号システムを実現することができ
る。
After the encryption system is constructed once,
Even when the number of integer bits to be calculated for increasing the strength of the cryptosystem is increased, the same circuit or a similar circuit with an increased number of PEs can be used. This is because the modular exponentiation and modular multiplication circuit of the present invention can easily trade off the circuit scale and the number of times of processing, so that the difference in the number of bits of the integers to be calculated can result in the difference in the number of times of processing. Therefore, even if the cryptographic strength of the system is increased, it is not necessary to remake the cryptographic device. Further, even when the number of bits of the integer to be calculated is reduced, it is possible to realize a cryptographic system without recreating the cryptographic device.

【0121】以上のような効果は、効率的に並列処理を
用いない従来のべき乗剰余演算及び剰余乗算による暗号
装置では実現できないものである。従って、本発明によ
るべき乗剰余演算及び剰余乗算回路及び方法を用いるこ
とによって柔軟で拡張性のある暗号システムを構成する
ことができる。
The above-described effects cannot be realized by the conventional cryptographic device based on modular exponentiation and modular multiplication that does not efficiently use parallel processing. Therefore, by using the modular exponentiation operation and the modular multiplication circuit and method according to the present invention, a flexible and expandable cryptosystem can be constructed.

【0122】[0122]

【発明の効果】以上説明したように、本発明によれば、
べき乗剰余演算及び剰余乗算が、 Z=X・ Y・ R-1 mod N (16) の繰り返し演算によって実行できる。従って、必要な演
算は、同一または同型の演算回路によって実行できる。
As described above, according to the present invention,
The modular exponentiation and the modular multiplication can be performed by the iterative calculation of Z = X · Y · R −1 mod N (16). Therefore, required arithmetic operations can be performed by the same or the same type of arithmetic circuit.

【0123】また、これをモンゴメリーの剰余乗算 Z=X・ Y・ R-1 mod N =(X・ Y+S・ N)/R ただし、S=X・Y・N’ mod N を用いて演算する場合には、条件を満足する入力値を用
いることによって、モンゴメリーの剰余乗算の単純な繰
り返しによって剰余乗算及びべき乗剰余演算が実行でき
る。
Further, when this is calculated using Montgomery's remainder multiplication Z = X · Y · R −1 mod N = (X · Y + S · N) / R, where S = X · Y · N ′ mod N For, by using an input value that satisfies the condition, the modular multiplication and the modular exponentiation operation can be executed by a simple iteration of Montgomery's modular multiplication.

【0124】また、必要な演算は整数演算であるので、
その演算回路が簡単に実現できるようになった。
Since the required operation is an integer operation,
The arithmetic circuit can now be easily realized.

【0125】従って、共通の演算回路及び方法によっ
て、剰余乗算及びべき乗剰余演算を用いた種々の暗号シ
ステムが効率的に構成できるようになった。
Therefore, various cryptographic systems using the modular multiplication and the modular exponentiation can be efficiently constructed by the common arithmetic circuit and method.

【0126】本発明によるモンゴメリーの剰余乗算回路
は非常に小さな回路規模で、高速処理を実現する。
The Montgomery remainder multiplication circuit according to the present invention realizes high-speed processing with a very small circuit scale.

【0127】本発明によるシストリックアレイを用いた
べき乗剰余演算及び剰余乗算回路によって、次のような
効果を持つ効率的な暗号システムを構成することができ
る。
By the modular exponentiation operation and the modular multiplication circuit using the systolic array according to the present invention, an efficient cryptosystem having the following effects can be constructed.

【0128】高速な暗号システムが必要な場合、本発明
によるべき乗剰余演算及び剰余乗算回路をVLSI等に
よって構成すればよい。この場合、本発明によるべき乗
剰余演算及び剰余乗算回路は簡単なPEによる規則構造
を持ち、かつ、PEの制御とPE内の遅延時間は局所的
であるので、VLSIに最適である。これによって、高
速な暗号システムが構成される。
When a high-speed cryptosystem is required, the exponentiation and modular multiplication and modular multiplication circuit according to the present invention may be constructed by VLSI or the like. In this case, the modular exponentiation operation and modular multiplication according to the present invention have a simple PE rule structure, and the PE control and the delay time within the PE are local, which is optimal for VLSI. This constitutes a high speed encryption system.

【0129】また、高速性よりも回路規模の小型化が暗
号システムに要求される場合は、本発明によるべき乗剰
余演算及び剰余乗算回路をPE数個で構成すればよい。
この場合も、PEによる規則構造と制御と遅延時間の局
所性といった特徴は失われず回路化しやすい。また、P
E内で行われる演算は簡単な整数演算であるので、本発
明による演算手順はCPUやDSP等のソフト的な手法
によっても簡単な暗号システムを実現することができ
る。
Further, when the cryptographic system is required to have a smaller circuit scale rather than high speed, the power-residue arithmetic operation and the modular multiplication circuit according to the present invention may be constituted by several PEs.
In this case as well, the features such as the regular structure by PE, the control, and the locality of the delay time are not lost, and the circuit can be easily formed. Also, P
Since the operation performed in E is a simple integer operation, the operation procedure according to the present invention can realize a simple cryptographic system even by a software method such as a CPU or a DSP.

【0130】また、いくつかのPEからなる小型回路
(SYMC等)による暗号装置を構成した後で、高速性
が必要となっても、その小型回路を縦続に接続して行く
ことで、回路規模に比例した高速化が実現できる。従っ
て、暗号装置をまったく新たに作り直すことなく、継ぎ
足して行くだけで必要に応じた高速化が簡単に行える暗
号システムを実現できる。
Further, even if high speed is required after the encryption device is constructed by a small circuit (SYMC or the like) made up of several PEs, the small circuits can be connected in cascade to achieve circuit scale. It is possible to realize speedup proportional to. Therefore, it is possible to realize an encryption system in which the speed can be easily increased as needed by simply adding the encryption devices without newly recreating them.

【0131】また、回路規模と処理回数を簡単にトレー
ドオフできるので、1度暗号システムを構成した後で、
暗号システムの強度(解読に対する安全性)を高めるた
めに演算する整数のビット数を増加させる場合も、演算
すべき整数のビット数の違いを処理回数の違いに帰着で
きるため、同一の回路または、PEの数を増した同様の
回路によって対応することができる。従って、この場
合、暗号装置を新たにつくり直す必要がない。また、演
算する整数のビット数を減少させる場合にも、暗号装置
をあらためてつくり直さずに対処することができる。
Further, since the circuit scale and the number of processings can be easily traded off, once the encryption system is constructed,
Even when increasing the number of bits of the integer to be calculated in order to increase the strength (security against decryption) of the cryptosystem, the difference in the number of bits of the integer to be calculated can be attributed to the difference in the number of processing times. A similar circuit with an increased number of PEs can be accommodated. Therefore, in this case, it is not necessary to recreate the encryption device. Further, even when the number of bits of the integer to be calculated is reduced, it is possible to deal with the cryptographic device without remaking it.

【0132】従って、本発明によるべき乗剰余演算及び
剰余乗算回路及び方法を用いることによって柔軟で拡張
性のある暗号システムを構成することができる。
Therefore, by using the modular exponentiation operation and the modular multiplication circuit and method according to the present invention, it is possible to construct a flexible and expandable cryptographic system.

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

【図1】暗号システムを用いる通信系の構成例を示す図
である。
FIG. 1 is a diagram showing a configuration example of a communication system using a cryptographic system.

【図2】本発明による剰余乗算回路の例を示す図であ
る。
FIG. 2 is a diagram showing an example of a modular multiplication circuit according to the present invention.

【図3】本発明によるべき乗剰余演算回路の例を示す図
である。
FIG. 3 is a diagram showing an example of a modular exponentiation arithmetic circuit according to the present invention.

【図4】実施例の剰余乗算回路のブロック構成図であ
る。
FIG. 4 is a block configuration diagram of a modular multiplication circuit according to the embodiment.

【図5】実施例のPE(プロセッシング・ エレメント)
を示す図である。
FIG. 5 PE of the embodiment (processing element)
FIG.

【図6】図5のPEを用いたシストリックアレイを示す
図である。
6 is a diagram showing a systolic array using the PE of FIG.

【図7】共通化PEを示す図である。FIG. 7 is a diagram showing a common PE.

【図8】他の実施例のPEを示す図である。FIG. 8 is a diagram showing a PE of another embodiment.

【図9】図8のPEを用いたシストリックアレイを示す
図である。
9 is a diagram showing a systolic array using the PE of FIG.

【図10】他の実施例のPEを示す図である。FIG. 10 is a diagram showing a PE of another embodiment.

【図11】図10のPEを用いたシストリックアレイを
示す図である。
11 is a diagram showing a systolic array using the PE of FIG. 10. FIG.

【図12】PEとメモリを組み合わせた回路FIG. 12: Circuit combining PE and memory

【図13】SYMCを用いたべき乗剰余演算及び剰余乗
算回路を示す図である。
FIG. 13 is a diagram showing a modular exponentiation operation and a modular multiplication circuit using SYMC.

【図14】実施例2のPEを示す図である。14 is a diagram showing PE of Example 2. FIG.

【図15】図14のPEを用いた回路を示す図である。15 is a diagram showing a circuit using the PE of FIG.

【図16】実施例2のPEを示す図である。16 is a diagram showing PE of Example 2. FIG.

【図17】図16のPEを用いた回路を示す図である。17 is a diagram showing a circuit using the PE shown in FIG.

【図18】図17の回路とメモリを組み合わせた回路を
示す図である。
18 is a diagram showing a circuit in which the circuit of FIG. 17 and a memory are combined.

【図19】MECを用いたべき乗剰余演算及び剰余乗算
回路を示す図である。
FIG. 19 is a diagram showing a modular exponentiation operation and a modular multiplication circuit using MEC.

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

T 通信端末 S,SL セレクタ R,Ri レジスタ H ハ−フアダ− + 加算器 Bi 乗算器 Ni 乗算器 PE プロセッシング・エレメント MEC べき乗剰余演算チップ SYMC シストリックべき乗剰余演算チップT communication terminal S, SL selector R, Ri register H half adder + adder B i multiplier N i multiplier PE processing element MEC exponentiation residue calculation chip SYMC systolic exponentiation residue calculation chip

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】 Nを法とする整数A、Bの剰余乗算Q=
A・ B mod Nを利用して、通信内容の暗号化または復
号を行なう暗号通信方法において、 入力データU、Vに対して、Nと素である整数Rを用い
て、Z=U・V・R-1mod Nを演算して出力する演算
部を1つ以上設け、 当該演算部に対して、 Aと、RR =R2 mod Nなる定数RR とを入力して、A
R =A・ RR・R-1 modNを出力させ、 Bと、前記定数RR とを入力して、BR =B・ RR・R-1
mod Nを出力させ、 出力された前記AR と前記BR とを入力して、TR =A
R・BR ・ R-1 mod Nを出力させ、 出力された前記TR と定数1とを入力して、TR・1・ R
-1 mod NをQとして出力させることにより、前記剰余
乗算Q=A・ B mod Nを実行することを特徴とする暗
号通信方法。
1. Remainder multiplication of integers A and B modulo N = Q
In an encrypted communication method for encrypting or decrypting communication contents by using A · B mod N, an integer R which is a prime to N is used for input data U and V, and Z = U · V · One or more calculation units for calculating and outputting R −1 mod N are provided, and A and a constant R R such that R R = R 2 mod N are input to the calculation unit, and A
R = A · R R · R −1 mod N is output, B and the constant R R are input, and B R = B · R R · R −1
mod N is output, the output A R and B R are input, and T R = A
R · B R · R −1 mod N is output, and the output T R and constant 1 are input, and T R · 1 · R
-1 mod N is output as Q, whereby the modular multiplication Q = A · B mod N is executed.
【請求項2】 Nを法とする整数M、eに関するべき乗
剰余演算:C=Memod Nを利用して、通信内容の暗号
化または復号を行なう暗号通信方法において、 入力データU、Vに対して、Nと素である整数Rを用い
て、Z=U・V・R-1mod Nを演算して出力する演算
部を1つ以上設け、 当該演算部に対して、Mと、RR =R2 mod Nなる定数
R とを入力して、 MR =M・ RR・R-1 modNを出力させ、 eの2進表現をe=〔et,et-1,…, e1 〕とし、CR
の初期値をCR =RR・R-1 mod Nとして、順次高位ビ
ットからのei の値に従って、ei =1なるときに、前
記演算部に対してCR とMR とを入力して、CR・MR・R
-1 modNを新たなCR として出力させ、 更に、前記ei におけるiが1より大なるときには、前
記演算部に対して2つの入力データとして共にCR を入
力して、CR・CR・R-1 mod Nを新たなCR として出力
させ、 全ての前記ei に対する処理の終了後に、前記演算部に
対してCR と定数1とを入力して、C=CR・1・ R-1 m
od Nを出力させることにより、前記べき乗剰余演算C
=Me mod Nを実行することを特徴とする暗号通信方
法。
2. A cryptographic communication method for encrypting or decrypting communication contents by using a modular exponentiation operation on integers M, e modulo N: C = M e mod N, wherein input data U, V On the other hand, by using an integer R that is a prime to N, one or more arithmetic units for calculating and outputting Z = U · V · R −1 mod N are provided, and M and R are provided for the arithmetic units. R = R 2 mod N, a constant R R , is input, and M R = M · R R · R −1 mod N is output, and the binary representation of e is e = [e t , et-1 , ... , e 1 ], and C R
The initial value of C R = R R · R −1 mod N is set, and C R and M R are input to the arithmetic unit when e i = 1 according to the value of e i from the higher order bits. and, C R · M R · R
-1 modN to output as a new C R, further, when the i in the e i is greater than 1, type both C R as two input data to the arithmetic unit, C R · C R R −1 mod N is output as a new C R , and after completion of the processing for all the e i , C R and a constant 1 are input to the arithmetic unit, and C = C R. R -1 m
By outputting od N, the modular exponentiation operation C
= M e mod N is executed.
【請求項3】 Nを法とする整数M、eに関するべき乗
剰余演算:C=Memod Nを利用して、通信内容の暗号
化または復号を行なう暗号通信方法において、 入力データU、Vに対して、Nと素である整数Rを用い
て、Z=U・V・R-1mod Nを演算して出力する演算
部を1つ以上設け、 当該演算部に対して、Mと、RR =R2 mod Nなる定数
R とを入力して、 MR =M・ RR・R-1 modNを出力させ、 eの2進表現をe=〔et,et-1,…, e1 〕とし、CR
の初期値をCR =RR・R-1 mod Nとして、順次低位ビ
ットからのei の値に従って、ei =1なるときに、前
記演算部に対してCR とMR とを入力して、CR・MR・R
-1 modNを新たなCR として出力させ、 更に、前記ei におけるiがtより小なるときには、前
記演算部に対して2つの入力データとして共にMR を入
力して、MR・MR・R-1 mod Nを新たなMR として出力
させ、 全ての前記ei に対する処理の終了後に、前記演算部に
対してCR と定数1とを入力して、C=CR・1・ R-1 m
od Nを出力させることにより、前記べき乗剰余演算C
=Me mod Nを実行することを特徴とする暗号通信方
法。
3. A cryptographic communication method for encrypting or decrypting communication contents by using a modular exponentiation operation on integers M, e modulo N: C = M e mod N, wherein input data U, V On the other hand, by using an integer R that is a prime to N, one or more arithmetic units for calculating and outputting Z = U · V · R −1 mod N are provided, and M and R are provided for the arithmetic units. R = R 2 mod N, a constant R R , is input, and M R = M · R R · R −1 mod N is output, and the binary representation of e is e = [e t , et-1 , ... , e 1 ], and C R
When the initial value of C R = R R · R −1 mod N is set and e i = 1 according to the value of e i from the lower order bits, C R and M R are input to the arithmetic unit. and, C R · M R · R
−1 mod N is output as a new C R , and when i in the e i is smaller than t, both M R are input to the arithmetic unit as two input data, and M R · M R R −1 mod N is output as a new M R , and after the processing for all the e i is completed, C R and the constant 1 are input to the arithmetic unit, and C = C R. R -1 m
By outputting od N, the modular exponentiation operation C
= M e mod N is executed.
【請求項4】 前記演算部に、定数RR と定数1とを入
力して、出力RR・1・R-1 modNをCR の初期値とする
ことを特徴とする請求項2あるいは3に記載の暗号通信
システム。
4. The constant R R and the constant 1 are input to the arithmetic unit, and the output R R · 1 · R −1 mod N is used as an initial value of C R. The encrypted communication system described in.
【請求項5】 nをN<2n なる値とするとき、前記演
算部において、定数R、入力データU、Vが、u=1か
つr>1,または、u>1かつr=u+1なるu,rに
対して、R=2n+r 、U<2n+u ,V<2n+u を満たし
ていることを特徴とする請求項1ないし4に記載の暗号
通信システム。
5. When n is a value N <2 n , in the arithmetic unit, a constant R and input data U and V are u = 1 and r> 1, or u> 1 and r = u + 1. 5. The cryptographic communication system according to claim 1, wherein R = 2 n + r , U <2 n + u , and V <2 n + u are satisfied for u and r.
【請求項6】 入力された整数A、Bに対するNを法と
した剰余乗算Q=A・ B mod Nを利用して、通信内容
の暗号化または復号を行なう暗号通信方法において、N
と素である整数Rを用いて、 入力されたA及び前記RよりA・ R mod Nを演算して
その結果をAR とし、 入力されたB及び前記RよりB・ R mod Nを演算して
その結果をBR とし、 前記演算結果AR 、BR 及び前記Rに基づき、AR・BR
・ R-1 mod Nを求めてその結果をTR とし、 前記TR と前記RとによりTR・R-1 mod Nを演算し、
その結果としてQを求めるようにし、 前記TR を求める演算を、Ai を任意の整数vによる前
記AR のvビット毎の分割、Y=2v として、 Ti =( Ti-1 +Ai・BR・Y+Mi-1・N)/Y Mi-1 =( Ti-1 mod Y)・( −N-1 mod Y) mod Y の順次演算により実行することを特徴とする暗号通信方
法。
6. A cryptographic communication method for encrypting or decrypting communication contents by using a modular multiplication Q = A · B mod N modulo N for input integers A and B, wherein N
Using the integer R which is a prime number, A · R mod N is calculated from the input A and R , the result is taken as A R, and B · R mod N is calculated from the input B and R. And the result is B R, and A R · B R is calculated based on the calculation results A R , B R and R.
· R -1 seeking mod N to the result with T R, calculates the T R and the R and the T R · R -1 mod N,
As a result, Q is obtained, and the operation for obtaining T R is performed by dividing A i by v bits of A R by an arbitrary integer v, Y = 2 v , and T i = (T i-1 + A i · BR · Y + M i−1 · N) / Y M i−1 = (T i−1 mod Y) · (−N −1 mod Y) mod Y Communication method.
【請求項7】 前記順次演算における各1回の演算を、
1つの演算素子によって実行し、前記順次演算全体をパ
イプライン処理により実行することを特徴とした請求項
6に記載の暗号通信方法。
7. Each one operation in the sequential operation,
7. The cryptographic communication method according to claim 6, wherein the cryptographic communication is performed by one arithmetic element, and the sequential arithmetic operation is entirely executed by pipeline processing.
【請求項8】 前記順次演算において、Yによる乗算ま
たは除算を、加算において、ビット位置をずらして加算
することにより実行することを特徴とした請求項6に記
載の暗号通信方法。
8. The cryptographic communication method according to claim 6, wherein in the sequential operation, multiplication or division by Y is executed by shifting the bit position and performing addition in the addition.
【請求項9】 前記順次演算において、Bj ,Nj をそ
れぞれ任意の整数dによる前記BR 、Nのdビット毎の
分割として、Ai・Bj-1 とMi-1・Nj とを演算し、該演
算結果と前回の順次演算結果Ti-1 を加算することを特
徴とした請求項6に記載の暗号通信方法。
9. In the sequential calculation, B j and N j are respectively divided into d B bits of B R and N by an arbitrary integer d, and A i · B j-1 and M i-1 · N j. 7. The cryptographic communication method according to claim 6, wherein the calculation result and the previous sequential calculation result T i-1 are added.
【請求項10】 入力された整数A、Bに対するNを法
とした剰余乗算Q=A・ B mod Nを利用して、通信内
容の暗号化または復号を行なう暗号通信方法において、
Nと素である整数Rを用いて、 入力されたA及び前記RよりA・ R mod Nを演算して
その結果をAR とし、 入力されたB及び前記RよりB・ R mod Nを演算して
その結果をBR とし、 前記演算結果AR 、BR 及び前記Rに基づき、AR・BR
・ R-1 mod Nを求めてその結果をTR とし、 前記TR と前記RとによりTR・R-1 mod Nを演算し、
その結果としてQを求めるようにし、 前記TR を求める演算を、Ai を任意の整数vによる前
記AR のvビット毎の分割、Y=2v として、 Ti =( Ti-1 /Y+Ai・BR )+Mi・N Mi-1 =((Ti-1 /Y+Ai・BR )mod Y)・( −N-1 mod Y) mod Y の順次演算により実行することを特徴とする暗号通信方
法。
10. A cryptographic communication method for encrypting or decrypting communication content by using a modular multiplication Q = A · B mod N modulo N for input integers A and B,
Using an integer R that is a prime to N, calculate A · R mod N from the input A and R, take the result as A R, and calculate B · R mod N from the input B and R Then, the result is set to B R, and based on the calculation results A R , B R and R, A R · B R
· R -1 seeking mod N to the result with T R, calculates the T R and the R and the T R · R -1 mod N,
As a result, Q is obtained, and the operation for obtaining T R is performed by dividing A i by v bits of A R by an arbitrary integer v, and Y = 2 v . T i = (T i-1 / Y + A i · B R ) + M i · N M i-1 = ((T i-1 / Y + A i · B R ) mod Y) · (−N −1 mod Y) mod Y Characterized cryptographic communication method.
JP12498292A 1991-09-05 1992-05-18 Encryption communication method and system Expired - Fee Related JP3302043B2 (en)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP12498292A JP3302043B2 (en) 1992-05-18 1992-05-18 Encryption communication method and system
US07/941,236 US5321752A (en) 1991-09-05 1992-09-04 Method of and apparatus for encryption and decryption of communication data
DE69229766T DE69229766T2 (en) 1991-09-05 1992-09-04 Method and device for encrypting and decrypting communication data
EP92308056A EP0531158B1 (en) 1991-09-05 1992-09-04 Method of and apparatus for encryption and decryption of communication data
AT92308056T ATE183315T1 (en) 1991-09-05 1992-09-04 METHOD AND DEVICE FOR ENCRYPTING AND DECRYPTING COMMUNICATION DATA
HK98112269A HK1011430A1 (en) 1991-09-05 1998-11-24 Method of and apparatus for encryption and decryption of communication data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12498292A JP3302043B2 (en) 1992-05-18 1992-05-18 Encryption communication method and system

Publications (2)

Publication Number Publication Date
JPH05324277A true JPH05324277A (en) 1993-12-07
JP3302043B2 JP3302043B2 (en) 2002-07-15

Family

ID=14899006

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12498292A Expired - Fee Related JP3302043B2 (en) 1991-09-05 1992-05-18 Encryption communication method and system

Country Status (1)

Country Link
JP (1) JP3302043B2 (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4899191A (en) * 1988-03-10 1990-02-06 Olympus Optical Co., Ltd. Exposure control apparatus for lens-shutter type camera
KR100400210B1 (en) * 1997-01-10 2003-11-14 삼성전자주식회사 Modular multiplication device for digital signature
JP2004501396A (en) * 2000-05-15 2004-01-15 エム−システムズ フラッシュ ディスク パイオニアーズ リミテッド Extended range of calculated integer fields
KR100442218B1 (en) * 2001-01-30 2004-07-30 미쓰비시 덴키 시스템 엘에스아이 디자인 가부시키가이샤 Power-residue calculating unit using montgomery algorithm
US7080110B2 (en) 2000-12-19 2006-07-18 International Business Machines Corporation Hardware implementation for modular multiplication using a plurality of almost entirely identical processor elements
US7266577B2 (en) 2002-05-20 2007-09-04 Kabushiki Kaisha Toshiba Modular multiplication apparatus, modular multiplication method, and modular exponentiation apparatus
US7471789B2 (en) 2002-10-24 2008-12-30 Renesas Technology Corp. Encryption circuit achieving higher operation speed
JP2010044398A (en) * 1999-04-07 2010-02-25 Panasonic Corp Multiple precision arithmetic device
US7870395B2 (en) 2006-10-20 2011-01-11 International Business Machines Corporation Load balancing for a system of cryptographic processors
US7890559B2 (en) 2006-12-22 2011-02-15 International Business Machines Corporation Forward shifting of processor element processing for load balancing
US8352529B2 (en) 2006-01-13 2013-01-08 Fujitsu Limited Modular multiplication calculation apparatus used for montgomery method
US8532288B2 (en) 2006-12-01 2013-09-10 International Business Machines Corporation Selectively isolating processor elements into subsets of processor elements

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4899191A (en) * 1988-03-10 1990-02-06 Olympus Optical Co., Ltd. Exposure control apparatus for lens-shutter type camera
KR100400210B1 (en) * 1997-01-10 2003-11-14 삼성전자주식회사 Modular multiplication device for digital signature
JP2010044398A (en) * 1999-04-07 2010-02-25 Panasonic Corp Multiple precision arithmetic device
JP2004501396A (en) * 2000-05-15 2004-01-15 エム−システムズ フラッシュ ディスク パイオニアーズ リミテッド Extended range of calculated integer fields
US7080110B2 (en) 2000-12-19 2006-07-18 International Business Machines Corporation Hardware implementation for modular multiplication using a plurality of almost entirely identical processor elements
KR100442218B1 (en) * 2001-01-30 2004-07-30 미쓰비시 덴키 시스템 엘에스아이 디자인 가부시키가이샤 Power-residue calculating unit using montgomery algorithm
US7266577B2 (en) 2002-05-20 2007-09-04 Kabushiki Kaisha Toshiba Modular multiplication apparatus, modular multiplication method, and modular exponentiation apparatus
US7471789B2 (en) 2002-10-24 2008-12-30 Renesas Technology Corp. Encryption circuit achieving higher operation speed
US8352529B2 (en) 2006-01-13 2013-01-08 Fujitsu Limited Modular multiplication calculation apparatus used for montgomery method
US7870395B2 (en) 2006-10-20 2011-01-11 International Business Machines Corporation Load balancing for a system of cryptographic processors
US8532288B2 (en) 2006-12-01 2013-09-10 International Business Machines Corporation Selectively isolating processor elements into subsets of processor elements
US7890559B2 (en) 2006-12-22 2011-02-15 International Business Machines Corporation Forward shifting of processor element processing for load balancing

Also Published As

Publication number Publication date
JP3302043B2 (en) 2002-07-15

Similar Documents

Publication Publication Date Title
EP0531158B1 (en) Method of and apparatus for encryption and decryption of communication data
EP0656709B1 (en) Encryption device and apparatus for encryption/decryption based on the Montgomery method using efficient modular multiplication
US7320015B2 (en) Circuit and method for performing multiple modulo mathematic operations
CN109067538B (en) Security protocol method, computer device, and storage medium
US6795553B1 (en) Method and apparatus for modular inversion for information security and recording medium with a program for implementing the method
US20060008081A1 (en) Modular-multiplication computing unit and information-processing unit
US7024560B2 (en) Power-residue calculating unit using Montgomery algorithm
JP3302043B2 (en) Encryption communication method and system
Großschädl A bit-serial unified multiplier architecture for finite fields GF (p) and GF (2 m)
KR100508092B1 (en) Modular multiplication circuit with low power
JP4177526B2 (en) Multiplication residue calculation method and multiplication residue circuit
US7319750B1 (en) Digital circuit apparatus and method for accelerating preliminary operations for cryptographic processing
KR100478974B1 (en) Serial finite-field multiplier
US20020172355A1 (en) High-performance booth-encoded montgomery module
Lu et al. A programmable VLSI architecture for computing multiplication and polynomial evaluation modulo a positive integer
US7403965B2 (en) Encryption/decryption system for calculating effective lower bits of a parameter for Montgomery modular multiplication
JPH0916379A (en) Communication method and equipment therefor
Pathirage et al. Multi-Prime RSA Verilog Implementation Using 4-Primes
Al-Tuwaijry et al. A high speed RSA processor
US7471789B2 (en) Encryption circuit achieving higher operation speed
JPH07152319A (en) Ciphering device
JP3323516B2 (en) Arithmetic device, encryption device and decryption device provided with the same
Kakde et al. Performance analysis of Montgomery multiplier for public key cryptosystem
Ku et al. Parallel Montgomery Multiplication and Squaring over GF (2 m) Based on Cellular Automata
RAMYA et al. Two Key Based RSA Encryption using FFT Algorithm

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

LAPS Cancellation because of no payment of annual fees