JP2005316038A - Scalar multiple computing method, device, and program in elliptic curve cryptosystem - Google Patents

Scalar multiple computing method, device, and program in elliptic curve cryptosystem Download PDF

Info

Publication number
JP2005316038A
JP2005316038A JP2004132486A JP2004132486A JP2005316038A JP 2005316038 A JP2005316038 A JP 2005316038A JP 2004132486 A JP2004132486 A JP 2004132486A JP 2004132486 A JP2004132486 A JP 2004132486A JP 2005316038 A JP2005316038 A JP 2005316038A
Authority
JP
Japan
Prior art keywords
unit
scalar multiplication
scalar
calculation
elliptic curve
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.)
Withdrawn
Application number
JP2004132486A
Other languages
Japanese (ja)
Other versions
JP2005316038A5 (en
Inventor
Katsuyuki Okeya
勝幸 桶屋
Takeshi Takagi
剛 高木
Christian Schuppan
クリスチャン シュパン
Kataya Shumittosamoa
カタヤ シュミットサモア
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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2004132486A priority Critical patent/JP2005316038A/en
Publication of JP2005316038A publication Critical patent/JP2005316038A/en
Publication of JP2005316038A5 publication Critical patent/JP2005316038A5/ja
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an elliptic curve scalar multiple computing method which can make quick calculation using a small amount of memory in elliptic curve scalar scale computing which requires the resources most in an elliptic curve cryptosystem. <P>SOLUTION: The transform processing of the scalar value is made by calculating on the continuous 2 bits of the scalar value in a scalar multiple computing method which calculates the scalar multiple point from the points on a scalar value and elliptic curve. Then this processing is made left-to-right by calculating for the continuous 2 bits of the scalar value. Thus, it becomes possible to calculate at high speed with a small memory. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明はセキュリティ技術に係り、特に楕円曲線演算を用いたメッセージ処理方法に関する。   The present invention relates to security technology, and more particularly to a message processing method using elliptic curve calculation.

楕円曲線暗号はN.Koblitz, V.S. Millerにより提案された公開鍵暗号の一種である。公開鍵暗号には、公開鍵と呼ばれる一般に公開してよい情報と、秘密鍵(Private Key)と呼ばれる秘匿しなければならない秘密情報がある。与えられたメッセージの暗号化や署名の検証には公開鍵を用い、与えられたメッセージの復号化や署名の作成には秘密鍵を用いる。   Elliptic curve cryptography is a kind of public key cryptography proposed by N.Koblitz, V.S. Miller. Public key cryptography includes information that can be disclosed to the public called a public key, and secret information that must be kept secret, called a private key. A public key is used for encryption of a given message and signature verification, and a secret key is used for decryption of a given message and creation of a signature.

楕円曲線暗号における秘密鍵は、スカラー値が担っている。また、楕円曲線暗号の安全性は楕円曲線上の離散対数問題の求解が困難であることに由来している。楕円曲線上の離散対数問題とは、楕円曲線上のある点Pとそのスカラー倍の点dPが与えられた時、スカラー値dを求める問題である。   The secret key in elliptic curve cryptography is a scalar value. The security of elliptic curve cryptography comes from the difficulty of solving discrete logarithm problems on elliptic curves. The discrete logarithm problem on an elliptic curve is a problem of obtaining a scalar value d when a certain point P on the elliptic curve and a point dP that is a scalar multiple thereof are given.

楕円曲線上の点とは、楕円曲線の定義方程式をみたす数の組をいい、楕円曲線上の点全体には、無限遠点という仮想的な点を単位元とした演算、すなわち楕円曲線上の加法(加算ともいう)が定義される。そして、同じ点同士による楕円曲線上の加法のことを、特に楕円曲線上の2倍算という。   The point on the elliptic curve is a set of numbers that satisfy the definition equation of the elliptic curve. The entire point on the elliptic curve is calculated based on a virtual point called an infinite point, that is, on the elliptic curve. Addition (also called addition) is defined. The addition on the elliptic curve by the same points is particularly called doubling on the elliptic curve.

楕円曲線上の2点の加法は次のようにして計算される。2点を通る直線を引くとその直線は楕円曲線と他の点において交わる。その交わった点とx軸に関して対称な点を、加法を行った結果の点とする。例えば、ワイエルシュトラス型楕円曲線の場合には、点(x1,y1)と点(x2,y2)の加算(x3,y3)=(x1,y1)+(x2,y2)は
x3=((y2-y1)/(x2-x1))2-x1-x2 (式1)
y3=((y2-y1)/(x2-x1))(x1-x3)-y1 (式2)
を計算することにより得られる。ここで、ワイエルシュトラス型楕円曲線の定義式は
y2=x3+ax+b (式3)
で与えられる。すなわち式3のx,yに各々xi,yi (i=1,2,3) を代入した場合に、式3の等式が成り立つ。
The addition of two points on the elliptic curve is calculated as follows. When a straight line passing through two points is drawn, the straight line intersects the elliptic curve at another point. The intersecting point and a point that is symmetric with respect to the x-axis are taken as points resulting from the addition. For example, in the case of a Weierstrass-type elliptic curve, the addition of the point (x 1 , y 1 ) and the point (x 2 , y 2 ) (x 3 , y 3 ) = (x 1 , y 1 ) + ( x 2 , y 2 ) is
x 3 = ((y 2 -y 1 ) / (x 2 -x 1 )) 2 -x 1 -x 2 (Equation 1)
y 3 = ((y 2 -y 1 ) / (x 2 -x 1 )) (x 1 -x 3 ) -y 1 (Equation 2)
Is obtained by calculating. Here, the defining formula of the Weierstrass-form elliptic curve is
y 2 = x 3 + ax + b (Formula 3)
Given in. That is, when x i and y i (i = 1, 2, 3) are substituted for x and y in Equation 3, the equation in Equation 3 holds.

楕円曲線上の点の2倍算は次のようにして計算される。楕円曲線上の点における接線を引くと、その接線は楕円曲線上の他の点において交わる。その交わった点とx座標に関して対称な点を、2倍算を行った結果の点とする。例えば、ワイエルシュトラス型楕円曲線の場合には、点(x1,y1)の2倍算(x3,y3)=2(x1,y1)=(x1,y1)+(x1,y1)は
x3=((3x1 2+a)/(2y1))2-2x1 (式4)
y3=((3x1 2+a)/(2y1))(x1-x3)-y1 (式5)
を計算することにより得られる。
The doubling of the points on the elliptic curve is calculated as follows. If you draw a tangent at a point on the elliptic curve, the tangent will intersect at another point on the elliptic curve. The intersecting point and a point that is symmetric with respect to the x-coordinate are taken as the result of doubling. For example, in the case of a Weierstrass-type elliptic curve, the doubling of the point (x 1 , y 1 ) (x 3 , y 3 ) = 2 (x 1 , y 1 ) = (x 1 , y 1 ) + (x 1 , y 1 ) is
x 3 = ((3x 1 2 + a) / (2y 1 )) 2 -2x 1 (Formula 4)
y 3 = ((3x 1 2 + a) / (2y 1 )) (x 1 -x 3 ) -y 1 (Formula 5)
Is obtained by calculating.

ある点に対し、特定の回数だけ加法を行うことをスカラー倍といい、その結果の点をスカラー倍点、その回数のことをスカラー値という。   Adding a certain number of times to a certain point is called scalar multiplication, the resulting point is called a scalar multiple, and the number of times is called a scalar value.

楕円曲線暗号においては、与えられたメッセージの暗号化、復号化、署名の作成またはその検証は、楕円曲線演算を用いて行う必要がある。特に楕円曲線上のスカラー倍の計算は、上記の暗号化、復号化等の各処理において、最も計算リソースを必要とする計算である。そのため、楕円曲線暗号を効率的に実行するためには、楕円曲線スカラー倍の計算を効率的に行う必要がある。   In elliptic curve cryptography, encryption, decryption, signature generation or verification of a given message must be performed using elliptic curve computation. In particular, the calculation of the scalar multiplication on the elliptic curve is the calculation that requires the most calculation resources in each processing such as encryption and decryption. Therefore, in order to efficiently execute the elliptic curve cryptography, it is necessary to efficiently calculate the elliptic curve scalar multiplication.

楕円曲線スカラー倍計算方法が、非特許文献1、非特許文献6に記載されている。   Non-Patent Document 1 and Non-Patent Document 6 describe the elliptic curve scalar multiplication method.

J.A. Solinas, “Efficient Arithmetic on Koblitz Curves,” Designs, Codes and Cryptography, 19, Kluwer Academic Publishers, pp.195-249, (2000).J.A. Solinas, “Efficient Arithmetic on Koblitz Curves,” Designs, Codes and Cryptography, 19, Kluwer Academic Publishers, pp.195-249, (2000). H. Cohen, A. Miyaji, and T. Ono, “Efficient Elliptic Curve Exponentiation Using Mixed Coordinates,” Advances in Cryptology - ASIACRYPT 1998, LNCS 1514, Springer-Verlag, pp.51-65, (1998).H. Cohen, A. Miyaji, and T. Ono, “Efficient Elliptic Curve Exponentiation Using Mixed Coordinates,” Advances in Cryptology-ASIACRYPT 1998, LNCS 1514, Springer-Verlag, pp.51-65, (1998). D.V. Bailey, C. Paar, “Optimal Extension Fields for Fast Arithmetic in Public-Key Algorithms,” Advances in Cryptology Crypto '98, LNCS 1462, Springer-Verlag, pp.472-485, (1998).D.V. Bailey, C. Paar, “Optimal Extension Fields for Fast Arithmetic in Public-Key Algorithms,” Advances in Cryptology Crypto '98, LNCS 1462, Springer-Verlag, pp.472-485, (1998). ANSI X9.62 Public Key Cryptography for the Financial Services Industry, The Elliptic Curve Digital Signature Algorithm (ECDSA), (1998)ANSI X9.62 Public Key Cryptography for the Financial Services Industry, The Elliptic Curve Digital Signature Algorithm (ECDSA), (1998) H. Cohen, “A course in computational algebraic number theory,” GTM138, Springer-Verlag, (1993).H. Cohen, “A course in computational algebraic number theory,” GTM138, Springer-Verlag, (1993). M. Joye, and S.-M. Yen, “Optimal Left-to-Right Binary Signed-digit Exponent Recoding,” IEEE Transactions on Computers 49(7), pp.740-748, (2000).M. Joye, and S.-M. Yen, “Optimal Left-to-Right Binary Signed-digit Exponent Recoding,” IEEE Transactions on Computers 49 (7), pp.740-748, (2000).

情報通信ネットワークの進展と共に電子情報に対する秘匿や認証のために暗号技術は不可欠な要素となってきている。暗号技術に課せられる要件としては、高速処理や少ないメモリ使用量などがある。他方、楕円曲線上の離散対数問題が非常に困難であるために、素因数分解の困難性を安全性の根拠にしている暗号と比べて、楕円曲線暗号は鍵長を短くすることができる。そのため計算能力、メモリ容量などのりソースが比較的少なくても暗号処理を行うことが可能である。しかしながら、スマートカード(ICカードともいう)等においては利用可能なリソースは少なく、限られたリソース内で最適な暗号処理を行うように処理速度やメモリ使用量に優れる暗号処理が必要となる。   Cryptographic techniques have become an indispensable element for the secrecy and authentication of electronic information with the development of information and communication networks. Requirements imposed on cryptographic technology include high-speed processing and low memory usage. On the other hand, since the discrete logarithm problem on an elliptic curve is very difficult, the elliptic curve cryptosystem can shorten the key length as compared with a cipher whose safety is based on the difficulty of prime factorization. For this reason, it is possible to perform cryptographic processing even if there are relatively few sources such as computing capacity and memory capacity. However, in a smart card (also referred to as an IC card) or the like, there are few resources that can be used, and cryptographic processing that is excellent in processing speed and memory usage is required so as to perform optimal cryptographic processing within the limited resources.

上記非特許文献1の技術は、一旦スカラー値の表現を変換し、その後 変換した表現を用いて暗号処理を実行するため、変換した表現を格納するメモリが必要となる。また、変換と暗号処理を同時に行うとすると、楕円加算の計算方法として高速な手法を用いることができない。これは、スカラー値の変換処理が最下位ビットから最上位ビットに向けて(right-to-left)処理が行われるのに対し、楕円加算の高速計算手法は最上位ビットから最下位ビットに向けて(left-to-right)処理が行われたときのみに適用可能だからである。したがって、上記技術はメモリ使用量の削減、処理速度の改善、といった点について十分に考慮されていない。   Since the technique of Non-Patent Document 1 converts a scalar value expression once, and then executes cryptographic processing using the converted expression, a memory for storing the converted expression is required. Further, if conversion and encryption processing are performed simultaneously, a high-speed method cannot be used as a method for calculating ellipse addition. This is because scalar value conversion is performed from the least significant bit to the most significant bit (right-to-left), while the high-speed calculation method of elliptic addition is directed from the most significant bit to the least significant bit. This is because it is applicable only when left-to-right processing is performed. Therefore, the above technique does not fully consider the reduction of the memory usage and the improvement of the processing speed.

また上記非特許文献6の技術は、特殊なケースに対して、スカラー値の変換をleft-to-rightで行うことができるが、一般的な場合に対する考察がなされていない。   The technique of Non-Patent Document 6 can perform left-to-right scalar value conversion for a special case, but no consideration is given to a general case.

本発明は、スカラー値の変換処理をleft-to-rightで行う処理を提供することにより、高速計算および小メモリで計算可能な楕円曲線演算方法を提供する。   The present invention provides an elliptic curve calculation method capable of high-speed calculation and calculation with a small memory by providing a process for converting a scalar value in a left-to-right manner.

本発明は、更に、上記楕円曲線演算方法を用いた、暗号化処理方法、復号化処理方法、署名作成方法、署名検証方法、データ共有方法を提供する。   The present invention further provides an encryption processing method, a decryption processing method, a signature creation method, a signature verification method, and a data sharing method using the above elliptic curve calculation method.

本発明は、楕円曲線演算において、スカラー値と楕円曲線上の点からスカラー倍を計算する楕円曲線暗号におけるスカラー倍計算方法であって、上記スカラー値における連続する2ビットに対する演算を行うステップと、を有する。   The present invention is an elliptic curve calculation method in elliptic curve cryptography for calculating a scalar multiplication from a scalar value and a point on the elliptic curve in an elliptic curve calculation, the step of performing an operation on two consecutive bits in the scalar value, Have

本発明は、また、上記2ビットに対する演算は、2ビットの差分を計算、ないしは2ビットの値を比較、ないしは2ビットの排他的論理和を、計算するようにしてもよい。   In the present invention, the calculation for the two bits may be performed by calculating a 2-bit difference, comparing a 2-bit value, or calculating a 2-bit exclusive OR.

本発明は、また、上記スカラー値を数値列にエンコードするステップと、上記エンコードした数値列及び上記楕円曲線上の点からスカラー倍を計算するステップと、を有し、上記エンコードするステップは、上記2ビットに対する演算を含むように構成してもよい。   The present invention also includes a step of encoding the scalar value into a numerical sequence, and a step of calculating a scalar multiple from the encoded numerical sequence and a point on the elliptic curve. You may comprise so that the calculation with respect to 2 bits may be included.

本発明は、また、上記スカラー値を数値列にエンコードするステップと、上記楕円曲線上の点から事前計算テーブルを作成するステップと、上記エンコードした数値列及び上記事前計算テーブルからスカラー倍を計算するステップと、を有し、上記エンコードするステップは、上記2ビットに対する演算を含むように構成してもよい。   The present invention also encodes the scalar value into a numerical sequence, creates a precalculation table from the points on the elliptic curve, and calculates a scalar multiplication from the encoded numerical sequence and the precalculation table. And the encoding step may include an operation on the two bits.

本発明は、また、上記楕円曲線上の点から事前計算テーブルを作成するステップと、上記スカラー値及び上記事前計算テーブルからスカラー倍を計算するステップと、を有し、上記スカラー倍を計算するステップは、上記2ビットに対する演算を含むように構成してもよい。   The present invention also includes a step of creating a pre-calculation table from the points on the elliptic curve, and a step of calculating a scalar multiplication from the scalar value and the pre-calculation table, and calculating the scalar multiplication May be configured to include operations on the two bits.

以上のように、本発明のスカラー倍計算方法によれば、スカラー値の変換処理をleft-to-rightで実行でき、高速計算および小メモリでの計算が可能な楕円曲線演算方法が利用可能となる。   As described above, according to the scalar multiplication method of the present invention, it is possible to use an elliptic curve calculation method capable of performing scalar value conversion processing left-to-right and performing high-speed calculation and calculation with a small memory. Become.

本発明によれば、スカラー値の変換処理をleft-to-rightで実行でき、高速および小メモリで計算することができる、楕円曲線演算を用いたメッセージ処理が可能となる。   According to the present invention, scalar value conversion processing can be executed left-to-right, and message processing using elliptic curve calculation that can be performed at high speed and with small memory becomes possible.

以下、本発明の実施例を図面により説明する。   Embodiments of the present invention will be described below with reference to the drawings.

図1はネットワーク142によって接続された本発明による楕円曲線演算方法を適用したコンピュータA101、コンピュータB121がネットワークにより接続されたシステム構成を示すものである。   FIG. 1 shows a system configuration in which a computer A101 and a computer B121 to which an elliptic curve calculation method according to the present invention connected by a network 142 is applied are connected by a network.

図1の暗号通信システムにおけるコンピュータA101でメッセージの暗号化を行なうには、Pm+k(aQ)及びkQを計算して出力し、コンピュータB121で暗号文の復号化を行なうには、秘密鍵a及びkQより-a(kQ)を計算し、
(Pm+k(aQ))-a(kQ) (式6)
を計算して出力すればよい。ここでPmはメッセージ、kは乱数、aは秘密鍵を示す定数、Qは定点、aQは公開鍵を示す点である。
In order to encrypt the message by the computer A101 in the cryptographic communication system of FIG. 1, P m + k (aQ) and kQ are calculated and output, and the decryption of the ciphertext is performed by the computer B121. Calculate -a (kQ) from a and kQ,
(P m + k (aQ))-a (kQ) (Formula 6)
Can be calculated and output. Here, P m is a message, k is a random number, a is a constant indicating a secret key, Q is a fixed point, and aQ is a point indicating a public key.

ネットワーク142には、Pm+k(aQ), kQのみ送信され、メッセージPmを復元するためには、kaQ、すなわちkQのa倍を計算する必要がある。ところが、秘密鍵aはネットワーク142には送信されないため、秘密鍵aを保持しているものだけが、Pmを復元できることになる。 Only P m + k (aQ), kQ is transmitted to the network 142. In order to restore the message P m , it is necessary to calculate kaQ, that is, a times kQ. However, since the private key a to the network 142 is not sent, only those holding the private key a is becomes possible to restore the P m.

図1において、コンピュータA101は、CPU113やコプロセッサ114などの演算装置、RAM103、ROM106や外部記憶装置107などの記憶装置、コンピュータ外部とのデータ入出力を行なう入出力インタフェース110を装備しており、外部にはコンピュータA101をユーザが操作するためのディスプレイ108、キーボード109、着脱可能な可搬型記憶媒体の読み書き装置などが接続されている。   In FIG. 1, a computer A101 is equipped with a calculation device such as a CPU 113 and a coprocessor 114, a storage device such as a RAM 103, a ROM 106 and an external storage device 107, and an input / output interface 110 for performing data input / output with the outside of the computer. A display 108, a keyboard 109, and a removable portable storage medium read / write device for operating the computer A101 by the user are connected to the outside.

更にコンピュータA101は、RAM103、ROM106や外部記憶装置107などの記憶装置によって、記憶部102を実現し、CPU113やコプロセッサ114などの演算装置が、記憶部102に格納されたプログラムを実行することにより、データ処理部112、スカラー倍計算部115とそれらに含まれる各処理部を実現する。   Further, the computer A101 realizes the storage unit 102 by a storage device such as the RAM 103, the ROM 106, and the external storage device 107, and an arithmetic device such as the CPU 113 or the coprocessor 114 executes the program stored in the storage unit 102. The data processing unit 112, the scalar multiplication calculation unit 115, and the processing units included therein are realized.

データ処理部112は、本実施形態においては、暗号化処理部として機能し、入力されたメッセージの暗号化を行なう。   In this embodiment, the data processing unit 112 functions as an encryption processing unit, and encrypts an input message.

スカラー倍計算部115は、暗号化処理部112で暗号化を行なうのに必要なパラメタを計算する。記憶部102は、定数104(例えば、楕円曲線の定義式や楕円曲線上の定点である)、秘密情報105(例えば、秘密鍵である)などを記憶している。   The scalar multiplication calculation unit 115 calculates parameters necessary for the encryption processing unit 112 to perform encryption. The storage unit 102 stores a constant 104 (for example, an elliptic curve definition formula or a fixed point on the elliptic curve), secret information 105 (for example, a secret key), and the like.

コンピュータB121は、コンピュータAと同様のハードウェア構成を備える。   The computer B121 has the same hardware configuration as the computer A.

更にコンピュータB121は、RAM123、ROM126や外部記憶装置127などの記憶装置によって、記憶部122を実現し、CPU133やコプロセッサ134などの演算装置が、記憶部122に格納されたプログラムを実行することにより、データ処理部132、スカラー倍計算部135とそれらに含まれる各処理部を実現する。   Further, the computer B121 realizes the storage unit 122 by a storage device such as the RAM 123, the ROM 126, and the external storage device 127, and the arithmetic device such as the CPU 133 and the coprocessor 134 executes the program stored in the storage unit 122. The data processing unit 132, the scalar multiplication calculation unit 135, and the processing units included therein are realized.

データ処理部132は、本実施形態においては、復号化処理部132として機能し、暗号化されたメッセージである暗号文141の復号化を行なう。   In the present embodiment, the data processing unit 132 functions as the decryption processing unit 132 and decrypts the ciphertext 141 that is an encrypted message.

スカラー倍計算部135は、復号化処理部132で復号化を行なうのに必要なパラメタを計算する。記憶部122は、定数124(例えば、楕円曲線の定義式や楕円曲線上の定点である)、秘密情報125(例えば、秘密鍵である)などを記憶している。   The scalar multiplication calculator 135 calculates parameters necessary for the decoding processor 132 to perform decoding. The storage unit 122 stores a constant 124 (for example, an elliptic curve definition formula or a fixed point on the elliptic curve), secret information 125 (for example, a secret key), and the like.

なお、上記プログラムは、あらかじめ、上記コンピュータ内の記憶部に格納されていてもよいし、必要なときに、入出力インタフェース110と上記コンピュータが利用可能な媒体を介して、他の装置から上記記憶媒部に導入されてもよい、媒体とは、例えば、入出力インタフェースに着脱可能な記憶媒体、または通信媒体(すなわちネットワークまたはネットワークを伝搬する搬送波またはディジタル信号)を指す。   The program may be stored in advance in a storage unit in the computer, or when necessary, the program may be stored from another device via an input / output interface 110 and a medium usable by the computer. The medium that may be introduced into the medium unit refers to, for example, a storage medium that is detachable from the input / output interface, or a communication medium (that is, a network or a carrier wave or a digital signal that propagates through the network).

図2は、コンピュータA101、コンピュータB121の各処理部が行なう情報の受け渡しの様子を示したものである。   FIG. 2 shows how information is transferred by the processing units of the computer A101 and the computer B121.

次に、図1のコンピュータA101が、入力されたメッセージを暗号化する場合の動作について説明する。メッセージはディジタル化されたデータであればよく、テキスト、画像、映像、音などの種類は問わない。   Next, an operation when the computer A101 in FIG. 1 encrypts an input message will be described. The message may be any digitized data, and may be any type of text, image, video, sound, etc.

暗号化処理部112は、入出力インタフェース110を介して、平文メッセージ(図2の入力メッセージ204)を受け取ると、入力された平文メッセージのビット長があらかじめ定めたビット長か否かを判断する。あらかじめ定めたビット長よりも長い場合には、あらかじめ定めたビット長となるように平文メッセージを区切る。以下、所定のビット長に区切られている部分メッセージ(単にメッセージともいう)について説明する。   When receiving the plaintext message (input message 204 in FIG. 2) via the input / output interface 110, the encryption processing unit 112 determines whether or not the bit length of the input plaintext message is a predetermined bit length. When the bit length is longer than a predetermined bit length, the plaintext message is divided so as to have a predetermined bit length. Hereinafter, a partial message (also simply referred to as a message) divided into a predetermined bit length will be described.

次に、暗号化処理部112は、メッセージのビット列によって表される数値をx座標(x1)にもつ楕円曲線上の点Pmのy座標(y1)の値を計算する。 Next, the encryption processing unit 112 calculates the value of the y coordinate (y 1 ) of the point P m on the elliptic curve having the numerical value represented by the bit string of the message at the x coordinate (x 1 ).

例えば、ワイエルシュトラス型楕円曲線は、A,Bを定数とするとき、
y1 2=x1 3 +Ax1+B (式7)
で表されるので、これよりy座標の値を求めることができる。
For example, the Weierstrass-type elliptic curve, when A and B are constants,
y 1 2 = x 1 3 + Ax1 + B (Formula 7)
Therefore, the y-coordinate value can be obtained from this.

次に、暗号化処理部112は、乱数kを生成する。そして記憶部102に格納されている定数104から読み出した(図2の205)公開鍵aQとQのx座標と、求めたy座標の値と乱数kとをスカラー倍計算部115へ送る(図2の206)。   Next, the encryption processing unit 112 generates a random number k. Then, the public key aQ and the x coordinate of Q read from the constant 104 stored in the storage unit 102 (205 in FIG. 2), the obtained y coordinate value, and the random number k are sent to the scalar multiplication unit 115 (FIG. 2 of 206).

スカラー倍計算部115は、Qのx座標、y座標の値、乱数kによるスカラー倍点(xd1,yd1)=kQと、公開鍵aQのx座標、y座標の値、乱数によるスカラー倍点(xd2,yd2)=k(aQ)とを計算し、計算されたスカラー倍点を暗号化処理部112へ送る(図2の207)。 The scalar multiplication calculation unit 115 calculates the x-coordinate and y-coordinate values of Q, and the scalar multiplication point (x d1 , y d1 ) = kQ based on the random number k, the x-coordinate of the public key aQ, the y-coordinate value, and the scalar multiplication based on the random number. The point (x d2 , y d2 ) = k (aQ) is calculated, and the calculated scalar multiple is sent to the encryption processing unit 112 (207 in FIG. 2).

暗号化処理部112は、送られたスカラー倍点を用いて、暗号化処理を行なう。例えば、ワイエルシュトラス型楕円曲線については、Pm+k(aQ)とkQを計算する。すなわち、
xe1=((yd1-y1)/(xd1-x1))2-x1-xd1 (式8)
xe2=xd2 (式9)
を計算し、暗号化されたメッセージxe1,xe2を得る。
The encryption processing unit 112 performs encryption processing using the sent scalar multiple. For example, for a Weierstrass-type elliptic curve, P m + k (aQ) and kQ are calculated. That is,
x e1 = ((y d1 -y 1 ) / (x d1 -x 1 )) 2 -x 1 -x d1 (Equation 8)
x e2 = x d2 (Formula 9)
To obtain encrypted messages x e1 and x e2 .

コンピュータA101は暗号化処理部112で暗号化された1つ以上の部分メッセージから暗号化された出力メッセージを組み立てる(図2の208)。   The computer A101 assembles an encrypted output message from the one or more partial messages encrypted by the encryption processing unit 112 (208 in FIG. 2).

コンピュータA101は、暗号化されたメッセージをデータ141として入出力インタフェース110より出力し、ネットワーク142を介してコンピュータB121へ転送する。   The computer A101 outputs the encrypted message as data 141 from the input / output interface 110, and transfers it to the computer B121 via the network 142.

なお、図2の記憶部102からの情報読出しは、スカラー倍計算部115へ当該当情報を送る前であれば、入力メッセージを受付ける前であってもよい。   Note that the information read from the storage unit 102 in FIG. 2 may be performed before the input message is received as long as the information is not sent to the scalar multiplication unit 115.

次に、コンピュータB121が、暗号化されたメッセージ141を復号化する場合の動作について、図2を参照しつつ説明する。   Next, the operation when the computer B 121 decrypts the encrypted message 141 will be described with reference to FIG.

復号化処理部132(図2のデータ処理部112)は、入出力インタフェース110を介して、暗号化されたデータ141(図2の入力メッセージ204)が入力されると、入力された暗号化されたデータ141のビット長があらかじめ定めたビット長か否かを判断する。あらかじめ定めたビット長よりも長い場合は、あらかじめ定めたビット長となるように暗号化されたデータを区切る。以下、所定のビット長に区切られている部分データ(単にデータともいう)について説明する。   When the encrypted data 141 (input message 204 in FIG. 2) is input via the input / output interface 110, the decryption processing unit 132 (data processing unit 112 in FIG. 2) receives the input encrypted data. It is determined whether the bit length of the data 141 is a predetermined bit length. If the bit length is longer than the predetermined bit length, the encrypted data is divided so as to have the predetermined bit length. Hereinafter, partial data (also simply referred to as data) divided into a predetermined bit length will be described.

データ141のビット列によって表される数値をx座標にもつ楕円曲線上のy座標の値を計算する。   The value of the y coordinate on the elliptic curve having the numerical value represented by the bit string of the data 141 at the x coordinate is calculated.

暗号化されたメッセージがxe1,xe2のビット列であり、ワイエルシュトラス型楕円曲線の場合、y座標の値(ye1)は
ye1 2=xe1 3+Axe1+B (式10)
(ただし、A,Bはそれぞれ定数である)
から得ることができる。
If the encrypted message is a bit string of x e1 and x e2 and is a Weierstrass-type elliptic curve, the y coordinate value (y e1 ) is
y e1 2 = x e1 3 + Ax e1 + B (Formula 10)
(However, A and B are constants)
Can be obtained from

復号化処理部132は、記憶部122(図2の102)に格納されている秘密情報125から読み出した(図2の205)秘密鍵aと、x座標、y座標の値(xe2,ye2)を、スカラー倍計算部135(図2の115)へ送る(図2の206)。 The decryption processing unit 132 reads the secret key a (205 in FIG. 2) stored in the storage unit 122 (102 in FIG. 2) (205 in FIG. 2) and the values of the x and y coordinates (x e2 , y e2 ) is sent to the scalar multiplication unit 135 (115 in FIG. 2) (206 in FIG. 2).

スカラー倍計算部135は、x座標、y座標の値、秘密情報a125からスカラー倍点(xd3,yd3)=a(xe2,ye2)を計算する。スカラー倍計算部135は、計算されたスカラー倍点を復号化処理部132へ送る(図2の207)。復号化処理部132は、送られたスカラー倍点を用いて、復号化処理を行う。 The scalar multiplication calculator 135 calculates a scalar multiple (x d3 , y d3 ) = a (x e2 , y e2 ) from the x-coordinate and y-coordinate values and the secret information a125. The scalar multiplication calculator 135 sends the calculated scalar multiple to the decoding processor 132 (207 in FIG. 2). The decoding processing unit 132 performs a decoding process using the sent scalar multiple.

例えば、暗号化されたメッセージが、xe1,xe2のビット列であり、ワイエルシュトラス型楕円曲線の場合は、
(Pm+k(aQ))-a(kQ)=(xe1,ye1)-(xd3,yd3) (式11)
を計算することにより達成する。すなわち、
xf1=((ye1+yd3)/(xe1-xd3))2-xe1-xd3 (式12)
を計算し、暗号化される前の部分メッセージx1に相当するxf1を得る。
For example, if the encrypted message is a bit string of x e1 and x e2 and a Weierstrass-type elliptic curve,
(P m + k (aQ))-a (kQ) = (x e1 , y e1 )-(x d3 , y d3 ) (Formula 11)
This is achieved by calculating That is,
x f1 = ((y e1 + y d3 ) / (x e1 -x d3 )) 2 -x e1 -x d3 (Equation 12)
And x f1 corresponding to the partial message x 1 before being encrypted is obtained.

コンピュータB121は、復号化処理部132で復号化された部分メッセージから平文メッセージを組み立て(図2の208)、入出力インタフェース110を介して、ディスプレイ108などから出力する。   The computer B 121 assembles a plain text message from the partial message decrypted by the decryption processing unit 132 (208 in FIG. 2), and outputs it from the display 108 or the like via the input / output interface 110.

次に、コンピュータA101が、暗号化処理を行う場合の、スカラー倍計算部115の処理を詳細に説明する。   Next, the processing of the scalar multiplication calculation unit 115 when the computer A101 performs encryption processing will be described in detail.

第1実施例では、図3で示されるスカラー倍計算部の機能ブロックを用いる。スカラー倍計算部115(図1の115)は、エンコード部302、実計算部304からなる。エンコード部302は、BinaryToMOFエンコード部305、MOFTo2cMOFエンコード部306からなる。BinaryToMOFエンコード部305は、繰り返し判定部351、変換部352からなる。MOFTo2cMOFエンコード部306は、繰り返し判定部361、変換部362からなる。実計算部304は、ビット値判定部341、加算部342、2倍算部343、繰り返し判定部344からなる。   In the first embodiment, the functional block of the scalar multiplication calculator shown in FIG. 3 is used. The scalar multiplication calculation unit 115 (115 in FIG. 1) includes an encoding unit 302 and an actual calculation unit 304. The encoding unit 302 includes a BinaryToMOF encoding unit 305 and a MOFTo2cMOF encoding unit 306. The BinaryToMOF encoding unit 305 includes a repetition determination unit 351 and a conversion unit 352. The MOFTo2cMOF encoding unit 306 includes a repetition determination unit 361 and a conversion unit 362. The actual calculation unit 304 includes a bit value determination unit 341, an addition unit 342, a doubling unit 343, and a repetition determination unit 344.

スカラー倍計算部115がスカラー値d及び楕円曲線上の点Pから、楕円曲線におけるスカラー倍点dPを計算する第1の計算方法を説明する。   A first calculation method in which the scalar multiplication calculation unit 115 calculates the scalar multiplication point dP in the elliptic curve from the scalar value d and the point P on the elliptic curve will be described.

スカラー倍計算部115が暗号化処理部112からスカラー値dと楕円曲線上の点Pを受け取ると、エンコード部302は、入力されたスカラー値dを数値列dw[j]にエンコードする。すなわち、
d=dw[n]2n+dw[n-1]2n-1+…+dw[j]2j+… +dw[0] (式13)
-2w-1≦dw[j]≦2w-1, dw[j]=0 or 奇数 (式14)
をみたすdw[j]に、スカラー値dを変換する。ここで、wはあらかじめ定めた小さな正整数で、ウィンドウ幅と呼ばれる。計算時間を優先する場合はwを大きな値とする。メモリ使用量を小さくする場合はwを小さな値にする。実計算部304は、エンコードされたスカラー値と入力された点Pを用いてスカラー倍点dPを計算する。第1実施例では特にw=2の場合について説明する。
When the scalar multiplication calculation unit 115 receives the scalar value d and the point P on the elliptic curve from the encryption processing unit 112, the encoding unit 302 encodes the input scalar value d into a numeric string d w [j]. That is,
d = d w [n] 2 n + d w [n-1] 2 n-1 +… + d w [j] 2 j +… + d w [0] (Equation 13)
-2 w-1 ≤d w [j] ≤2 w-1 , d w [j] = 0 or odd (equation 14)
Convert scalar value d to d w [j] that satisfies Here, w is a predetermined small positive integer and is called a window width. If priority is given to calculation time, set w to a large value. Set w to a small value to reduce memory usage. The actual calculation unit 304 calculates a scalar multiple dP using the encoded scalar value and the input point P. In the first embodiment, a case where w = 2 is described.

次にエンコード部302、実計算部304の行う各処理について詳細に説明する。   Next, each process performed by the encoding unit 302 and the actual calculation unit 304 will be described in detail.

まず、エンコード部302の行う処理について説明する。
エンコード部302は、バイナリ列dを符号付バイナリ列cmdに変換する。
First, processing performed by the encoding unit 302 will be described.
The encoding unit 302 converts the binary string d into a signed binary string cmd.

エンコード部302にバイナリ列dが入力されると、BinaryToMOFエンコード部305はバイナリ列dを符号付バイナリ列mdに変換する。   When the binary string d is input to the encoding unit 302, the BinaryToMOF encoding unit 305 converts the binary string d into a signed binary string md.

MOFTo2cMOFエンコード部306は、BinaryToMOFエンコード部305が変換した符号付バイナリ列mdを別の符号付バイナリ列cmdに変換する。   The MOFTo2cMOF encoding unit 306 converts the signed binary string md converted by the BinaryToMOF encoding unit 305 into another signed binary string cmd.

エンコード部302は、MOFTO2cMOFエンコード部306が変換した符号付バイナリ列cmdをエンコードされた数値列dw[j]として出力する。すなわち、各jに対して、dw[j] = cmdjである。ただし、cmdjはcmdのjビット目の値とする。 The encoding unit 302 outputs the signed binary sequence cmd converted by the MOFTO2cMOF encoding unit 306 as an encoded numeric sequence d w [j]. That is, for each j, d w [j] = cmd j . However, cmd j is the value of the jth bit of cmd.

次に図4を用いて、BinaryToMOF エンコード部305の行う処理について詳細に説明する。この処理は2d-dという変換を念頭において構成されている。ただし、この引き算はビットごとの引き算であり、負の値(-1)も取りうる。また、符号付バイナリ列mdにおいて、jビット目の値をmdj と表記する。 Next, processing performed by the BinaryToMOF encoding unit 305 will be described in detail with reference to FIG. This process is configured with 2d-d conversion in mind. However, this subtraction is a bit-by-bit subtraction and can take a negative value (−1). In the signed binary string md, the value of the j-th bit is expressed as md j .

変換部352はmdn にdn-1 を代入する(401)。 The conversion unit 352 substitutes d n−1 for md n (401).

変数iに初期値n-1を代入する(402)。   An initial value n-1 is assigned to variable i (402).

変換部352は、di-1 di を計算し、mdi に代入する(403)。 Conversion unit 352 calculates the d i-1 d i, and substitutes the md i (403).

繰り返し判定部351は、i>1かどうかを判定する。i>1の場合はステップ411へ行く。i<=1の場合はステップ421へ行く(404)。   The repetition determination unit 351 determines whether i> 1. If i> 1, go to step 411. If i <= 1, go to step 421 (404).

ステップ404でi>1の場合、
変数iを1減少させ、ステップ403へ戻る(411)。
If i> 1 in step 404,
The variable i is decreased by 1, and the process returns to step 403 (411).

ステップ404でi<=1の場合、
変換部352はmd0 にd0 を代入する(421)。
If i <= 1 in step 404,
The conversion unit 352 substitutes d 0 for md 0 (421).

mdn, ..., md0 を変換された符号付バイナリ列mdとして出力する(422)。 Output md n , ..., md 0 as a converted signed binary string md (422).

なお、BinaryToMOFエンコード部305が出力するmdi は0,1,-1のいずれかの値のみを取りうる。なぜならば、mdi にはdiもしくはdi-1 -diのみが割当てられ、diはあり0,1のみ取りうるからである。 Incidentally, md i output by the BinaryToMOF encoding unit 305 0,1, can take only one of the values of -1. This is because md i is assigned only d i or d i-1 -d i , and d i is available and only 0 and 1 can be taken.

本明細書では、この符号付バイナリ表現mdをMOF表現と呼ぶ。MOF表現では、非零ビットは、0値ビットを無視して隣接する非零ビットとは必ず異なる符号を持つ。例えば、ビット列1010011のMOF表現は、1,-1,1,-1,0,1,0,-1 となる。0値ビットを無視すると隣接する非零ビットの符号が反転していることが分かる。   In this specification, this signed binary representation md is referred to as MOF representation. In MOF representation, non-zero bits always have a different sign from the adjacent non-zero bits, ignoring zero-value bits. For example, the MOF representation of the bit string 1010011 is 1, -1,1, -1,0,1,0, -1. If the zero value bit is ignored, it can be seen that the sign of the adjacent non-zero bit is inverted.

次に図5を用いて、MOFTo2cMOFエンコード部306の行う処理について詳細に説明する。この処理は隣接する2ビットの値が(1,-1)もしくは(-1,1)であった場合、それぞれ(0,1), (0,-1)に変換するという処理を最上位ビット側から行うものである。なお、符号付バイナリ列cmdにおいて、jビット目の値をcmdj と表記する。 Next, processing performed by the MOFTo2cMOF encoding unit 306 will be described in detail with reference to FIG. This process converts the most significant bit into the process of converting to (0,1) and (0, -1), respectively, when the value of two adjacent bits is (1, -1) or (-1,1). From the side. In the signed binary string cmd, the value of the j-th bit is expressed as cmd j .

変数iをnで初期化する(501)。   The variable i is initialized with n (501).

変換部362は、(mdi, mdi-1)の値に応じて処理を振分ける。(mdi, mdi-1)=(1,-1)の場合はステップ511へ行く。(mdi, mdi-1)=(-1,1)の場合はステップ512へ行く。(mdi, mdi-1)がそれ以外の値の場合はステップ503へ行く(502)。 The conversion unit 362 distributes the process according to the value of (md i , md i-1 ). If (md i , md i-1 ) = (1, -1), go to step 511. If (md i , md i−1 ) = (− 1, 1), go to step 512. If (md i , md i-1 ) is any other value, the process goes to step 503 (502).

ステップ502で(mdi, mdi-1)=(1,-1)の場合、
変換部362はcmdiに0、cmdi-1に1を代入し、ステップ513へ行く(511)。
If (md i , md i-1 ) = (1, -1) in step 502,
Conversion unit 362 substitutes 1 to the 0, cmd i-1 cmd i , go to step 513 (511).

ステップ502で(mdi, mdi-1)=(-1,1)の場合、
変換部362はcmdiに0、cmdi-1に-1を代入し、ステップ513へ行く(512)。
If (md i , md i-1 ) = (-1,1) in step 502,
Conversion unit 362 substitutes -1 0, cmd i-1 in cmd i, go to step 513 (512).

変数iを2減少させ、ステップ505へ行く(513)。   Decrease variable i by 2 and go to step 505 (513).

ステップ502で(mdi, mdi-1)が(1,-1), (-1,1)以外の値の場合、
変換部362はcmdiにmdi を代入し、ステップ504へ行く(503)。
If (md i , md i-1 ) is a value other than (1, -1), (-1,1) in step 502,
The conversion unit 362 substitutes md i for cmd i and goes to step 504 (503).

変数iを1減少させ、ステップ505へ行く(504)。   Decrease the variable i by 1 and go to step 505 (504).

繰り返し判定部361は、i>=1かどうかを判定する。i>=1の場合はステップ502へ戻る。i<1の場合はステップ506へ行く(505)。   The repetition determination unit 361 determines whether i> = 1. If i> = 1, the process returns to step 502. If i <1, go to step 506 (505).

ステップ505でi<1の場合、
i=0かどうかを判定する。i=0の場合はステップ507へ行く。i != 0の場合はステップ508へ行く(506)。
If i <1 in step 505,
Determine if i = 0. If i = 0, go to step 507. If i! = 0, go to step 508 (506).

ステップ506でi=0の場合、
変換部362はcmd0にmd0を代入し、ステップ508へ行く(507)。
If i = 0 in step 506,
The conversion unit 362 substitutes md 0 for cmd 0 and goes to step 508 (507).

cmdn, ..., cmd0 を変換された符号付バイナリ列cmdとして出力する(508)。 cmd n , ..., cmd 0 are output as a converted signed binary string cmd (508).

なお、MOFTo2cMOFエンコード部306が出力するcmdi は0,1,-1のいずれかの値のみを取りうる。なぜならば、cmdi には0,1,-1もしくはmdiのみが割当てられ、mdiはBinaryToMOFエンコード部305の出力であり0,1,-1のみ取りうるからである。 Note that cmd i output from the MOFTo2cMOF encoding unit 306 can take only one of 0, 1, and -1. This is because only 0, 1, -1 or md i is assigned to cmd i , and md i is the output of the BinaryToMOF encoding unit 305 and can take only 0, 1, -1.

結果として、エンコード部302が出力するdw[j]は、0,1,-1のいずれかの値のみを取りうる。 As a result, d w [j] output from the encoding unit 302 can take only one of 0, 1, and -1.

本明細書では、この符号付バイナリ表現cmdを2cMOF表現と呼ぶ。   In this specification, this signed binary representation cmd is referred to as a 2cMOF representation.

最後に、図6を用いて、実計算部304がエンコードされたスカラー値と楕円曲線上の点から、楕円曲線におけるスカラー倍点を計算する方法を説明する。   Finally, a method for calculating a scalar multiple point in an elliptic curve from the encoded scalar value and a point on the elliptic curve will be described with reference to FIG.

変数cに初期値nを代入する(601)。    The initial value n is assigned to the variable c (601).

dw[c]が0か0でないかを判定する。 d w Determine whether [c] is 0 or 0.

dw[c]が0の場合はステップ603へ行く。0でなければステップ611へ行く(602)。 If d w [c] is 0, go to Step 603. If not 0, go to step 611 (602).

変数cを1減少させ、ステップ602へ戻る(603)。    The variable c is decreased by 1, and the process returns to step 602 (603).

ステップ602でdw[c]が0でない場合、点Qにdw[c]Pを代入する(611)。 If d w [c] is not 0 in step 602, assigns the d w [c] P to the point Q (611).

変数jに初期値c-1を代入する(612)。    The initial value c-1 is assigned to the variable j (612).

繰り返し判定部344は、jが0より小さいかどうかを判定する。jが0より小さい場合はステップ621へ行く。0以上の場合はステップ614へ行く(613)。    The repetition determination unit 344 determines whether j is smaller than 0. If j is smaller than 0, go to Step 621. If it is greater than 0, go to step 614 (613).

ステップ613でjが0以上の場合、
2倍算部343は、点QをECDBLにより2倍し、点Qに再び格納する(614)。
If j is greater than or equal to 0 in step 613,
The doubling unit 343 doubles the point Q by ECDBL and stores it again at the point Q (614).

ビット値判定部341は、dw[j]が0か0でないかを判定する。dw[j]が0の場合はステップ617へ行く。0でなければステップ616へ行く(615)。 The bit value determination unit 341 determines whether d w [j] is 0 or not 0. If d w [j] is 0, go to Step 617. If not 0, go to step 616 (615).

ステップ615でdw[j]が0でない場合、
加算部342は、点Qとdw[j]PとをECADDにより加算する。ただし、dw[j]が負の場合は、(-dw[j])Pのy座標を反転したものを用いて加算を行う。その結果を点Qに格納し、ステップ617へ行く(616)。
なお、dw[j]が0でない場合は、dw[j]は1もしくは-1であり、dw[j]Pは、Pもしくは-Pのいずれかを表すことになる。
If d w [j] is not 0 in step 615,
The adding unit 342 adds the point Q and d w [j] P by ECADD. However, when d w [j] is negative, addition is performed using the inverted y coordinate of (−d w [j]) P. The result is stored at point Q and the process goes to step 617 (616).
When d w [j] is not 0, d w [j] is 1 or −1, and d w [j] P represents either P or −P.

変数jを1減少させ、ステップ613へと戻る(617)。    The variable j is decreased by 1, and the process returns to step 613 (617).

ステップ613でjが0より小さい場合、
点Qを出力する(621)。
If j is less than 0 in step 613,
The point Q is output (621).

なお、楕円曲線上の点Q=(x,y)に対して、楕円曲線加算に関する逆元の点-Qは、-Q=(x,-y)と表されるため、点Qの座標が与えられていれば容易に計算できる。そのため、点Pのみを保持していれば、実計算部304が行う計算で必要となる点-Pは、それらから導出することが可能である。   Note that for the point Q = (x, y) on the elliptic curve, the inverse element point -Q relating to the addition of the elliptic curve is expressed as -Q = (x, -y). It can be easily calculated if given. Therefore, if only the point P is held, the point -P necessary for the calculation performed by the actual calculation unit 304 can be derived from them.

また、ECADD, ECDBLはそれぞれ楕円曲線における加算、2倍算を表す。加算は式1,2を用いて、2倍算は式4,5を用いてそれぞれ計算される。なお、加算、2倍算の計算には式1,2、および式4,5を用いる以外にも、射影座標やヤコビアン座標における計算公式があり、非特許文献2に記載されている。特に、点Pをアフィン座標として表すことにより、高速に計算することが可能である。   ECADD and ECDBL represent addition and doubling on an elliptic curve, respectively. Addition is calculated using equations 1 and 2, and doubling is calculated using equations 4 and 5, respectively. Note that, in addition to using Equations 1, 2 and Equations 4 and 5 for addition and doubling calculations, there are calculation formulas in projective coordinates and Jacobian coordinates, which are described in Non-Patent Document 2. In particular, by expressing the point P as affine coordinates, it is possible to calculate at high speed.

実計算部304が出力する点Qはスカラー倍点dPに等しい。この理由は次の通りである。   The point Q output from the actual calculation unit 304 is equal to the scalar multiple dP. The reason is as follows.

ステップ613において点Qが
(dw[c]2c-(j+1)+dw[c-1]2(c-1)-(j+1)+…+ dw[j+1]2(j+1)-(j+1))P (式15)
と表されるとする。このとき、次にステップ613に来る時も点Qは式15をみたすことを示す。
In step 613, point Q is
(d w [c] 2 c- (j + 1) + d w [c-1] 2 (c-1)-(j + 1) +… + d w [j + 1] 2 (j + 1) -(j + 1) ) P (Formula 15)
It is assumed that At this time, the point Q indicates that the equation 15 is satisfied even when the next step 613 is reached.

点Qはステップ614で2倍され、dw[j]が0でなければステップ616でdw[j]Pが加えられる。そのためステップ616の直後では、点Qの値は
(dw[c]2c-j+dw[c-1]2(c-1)-j+…+dw[j+1]2(j+1)-j+ dw[j]2j-j)P (式16)
となる。したがってdw[j]=0の時も含めて、ステップ617の直前で、点Qは式16をみたす。ステップ617でjが1減少するので、式16のjにj+1を代入すると式15になる。すなわち、次にステップ613に来る時も点Qは式15をみたす。
Point Q is doubled at step 614 and d w [j] P is added at step 616 if d w [j] is not zero. So immediately after step 616, the value of point Q is
(d w [c] 2 cj + d w [c-1] 2 (c-1) -j +… + d w [j + 1] 2 (j + 1) -j + d w [j] 2 jj ) P (Formula 16)
It becomes. Therefore, the point Q satisfies Equation 16 immediately before step 617, including when d w [j] = 0. Since j is decreased by 1 in step 617, substituting j + 1 for j in equation 16 yields equation 15. That is, the next time when coming to step 613, the point Q satisfies the equation 15.

j>cに対するdw[j]の値は0であるので、ステップ621で出力される点Qの値は
(dw[n]2n+dw[n-1]2n-1+…+dw[0])P (式17)
に等しい。実計算部304に入力されるスカラー値は、エンコード部302によりエンコードされたdw[j]であるので、そのdw[j]は式13をみたす。したがって、Q=dPである。
Since the value of d w [j] for j> c is 0, the value of the point Q output in step 621 is
(d w [n] 2 n + d w [n-1] 2 n-1 +… + d w [0]) P (Equation 17)
be equivalent to. Since the scalar value input to the actual calculation unit 304 is d w [j] encoded by the encoding unit 302, the d w [j] satisfies Equation 13. Therefore, Q = dP.

BinaryToMOFエンコード部305が出力する符号付バイナリ列mdは、
d = mdn2n+mdn-12n-1+…+ md0 (式18)
をみたす。この理由は次の通りである。
ステップ401でmdnにdn-1が、ステップ403でmdiにdi-1-diが、ステップ421でmd0にd0が格納される。したがって、
mdn2n+mdn-12n-1+…+ md0
= dn-12n +(dn-2dn-1)2n-1 +(dn-3dn-2)2n-2 +...+ (d0-d1)2 +d0
= dn-12n-1 +dn-22n-2 +...+ d12 +d0
= d (式19)
が成り立つ。
The signed binary string md output by the BinaryToMOF encoding unit 305 is
d = md n 2 n + md n-1 2 n-1 +… + md 0 (Equation 18)
Meet. The reason is as follows.
In step 401, d n-1 is stored in md n , d i-1 -d i is stored in md i in step 403, and d 0 is stored in md 0 in step 421. Therefore,
md n 2 n + md n-1 2 n-1 +… + md 0
= d n-1 2 n + (d n-2 d n-1 ) 2 n-1 + (d n-3 d n-2 ) 2 n-2 + ... + (d 0 -d 1 ) 2 + d 0
= d n-1 2 n-1 + d n-2 2 n-2 + ... + d 1 2 + d 0
= d (Equation 19)
Holds.

MOFTo2cMOFエンコード部306が出力する符号付バイナリ列cmdは、
d = cmdn2n+cmdn-12n-1+…+ cmd0 (式20)
をみたす。この理由は次の通りである。
ステップ502で(mdi, mdi-1)=(1,-1), (-1,1)の場合、ステップ511、ステップ512の変換により定まるcmdi, cmdi-1 とmdi, mdi-1の間には
cmdi2i +cmdi-12i-1 = mdi2i +mdi-12i-1 (式21)
の関係が成り立つ。またステップ502で(mdi, mdi-1)=(1,-1), (-1,1)以外の場合、ステップ503の変換により定まるcmdi, とmdi, の間には
cmdi2i = mdi2i (式22)
の関係が成り立つ。ステップ507でcmd0にmd0が代入される。したがって、
cmdn2n+cmdn-12n-1+…+ cmd0 = mdn2n+mdn-12n-1+…+ md0 (式23)
が成り立つ。mdはBinaryToMOFエンコード部の305の出力であるため、式13をみたす。したがって、式18が成り立つ。
The signed binary string cmd output by the MOFTo2cMOF encoding unit 306 is
d = cmd n 2 n + cmd n-1 2 n-1 +… + cmd 0 (Formula 20)
Meet. The reason is as follows.
If (md i , md i-1 ) = (1, -1), (-1,1) in step 502, cmd i , cmd i-1 and md i , md determined by the conversion in step 511 and step 512 Between i-1
cmd i 2 i + cmd i-1 2 i-1 = md i 2 i + md i-1 2 i-1 (Formula 21)
The relationship holds. Also, if (md i , md i-1 ) = (1, -1), (-1,1) other than (md i ) in step 502, there is a gap between cmd i , and md i , determined by the conversion in step 503.
cmd i 2 i = md i 2 i (Formula 22)
The relationship holds. In step 507, md 0 is assigned to cmd 0 . Therefore,
cmd n 2 n + cmd n-1 2 n-1 +… + cmd 0 = md n 2 n + md n-1 2 n-1 +… + md 0 (Equation 23)
Holds. Since md is the output of 305 of the BinaryToMOF encoding unit, Equation 13 is satisfied. Therefore, Equation 18 holds.

結果として、エンコード部302が出力する数値列dw[j]は、式13をみたす。 As a result, the numerical sequence d w [j] output from the encoding unit 302 satisfies Expression 13.

BinaryToMOFエンコード部305の行う処理はleft-to-rightである。なぜならば、ステップ401においてdn-1の値を用いてmdnの値を割当て、その後ステップ403において、順次iが大きい方からdi, di-1 を用いてmdi の値を決定し、最後にステップ421においてd0を用いてmd0の値を割当てるからである。 The processing performed by the BinaryToMOF encoding unit 305 is left-to-right. This is because, in step 401, the value of md n is assigned using the value of d n-1 , and then in step 403, the value of md i is determined using d i and d i-1 in descending order of i. Finally, in step 421, the value of md 0 is assigned using d 0 .

なお、第1実施例ではBinaryToMOFエンコード部305の処理をleft-to-rightで行う場合を説明したが、right-to-leftでの処理や並列処理も可能である。なぜならば、各mdi はdi, di-1 から定まり、他のmdjの結果を用いないからである。そのため、right-to-left で処理を行う場合はiが小さい値から順次定めることにより、また並列で行う場合は対象とするmdi の計算を同時に行うことにより、計算することが可能である。 In the first embodiment, the case where the processing of the BinaryToMOF encoding unit 305 is performed left-to-right has been described, but right-to-left processing and parallel processing are also possible. This is because each md i is determined from d i and d i−1, and the result of other md j is not used. Therefore, when processing with right-to-left by sequentially determined from i is smaller, also by performing the calculation of md i of interest simultaneously when performing in parallel, it is possible to calculate.

MOFTo2cMOFエンコード部306の行う処理はleft-to-rightである。なぜならば、ステップ511、ステップ512、ステップ503において、順次iが大きい方からmdi, mdi-1 を用いてcmdi, cmdi-1 の値を決定し、最後にステップ507においてmd0を用いてcmd0 の値を割当てるからである。 The processing performed by the MOFTo2cMOF encoding unit 306 is left-to-right. This is because in Step 511, Step 512, and Step 503, the values of cmd i and cmd i-1 are determined using md i and md i-1 from the largest i in order, and finally md 0 is set in Step 507. This is because the value of cmd 0 is assigned.

結果として、エンコード部302の行う処理はleft-to-rightである。   As a result, the processing performed by the encoding unit 302 is left-to-right.

BinaryToMOFエンコード部305の出力するmdは、その出現ビットの値の推移確率をして、以下のような推移確率を持つ。
0→0:1/2、 0→非零:1/2、 非零→0:1/2、 非零→非零:1/2 (式24)
すなわち、0と非零とは独立である。この理由は次の通りである。各mdi は、di-1 di より定まり、他のmdj には依存しない。di-1, di の値として0,1の各々二通りの場合を考えることにより、0と非零の値が各々1/2の確率となることが分かる。したがって、上記の推移確率を取ることが分かる。
The md output from the BinaryToMOF encoding unit 305 represents the transition probability of the value of the appearance bit and has the following transition probability.
0 → 0: 1/2, 0 → non-zero: 1/2, non-zero → 0: 1/2, non-zero → non-zero: 1/2 (Formula 24)
That is, 0 and non-zero are independent. The reason is as follows. Each md i is determined by d i-1 d i and does not depend on other md j . By considering two cases of 0 and 1 as the values of d i-1 and d i , it can be seen that 0 and non-zero values each have a probability of 1/2. Therefore, it can be seen that the above transition probability is taken.

次に、MOFTo2cMOFエンコード部306が出力するcmdは、非零濃度が1/3となる。ここで非零濃度とは、(非零ビットの個数)/(ビット長) の漸近的な値を指す。この理由は次の通りである。
ステップ502-ステップ505の変換は、mdi, mdi-1の値により 取りうる状態が4つある。すなわち、(a)00, (b)01, (c)10, (d)11である。ただし、ここでの1は非零を表している。ステップ513ではiを2減少させるので、もう一つの状態(e)を補う。MOF表現の推移確率は式24で与えられるので、これらの間の推移確率は、
(a)→(a):1/2、(a)→(b):1/2、
(b)→(c):1/2、(b)→(d):1/2、
(c)→(a):1/2、(c)→(b):1/2、
(d)→(e):1、
(e)→(a):1/4、(e)→(b):1/4、(e)→(c):1/4、(e)→(d):1/4 (式25)
となる。この推移確率から定まる定常状態を計算すると、
(a):1/4、(b):1/4、(c):1/6、(d):1/6、(e):1/6 (式26)
となる。非零ビットが出力されるのは、状態(c)(d)に対応するので、非零濃度は1/3となる。また、非特許文献1によれば、ウィンドウ幅wが2の場合、非零濃度1/3が最小であることが示されている。
Next, cmd output from the MOFTo2cMOF encoding unit 306 has a non-zero density of 1/3. Here, the non-zero density indicates an asymptotic value of (number of non-zero bits) / (bit length). The reason is as follows.
The conversion from step 502 to step 505 has four possible states depending on the values of md i and md i−1 . That is, (a) 00, (b) 01, (c) 10, (d) 11. However, 1 here represents non-zero. In step 513, i is decreased by 2, so that another state (e) is compensated. Since the transition probability of MOF expression is given by Equation 24, the transition probability between these is
(a) → (a): 1/2, (a) → (b): 1/2,
(b) → (c): 1/2, (b) → (d): 1/2,
(c) → (a): 1/2, (c) → (b): 1/2,
(d) → (e): 1,
(e) → (a): 1/4, (e) → (b): 1/4, (e) → (c): 1/4, (e) → (d): 1/4 (Formula 25 )
It becomes. When calculating the steady state determined from this transition probability,
(a): 1/4, (b): 1/4, (c): 1/6, (d): 1/6, (e): 1/6 (Formula 26)
It becomes. Since the non-zero bit is output corresponding to the states (c) and (d), the non-zero density is 1/3. Non-Patent Document 1 shows that when the window width w is 2, the non-zero density 1/3 is the smallest.

したがって、エンコード部302の出力も非零濃度1/3となり、最小の非零濃度である。   Therefore, the output of the encoding unit 302 is also 1/3 of the non-zero density, which is the minimum non-zero density.

実計算部304の加算部342が実行する楕円加算の回数は、エンコードされた符号付バイナリ列の非零ビットの個数となる。この非零ビットの個数は最小であるため、楕円加算の回数は最小となる。
以上の通り、上記計算方法は、エンコード処理をleft-to-rightで行うことが可能である。また、エンコードされた数値列は最小の非零濃度を持つため、楕円加算を行う回数が少なくてすみ、そのため、高速に計算することが可能である、という特徴がある。
The number of elliptical additions performed by the adding unit 342 of the actual calculation unit 304 is the number of non-zero bits of the encoded signed binary string. Since the number of non-zero bits is the smallest, the number of elliptical additions is the smallest.
As described above, the above calculation method can perform the encoding process left-to-right. In addition, since the encoded numerical sequence has the minimum non-zero density, the number of times of ellipse addition can be reduced, so that it can be calculated at high speed.

なお、第1の計算方法では楕円曲線としてワイエルシュトラス型楕円曲線を用いたが、標数2の有限体上で定義された楕円曲線や、非特許文献4に記載されているOEF(Optimal Extension Field)上で定義された楕円曲線、もしくはモンゴメリ型楕円曲線を用いてもよい。   In the first calculation method, the Weierstrass-type elliptic curve is used as the elliptic curve, but the elliptic curve defined on the finite field of characteristic 2 or the OEF (Optimal An elliptic curve defined on Extension Field) or a Montgomery-type elliptic curve may be used.

第2実施例では、第1実施例の2つのエンコード処理を同時に実行する方法に関して説明する。第2実施例では、図7で示されるスカラー倍計算部の機能ブロックを用いる。スカラー倍計算部115(図1の115)は、エンコード部702、実計算部704からなる。エンコード部702は、繰り返し判定部721、変換部722からなる。実計算部704は、第1実施例の実計算部304と同様の構成を備える。   In the second embodiment, a method for simultaneously executing the two encoding processes of the first embodiment will be described. In the second embodiment, the functional block of the scalar multiplication calculator shown in FIG. 7 is used. The scalar multiplication calculation unit 115 (115 in FIG. 1) includes an encoding unit 702 and an actual calculation unit 704. The encoding unit 702 includes a repetition determination unit 721 and a conversion unit 722. The actual calculation unit 704 has the same configuration as the actual calculation unit 304 of the first embodiment.

スカラー倍計算部115がスカラー値d及び楕円曲線上の点Pから、楕円曲線におけるスカラー倍点dPを計算する第2の計算方法を説明する。   A second calculation method in which the scalar multiplication calculation unit 115 calculates the scalar multiplication point dP in the elliptic curve from the scalar value d and the point P on the elliptic curve will be described.

スカラー倍計算部115が暗号化処理部112からスカラー値dと楕円曲線上の点Pを受け取ると、エンコード部702は、入力されたスカラー値dを式13, 式14をみたす数値列dw[j]にエンコードする。実計算部704は、エンコードされたスカラー値と入力された点Pを用いてスカラー倍点dPを計算する。第2実施例では特にw=2の場合について説明する。 When the scalar multiplication calculation unit 115 receives the scalar value d and the point P on the elliptic curve from the encryption processing unit 112, the encoding unit 702 converts the input scalar value d into a numerical sequence d w [ j]. The actual calculation unit 704 calculates a scalar multiple dP using the encoded scalar value and the input point P. In the second embodiment, a case where w = 2 is described.

次にエンコード部702、実計算部704の行う各処理について詳細に説明する。   Next, each process performed by the encoding unit 702 and the actual calculation unit 704 will be described in detail.

まず、エンコード部702の行う処理について説明する。   First, processing performed by the encoding unit 702 will be described.

エンコード部702にバイナリ列dが入力されると、符号付バイナリ列cmdに変換する。エンコード部702は、この符号付バイナリ列cmdをエンコードされた数値列dw[j]として出力する。すなわち、各jに対して、dw[j] = cmdjである。ただし、cmdjはcmdのjビット目の値とする。 When the binary string d is input to the encoding unit 702, it is converted into a signed binary string cmd. The encoding unit 702 outputs the signed binary string cmd as an encoded numeric string d w [j]. That is, for each j, d w [j] = cmd j . However, cmd j is the value of the jth bit of cmd.

次に実計算部704の行う処理について説明する。実計算部704の行う処理は、第1実施例の実計算部304の行う処理と同様の処理を行う。   Next, processing performed by the actual calculation unit 704 will be described. The process performed by the actual calculation unit 704 is the same as the process performed by the actual calculation unit 304 of the first embodiment.

次に図8を用いて、エンコード部702の行う処理について詳細に説明する。   Next, processing performed by the encoding unit 702 will be described in detail with reference to FIG.

変数iに初期値c+1を代入する。ただし、cはdの非零ビットのインデックスで最大のものとする。すなわち、dc!=0かつi>cに対してdi=0(801)。 Substitute initial value c + 1 for variable i. Here, c is the largest index of non-zero bits of d. That is, d i = 0 (801) for d c ! = 0 and i> c.

変換部722は、d-1に0を代入し、cmdn, ..., cmdc+1 に0を代入する(802)。 The conversion unit 722 substitutes 0 for d−1 and substitutes 0 for cmd n ,..., Cmd c + 1 (802).

繰り返し判定部721は、i>=1かどうかを判定する。i>=1の場合はステップ811へ行く。i<1の場合はステップ821へ行く(803)。   The repetition determination unit 721 determines whether i> = 1. If i> = 1, go to Step 811. If i <1, go to Step 821 (803).

ステップ803でi>=1の場合、
di-1 = di かどうかを判定する。di-1 = di の場合はステップ812へ行く。di-1 != di の場合はステップ813へ行く(811)。
If i> = 1 in step 803,
Determine whether d i-1 = d i . If d i−1 = d i , go to step 812. If d i-1 ! = d i , go to Step 813 (811).

ステップ811でdi-1 = di の場合、
変換部722はcmdi に0を代入し、変数iを1減少させ、ステップ803へ戻る(812)。
If d i-1 = d i in step 811,
The conversion unit 722 assigns 0 to cmd i , decreases the variable i by 1, and returns to step 803 (812).

ステップ811でdi-1 != di の場合、
変換部722はcmdi に -di +di-2 を、cmdi-1 に di-2 +di-1 を代入し、変数iを2減少させ、ステップ803へ戻る(813)。
If d i-1 ! = D i in step 811,
The conversion unit 722 -d i + d i-2 in cmd i, by substituting the d i-2 + d i- 1 to cmd i-1, the variable i 2 is reduced, the flow returns to step 803 (813).

ステップ803でi<1の場合、
i=0 かどうかを判定する。i=0 の場合はステップ822へ行く。i != 0の場合はステップ823へ行く(821)。
If i <1 in step 803,
Determine if i = 0. If i = 0, go to step 822. If i! = 0, go to Step 823 (821).

ステップ821でi=0の場合、
変換部722はcmd0 に d0を代入し、ステップ823へ行く(822)。
If i = 0 in step 821,
The conversion unit 722 substitutes d 0 for cmd 0 and goes to Step 823 (822).

cmdn, ..., cmd0 を変換された符号付バイナリ列cmdとして出力する(823)。 cmd n , ..., cmd 0 are output as the converted signed binary string cmd (823).

なお、エンコード部702が出力するdw[j]は、0,1,-1のいずれかの値のみを取りうる。なぜならば、スカラー値dの各ビットdi は0,1いずれかの値のみを取り、cmdj は0, -di もしくは、2つのdi の差分のいずれかが代入されるからである。 Note that d w [j] output from the encoding unit 702 can take only one of 0, 1, and -1. This is because each bit d i of the scalar value d takes only 0 or 1 and cmd j is substituted with 0, −d i or one of the differences between the two d i .

エンコード部702が出力する符号付バイナリ列cmdは、
d = cmdn2n+cmdn-12n-1+…+ cmd0 (式27)
をみたす。この理由は次の通りである。
ステップ803-ステップ813におけるループでは、di2i+1がキャリーとしてループでの不変量となる。まずステップ811の分岐処理によりステップ812へ行った場合を考える。ステップ812ではcmdiに0が代入される。
cmdi2i +di2i+1 = di2i +di2i
= di2i +di-12i (式28)
したがって、diに対する項はdi2iとなり、キャリーdi-12iとなる。次にステップ811の分岐処理によりステップ813へ行った場合を考える。
cmdi2i +cmdi2i-1 +di2i+1 = (-di+di-2)2i +(di-2+di-1)2i-1 +di2i+1
= di2i +di-12i-1 +di-22i-1 (式29)
したがって、di, di-1に対する項はそれぞれdi2i, di-12i-1となり、キャリーdi-22i-1となる。したがって、di2i+1がキャリーとしてループでの不変量となることが分かった。最初にステップ803に来る時のiの値はi=c+1であり、
dc+12c+2 = 0 (式30)
であるのでキャリーは0となる。他方、ループを抜けたあとの処理では、キャリーの値はd02もしくはd-11となる。i=0の場合はステップ822の処理を行うため、いずれの場合もキャリーがキャンセルされる。以上をまとめると、
cmdn2n+cmdn-12n-1+…+ cmd0 = dn2n+dn-12n-1+…+ d0 = d (式31)
となる。
The signed binary string cmd output from the encoding unit 702 is
d = cmd n 2 n + cmd n-1 2 n-1 +… + cmd 0 (Equation 27)
Meet. The reason is as follows.
In the loop in Step 803 to Step 813, d i 2 i + 1 is a carry and becomes an invariant in the loop. First, consider the case where the process proceeds to step 812 by the branch process of step 811. In step 812, 0 is assigned to cmd i .
cmd i 2 i + d i 2 i + 1 = d i 2 i + d i 2 i
= d i 2 i + d i-1 2 i (Equation 28)
Thus, term for d i is d i 2 i, and becomes a carry d i-1 2 i. Next, consider a case where the process goes to step 813 by the branch process of step 811.
cmd i 2 i + cmd i 2 i-1 + d i 2 i + 1 = (-d i + d i-2 ) 2 i + (d i-2 + d i-1 ) 2 i-1 + d i 2 i + 1
= d i 2 i + d i-1 2 i-1 + d i-2 2 i-1 (Equation 29)
Therefore, the terms for d i and d i−1 are d i 2 i and d i−1 2 i−1 , respectively, and carry d i−2 2 i−1 . Therefore, it was found that d i 2 i + 1 is an invariant in the loop as a carry. The value of i when first coming to step 803 is i = c + 1,
d c + 1 2 c + 2 = 0 (Equation 30)
Therefore, the carry becomes 0. On the other hand, in the processing after exiting the loop, the carry value is d 0 2 or d −1 1. If i = 0, the process of step 822 is performed, and in either case, the carry is canceled. In summary,
cmd n 2 n + cmd n-1 2 n-1 +… + cmd 0 = d n 2 n + d n-1 2 n-1 +… + d 0 = d (Equation 31)
It becomes.

エンコード部702の行う処理はleft-to-rightである。なぜならば、ステップ802においてcmdn,..., cmdc+2の値をクリアし、その後ステップ812, ステップ813において、順次iが大きい方からdi, di-1, di-2を用いてcmdi, cmdi-1の値を決定し、最後にステップ821においてd0を用いてcmd0の値を割当てるからである。 Processing performed by the encoding unit 702 is left-to-right. This is because the values of cmd n ,..., Cmd c + 2 are cleared in step 802, and then in steps 812 and 813, d i , d i-1 and d i-2 are set in descending order of i. This is because the values of cmd i and cmd i−1 are determined by using and finally the value of cmd 0 is assigned using d 0 in step 821.

エンコード部702の出力する符号付バイナリ列cmdは、非零濃度が1/3となり、最小の非零濃度である。なぜならば、エンコード部702の出力は、第1実施例のエンコード部302の出力と一致するからである。   In the signed binary string cmd output from the encoding unit 702, the non-zero density is 1/3, which is the minimum non-zero density. This is because the output of the encoding unit 702 matches the output of the encoding unit 302 of the first embodiment.

実計算部704の加算部742が実行する楕円加算の回数は、エンコードされた符号付バイナリ列の非零ビットの個数となる。この非零ビットの個数は最小であるため、楕円加算の回数は最小となる。   The number of elliptical additions performed by the adding unit 742 of the actual calculation unit 704 is the number of non-zero bits of the encoded signed binary string. Since the number of non-zero bits is the smallest, the number of elliptical additions is the smallest.

以上の通り、上記計算方法は、エンコード処理をleft-to-rightで行うことが可能である。また、エンコードされた数値列は最小の非零濃度を持つため、楕円加算を行う回数が少なくてすみ、そのため、高速に計算することが可能である、という特徴がある。また、第2実施例ではエンコード処理を1回で行うことにより、エンコード処理の高速化、プログラムの簡素化やハードウェア論理回路の小規模化といったメリットがある。   As described above, the above calculation method can perform the encoding process left-to-right. In addition, since the encoded numerical sequence has a minimum non-zero density, the number of times of ellipse addition can be reduced, so that it can be calculated at high speed. Further, in the second embodiment, the encoding process is performed once, so that there are merits such as speeding up of the encoding process, simplification of the program and downsizing of the hardware logic circuit.

なお、第2の計算方法でも楕円曲線としてワイエルシュトラス型楕円曲線を用いたが、標数2の有限体上で定義された楕円曲線や、OEF(Optimal Extension Field)上で定義された楕円曲線、もしくはモンゴメリ型楕円曲線を用いてもよいことも、第1実施例と同様である。   In the second calculation method, the Weierstrass-type elliptic curve was used as an elliptic curve, but an elliptic curve defined on a characteristic 2 finite field or an ellipse defined on OEF (Optimal Extension Field) Similarly to the first embodiment, a curve or a Montgomery-type elliptic curve may be used.

第3実施例では、第1実施例、第2実施例でのエンコード処理を、実計算部の行う処理に組込み、楕円演算を行う際に逐次変換し用いる方法に関して説明する。第3実施例では、図9で示されるスカラー倍計算部の機能ブロックを用いる。スカラー倍計算部115(図1の115)は、実計算部904からなる。実計算部904は、変換判定部941、加算部942、2倍算部943、繰り返し判定部944からなる。   In the third embodiment, the encoding process in the first embodiment and the second embodiment will be incorporated into the process performed by the real calculation unit, and a method of sequential conversion and use when performing an elliptic operation will be described. In the third embodiment, the functional block of the scalar multiplication calculator shown in FIG. 9 is used. The scalar multiplication calculation unit 115 (115 in FIG. 1) includes an actual calculation unit 904. The actual calculation unit 904 includes a conversion determination unit 941, an addition unit 942, a doubling unit 943, and a repetition determination unit 944.

スカラー倍計算部115がスカラー値d及び楕円曲線上の点Pから、楕円曲線におけるスカラー倍点dPを計算する第3の計算方法を説明する。   A third calculation method in which the scalar multiplication calculation unit 115 calculates the scalar multiplication point dP in the elliptic curve from the scalar value d and the point P on the elliptic curve will be described.

スカラー倍計算部115が暗号化処理部112からスカラー値dと楕円曲線上の点Pを受け取ると、実計算部904は、入力されたスカラー値と入力された点Pを用いてスカラー倍点dPを計算する。第3実施例では特にw=2の場合について説明する。   When the scalar multiplication calculation unit 115 receives the scalar value d and the point P on the elliptic curve from the encryption processing unit 112, the actual calculation unit 904 uses the input scalar value and the input point P to determine the scalar multiple dP. Calculate In the third embodiment, a case where w = 2 is described.

次に図10、図11を用いて、実計算部904の行う処理について詳細に説明する。   Next, processing performed by the actual calculation unit 904 will be described in detail with reference to FIGS.

d-1に0を、変数iにc+1を代入する。ただし、cはdの非零ビットのインデックスで最大のものとする。すなわち、dc!=0かつi>cに対してdi=0 (1001)。 Substitute 0 for d- 1 and c + 1 for variable i. Here, c is the largest index of non-zero bits of d. That is, d c ! = 0 and d i = 0 (1001) for i> c.

変換判定部941は、di-2=1かどうかを判定する。di-2=1の場合、ステップ1003へ行く。di-2!=1の場合、ステップ1004へ行く(1002)。 The conversion determination unit 941 determines whether d i−2 = 1. If d i−2 = 1, go to step 1003. If d i-2 ! = 1, go to step 1004 (1002).

ステップ1002でdi-2=1の場合、
2倍算部943は、点PをECDBLにより2倍し、点Qに格納し、ステップ1005へ行く(1003)。
If d i-2 = 1 in step 1002,
The doubling unit 943 doubles the point P by ECDBL, stores it at the point Q, and goes to Step 1005 (1003).

ステップ1002でdi-2!=1の場合、
点Pを点Qに格納し、ステップ1005へ行く(1004)。
If d i-2 ! = 1 in step 1002,
Point P is stored in point Q, and the process goes to step 1005 (1004).

変数iを2減少させる(1005)。   Decrease variable i by 2 (1005).

繰り返し判定部944は、i>0かどうかを判定する。i>0の場合、ステップ1111へ行く。i<=0の場合、ステップ1007へ行く(1006)。   The repetition determination unit 944 determines whether i> 0. If i> 0, go to step 1111. If i <= 0, go to step 1007 (1006).

ステップ1006でi>0の場合、
変換判定部941は、di-1=dかどうかを判定する。di-1=diの場合、ステップ1121へ行く。di-1!=diの場合、ステップ1112へ行く(1111)。
If i> 0 in step 1006,
The conversion determination unit 941 determines whether di-1 = d. If d i−1 = d i , go to step 1121. If d i-1 ! = d i , go to step 1112 (1111).

ステップ1111でdi-1=diの場合、
2倍算部943は、点QをECDBLにより2倍し、点Qに再び格納する(1121)。
If d i-1 = d i in step 1111,
The doubling unit 943 doubles the point Q by ECDBL and stores it again at the point Q (1121).

変数iを1減少させ、ステップ1006へと戻る(1122)。   The variable i is decreased by 1, and the process returns to step 1006 (1122).

ステップ1111でdi-1!=diの場合、
2倍算部943は、点QをECDBLにより2倍し、点Qに再び格納する(1112)。
If d i-1 ! = D i in step 1111,
The doubling unit 943 doubles the point Q by ECDBL and stores it again at the point Q (1112).

変換判定部941は、(di,di-2)の値に応じて処理を振分ける。(di,di-2)=(1,1)の場合、ステップ1114へ行く。(di,di-2)=(1,0)の場合、ステップ1115へ行く。(di,di-2)=(0,1)の場合、ステップ1116へ行く。(di,di-2)=(0,0)の場合、ステップ1117へ行く(1113)。 The conversion determination unit 941 distributes processing according to the value of (d i , d i−2 ). If (d i , d i−2 ) = (1,1), go to step 1114. If (d i , d i−2 ) = (1,0), go to step 1115. If (d i , d i−2 ) = (0,1), go to step 1116. If (d i , d i−2 ) = (0,0), go to step 1117 (1113).

ステップ1113で(di,di-2)=(1,1)の場合、
2倍算部943は、点QをECDBLにより2倍し、点Qに再び格納する。その後、加算部942は、点Qと点-PとをECADDにより加算し、点Qに格納する。その後、ステップ1118へ行く(1114)。
If (d i , d i-2 ) = (1,1) in step 1113,
The doubling unit 943 doubles the point Q by ECDBL and stores it again at the point Q. Thereafter, the adding unit 942 adds the point Q and the point −P by ECADD, and stores the result in the point Q. Thereafter, the process goes to Step 1118 (1114).

ステップ1113で(di,di-2)=(1,0)の場合、
加算部942は、点Qと点-PとをECADDにより加算し、点Qに格納する。その後、2倍算部943は、点QをECDBLにより2倍し、点Qに再び格納する。その後、ステップ1118へ行く(1115)。
If (d i , d i-2 ) = (1,0) in step 1113,
The adding unit 942 adds the point Q and the point −P by ECADD, and stores the result in the point Q. Thereafter, the doubling unit 943 doubles the point Q by ECDBL and stores it again at the point Q. Thereafter, the process goes to Step 1118 (1115).

ステップ1113で(di,di-2)=(0,1)の場合、
加算部942は、点Qと点PとをECADDにより加算し、点Qに格納する。その後、2倍算部943は、点QをECDBLにより2倍し、点Qに再び格納する。その後、ステップ1118へ行く(1116)。
If (d i , d i-2 ) = (0,1) in step 1113,
Adder 942 adds point Q and point P by ECADD, and stores the result at point Q. Thereafter, the doubling unit 943 doubles the point Q by ECDBL and stores it again at the point Q. Thereafter, the process goes to step 1118 (1116).

ステップ1113で(di,di-2)=(0,0)の場合、
2倍算部943は、点QをECDBLにより2倍し、点Qに再び格納する。その後、加算部942は、点Qと点PとをECADDにより加算し、点Qに格納する。その後、ステップ1118へ行く(1117)。
If (d i , d i-2 ) = (0,0) in step 1113,
The doubling unit 943 doubles the point Q by ECDBL and stores it again at the point Q. Thereafter, the adding unit 942 adds the point Q and the point P by ECADD, and stores the result at the point Q. Thereafter, the process goes to Step 1118 (1117).

変数iを2減少させ、ステップ1006へと戻る(1118)。   Decrease the variable i by 2 and return to Step 1006 (1118).

ステップ1006でi<=0の場合、
i=0かどうかを判定する。i=0の場合はステップ1008へ行く。i != 0の場合はステップ1009へ行く(1007)。
If i <= 0 in step 1006,
Determine if i = 0. If i = 0, go to step 1008. If i! = 0, go to step 1009 (1007).

ステップ1007でi=0の場合、
2倍算部943は、点QをECDBLにより2倍し、点Qに再び格納する。その後、加算部942は、点Qと点-d0PとをECADDにより加算し、点Qに格納する。その後、ステップ1009へ行く(1008)。
If i = 0 in step 1007,
The doubling unit 943 doubles the point Q by ECDBL and stores it again at the point Q. Thereafter, the adding unit 942 adds the point Q and the point −d0P by ECADD, and stores the result at the point Q. Thereafter, the process goes to Step 1009 (1008).

点Qをスカラー倍点dPとして出力する(1009)。   The point Q is output as a scalar multiple dP (1009).

実計算部904が出力する点Qはスカラー倍点dPに等しい。この理由は次の通りである。
まず、ステップ1112-ステップ1118の処理について考える。この場合、di=di-1が成り立っている。(di, di-2)=(1,1)の場合、ステップ1112、ステップ1114の処理により、実行される演算はcmdi=0, cmdi-1=-1が第2実施例の実計算部704に入力された時と同じとなる。また、第2実施例のエンコード部702は、入力が(di, di-1, di-2)=(1,1,1)の時、ステップ813の処理により (cmdi, cmdi-1) = (0,-1)を出力する。したがって、この場合の処理は、第3実施例と第2実施例で同じとなる。同様に、ステップ1112、ステップ1115の処理は、(cmdi, cmdi-1) = (-1,0)、ステップ1112、ステップ1116の処理は、(cmdi, cmdi-1) = (1,0)、ステップ1112、ステップ1117の処理は、(cmdi, cmdi-1) = (0,1)に、それぞれ相当し、ステップ813の処理と一致する。また同様に、di, != di-1 の場合、ステップ1121の処理はステップ812の処理に相当する。他の部分についても第2実施例のエンコード部702の処理と同様に対応がつく。したがって、実計算部904が出力する点Qはスカラー倍点dPに等しい。
The point Q output from the actual calculation unit 904 is equal to the scalar multiple dP. The reason is as follows.
First, consider the processing of step 1112-step 1118. In this case, d i = d i−1 holds. When (d i , d i−2 ) = (1, 1), the operations executed in steps 1112 and 1114 are cmd i = 0 and cmd i−1 = −1. This is the same as when input to the actual calculation unit 704. Also, the encoding unit 702 of the second embodiment performs (cmd i , cmd i ) by the process of step 813 when the input is (d i , d i-1 , d i-2 ) = (1, 1, 1). -1 ) = (0, -1) is output. Therefore, the processing in this case is the same between the third embodiment and the second embodiment. Similarly, the processing of step 1112 and step 1115 is (cmd i , cmd i-1 ) = (-1,0), and the processing of step 1112 and step 1116 is (cmd i , cmd i-1 ) = (1 , 0), step 1112, and step 1117 correspond to (cmd i , cmd i-1 ) = (0, 1), respectively, and correspond to the processing of step 813. Similarly, when d i ,! = D i−1 , the process at step 1121 corresponds to the process at step 812. Other portions can be handled in the same manner as the processing of the encoding unit 702 of the second embodiment. Therefore, the point Q output from the actual calculation unit 904 is equal to the scalar multiple dP.

また、第2実施例との対応関係により、実計算部904の行う処理はleft-to-rightとなる。   Further, due to the correspondence with the second embodiment, the processing performed by the actual calculation unit 904 is left-to-right.

実計算部904の行う楕円加算の回数は最小である。なぜならば、実計算部904の変換判定部941の行う処理は、第2実施例のエンコード部702の処理と対応がつくからである。   The number of ellipse additions performed by the actual calculation unit 904 is minimum. This is because the processing performed by the conversion determination unit 941 of the actual calculation unit 904 can correspond to the processing of the encoding unit 702 of the second embodiment.

以上の通り、上記計算方法は、スカラー倍計算をleft-to-rightで行うことができる。また、楕円加算の回数は最小となっているため、高速に計算することが可能である、という特徴がある。また、第3実施例ではエンコード処理と楕円演算を1度に行うため、エンコード結果を一旦メモリに格納する必要がなく、メモリ使用量を少なくすることができる。   As described above, the above calculation method can perform left-to-right scalar multiplication. In addition, since the number of times of ellipse addition is minimized, the calculation can be performed at high speed. In the third embodiment, since the encoding process and the ellipse calculation are performed once, it is not necessary to store the encoding result in the memory once, and the memory usage can be reduced.

なお、第3の計算方法でも楕円曲線としてワイエルシュトラス型楕円曲線を用いたが、標数2の有限体上で定義された楕円曲線や、OEF(Optimal Extension Field)上で定義された楕円曲線、もしくはモンゴメリ型楕円曲線を用いてもよいことも、第1実施例と同様である。   In the third calculation method, the Weierstrass-type elliptic curve was used as the elliptic curve. Similarly to the first embodiment, a curve or a Montgomery-type elliptic curve may be used.

第4実施例では、第1実施例の計算方法を、一般のウィンドウ幅wに拡張した方法に関して説明する。第4実施例では、図12で示されるスカラー倍計算部の機能ブロックを用いる。スカラー倍計算部115(図1の135)は、エンコード部1202、前計算部1203、実計算部1204からなる。エンコード部1202は、BinaryToMOFエンコード部1205、MOFTowcMOFエンコード部1207からなる。BinaryToMOFエンコード部1205は、第1実施例のBinaryToMOFエンコード部305と同様の構成を備える。MOFTowcMOFエンコード部1207は、繰り返し判定部1271、変換部1272からなる。前計算部1203は、加算部1231、2倍算部1232、繰り返し判定部1233からなる。実計算部1204は、第1実施例の実計算部304と同様の構成を備える。   In the fourth embodiment, a description will be given of a method in which the calculation method of the first embodiment is expanded to a general window width w. In the fourth embodiment, the functional block of the scalar multiplication unit shown in FIG. 12 is used. The scalar multiplication calculation unit 115 (135 in FIG. 1) includes an encoding unit 1202, a previous calculation unit 1203, and an actual calculation unit 1204. The encoding unit 1202 includes a BinaryToMOF encoding unit 1205 and a MOFTowcMOF encoding unit 1207. The BinaryToMOF encoding unit 1205 has the same configuration as the BinaryToMOF encoding unit 305 of the first embodiment. The MOFTowcMOF encoding unit 1207 includes an iterative determination unit 1271 and a conversion unit 1272. The pre-calculation unit 1203 includes an addition unit 1231, a doubling unit 1232, and an iterative determination unit 1233. The actual calculation unit 1204 has the same configuration as the actual calculation unit 304 of the first embodiment.

スカラー倍計算部115がスカラー値d及び楕円曲線上の点Pから、楕円曲線におけるスカラー倍点dPを計算する第4の計算方法を説明する。   A fourth calculation method in which the scalar multiplication calculator 115 calculates the scalar multiplication point dP in the elliptic curve from the scalar value d and the point P on the elliptic curve will be described.

スカラー倍計算部115が暗号化処理部112からスカラー値dと楕円曲線上の点Pを受け取ると、エンコード部1202は、入力されたスカラー値dを式13、式14をみたす数値列dw[j]にエンコードする。前計算部1203は、入力された楕円曲線上の点Pから事前計算テーブルを作成する。事前計算テーブルはP, 3P, …, (2w-1-1)Pにより構成される。実計算部1204は、エンコードされたスカラー値と事前計算テーブルを用いてスカラー倍点dPを計算する。 When the scalar multiplication calculation unit 115 receives the scalar value d and the point P on the elliptic curve from the encryption processing unit 112, the encoding unit 1202 converts the input scalar value d into a numerical sequence d w [ j]. The pre-calculation unit 1203 creates a pre-calculation table from the input point P on the elliptic curve. The pre-calculation table is composed of P, 3P, ..., (2 w-1 -1) P. The actual calculation unit 1204 calculates the scalar multiple dP using the encoded scalar value and the pre-calculation table.

なお、エンコード部1202の行うエンコード処理は、スカラー値dを受け取った後、および実計算部1204がスカラー倍点を計算する前であればよい。すなわち、前計算部1203が事前計算テーブルを作成する前に行っても、後に行ってもよい。   The encoding process performed by the encoding unit 1202 may be performed after the scalar value d is received and before the actual calculation unit 1204 calculates the scalar multiple. That is, it may be performed before or after the pre-calculation unit 1203 creates the pre-calculation table.

また、点Pが固定点である場合、前計算部1203の行う事前計算テーブルの作成処理は、ただ一度行えばよい。すなわち、一旦事前計算テーブルを作成すれば、それ以降のスカラー倍計算では事前計算テーブルを再作成する必要はない。   When the point P is a fixed point, the pre-calculation table creation process performed by the pre-calculation unit 1203 may be performed only once. That is, once a pre-calculation table is created, it is not necessary to re-create the pre-calculation table for subsequent scalar multiplication.

次に、エンコード部1202、前計算部1203、実計算部1204の行う各処理について詳細に説明する。   Next, each process performed by the encoding unit 1202, the previous calculation unit 1203, and the actual calculation unit 1204 will be described in detail.

まず、エンコード部1202の行う処理について説明する。
エンコード部1202は、バイナリ列dを数値列cmdに変換する。
First, processing performed by the encoding unit 1202 will be described.
The encoding unit 1202 converts the binary string d into a numeric string cmd.

エンコード部1202にバイナリ列dが入力されると、BinaryToMOFエンコード部1205はバイナリ列dを符号付バイナリ列mdに変換する。   When the binary string d is input to the encoding unit 1202, the BinaryToMOF encoding unit 1205 converts the binary string d into a signed binary string md.

MOFTowcMOFエンコード部1207は、BinaryToMOFエンコード部1205が変換した符号付バイナリ列mdを数値列cmdに変換する。ただし、数値列cmdの各数値cmdiの取りうる値は、
-2w-1≦cmdi≦2w-1, cmdi=0 or 奇数 (式32)
である。
The MOFTowcMOF encoding unit 1207 converts the signed binary string md converted by the BinaryToMOF encoding unit 1205 into a numeric string cmd. However, the possible values for each numeric cmd i in the numeric column cmd are:
-2 w-1 ≤cmd i ≤2 w-1 , cmd i = 0 or odd (equation 32)
It is.

エンコード部1202は、MOFTowcMOFエンコード部1207が変換した数値列cmdをエンコードされた数値列dw[j]として出力する。すなわち、各jに対して、dw[j] = cmdjである。ただし、cmdjはcmdのjビット目の値とする。 The encoding unit 1202 outputs the numerical sequence cmd converted by the MOFTowcMOF encoding unit 1207 as an encoded numerical sequence d w [j]. That is, for each j, d w [j] = cmd j . However, cmd j is the value of the jth bit of cmd.

次に、BinaryToMOFエンコード部1205の行う処理について説明する。BinaryToMOFエンコード部1205の行う処理は、第1実施例のBinaryToMOFエンコード部305の行う処理と同様の処理を行う。   Next, processing performed by the BinaryToMOF encoding unit 1205 will be described. The processing performed by the BinaryToMOF encoding unit 1205 is the same as the processing performed by the BinaryToMOF encoding unit 305 of the first embodiment.

次に、図13を用いて、MOFTowcMOFエンコード部1207の行う処理について説明する。   Next, processing performed by the MOFTowcMOF encoding unit 1207 will be described with reference to FIG.

変数iをnで初期化する(1301)。   The variable i is initialized with n (1301).

変換部1272は、mdi =0かどうかを判定する。mdi =0 の場合、ステップ1303へ行く。mdi !=0の場合、ステップ1311へ行く(1302)。 The conversion unit 1272 determines whether md i = 0. If md i = 0, go to step 1303. If md i ! = 0, go to step 1311 (1302).

ステップ1302でmdi =0 の場合、
変換部1272は、cmdi にmdi を代入する(1303)。
If md i = 0 in step 1302,
Conversion unit 1272 substitutes md i in cmd i (1303).

変数iを1減少させ、ステップ1305へ行く(1304)。   Decrease the variable i by 1 and go to step 1305 (1304).

ステップ1302でmdi !=0 の場合、
変換部1272は、i >= j >= i-(w-1) の範囲のjで、mdj !=0をみたすもののうち、最小のものをjとする(1311)。
If md i ! = 0 in step 1302,
The conversion unit 1272 sets j to the minimum of j satisfying md j ! = 0 in the range of i> = j> = i− (w−1) (1311).

変換部1272は、cmdi, ..., cmdi-j+1 に0を、cmdi-j
mdi 2j +mdi-1 2j-1 +... +mdi-j (式33)
を、cmdi-j-1, ..., cmdi-(w-1) に0を、それぞれ代入する(1312)。
The converter 1272 converts cmd i , ..., cmd i-j + 1 to 0 and cmd ij
md i 2 j + md i-1 2 j-1 + ... + md ij (Formula 33)
And cmd ij−1 ,..., Cmd i- (w−1) are each substituted with 0 (1312).

変数iをw減少させ、ステップ1305へ行く(1313)。   Decrease variable i by w and go to step 1305 (1313).

繰り返し判定部1271は、i>=w-1かどうかを判定する。i>=w-1の場合、ステップ1302へ戻る。i<w-1の場合、ステップ1306へ行く(1305)。   The repetition determination unit 1271 determines whether i> = w−1. If i> = w-1, the process returns to step 1302. If i <w-1, go to Step 1306 (1305).

ステップ1305でi<w-1の場合、
i>=0かどうかを判定する。i>=0の場合、ステップ1307へ行く。i<0の場合、ステップ1309へ行く(1306)。
If i <w-1 in step 1305,
Determine if i> = 0. If i> = 0, go to step 1307. If i <0, go to Step 1309 (1306).

ステップ1306でi>=0の場合、
変換部1272は、j>=0 の範囲のjで、mdj !=0をみたすもののうち、最小のものをjとする(1307)。
If i> = 0 in step 1306,
The conversion unit 1272 sets j to the minimum of j satisfying md j ! = 0 within j in the range of j> = 0 (1307).

変換部1272は、cmdi, ..., cmdi-j+1 に0を、cmdi-j
mdi 2j +mdi-1 2j-1 +... +mdi-j (式34)
を、cmdi-j-1, ..., cmd0 に0を、それぞれ代入する(1308)。
The converter 1272 converts cmd i , ..., cmd i-j + 1 to 0 and cmd ij
md i 2 j + md i-1 2 j-1 + ... + md ij (Formula 34)
Are substituted for cmd ij−1 ,..., Cmd 0 by 0 (1308).

cmdn, ..., cmd0 を変換された数値列cmdとして出力する(1309)。 cmd n , ..., cmd 0 are output as a converted numeric string cmd (1309).

本明細書では、この数値列cmdをwcMOF表現と呼ぶ。   In this specification, this numeric string cmd is referred to as wcMOF expression.

次に、図14を用いて、前計算部1203が楕円曲線上の点から、事前計算テーブルを作成する方法を説明する。   Next, a method in which the pre-calculation unit 1203 creates a pre-calculation table from points on an elliptic curve will be described using FIG.

2倍算部1232は、点PをECDBLにより2倍し、その結果を点2Pに格納する(1401)。   The doubling unit 1232 doubles the point P by ECDBL and stores the result in the point 2P (1401).

変数jに初期値1を代入する(1402)。   The initial value 1 is assigned to the variable j (1402).

繰り返し判定部1233は、jが2w-1より小さいかどうかを判定する。jが2w-1より小さい場合はステップ1204へ行く。2w-1以上の場合はステップ1411へ行く(1403)。 The iterative determination unit 1233 determines whether j is smaller than 2 w−1 . If j is smaller than 2 w−1 , go to Step 1204. If 2 w-1 or more, go to Step 1411 (1403).

ステップ1403でjが2w-1より小さい場合、
加算部1231は、点2Pと点(2j-1)PをECADDにより加算し、その結果を点(2j+1)Pに格納する(1404)。
If j is less than 2 w-1 in step 1403,
The adding unit 1231 adds the point 2P and the point (2j-1) P by ECADD, and stores the result in the point (2j + 1) P (1404).

変数jを1増加させ、ステップ1403へ戻る(1405)。   The variable j is incremented by 1, and the process returns to step 1403 (1405).

ステップ1403でjが2w-1以上の場合、
P, 3P, …, (2w-1-1)Pを事前計算テーブルとして出力する(1411)。
If j is 2 w-1 or more in step 1403,
P, 3P, ..., (2 w-1 -1) P is output as a pre-calculation table (1411).

また、楕円曲線上の点Q=(x,y)に対して、楕円曲線加算に関する逆元の点-Qは、-Q=(x,-y)と表されるため、点Qの座標が与えられていれば容易に計算できる。そのため、点P, 3P, …, (2w-1-1)Pのみを事前計算テーブルとして格納する。その後の実計算部1204が行う計算で必要となる点-P, -3P, …, -(2w-1-1)Pは、それらから導出すればよく、事前計算テーブルには格納する必要はない。 Also, for the point Q = (x, y) on the elliptic curve, the inverse element point -Q related to the elliptic curve addition is expressed as -Q = (x, -y), so the coordinate of the point Q is It can be easily calculated if given. Therefore, only the points P, 3P,..., (2 w−1 −1) P are stored as a pre-calculation table. The points -P, -3P, ...,-(2 w-1 -1) P required for the calculation performed by the actual calculation unit 1204 thereafter may be derived from them, and need to be stored in the pre-calculation table. Absent.

なお、前計算部1203の行う事前計算テーブルの作成処理は、点P, 3P, …, (2w-1-1)Pが計算されればよい。そのため、非特許文献5の481ページに記載されているモンゴメリトリックを用いて、楕円曲線演算で必要となる逆元演算の計算の共通化を行うことにより、高速化をはかってもよい。 The pre-calculation table creation process performed by the pre-calculation unit 1203 only needs to calculate points P, 3P,..., (2 w−1 −1) P. For this reason, using Montgomery trick described on page 481 of Non-Patent Document 5, the calculation of the inverse element calculation required for the elliptic curve calculation may be made common to increase the speed.

最後に、図6を用いて、実計算部1204がエンコードされたスカラー値と楕円曲線上の点から、楕円曲線におけるスカラー倍点を計算する方法を説明する。   Finally, a method of calculating a scalar multiple in an elliptic curve from the encoded scalar value and a point on the elliptic curve will be described with reference to FIG.

変数cに初期値nを代入する(601)。   The initial value n is assigned to the variable c (601).

dw[c]が0か0でないかを判定する。 d w Determine whether [c] is 0 or 0.

dw[c]が0の場合はステップ603へ行く。0でなければステップ611へ行く(602)。 If d w [c] is 0, go to Step 603. If not 0, go to step 611 (602).

変数cを1減少させ、ステップ602へ戻る(603)。   The variable c is decreased by 1, and the process returns to step 602 (603).

ステップ602でdw[c]が0でない場合、点Qにdw[c]Pを代入する(611)。 If d w [c] is not 0 in step 602, assigns the d w [c] P to the point Q (611).

変数jに初期値c-1を代入する(612)。   The initial value c-1 is assigned to the variable j (612).

繰り返し判定部1244は、jが0より小さいかどうかを判定する。jが0より小さい場合はステップ621へ行く。0以上の場合はステップ614へ行く(613)。   The repetition determination unit 1244 determines whether j is smaller than 0. If j is smaller than 0, go to Step 621. If it is greater than 0, go to step 614 (613).

ステップ613でjが0以上の場合、
2倍算部は、点QをECDBLにより2倍し、点Qに再び格納する(614)。
If j is greater than or equal to 0 in step 613,
The doubling unit doubles the point Q by ECDBL and stores it again at the point Q (614).

ビット値判定部1241は、dw[j]が0か0でないかを判定する。dw[j]が0の場合はステップ617へ行く。0でなければステップ616へ行く(615)。 The bit value determination unit 1241 determines whether d w [j] is 0 or not 0. If d w [j] is 0, go to Step 617. If not 0, go to step 616 (615).

ステップ615でdw[j]が0でない場合、
加算部1242は、点Qとdw[j]PとをECADDにより加算する。ただし、dw[j]が負の場合は(-dw[j])Pのy座標を反転したものを用いて加算を行う。その結果を点Qに格納し、ステップ617へ行く(616)。
なお、dw[j]が0でない場合は、dw[j]はエンコード部1202の出力であるので、1,3,..., 2w-1-1のいずれかの値である。そのため、dw[j]Pもしくは(-dw[j])Pのいずれかが、事前計算テーブルに必ず存在する。
If d w [j] is not 0 in step 615,
The adding unit 1242 adds the point Q and d w [j] P by ECADD. However, when d w [j] is negative, addition is performed using the inverted y coordinate of (−d w [j]) P. The result is stored at point Q and the process goes to step 617 (616).
When d w [j] is not 0, d w [j] is an output of the encoding unit 1202, and is any one of 1 , 3,..., 2 w−1 −1. Therefore, either d w [j] P or (−d w [j]) P always exists in the pre-calculation table.

変数jを1減少させ、ステップ613へと戻る(617)。   The variable j is decreased by 1, and the process returns to step 613 (617).

ステップ613でjが0より小さい場合、
点Qを出力する(621)。
If j is less than 0 in step 613,
The point Q is output (621).

第1実施例で説明した通り、BinaryToMOFエンコード部1205が出力する符号付バイナリ列mdは、式18をみたす。また、mdi は0,1,-1のいずれかの値のみを取りうる。 As described in the first embodiment, the signed binary string md output from the BinaryToMOF encoding unit 1205 satisfies Equation 18. Further, md i is 0, 1, may take only one of the values of -1.

MOFTowcMOFエンコード部1207が出力する数値列cmdは、
d = cmdn2n+cmdn-12n-1+…+ cmd0 (式35)
をみたす。この理由は次の通りである。
ステップ1312で変換されるcmdi, ..., cmdi-(w-1) は、
cmdi2w-1+cmdi-12w-2+…+ cmdi-(w-1) = mdi2w-1+mdi-12w-2+…+ mdi-(w-1) (式36)
をみたす。また、ステップ1308で変換されるcmdi, ..., cmdi-(w-1)
cmdi2w-1+cmdi-12w-2+…+ cmd0 = mdi2w-1+mdi-12w-2+…+ md0 (式37)
をみたす。そのため、
cmdn2n+cmdn-12n-1+…+ cmd0 = mdn2n+mdn-12n-1+…+ md0 (式38)
が成り立つ。md はBinaryToMOFエンコード部1205の出力であるので、式18をみたす。したがって、式35が成り立つ。
The numeric string cmd output by the MOFTowcMOF encoding unit 1207 is
d = cmd n 2 n + cmd n-1 2 n-1 +… + cmd 0 (Formula 35)
Meet. The reason is as follows.
Cmd i , ..., cmd i- (w-1) converted in step 1312 are
cmd i 2 w-1 + cmd i-1 2 w-2 +… + cmd i- (w-1) = md i 2 w-1 + md i-1 2 w-2 +… + md i- (w -1) (Formula 36)
Meet. Also, cmd i , ..., cmd i- (w-1) converted in step 1308
cmd i 2 w-1 + cmd i-1 2 w-2 +… + cmd 0 = md i 2 w-1 + md i-1 2 w-2 +… + md 0 (Formula 37)
Meet. for that reason,
cmd n 2 n + cmd n-1 2 n-1 +… + cmd 0 = md n 2 n + md n-1 2 n-1 +… + md 0 (Equation 38)
Holds. Since md is the output of the BinaryToMOF encoding unit 1205, Equation 18 is satisfied. Therefore, Expression 35 is established.

MOFTowcMOFエンコード部1207が出力する数値列cmdは、式32をみたす。なぜならば、ステップ1312でエンコードされるcmdi-j はmdがMOF表現であり、またjの取り方から必ず奇数となるからである。 The numerical sequence cmd output from the MOFTowcMOF encoding unit 1207 satisfies Expression 32. This is because cmd ij encoded in step 1312 is an MOF expression of md, and is always an odd number from the way of taking j.

結果として、エンコード部1202が出力する数値列dw[j]は、式13、式14をみたす。 As a result, the numerical sequence d w [j] output from the encoding unit 1202 satisfies Expressions 13 and 14.

そのため、第1実施例で説明した通り、実計算部1204が出力する点Qはスカラー倍点dPに等しい。   Therefore, as described in the first embodiment, the point Q output from the actual calculation unit 1204 is equal to the scalar multiple dP.

第1実施例で説明した通り、BinaryToMOFエンコード部1205の行う処理はleft-to-rightである。   As described in the first embodiment, the processing performed by the BinaryToMOF encoding unit 1205 is left-to-right.

MOFTowcMOFエンコード部1207の行う処理はleft-to-rightである。なぜならば、ステップ1312の変換では、順次iが大きい方からmdiを用いてcmdiの値を割当てるからである。 The processing performed by the MOFTowcMOF encoding unit 1207 is left-to-right. Because the conversion of step 1312 is because assigning the value of cmd i using md i from the direction successively i is greater.

結果として、エンコード部1202の行う処理はleft-to-rightである。   As a result, the processing performed by the encoding unit 1202 is left-to-right.

MOFTo2cMOFエンコード部1207が出力するcmdは、非零濃度が1/(w+1)となる。この理由は次の通りである。
ステップ1302でmdi の値により処理を2つに振分ける。MOF表現における各ビットの値の出現確率は、0、非零ともに1/2である。ステップ1303-ステップ1304の処理が実行された場合、処理ビット数は1で 非零ビットの数は0個である。そのため、非零ビットの出現する期待値は1/2である。ステップ1311-ステップ1313の処理が実行された場合、処理ビット数はwで非零ビット数は1である。そのため、非零ビットの出現する期待値は1/(2w)である。非零濃度はこれらの期待値の調和平均となるため、1/(2+2w) = 1/(w+1) となる。また、非特許文献1によれば、ウィンドウ幅wに対して、非零濃度1/(w+1)が最小であることが示されている。
The cmd output from the MOFTo2cMOF encoding unit 1207 has a non-zero density of 1 / (w + 1). The reason is as follows.
It distributes two processes according to the value of md i in step 1302. The occurrence probability of each bit value in the MOF representation is 1/2 for both 0 and non-zero. When the processing of step 1303 to step 1304 is executed, the number of processing bits is 1 and the number of non-zero bits is 0. Therefore, the expected value at which non-zero bits appear is 1/2. When the processing of step 1311-step 1313 is executed, the number of processing bits is w and the number of non-zero bits is 1. Therefore, the expected value at which non-zero bits appear is 1 / (2w). Since the non-zero concentration is a harmonic average of these expected values, 1 / (2 + 2w) = 1 / (w + 1). Non-Patent Document 1 shows that the non-zero density 1 / (w + 1) is the smallest with respect to the window width w.

したがって、エンコード部1202の出力も非零濃度1/(w+1)となり、最小の非零濃度である。   Therefore, the output of the encoding unit 1202 is also non-zero density 1 / (w + 1), which is the minimum non-zero density.

実計算部1204の加算部1242が実行する楕円加算の回数は、エンコードされた数値列の非零ビットの個数となる。この非零ビットの個数は最小であるため、楕円加算の回数は最小となる。   The number of elliptical additions performed by the adding unit 1242 of the actual calculation unit 1204 is the number of non-zero bits in the encoded numerical sequence. Since the number of non-zero bits is the smallest, the number of elliptical additions is the smallest.

以上の通り、上記計算方法は、エンコード処理をleft-to-rightで行うことが可能である。また、エンコードされた数値列は最小の非零濃度を持つため、楕円加算を行う回数が少なくてすみ、そのため、高速に計算することが可能である、という特徴がある。また、第4実施例ではウィンドウ幅を自由に設定することができる。そのため、高速性を重視する場合には、ウィンドウ幅を大きく設定することにより、高速な演算を達成することができる。   As described above, the above calculation method can perform the encoding process left-to-right. In addition, since the encoded numerical sequence has a minimum non-zero density, the number of times of ellipse addition can be reduced, so that it can be calculated at high speed. In the fourth embodiment, the window width can be freely set. Therefore, when importance is attached to high speed, high speed computation can be achieved by setting a large window width.

なお、第4の計算方法でも楕円曲線としてワイエルシュトラス型楕円曲線を用いたが、標数2の有限体上で定義された楕円曲線や、OEF(Optimal Extension Field)上で定義された楕円曲線、もしくはモンゴメリ型楕円曲線を用いてもよいことも、第1実施例と同様である。   In the fourth calculation method, the Weierstrass-type elliptic curve was used as the elliptic curve. Similarly to the first embodiment, a curve or a Montgomery-type elliptic curve may be used.

第5実施例では、第4実施例のエンコード処理を より効率的に行う方法について説明する。第5実施例では、図15で示されるスカラー倍計算部の機能ブロックを用いる。スカラー倍計算部115(図1の135)は、エンコード部1502、前計算部1503、実計算部1504からなる。エンコード部1502は、エンコード用テーブル作成部1508、BinaryTowcMOFエンコード部1509からなる。エンコード用テーブル作成部1508は、繰り返し判定部1581、変換部1582からなる。BinaryTowcMOFエンコード部1509は、繰り返し判定部1591、変換部1592からなる。前計算部1503は、第4実施例の前計算部1203と同様の構成を備える。実計算部1204は、第1実施例の実計算部304と同様の構成を備える。   In the fifth embodiment, a method for performing the encoding process of the fourth embodiment more efficiently will be described. In the fifth embodiment, the functional block of the scalar multiplication calculator shown in FIG. 15 is used. The scalar multiplication calculation unit 115 (135 in FIG. 1) includes an encoding unit 1502, a previous calculation unit 1503, and an actual calculation unit 1504. The encoding unit 1502 includes an encoding table creation unit 1508 and a BinaryTowcMOF encoding unit 1509. The encoding table creation unit 1508 includes a repetition determination unit 1581 and a conversion unit 1582. The BinaryTowcMOF encoding unit 1509 includes an iterative determination unit 1591 and a conversion unit 1592. The pre-calculation unit 1503 has the same configuration as the pre-calculation unit 1203 of the fourth embodiment. The actual calculation unit 1204 has the same configuration as the actual calculation unit 304 of the first embodiment.

スカラー倍計算部115がスカラー値d及び楕円曲線上の点Pから、楕円曲線におけるスカラー倍点dPを計算する第5の計算方法を説明する。   A fifth calculation method in which the scalar multiplication calculator 115 calculates the scalar multiplication point dP in the elliptic curve from the scalar value d and the point P on the elliptic curve will be described.

スカラー倍計算部115が暗号化処理部112からスカラー値dと楕円曲線上の点Pを受け取ると、エンコード部1502は、入力されたスカラー値dを式13、式14をみたす数値列dw[j]にエンコードする。前計算部1503は、入力された楕円曲線上の点Pから事前計算テーブルを作成する。事前計算テーブルはP, 3P, …, (2w-1-1)Pにより構成される。実計算部1504は、エンコードされたスカラー値と事前計算テーブルを用いてスカラー倍点dPを計算する。 When the scalar multiplication calculation unit 115 receives the scalar value d and the point P on the elliptic curve from the encryption processing unit 112, the encoding unit 1502 converts the input scalar value d into a numerical sequence d w [ j]. The pre-calculation unit 1503 creates a pre-calculation table from the input point P on the elliptic curve. The pre-calculation table is composed of P, 3P, ..., (2 w-1 -1) P. The actual calculation unit 1504 calculates the scalar multiple dP using the encoded scalar value and the pre-calculation table.

なお、エンコード部1502の行うエンコード処理は、スカラー値dを受け取った後、および実計算部1504がスカラー倍点を計算する前であればよいことも、第4実施例と同様である。   It is to be noted that the encoding process performed by the encoding unit 1502 only needs to be performed after the scalar value d is received and before the actual calculation unit 1504 calculates the scalar multiple, as in the fourth embodiment.

また、点Pが固定点である場合、前計算部1503の行う事前計算テーブルの作成処理は、ただ一度行えばよいことも、第4実施例と同様である。   Further, when the point P is a fixed point, the pre-calculation table creation process performed by the pre-calculation unit 1503 may be performed only once, as in the fourth embodiment.

次に、エンコード部1502、前計算部1503、実計算部1504の行う各処理について詳細に説明する。   Next, each process performed by the encoding unit 1502, the previous calculation unit 1503, and the actual calculation unit 1504 will be described in detail.

まず、エンコード部1502の行う処理について説明する。
エンコード部1502は、バイナリ列dを数値列dw[j]に変換する。
First, processing performed by the encoding unit 1502 will be described.
The encoding unit 1502 converts the binary string d into a numeric string d w [j].

エンコード部1502にバイナリ列dが入力されると、エンコード用テーブル作成部1508は、エンコード用のテーブルを作成する。   When the binary string d is input to the encoding unit 1502, the encoding table creation unit 1508 creates an encoding table.

BinaryTowcMOFエンコード部1509は、エンコード用テーブル作成部1508が作成したエンコード用テーブルを用いて、入力されたバイナリ列dを、数値列cmdに変換する。   The BinaryTowcMOF encoding unit 1509 converts the input binary string d into a numeric string cmd using the encoding table created by the encoding table creation unit 1508.

エンコード部1502は、BinaryTowcMOFエンコード部1509が変換した数値列cmdをエンコードされた数値列dw[j]として出力する。すなわち、各jに対して、dw[j] = cmdjである。ただし、cmdjはcmdのjビット目の値とする。 The encoding unit 1502 outputs the numerical sequence cmd converted by the BinaryTowcMOF encoding unit 1509 as an encoded numerical sequence d w [j]. That is, for each j, d w [j] = cmd j . However, cmd j is the value of the jth bit of cmd.

なお、エンコード用テーブル作成部1508の行うエンコード用テーブルの作成処理は、与えられたウィンドウ幅wに対して ただ1度行えばよい。そのため、同じウィンドウ幅を用いる場合は、エンコード用テーブルを再作成する必要はない。   The encoding table creation process performed by the encoding table creation unit 1508 may be performed only once for a given window width w. Therefore, when the same window width is used, it is not necessary to recreate the encoding table.

また、エンコード用テーブル作成処理は、BinaryToMOFエンコード部1509がエンコード処理を行う前であればよく、エンコード部1508にバイナリ列dが入力される前であってもよい。   The encoding table creation process may be performed before the BinaryToMOF encoding unit 1509 performs the encoding process, or may be performed before the binary string d is input to the encoding unit 1508.

次に、図17を用いて、エンコード用テーブルの構成について説明する。   Next, the configuration of the encoding table will be described with reference to FIG.

第4実施例のエンコード部1202の行う変換では、入力されたバイナリ列の2ビットをスキャンし、それらビットが一致しない場合、w+1ビットをスキャンし、対応する数値に変換する、といった処理が行われている。したがって、w+1ビットのバイナリ列dで上位2ビットが一致しないものに対して、変換前後の対応を示したテーブルをエンコード用テーブルとして用意することにより、効率的な変換を行うことができる。   In the conversion performed by the encoding unit 1202 of the fourth embodiment, processing is performed such that two bits of the input binary string are scanned, and if these bits do not match, the w + 1 bits are scanned and converted into corresponding numerical values. Has been done. Therefore, efficient conversion can be performed by preparing a table indicating correspondence before and after conversion as a table for encoding for a w + 1-bit binary string d in which the upper 2 bits do not match.

w+1ビットのバイナリ列dで上位2ビットが一致しないものが与えられたとき、対応するwビットのMOF表現mdを、md = sdm*2sde と、整数sdm, sdeを用いて表現することができる(1701)。このとき、整数sdm, sde は、
-2w-1≦sdm≦2w-1, sdm=奇数 (式39)
0≦sde≦w-2 (式40)
の範囲となる。このsdm, sdeを用いることにより、変換後の数値列cmdは(0, ..., 0, sdm, 0, ..., 0)と表すことができる(1702)。そのため、このsdm,sdeを用いてエンコード用テーブルを構成すればよい。
When w + 1 bit binary string d is given, the upper 2 bits do not match, the corresponding w bit MOF representation md is expressed using md = sdm * 2 sde and integers sdm, sde (1701). At this time, the integers sdm and sde are
-2 w-1 ≦ sdm ≦ 2 w-1 , sdm = odd (Equation 39)
0 ≦ sde ≦ w-2 (Formula 40)
It becomes the range. By using the sdm and sde, the converted numeric string cmd can be expressed as (0, ..., 0, sdm, 0, ..., 0) (1702). Therefore, an encoding table may be configured using these sdm and sde.

エンコード用テーブルは、ウィンドウ幅wから定まり、sdm, sdeの2つの配列からなる。sdm, sdeの要素数はともに2w個である。w+1ビットの非零バイナリ列dで上位2ビットが一致しないものに対して、sdm, sdeのj=d-2w-1 番目の要素sdm[j], sde[j]に対応するsdm, sdeを格納する。w=2の場合の対応を1703に、w=3の場合の対応を1704に示している。dはw+1ビットのバイナリ列dで上位2ビットが一致しないもの、ddecはその10進表現、ddec -2w-1 はエンコード用テーブルのインデックス、mdはdのwビットのMOF表現、mddecはその10進表現、sdmはdに対応する対応するsdm、sdeはdに対応するsde、cmdはMOF表現mdに対応するwcMOF表現を、それぞれ表す。 The encoding table is determined from the window width w and consists of two arrays, sdm and sde. Both sdm and sde have 2 w elements. For the w + 1 bit non-zero binary string d whose upper 2 bits do not match, j = d-2 of sdm, sde The sdm corresponding to the w- 1th element sdm [j], sde [j] , stores sde. The correspondence in the case of w = 2 is shown in 1703, and the correspondence in the case of w = 3 is shown in 1704. d is a w + 1 bit binary string d whose upper 2 bits do not match, d dec is its decimal representation, d dec -2 w-1 is the index of the encoding table, md is the w bit MOF representation of d , Md dec represents its decimal representation, sdm represents the corresponding sdm corresponding to d, sde represents the sde corresponding to d, and cmd represents the wcMOF representation corresponding to the MOF representation md.

次に、図16を用いて、エンコード用テーブル作成部1508の行う処理について説明する。   Next, processing performed by the encoding table creation unit 1508 will be described with reference to FIG.

変数dを2w-1で初期化する(1601)。 The variable d is initialized with 2 w-1 (1601).

繰り返し判定部1581は、d<=3*2w-1 かどうかを判定する。d<=3*2w-1 の場合、ステップ1603へ行く。d>3*2w-1 の場合、ステップ1621へ行く(1602)。 The repetition determination unit 1581 determines whether d <= 3 * 2 w−1 . If d <= 3 * 2 w−1 , go to Step 1603. If d> 3 * 2 w−1 , go to step 1621 (1602).

ステップ1602でd<=3*2w-1 の場合、
変換部1582は、変数mdに(d&(2w-1))-(d>>1)を代入する(1603)。ただし、”&”はビット毎の論理積を、”>>”は右シフトを表す。これらの演算は、ほぼ全てのCPUに命令として具備されており、CPU上で効率的に実行することが可能である。
If d <= 3 * 2 w-1 in step 1602,
The conversion unit 1582 substitutes (d & (2 w −1)) − (d >> 1) for the variable md (1603). However, “&” represents a logical product for each bit, and “>>” represents a right shift. These operations are provided as instructions in almost all CPUs, and can be executed efficiently on the CPUs.

変数jにd-2w-1を代入する(1604)。 D-2 w-1 is assigned to the variable j (1604).

変換部1582は、変換テーブルの要素sde[j]を0で初期化する(1605)。   The conversion unit 1582 initializes the element sde [j] of the conversion table with 0 (1605).

変換部1582は、(md&1)=0かどうかを判定する。(md&1)=0の場合、ステップ1611へ行く。(md&1)!=0の場合、ステップ1607へ行く(1606)。   The conversion unit 1582 determines whether (md & 1) = 0. If (md & 1) = 0, go to step 1611. If (md & 1)! = 0, go to step 1607 (1606).

ステップ1606で(md&1)=0の場合、
変換部1582は、変換テーブルの要素sde[j]を1増加させる(1611)。
If (md & 1) = 0 in step 1606,
The conversion unit 1582 increases the element sde [j] of the conversion table by 1 (1611).

変換部1582は、変数mdを1ビット右シフトし、ステップ1606へ戻る(1612)。   The conversion unit 1582 shifts the variable md to the right by 1 bit, and returns to Step 1606 (1612).

ステップ1606で(md&1)!=0の場合、
変換部1582は、変換テーブルの要素sdm[j] にmdを代入する(1607)。
If (md & 1)! = 0 in step 1606,
The conversion unit 1582 substitutes md for the element sdm [j] of the conversion table (1607).

変数dを1増加し、ステップ1602へ戻る(1608)。   The variable d is incremented by 1, and the process returns to step 1602 (1608).

ステップ1602でd>3*2w-1 の場合、
変換テーブルsde及びsdmを出力する(1621)。
If d> 3 * 2 w-1 in step 1602,
The conversion tables sde and sdm are output (1621).

次に、図18を用いて、BinaryTowcMOFエンコード部1509の行う処理について説明する。   Next, processing performed by the BinaryTowcMOF encoding unit 1509 will be described with reference to FIG.

変数iをnで初期化する。数値列cmdを0で初期化する。dnを0で初期化する(1801)。 Initialize variable i with n. Initialize the numeric column cmd with 0. d n is initialized to 0 (1801).

繰り返し判定部1591は、i>=1かどうかを判定する。i>=1の場合、ステップ1803へ行く。i<1の場合、ステップ1811へ行く(1802)。   The repetition determination unit 1591 determines whether i> = 1. If i> = 1, go to step 1803. If i <1, go to Step 1811 (1802).

ステップ1802でi>=1の場合、
変換部1592は、di XOR di+1 =0かどうかを判定する。di XOR di+1 =0の場合、ステップ1807へ行く。di XOR di+1 !=0の場合、ステップ1804へ行く(1803)。なお、”XOR”は、排他的論理和を表す。この演算は、ほぼ全てのCPUに命令として具備されており、CPU上で効率的に実行することが可能である。
If i> = 1 in step 1802,
The conversion unit 1592 determines whether d i XOR d i + 1 = 0. If d i XOR d i + 1 = 0, go to Step 1807. If d i XOR d i + 1 ! = 0, go to step 1804 (1803). “XOR” represents an exclusive OR. This calculation is provided as an instruction in almost all CPUs, and can be executed efficiently on the CPU.

ステップ1803でdi XOR di+1 =0の場合、
変数iを1減少させ、ステップ1802へ戻る(1807)。
If d i XOR d i + 1 = 0 in step 1803,
The variable i is decreased by 1, and the process returns to Step 1802 (1807).

ステップ1803でdi XOR di+1 !=0の場合、
変換部1592は、変数jに、((d>>(i-w))&(2w+1-1))-2w-1 を代入する(1804)。
If d i XOR d i + 1 ! = 0 in step 1803,
The conversion unit 1592 substitutes ((d >> (iw)) & (2 w + 1 −1)) − 2 w−1 for the variable j (1804).

変換部1592は、cmdi-w+1+sde[j] に sdm[j] を代入する(1805)。 The conversion unit 1592 substitutes sdm [j] for cmd i-w + 1 + sde [j] (1805).

変数iをw減少させ、ステップ1802へ戻る(1806)。   The variable i is decreased by w, and the process returns to Step 1802 (1806).

ステップ1802でi<1の場合、
i=0 & d0=0 かどうかを判定する。i=0 & d0=0の場合、ステップ1812へ行く。i!=0 | d0 !=0の場合、ステップ1813へ行く(1811)。なお、”|” は論理和を表す。
If i <1 in step 1802,
Determine if i = 0 & d 0 = 0. If i = 0 & d 0 = 0, go to Step 1812. If i! = 0 | d 0 ! = 0, go to Step 1813 (1811). “|” Represents a logical sum.

ステップ1802でi=0 & d0=0の場合、
変換部1592は、cmd0 に-1を代入し、ステップ1813へ行く(1812)。
If i = 0 & d 0 = 0 in step 1802,
The conversion unit 1592 substitutes −1 for cmd 0 and goes to Step 1813 (1812).

cmdn, ..., cmd0 を数値列cmdとして出力する(1813)。 cmd n , ..., cmd 0 are output as a numeric string cmd (1813).

次に、前計算部1503の行う処理について説明する。
前計算部1503の行う処理は、第4実施例の前計算部1203の行う処理と同様の処理を行う。
Next, processing performed by the pre-calculation unit 1503 will be described.
The processing performed by the pre-calculation unit 1503 is the same as the processing performed by the pre-calculation unit 1203 of the fourth embodiment.

最後に、実計算部1504の行う処理について説明する。
実計算部1504の行う処理は、第4実施例の実計算部1204の行う処理と同様の処理を行う。
Finally, processing performed by the actual calculation unit 1504 will be described.
The process performed by the actual calculation unit 1504 is the same as the process performed by the actual calculation unit 1204 of the fourth embodiment.

BinaryTowcMOFエンコード部1509が出力する数値列cmdは、
d = cmdn2n+cmdn-12n-1+…+ cmd0 (式41)
をみたす。この理由は次の通りである。
ステップ1804、ステップ1805の処理は、該当するwビットの変換を行うものであり、図13のステップ1312の処理に相当する。そのため、式41が成り立つ。
The numeric string cmd output by the BinaryTowcMOF encoding unit 1509 is
d = cmd n 2 n + cmd n-1 2 n-1 +… + cmd 0 (Formula 41)
Meet. The reason is as follows.
The processing of Step 1804 and Step 1805 is to perform the corresponding w-bit conversion, and corresponds to the processing of Step 1312 in FIG. Therefore, Formula 41 is established.

また、BinaryTowcMOFエンコード部1509が出力する数値列cmdは、第4実施例で説明したように、式32をみたす。   Further, the numerical value sequence cmd output from the BinaryTowcMOF encoding unit 1509 satisfies Expression 32 as described in the fourth embodiment.

結果として、エンコード部1502が出力する数値列dw[j]は、式13、式14をみたす。 As a result, the numerical sequence d w [j] output from the encoding unit 1502 satisfies Expressions 13 and 14.

そのため、第1実施例で説明した通り、実計算部1504が出力する点Qはスカラー倍点dPに等しい。   Therefore, as described in the first embodiment, the point Q output from the actual calculation unit 1504 is equal to the scalar multiple dP.

BinaryTowcMOFエンコード部1509の行う処理はleft-to-rightである。なぜならば、ステップ1804、ステップ1805の変換では、順次iが大きい方からcmdiの値を割当てるからである。 The processing performed by the BinaryTowcMOF encoding unit 1509 is left-to-right. This is because the values of cmd i are assigned in descending order of i in the conversions in step 1804 and step 1805.

結果として、エンコード部1502の行う処理はleft-to-rightである。   As a result, the processing performed by the encoding unit 1502 is left-to-right.

エンコード部1502の出力する数値列dw[j]は、非零濃度が1/(w+1)となり、最小の非零濃度である。なぜならば、エンコード部1502の出力は、第4実施例のエンコード部1202の出力と一致するからである。 The numerical sequence d w [j] output from the encoding unit 1502 has a non-zero density of 1 / (w + 1), which is the minimum non-zero density. This is because the output of the encoding unit 1502 matches the output of the encoding unit 1202 of the fourth embodiment.

実計算部1504の加算部1542が実行する楕円加算の回数は、エンコードされた数値列の非零ビットの個数となる。この非零ビットの個数は最小であるため、楕円加算の回数は最小となる。   The number of ellipse additions executed by the addition unit 1542 of the actual calculation unit 1504 is the number of non-zero bits in the encoded numerical sequence. Since the number of non-zero bits is the smallest, the number of elliptical additions is the smallest.

以上の通り、上記計算方法は、エンコード処理をleft-to-rightで行うことが可能である。また、エンコードされた数値列は最小の非零濃度を持つため、楕円加算を行う回数が少なくてすみ、そのため、高速に計算することが可能である、という特徴がある。また、第5実施例ではウィンドウ幅を自由に設定することができる。そのため、高速性を重視する場合には、ウィンドウ幅を大きく設定することにより、高速な演算を達成することができる。また、効率的なエンコード処理を行うことができ、プログラムの簡素化やハードウェア論理回路の小規模化といったメリットがある。   As described above, the above calculation method can perform the encoding process left-to-right. In addition, since the encoded numerical sequence has a minimum non-zero density, the number of times of ellipse addition can be reduced, so that it can be calculated at high speed. In the fifth embodiment, the window width can be set freely. Therefore, when importance is attached to high speed, high speed computation can be achieved by setting a large window width. Further, efficient encoding processing can be performed, and there are advantages such as simplification of the program and downsizing of the hardware logic circuit.

なお、第5の計算方法でも楕円曲線としてワイエルシュトラス型楕円曲線を用いたが、標数2の有限体上で定義された楕円曲線や、OEF(Optimal Extension Field)上で定義された楕円曲線、もしくはモンゴメリ型楕円曲線を用いてもよいことも、第1実施例と同様である。   In the fifth calculation method, the Weierstrass-type elliptic curve was used as the elliptic curve, but the elliptic curve defined on the characteristic 2 finite field or the ellipse defined on the OEF (Optimal Extension Field) Similarly to the first embodiment, a curve or a Montgomery-type elliptic curve may be used.

第6実施例では、第5実施例のエンコード処理を、実計算部の行う処理に組込み、楕円演算を行う際に逐次変換し用いる方法に関して説明する。第6実施例では、図19で示されるスカラー倍計算部の機能ブロックを用いる。スカラー倍計算部115(図1の135)は、エンコード用テーブル作成部1908、前計算部1903、実計算部1904からなる。エンコード用テーブル作成部1908は、第5実施例のエンコード用テーブル作成部1508と同様の構成を備える。前計算部1503は、第4実施例の前計算部1203と同様の構成を備える。実計算部1204は、変換判定部1941、加算部1942、2倍算部1943、繰り返し判定部1944からなる。   In the sixth embodiment, the encoding process of the fifth embodiment is incorporated into the process performed by the real calculation unit, and a method of sequential conversion and use when performing an elliptic operation will be described. In the sixth embodiment, the functional block of the scalar multiplication calculator shown in FIG. 19 is used. The scalar multiplication calculation unit 115 (135 in FIG. 1) includes an encoding table creation unit 1908, a previous calculation unit 1903, and an actual calculation unit 1904. The encoding table creation unit 1908 has the same configuration as the encoding table creation unit 1508 of the fifth embodiment. The pre-calculation unit 1503 has the same configuration as the pre-calculation unit 1203 of the fourth embodiment. The actual calculation unit 1204 includes a conversion determination unit 1941, an addition unit 1942, a doubling unit 1943, and a repetition determination unit 1944.

スカラー倍計算部115がスカラー値d及び楕円曲線上の点Pから、楕円曲線におけるスカラー倍点dPを計算する第6の計算方法を説明する。   A sixth calculation method in which the scalar multiplication calculation unit 115 calculates the scalar multiplication point dP in the elliptic curve from the scalar value d and the point P on the elliptic curve will be described.

スカラー倍計算部115が暗号化処理部112からスカラー値dと楕円曲線上の点Pを受け取ると、エンコード用テーブル作成部1908は、エンコード用のテーブルを作成する。前計算部1903は、入力された楕円曲線上の点Pから事前計算テーブルを作成する。事前計算テーブルはP, 3P, …, (2w-1-1)Pにより構成される。実計算部1904は、入力されたスカラー値、事前計算テーブルおよびエンコード用テーブルを用いてスカラー倍点dPを計算する。 When the scalar multiplication calculation unit 115 receives the scalar value d and the point P on the elliptic curve from the encryption processing unit 112, the encoding table creation unit 1908 creates an encoding table. The pre-calculation unit 1903 creates a pre-calculation table from the input point P on the elliptic curve. The pre-calculation table is composed of P, 3P, ..., (2 w-1 -1) P. The actual calculation unit 1904 calculates a scalar multiple dP using the input scalar value, pre-calculation table, and encoding table.

なお、点Pが固定点である場合、前計算部1903の行う事前計算テーブルの作成処理は、ただ一度行えばよいことも、第4実施例と同様である。   Note that when the point P is a fixed point, the pre-calculation table creation process performed by the pre-calculation unit 1903 may be performed only once, as in the fourth embodiment.

また、エンコード用テーブル作成部1908の行うエンコード用テーブルの作成処理は、与えられたウィンドウ幅wに対して ただ1度行えばよいことも、第5実施例と同様である。   Similarly to the fifth embodiment, the encoding table creation processing performed by the encoding table creation unit 1908 may be performed only once for a given window width w.

また、エンコード用テーブル作成処理は、実計算部1904がスカラー倍点を計算する前であればよい。すなわち、前計算部1903が事前計算テーブルの作成の前に行っても、後に行ってもよい。   The encoding table creation process may be performed before the actual calculation unit 1904 calculates a scalar multiple. That is, it may be performed before or after the pre-calculation unit 1903 creates the pre-calculation table.

次に、エンコード用テーブル作成部1908、前計算部1903、実計算部1904の行う各処理について詳細に説明する。   Next, each process performed by the encoding table creation unit 1908, the previous calculation unit 1903, and the actual calculation unit 1904 will be described in detail.

まず、エンコード用テーブル作成部1908の行う処理について説明する。
エンコード用テーブル作成部1908の行う処理は、第5実施例のエンコード用テーブル作成部1508の行う処理と同様の処理を行う。
First, processing performed by the encoding table creation unit 1908 will be described.
The processing performed by the encoding table creation unit 1908 is the same as the processing performed by the encoding table creation unit 1508 of the fifth embodiment.

次に、前計算部1903の行う処理について説明する。
前計算部1903の行う処理は、第4実施例の前計算部1203の行う処理と同様の処理を行う。
Next, processing performed by the pre-calculation unit 1903 will be described.
The process performed by the pre-calculation unit 1903 performs the same process as the process performed by the pre-calculation unit 1203 of the fourth embodiment.

最後に、図20、図21を用いて、実計算部1904の行う処理について説明する。   Finally, processing performed by the actual calculation unit 1904 will be described with reference to FIGS.

変数iをnで、点Qを無限遠点Oで初期化する(2001)。ここで無限遠点Oとは、楕円加算に関する単位元であり、任意の点Pに対して、P+O=O+P=Pをみたす。   The variable i is initialized with n and the point Q is initialized with an infinite point O (2001). Here, the point O at infinity is a unit element relating to the addition of ellipses, and for any point P, P + O = O + P = P is satisfied.

繰り返し判定部1944は、i>=1かどうかを判定する。i>=1の場合は、ステップ2011へ行く。i<1の場合は、ステップ2021へ行く(2002)。   The repetition determination unit 1944 determines whether i> = 1. If i> = 1, go to step 2011. If i <1, go to step 2021 (2002).

ステップ2002でi>=1の場合、
変換判定部1941は、di XOR di+1 =0かどうかを判定する。di XOR di+1 =0の場合、ステップ2012へ行く。di XOR di+1 !=0の場合、ステップ2131へ行く(2011)。
If i> = 1 in step 2002,
The conversion determination unit 1941 determines whether d i XOR d i + 1 = 0. If d i XOR d i + 1 = 0, go to step 2012. If d i XOR d i + 1 ! = 0, go to step 2131 (2011).

ステップ2011でdi XOR di+1 =0の場合、
2倍算部1943は、点QをECDBLにより2倍し、点Qに再び格納する(2012)。
If d i XOR d i + 1 = 0 in step 2011,
The doubling unit 1943 doubles the point Q by ECDBL and stores it again at the point Q (2012).

変数iを1減少させ、ステップ2002に戻る(2013)。   Decrease variable i by 1 and return to step 2002 (2013).

ステップ2011でdi XOR di+1 !=0の場合、
変換判定部1941は、変数jに((d>>(i-w))&(2w+1-1))-2w-1 を代入する(2131)。
変数kを1減少させる(2132)。
If d i XOR d i + 1 ! = 0 in step 2011,
The conversion determining unit 1941 assigns ((d >> (iw)) & (2 w + 1 −1)) − 2 w−1 to the variable j (2131).
The variable k is decreased by 1 (2132).

変換判定部1941は、k<=w-sde[j] かどうかを判定する。k<=w-sde[j] の場合、ステップ2134へ行く、k>w-sde[j]の場合、ステップ2141へ行く(2133)。   The conversion determination unit 1941 determines whether k <= w-sde [j]. If k <= w-sde [j], go to Step 2134; if k> w-sde [j], go to Step 2141 (2133).

ステップ2133でk<=w-sde[j] の場合、
2倍算部1943は、点QをECDBLにより2倍し、点Qに再び格納する(2134)。
If k <= w-sde [j] in step 2133,
The doubling unit 1943 doubles the point Q by ECDBL and stores it again at the point Q (2134).

変数kを1増加させ、変数iを1減少させ、ステップ2133に戻る(2135)。   The variable k is increased by 1, the variable i is decreased by 1, and the process returns to step 2133 (2135).

ステップ2133でk>w-sde[j] の場合、
加算部1942は、点Qと点sdm[j]PとをECADDにより加算し、点Qに格納する(2141)。
If k> w-sde [j] in step 2133,
The adder 1942 adds the point Q and the point sdm [j] P by ECADD and stores the result in the point Q (2141).

変数kに1を代入する(2142)。   1 is assigned to variable k (2142).

変換判定部1941は、k<=sde[j] かどうかを判定する。k<=sde[j]の場合、ステップ2144へ行く。k>sde[j]の場合、ステップ2002に戻る(2143)。   The conversion determination unit 1941 determines whether k <= sde [j]. If k <= sde [j], go to step 2144. If k> sde [j], the process returns to step 2002 (2143).

ステップ2143でk<=sde[j]の場合、
2倍算部1943は、点QをECDBLにより2倍し、点Qに再び格納する(2144)。
If k <= sde [j] in step 2143,
The doubling unit 1943 doubles the point Q by ECDBL and stores it again at the point Q (2144).

変数kを1増加させ、変数iを1減少させ、ステップ2143に戻る(2145)。   The variable k is increased by 1, the variable i is decreased by 1, and the process returns to step 2143 (2145).

ステップ2002でi<1の場合、
i=0かどうかを判定する。i=0の場合、ステップ2022へ行く。i !=0の場合、ステップ2025へ行く(2021)。
If i <1 in step 2002,
Determine if i = 0. If i = 0, go to step 2022. If i! = 0, go to Step 2025 (2021).

ステップ2021でi=0の場合、
2倍算部1943は、点QをECDBLにより2倍し、点Qに再び格納する(2022)。
If i = 0 in step 2021,
The doubling unit 1943 doubles the point Q by ECDBL and stores it again at the point Q (2022).

d0 =0かどうかを判定する。d0 =0 の場合、ステップ2024へ行く。d0 !=0の場合、ステップ2025へ行く(2023)。 Determine if d 0 = 0. If d 0 = 0, go to Step 2024. If d 0 ! = 0, go to Step 2025 (2023).

点Qをスカラー倍点dPとして出力する(2025)。   The point Q is output as a scalar multiple dP (2025).

実計算部1904が出力する点Qはスカラー倍点dPに等しい。なぜならば、ステップ2012、ステップ2131-ステップ2145の各処理は、図13のステップ1303、ステップ1311-ステップ1312の各処理に相当する楕円演算となるからである。   The point Q output from the actual calculation unit 1904 is equal to the scalar multiple dP. This is because the processes in step 2012 and step 2131 to step 2145 are elliptic operations corresponding to the processes in step 1303 and step 1311 to step 1312 in FIG.

また、第5実施例との対応関係により、実計算部1904の行う処理はleft-to-rightとなる。   Also, the processing performed by the actual calculation unit 1904 is left-to-right due to the correspondence with the fifth embodiment.

実計算部1904の行う楕円加算の回数は最小である。なぜならば、実計算部1904の変換判定部1941の行う処理は、第5実施例のエンコード部1502の処理と対応がつくからである。   The number of ellipse additions performed by the actual calculation unit 1904 is minimum. This is because the processing performed by the conversion determination unit 1941 of the actual calculation unit 1904 can correspond to the processing of the encoding unit 1502 of the fifth embodiment.

以上の通り、上記計算方法は、スカラー倍計算をleft-to-rightで行うことができる。また、楕円加算の回数は最小であるため、高速に計算することが可能である、という特徴がある。また、第6実施例ではウィンドウ幅を自由に設定することができる。そのため、高速性を重視する場合には、ウィンドウ幅を大きく設定することにより、高速な演算を達成することができる。また、エンコード処理と楕円演算を1度に行うため、エンコード結果を一旦メモリに格納する必要がなく、メモリ使用量を少なくすることができる。   As described above, the above calculation method can perform left-to-right scalar multiplication. In addition, since the number of times of ellipse addition is minimum, it can be calculated at high speed. In the sixth embodiment, the window width can be set freely. Therefore, when importance is attached to high speed, high speed computation can be achieved by setting a large window width. In addition, since the encoding process and the ellipse calculation are performed at a time, it is not necessary to store the encoding result in the memory once, and the memory usage can be reduced.

なお、第6の計算方法でも楕円曲線としてワイエルシュトラス型楕円曲線を用いたが、標数2の有限体上で定義された楕円曲線や、OEF(Optimal Extension Field)上で定義された楕円曲線、もしくはモンゴメリ型楕円曲線を用いてもよいことも、第1実施例と同様である。   Although the Weierstrass-type elliptic curve was used as the elliptic curve in the sixth calculation method, an elliptic curve defined on a characteristic 2 finite field or an ellipse defined on the OEF (Optimal Extension Field) Similarly to the first embodiment, a curve or a Montgomery-type elliptic curve may be used.

第7実施例では、第4実施例のエンコード処理におけるMOFTowcMOFエンコード方法を、MOFTowNAFエンコード方法に置きかえることにより、非零濃度が小さい別の表現方式であるwNAF表現でエンコードされた数値列を生成し、楕円演算を効率的に実行する方法を説明する。第7実施例では、図22で示されるスカラー倍計算部の機能ブロックを用いる。スカラー倍計算部115(図1の135)は、エンコード部2202、前計算部2203、実計算部2204からなる。エンコード部2202は、BinaryToMOFエンコード部2205とMOFTowNAFエンコード部からなる。BinaryToMOFエンコード部2205は、繰り返し判定部2251と変換部2252からなる。MOFTowNAFエンコード部2207は、繰り返し判定部2271と変換部2272からなる。前計算部2203は、第4実施例の前計算部1203と同様の構成を備える。実計算部2204は、第4実施例の実計算部1204と同様の構成を備える。   In the seventh embodiment, by replacing the MOFTowcMOF encoding method in the encoding process of the fourth embodiment with the MOFTowNAF encoding method, a numerical sequence encoded with wNAF expression, which is another expression method with a small non-zero density, is generated, A method for efficiently executing the ellipse operation will be described. In the seventh embodiment, the function block of the scalar multiplication unit shown in FIG. 22 is used. The scalar multiplication calculation unit 115 (135 in FIG. 1) includes an encoding unit 2202, a previous calculation unit 2203, and an actual calculation unit 2204. The encoding unit 2202 includes a BinaryToMOF encoding unit 2205 and a MOFTowNAF encoding unit. The BinaryToMOF encoding unit 2205 includes an iterative determination unit 2251 and a conversion unit 2252. The MOFTowNAF encoding unit 2207 includes an iterative determination unit 2271 and a conversion unit 2272. The pre-calculation unit 2203 has the same configuration as the pre-calculation unit 1203 of the fourth embodiment. The actual calculation unit 2204 has the same configuration as the actual calculation unit 1204 of the fourth embodiment.

スカラー倍計算部115がスカラー値d及び楕円曲線上の点Pから、楕円曲線におけるスカラー倍点dPを計算する第7の計算方法を説明する。   A seventh calculation method in which the scalar multiplication calculation unit 115 calculates the scalar multiplication point dP in the elliptic curve from the scalar value d and the point P on the elliptic curve will be described.

スカラー倍計算部115が暗号化処理部112からスカラー値dと楕円曲線上の点Pを受け取ると、エンコード部2202は、入力されたスカラー値dを式13、式14をみたす数値列dw[j]にエンコードする。前計算部2203は、入力された楕円曲線上の点Pから事前計算テーブルを作成する。事前計算テーブルはP, 3P, …, (2w-1-1)Pにより構成される。実計算部2204は、エンコードされたスカラー値と事前計算テーブルを用いてスカラー倍点dPを計算する。 When the scalar multiplication calculation unit 115 receives the scalar value d and the point P on the elliptic curve from the encryption processing unit 112, the encoding unit 2202 converts the input scalar value d into a numerical sequence d w [ j]. The pre-calculation unit 2203 creates a pre-calculation table from the input point P on the elliptic curve. The pre-calculation table is composed of P, 3P, ..., (2 w-1 -1) P. The actual calculation unit 2204 calculates the scalar multiple dP using the encoded scalar value and the pre-calculation table.

なお、エンコード部2202の行うエンコード処理は、スカラー値dを受け取った後、および実計算部2204がスカラー倍点を計算する前であればよいことも第4実施例と同様である。   Note that the encoding process performed by the encoding unit 2202 only needs to be performed after the scalar value d is received and before the actual calculation unit 2204 calculates the scalar multiple, as in the fourth embodiment.

また、点Pが固定点である場合、前計算部2203の行う事前計算テーブルの作成処理は、ただ一度行えばよいことも第4実施例と同様である。   Further, when the point P is a fixed point, the pre-calculation table creation process performed by the pre-calculation unit 2203 may be performed only once as in the fourth embodiment.

次に、エンコード部2202、前計算部2203、実計算部2204の行う各処理について詳細に説明する。   Next, each process performed by the encoding unit 2202, the previous calculation unit 2203, and the actual calculation unit 2204 will be described in detail.

まず、エンコード部2202の行う処理について説明する。
エンコード部2202は、バイナリ列dを数値列cmdに変換する。
First, processing performed by the encoding unit 2202 will be described.
The encoding unit 2202 converts the binary string d into a numeric string cmd.

エンコード部2202にバイナリ列dが入力されると、BinaryToMOFエンコード部2205はバイナリ列dを符号付バイナリ列mdに変換する。   When the binary string d is input to the encoding unit 2202, the BinaryToMOF encoding unit 2205 converts the binary string d into a signed binary string md.

MOFTowNAFエンコード部2207は、BinaryToMOFエンコード部2205が変換した符号付バイナリ列mdを数値列cmdに変換する。ただし、数値列cmdの各数値cmdiの取りうる値は、
-2w-1≦cmdi≦2w-1, cmdi=0 or 奇数 (式42)
である。この変換はright-to-leftで行われる。
The MOFTowNAF encoding unit 2207 converts the signed binary string md converted by the BinaryToMOF encoding unit 2205 into a numeric string cmd. However, the possible values for each numeric cmd i in the numeric column cmd are:
-2 w-1 ≤cmd i ≤2 w-1 , cmd i = 0 or odd number (Formula 42)
It is. This conversion is done right-to-left.

エンコード部2202は、MOFTowNAFエンコード部2207が変換した数値列cmdをエンコードされた数値列dw[j]として出力する。すなわち、各jに対して、dw[j] = cmdjである。ただし、cmdjはcmdのjビット目の値とする。 The encoding unit 2202 outputs the numerical sequence cmd converted by the MOFTowNAF encoding unit 2207 as an encoded numerical sequence d w [j]. That is, for each j, d w [j] = cmd j . However, cmd j is the value of the jth bit of cmd.

次に、BinaryToMOFエンコード部2205の行う処理について説明する。BinaryToMOFエンコード部2205の行う処理は、第1実施例のBinaryToMOFエンコード部305の行う処理と同様の処理を行う。   Next, processing performed by the BinaryToMOF encoding unit 2205 will be described. The processing performed by the BinaryToMOF encoding unit 2205 is the same as the processing performed by the BinaryToMOF encoding unit 305 of the first embodiment.

次に、図23を用いて、MOFTowNAFエンコード部2207の行う処理について説明する。   Next, processing performed by the MOFTowNAF encoding unit 2207 will be described with reference to FIG.

変数iを0で初期化する(2301)。   The variable i is initialized with 0 (2301).

変換部2272は、mdi =0かどうかを判定する。mdi =0 の場合、ステップ2303へ行く。mdi !=0の場合、ステップ2311へ行く(2302)。 The conversion unit 2272 determines whether md i = 0. If md i = 0, go to step 2303. If md i ! = 0, go to step 2311 (2302).

ステップ2302でmdi =0 の場合、
変換部2272は、cmdi にmdi を代入する(2303)。
If md i = 0 in step 2302,
Conversion unit 2272 substitutes md i in cmd i (2303).

変数iを1増加させ、ステップ2305へ行く(2304)。   The variable i is incremented by 1, and the process goes to Step 2305 (2304).

ステップ2302でmdi !=0 の場合、
変換部1272は、cmdi
mdi+w-1 2w-1 +mdi+w-2 2w-2 +... +mdi (式43)
を、cmdi+1, ..., cmdi+w-1 に0を、それぞれ代入する(1311)。
If md i ! = 0 in step 2302,
The converter 1272 converts to cmd i
md i + w-1 2 w-1 + md i + w-2 2 w-2 + ... + md i (Formula 43)
Is substituted for cmd i + 1 ,..., Cmd i + w−1 by substituting 0 (1311).

変数iをw増加させ、ステップ2305へ行く(2312)。   The variable i is increased by w and the process goes to Step 2305 (2312).

繰り返し判定部2271は、i<=nかどうかを判定する。i<=nの場合、ステップ2302に戻る。i>nの場合、ステップ2321へ行く(2305)。   The repetition determination unit 2271 determines whether i <= n. If i <= n, the process returns to step 2302. If i> n, go to Step 2321 (2305).

ステップ2305でi<w-1の場合、
cmdn, ..., cmd0 を変換された数値列cmdとして出力する(2321)。
If i <w-1 in step 2305,
cmd n , ..., cmd 0 are output as the converted numeric string cmd (2321).

本明細書では、この数値列cmdをwNAF表現と呼ぶ。   In the present specification, this numeric string cmd is referred to as a wNAF expression.

次に、前計算部2203の行う処理について説明する。
前計算部2203の行う処理は、第4実施例の前計算部1203の行う処理と同様の処理を行う。
Next, processing performed by the pre-calculation unit 2203 will be described.
The processing performed by the pre-calculation unit 2203 performs the same processing as the processing performed by the pre-calculation unit 1203 of the fourth embodiment.

最後に、実計算部2204の行う処理について説明する。
実計算部2204の行う処理は、第4実施例の実計算部1204の行う処理と同様の処理を行う。
Finally, processing performed by the actual calculation unit 2204 will be described.
The process performed by the actual calculation unit 2204 is the same as the process performed by the actual calculation unit 1204 of the fourth embodiment.

第1実施例で説明した通り、BinaryToMOFエンコード部2205が出力する符号付バイナリ列mdは、式18をみたす。また、mdi は0,1,-1のいずれかの値のみを取りうる。 As described in the first embodiment, the signed binary string md output from the BinaryToMOF encoding unit 2205 satisfies Expression 18. Further, md i is 0, 1, may take only one of the values of -1.

MOFTowNAFエンコード部2207が出力する数値列cmdは、
d = cmdn2n+cmdn-12n-1+…+ cmd0 (式44)
をみたす。この理由は次の通りである。
ステップ2311で変換されるcmdi, ..., cmdi+w-1 は、
cmdi2w-1+cmdi-12w-2+…+ cmdi-(w-1) = mdi2w-1+mdi-12w-2+…+ mdi-(w-1) (式45)
をみたす。また、ステップ2303で変換されるcmdi は cmdi = mdi である。そのため、
cmdn2n+cmdn-12n-1+…+ cmd0 = mdn2n+mdn-12n-1+…+ md0 (式46)
が成り立つ。md はBinaryToMOFエンコード部2205の出力であるので、式18をみたす。したがって、式44が成り立つ。
The numeric string cmd output by the MOFTowNAF encoding unit 2207 is
d = cmd n 2 n + cmd n-1 2 n-1 +… + cmd 0 (Formula 44)
Meet. The reason is as follows.
Cmd i , ..., cmd i + w-1 converted in step 2311
cmd i 2 w-1 + cmd i-1 2 w-2 +… + cmd i- (w-1) = md i 2 w-1 + md i-1 2 w-2 +… + md i- (w -1) (Formula 45)
Meet. Also, cmd i converted in step 2303 is cmd i = md i . for that reason,
cmd n 2 n + cmd n-1 2 n-1 +… + cmd 0 = md n 2 n + md n-1 2 n-1 +… + md 0 (Equation 46)
Holds. Since md is the output of the BinaryToMOF encoding unit 2205, Equation 18 is satisfied. Therefore, Formula 44 is established.

MOFTowNAFエンコード部2207が出力する数値列cmdは、式42をみたす。なぜならば、ステップ2311でエンコードされるcmdi はmdがMOF表現であり、またmdi !=0の場合にのみ ステップ2311が実行されるため、必ず奇数となるからである。 The numerical sequence cmd output from the MOFTowNAF encoding unit 2207 satisfies Expression 42. This is because cmd i encoded in step 2311 is an odd number because md is an MOF expression and step 2311 is executed only when md i ! = 0.

結果として、エンコード部2202が出力する数値列dw[j]は、式13、式14をみたす。 As a result, the numerical sequence d w [j] output from the encoding unit 2202 satisfies Expressions 13 and 14.

そのため、第1実施例で説明した通り、実計算部2204が出力する点Qはスカラー倍点dPに等しい。   Therefore, as described in the first embodiment, the point Q output from the actual calculation unit 2204 is equal to the scalar multiple dP.

第1実施例で説明した通り、BinaryToMOFエンコード部2205の行う処理はleft-to-rightである。ところが、right-to-leftでも処理を行うことができる。なぜならば、各mdi はdi, di-1 からのみ定まるからである。すなわち、iが小さいものより順にmdi を定めることもできる。そのため、必要であれば、BinaryToMOFエンコード部2205の処理をright-to-left で行ってもよい。 As described in the first embodiment, the processing performed by the BinaryToMOF encoding unit 2205 is left-to-right. However, processing can also be performed right-to-left. This is because each md i is determined only from d i and d i−1 . That is, mdi can be determined in order from the smallest i . Therefore, if necessary, the processing of the BinaryToMOF encoding unit 2205 may be performed right-to-left.

MOFTowNAFエンコード部2207の行う処理はright-to-leftである。なぜならば、ステップ2311、ステップ2303の変換では、順次iが小さい方からmdiを用いてcmdiの値を割当てるからである。 The processing performed by the MOFTowNAF encoding unit 2207 is right-to-left. Because step 2311, the conversion of step 2303 is because assigning the value of cmd i using md i from the direction successively i is smaller.

結果として、エンコード部2202の行う処理はright-to-leftで行うことが可能である。   As a result, the processing performed by the encoding unit 2202 can be performed right-to-left.

MOFTowNAFエンコード部2207が出力するcmdは、非零濃度が1/(w+1)となる。この理由は次の通りである。
ステップ2302でmdi の値により処理を2つに振分ける。MOF表現における各ビットの値の出現確率は、0、非零ともに1/2である。ステップ2303-ステップ2304の処理が実行された場合、処理ビット数は1で 非零ビットの数は0個である。そのため、非零ビットの出現する期待値は1/2である。ステップ2311-ステップ2312の処理が実行された場合、処理ビット数はwで非零ビット数は1である。そのため、非零ビットの出現する期待値は1/(2w)である。非零濃度はこれらの期待値の調和平均となるため、1/(2+2w) = 1/(w+1) となる。また、非特許文献1によれば、ウィンドウ幅wに対して、非零濃度1/(w+1)が最小であることが示されている。
The cmd output from the MOFTowNAF encoding unit 2207 has a non-zero density of 1 / (w + 1). The reason is as follows.
It distributes two processes according to the value of md i in step 2302. The occurrence probability of each bit value in the MOF representation is 1/2 for both 0 and non-zero. When the processing of step 2303 to step 2304 is executed, the number of processing bits is 1 and the number of non-zero bits is 0. Therefore, the expected value at which non-zero bits appear is 1/2. When the processing of step 2231 to step 2312 is executed, the number of processing bits is w and the number of non-zero bits is 1. Therefore, the expected value at which non-zero bits appear is 1 / (2w). Since the non-zero concentration is a harmonic average of these expected values, 1 / (2 + 2w) = 1 / (w + 1). Non-Patent Document 1 shows that the non-zero density 1 / (w + 1) is the smallest with respect to the window width w.

したがって、エンコード部2202の出力も非零濃度1/(w+1)となり、最小の非零濃度である。   Therefore, the output of the encoding unit 2202 is also non-zero density 1 / (w + 1), which is the minimum non-zero density.

実計算部2204の加算部2242が実行する楕円加算の回数は、エンコードされた数値列の非零ビットの個数となる。この非零ビットの個数は最小であるため、楕円加算の回数は最小となる。   The number of elliptical additions executed by the addition unit 2242 of the actual calculation unit 2204 is the number of non-zero bits in the encoded numerical sequence. Since the number of non-zero bits is the smallest, the number of elliptical additions is the smallest.

以上の通り、上記計算方法は、MOF表現を通じて、エンコード処理をright-to-leftで行うことが可能である。また、楕円加算の回数が最小であり、高速に計算することが可能である、という特徴がある。また、第7実施例ではウィンドウ幅を自由に設定することができる。そのため、高速性を重視する場合には、ウィンドウ幅を大きく設定することにより、高速な演算を達成することができる。   As described above, the above calculation method can perform right-to-left encoding processing through MOF representation. In addition, there is a feature that the number of times of ellipse addition is minimum and the calculation can be performed at high speed. In the seventh embodiment, the window width can be set freely. Therefore, when importance is attached to high speed, high speed computation can be achieved by setting a large window width.

なお、第7の計算方法でも楕円曲線としてワイエルシュトラス型楕円曲線を用いたが、標数2の有限体上で定義された楕円曲線や、OEF(Optimal Extension Field)上で定義された楕円曲線、もしくはモンゴメリ型楕円曲線を用いてもよいことも、第1実施例と同様である。   Although the Weierstrass-type elliptic curve was used as the elliptic curve in the seventh calculation method, the elliptic curve defined on the characteristic 2 finite field or the ellipse defined on the OEF (Optimal Extension Field) Similarly to the first embodiment, a curve or a Montgomery-type elliptic curve may be used.

なお、第7の計算方法では、BinaryToMOFエンコード部2205とMOFTowNAFエンコード部2207とにエンコード処理を分けて説明したが、第5実施例のように、2つのエンコード処理を合成してもよい。また、第5実施例のように変換テーブルを用いてもよい。さらに、第6実施例のように実計算部2204の行う処理に、エンコード処理を組み込んでもよい。そうすることにより、メモリ使用量の更なる削減、更なる高速化、プログラムの更なる簡素化やハードウェア論理回路の小規模化といったメリットがある。   In the seventh calculation method, the encoding process has been described separately for the BinaryToMOF encoding unit 2205 and the MOFTowNAF encoding unit 2207. However, two encoding processes may be combined as in the fifth embodiment. Also, a conversion table may be used as in the fifth embodiment. Furthermore, an encoding process may be incorporated in the process performed by the actual calculation unit 2204 as in the sixth embodiment. By doing so, there are merits such as further reduction in memory usage, further speed-up, further simplification of programs, and downsizing of hardware logic circuits.

第8実施例では、第7実施例の、wNAF表現へのエンコード処理を、left-to-rightで行う方法を説明する。第8実施例では、図24で示されるスカラー倍計算部の機能ブロックを用いる。スカラー倍計算部115(図1の135)は、エンコード部2402、前計算部2403、実計算部2404からなる。エンコード部2402は、BinaryToNAFエンコード部2407からなる。BinaryToNAFエンコード部2407は、繰り返し判定部2471と変換部2472からなる。前計算部2403は、第4実施例の前計算部1203と同様の構成を備える。実計算部2404は、第4実施例の実計算部1204と同様の構成を備える。   In the eighth embodiment, a method of performing left-to-right encoding processing to the wNAF expression of the seventh embodiment will be described. In the eighth embodiment, the function block of the scalar multiplication unit shown in FIG. 24 is used. The scalar multiplication calculation unit 115 (135 in FIG. 1) includes an encoding unit 2402, a previous calculation unit 2403, and an actual calculation unit 2404. The encoding unit 2402 includes a BinaryToNAF encoding unit 2407. The BinaryToNAF encoding unit 2407 includes an iterative determination unit 2471 and a conversion unit 2472. The pre-calculation unit 2403 has the same configuration as the pre-calculation unit 1203 of the fourth embodiment. The actual calculation unit 2404 has the same configuration as the actual calculation unit 1204 of the fourth embodiment.

スカラー倍計算部115がスカラー値d及び楕円曲線上の点Pから、楕円曲線におけるスカラー倍点dPを計算する第8の計算方法を説明する。   An eighth calculation method in which the scalar multiplication calculation unit 115 calculates the scalar multiplication point dP in the elliptic curve from the scalar value d and the point P on the elliptic curve will be described.

スカラー倍計算部115が暗号化処理部112からスカラー値dと楕円曲線上の点Pを受け取ると、エンコード部2402は、入力されたスカラー値dを式13、式14をみたす数値列dw[j]にエンコードする。前計算部2403は、入力された楕円曲線上の点Pから事前計算テーブルを作成する。事前計算テーブルはP, 3P, …, (2w-1-1)Pにより構成される。実計算部2404は、エンコードされたスカラー値と事前計算テーブルを用いてスカラー倍点dPを計算する。第8実施例では特にw=2の場合について説明する。 When the scalar multiplication unit 115 receives the scalar value d and the point P on the elliptic curve from the encryption processing unit 112, the encoding unit 2402 converts the input scalar value d into a numerical sequence d w [ j]. The pre-calculation unit 2403 creates a pre-calculation table from the input point P on the elliptic curve. The pre-calculation table is composed of P, 3P, ..., (2 w-1 -1) P. The actual calculation unit 2404 calculates the scalar multiple dP using the encoded scalar value and the pre-calculation table. In the eighth embodiment, a case where w = 2 will be particularly described.

なお、エンコード部2402の行うエンコード処理は、スカラー値dを受け取った後、および実計算部2404がスカラー倍点を計算する前であればよいことは第4実施例と同様である。   It is to be noted that the encoding process performed by the encoding unit 2402 may be performed after receiving the scalar value d and before the actual calculation unit 2404 calculates the scalar multiple, as in the fourth embodiment.

また、点Pが固定点である場合、前計算部2403の行う事前計算テーブルの作成処理は、ただ一度行えばよいことも第4実施例と同様である。   Further, when the point P is a fixed point, the pre-calculation table creation process performed by the pre-calculation unit 2403 may be performed only once as in the fourth embodiment.

次に、エンコード部2402、前計算部2403、実計算部2404の行う各処理について詳細に説明する。   Next, each process performed by the encoding unit 2402, the previous calculation unit 2403, and the actual calculation unit 2404 will be described in detail.

まず、エンコード部2402の行う処理について説明する。
エンコード部2402は、バイナリ列dを数値列cmdに変換する。
First, processing performed by the encoding unit 2402 will be described.
The encoding unit 2402 converts the binary string d into a numeric string cmd.

エンコード部2402にバイナリ列dが入力されると、BinaryToNAFエンコード部2407はバイナリ列dを数値列cmdに変換する。   When the binary string d is input to the encoding unit 2402, the BinaryToNAF encoding unit 2407 converts the binary string d into a numeric string cmd.

エンコード部2402は、BinaryToNAFエンコード部2407が変換した数値列cmdをエンコードされた数値列dw[j]として出力する。すなわち、各jに対して、dw[j] = cmdjである。ただし、cmdjはcmdのjビット目の値とする。 The encoding unit 2402 outputs the numerical sequence cmd converted by the BinaryToNAF encoding unit 2407 as an encoded numerical sequence d w [j]. That is, for each j, d w [j] = cmd j . However, cmd j is the value of the jth bit of cmd.

次に、図25を用いて、BinaryToNAFエンコード部2407の行う処理について説明する。   Next, processing performed by the BinaryToNAF encoding unit 2407 will be described with reference to FIG.

変数iをnで初期化する(2501)。   The variable i is initialized with n (2501).

dn, d-1, d-2 をそれぞれ0で初期化する(2502)。 d n , d −1 , and d −2 are each initialized with 0 (2502).

繰り返し判定部2471は、i>-1かどうかを判定する。i>-1の場合、ステップ2504へ行く。i<=-1の場合、ステップ2521へ行く(2503)。   The iterative determination unit 2471 determines whether i> -1. If i> -1, go to step 2504. If i <=-1, go to Step 2521 (2503).

ステップ2503でi>-1の場合、
変換部2472は、bにdi-1 di を代入する(2504)。
If i> -1 in step 2503,
The conversion unit 2472 substitutes d i−1 d i for b (2504).

変換部2472は、b=0かどうかを判定する。b=0の場合、ステップ2506へ行く。b!=0の場合、ステップ2511へ行く(2505)。   The conversion unit 2472 determines whether b = 0. If b = 0, go to step 2506. If b! = 0, go to step 2511 (2505).

ステップ2505でb=0の場合、
変換部2472は、cmdi に0を代入する(2506)。
If b = 0 in step 2505,
The conversion unit 2472 substitutes 0 for cmd i (2506).

変数iを1減少させ、ステップ2503に戻る(2507)。   The variable i is decreased by 1, and the process returns to step 2503 (2507).

ステップ2505でb !=0 の場合、
変換部2472は、 di-j-1 = di-j となる最大のjを見つける(2511)。
If b! = 0 in step 2505,
The conversion unit 2472 finds the maximum j that satisfies d ij−1 = d ij (2511).

変換部2472は、jが奇数かどうかを判定する。jが奇数の場合、ステップ2514へ行く。jが偶数の場合、ステップ2513へ行く(2512)。   The conversion unit 2472 determines whether j is an odd number. If j is an odd number, go to step 2514. If j is an even number, go to Step 2513 (2512).

ステップ2512でjが奇数の場合、
変換部2472は、cmdi, cmdi-1, cmdi-2, ..., cmdi-j+2, cmdi-j+1, cmdi-j に、それぞれb, 0, -b, ..., 0, -b, 0 を代入し、ステップ2515へ行く(2514)。
If j is an odd number in step 2512,
The converter 2472 converts cmd i , cmd i-1 , cmd i-2 , ..., cmd i-j + 2 , cmd i-j + 1 , cmd ij to b, 0, -b,. Substitute., 0, -b, 0 and go to step 2515 (2514).

ステップ2512でjが偶数の場合、
変換部2472は、cmdi, cmdi-1, ..., cmdi-j+2, cmdi-j+1, cmdi-j に、それぞれ0, b, ..., 0, b, 0 を代入し、ステップ2515へ行く(2513)。
If j is an even number in step 2512,
The conversion unit 2472 converts cmd i , cmd i-1 , ..., cmd i-j + 2 , cmd i-j + 1 , cmd ij to 0, b, ..., 0, b, 0, respectively. Substitute and go to step 2515 (2513).

変数iをj+1減少させ、ステップ2503に戻る(2515)。   The variable i is decreased by j + 1, and the process returns to step 2503 (2515).

ステップ2503でi<=-1の場合、
cmdn, ..., cmd0 を変換された数値列cmdとして出力する(2521)。
If i <=-1 in step 2503,
cmd n , ..., cmd 0 is output as the converted numeric string cmd (2521).

なお、BinaryToNAFエンコード部2407の出力するcmdi は、0, 1, -1のいずれかの値のみを取りうる。なぜならば、bはdi-1 di で与えられ、cmdi には0, b, -b のいずれかの値のみが割当てられるからである。 Note that cmd i output from the BinaryToNAF encoding unit 2407 can take only one of 0, 1, and -1. This is because b is given by d i−1 d i and cmd i is assigned only one of 0, b, and −b.

次に、前計算部2203の行う処理について説明する。
前計算部2203の行う処理は、第4実施例の前計算部1203の行う処理と同様の処理を行う。
Next, processing performed by the pre-calculation unit 2203 will be described.
The processing performed by the pre-calculation unit 2203 performs the same processing as the processing performed by the pre-calculation unit 1203 of the fourth embodiment.

最後に、実計算部2204の行う処理について説明する。
実計算部2204の行う処理は、第4実施例の実計算部1204の行う処理と同様の処理を行う。
Finally, processing performed by the actual calculation unit 2204 will be described.
The process performed by the actual calculation unit 2204 is the same as the process performed by the actual calculation unit 1204 of the fourth embodiment.

BinaryToNAFエンコード部2407が出力する数値列cmdは、
d = cmdn2n+cmdn-12n-1+…+ cmd0 (式47)
をみたす。この理由は次の通りである。
ステップ2511-ステップ2514の処理は、MOF表現から、次の変換を行うことに相当する。
0, 1, -1, 1, -1, ..., -1, 1, 0 → 0, 1, 0, -1, 0, ..., 0, -1, 0
0, -1, 1, -1, 1, ..., 1, -1, 0 → 0, -1, 0, 1, 0, ..., 0, 1, 0
0, 1, -1, 1, -1, ..., 1, -1, 0 → 0, 0, 1, 0, 1, ..., 0, 1, 0
0, -1, 1, -1, 1, ..., -1, 1, 0 → 0, 0, -1, 0, -1, ..., 0, -1, 0
したがって、式47が成り立つ。
The numeric string cmd output by the BinaryToNAF encoding unit 2407 is
d = cmd n 2 n + cmd n-1 2 n-1 +… + cmd 0 (Formula 47)
Meet. The reason is as follows.
The processing of Step 2251 to Step 2514 corresponds to performing the following conversion from the MOF expression.
0, 1, -1, 1, -1, ..., -1, 1, 0 → 0, 1, 0, -1, 0, ..., 0, -1, 0
0, -1, 1, -1, 1, ..., 1, -1, 0 → 0, -1, 0, 1, 0, ..., 0, 1, 0
0, 1, -1, 1, -1, ..., 1, -1, 0 → 0, 0, 1, 0, 1, ..., 0, 1, 0
0, -1, 1, -1, 1, ..., -1, 1, 0 → 0, 0, -1, 0, -1, ..., 0, -1, 0
Therefore, Formula 47 holds.

結果として、エンコード部2402が出力する数値列dw[j]は、式13、式14をみたす。 As a result, the numerical sequence d w [j] output from the encoding unit 2402 satisfies Expressions 13 and 14.

そのため、第1実施例で説明した通り、実計算部2404が出力する点Qはスカラー倍点dPに等しい。   Therefore, as described in the first embodiment, the point Q output from the actual calculation unit 2404 is equal to the scalar multiple dP.

BinaryToNAFエンコード部2407の行う処理はleft-to-rightである。なぜならば、ステップ2511-ステップ2514、ステップ2506の各変換では、順次iが大きい方からcmdiの値を割当てるからである。 The processing performed by the BinaryToNAF encoding unit 2407 is left-to-right. This is because the values of cmd i are assigned in descending order of i in each of the conversions in step 2511 to step 2514 and step 2506.

結果として、エンコード部2402の行う処理はleft-to-rightである。   As a result, the processing performed by the encoding unit 2402 is left-to-right.

BinaryToNAFエンコード部2407が出力するcmdは、非零濃度が1/3となる。なぜならば、BinaryToNAFエンコード部2407の出力は、ウィンドウ幅が2の時の、第7実施例のMOFTowNAFエンコード部2207の出力と一致し、その非零濃度は1/3だからである。   The cmd output from the BinaryToNAF encoding unit 2407 has a non-zero density of 1/3. This is because the output of the BinaryToNAF encoding unit 2407 matches the output of the MOFTowNAF encoding unit 2207 of the seventh embodiment when the window width is 2, and the non-zero density is 1/3.

したがって、エンコード部2402の出力も非零濃度1/3となり、最小の非零濃度である。   Therefore, the output of the encoding unit 2402 is also non-zero density 1/3, which is the minimum non-zero density.

実計算部2404の加算部2442が実行する楕円加算の回数は、エンコードされた数値列の非零ビットの個数となる。この非零ビットの個数は最小であるため、楕円加算の回数は最小となる。   The number of ellipse additions executed by the addition unit 2442 of the actual calculation unit 2404 is the number of non-zero bits in the encoded numerical sequence. Since the number of non-zero bits is the smallest, the number of elliptical additions is the smallest.

以上の通り、上記計算方法は、エンコード処理をleft-to-rightで行うことが可能である。また、楕円加算の回数が最小であり、高速に計算することが可能である、という特徴がある。   As described above, the above calculation method can perform the encoding process left-to-right. In addition, there is a feature that the number of times of ellipse addition is minimum and the calculation can be performed at high speed.

なお、第8の計算方法でも楕円曲線としてワイエルシュトラス型楕円曲線を用いたが、標数2の有限体上で定義された楕円曲線や、OEF(Optimal Extension Field)上で定義された楕円曲線、もしくはモンゴメリ型楕円曲線を用いてもよいことも、第1実施例と同様である。   Although the Weierstrass-type elliptic curve was used as the elliptic curve in the eighth calculation method, the elliptic curve defined on the finite field of characteristic 2 or the ellipse defined on the OEF (Optimal Extension Field) Similarly to the first embodiment, a curve or a Montgomery-type elliptic curve may be used.

なお、第8の計算方法では、BinaryToNAFエンコード部2407の行うエンコード法としてw=2の場合を説明したが、入力されるバイナリ列に対するMOF表現を考え、そのMOF表現を、
0...0 | r | bi | ti |...| b2 | t2 | b1 | t1 | 0...0
を一つのブロックとして分割し、最上位のブロックからwNAF表現に変換することにより、一般のウィンドウ幅wに対してもエンコードを行うことが可能である。ただし、rは高々w-1ビットのMOF表現、各bj は高々w-2ビットの0値ビット(0値ビットが0個の場合も含む)、各tj はwビットのMOF表現を、それぞれ表し、ブロックの最初と最後の0値ビットは各々w-1個連続する。
In the eighth calculation method, the case where w = 2 is described as the encoding method performed by the BinaryToNAF encoding unit 2407, but considering the MOF expression for the input binary string, the MOF expression is
0 | 0 | r | b i | t i | ... | b 2 | t 2 | b 1 | t 1 | 0 ... 0
Can be divided into a single block, and the most significant block can be converted into a wNAF representation to encode the general window width w. However, r is at most w-1 bit MOF representation, each b j is at most w-2 bit 0 value bit (including the case where 0 value bit is 0), each t j is w bit MOF representation, Each represents the first and last zero value bits of the block, each w-1 consecutive.

なお、第3実施例と同様に、エンコード処理を実計算部2404の行う処理に組み込んで行ってもよい。そうすることにより、メモリ使用量の更なる削減、更なる高速化、プログラムの更なる簡素化やハードウェア論理回路の小規模化といったメリットがある。   As in the third embodiment, the encoding process may be incorporated into the process performed by the actual calculation unit 2404. By doing so, there are merits such as further reduction in memory usage, further speed-up, further simplification of programs, and downsizing of hardware logic circuits.

以上、コンピュータA101が、入力メッセージを暗号化する場合のスカラー倍計算部115の動作を説明したが、コンピュータB121が暗号化されたデータ141を復号化する場合も同様である。   The operation of the scalar multiplication calculation unit 115 when the computer A101 encrypts the input message has been described above, but the same applies to the case where the computer B121 decrypts the encrypted data 141.

その場合には、コンピュータB121のスカラー倍計算部135は、既に説明した楕円曲線上の点(xe2, ye2)、秘密情報a125によるスカラー倍点(xd3, yd3)を出力する。このとき、上記計算方法で説明したスカラー値dを秘密情報a125、楕円曲線上の点Pを楕円曲線上の点(xe2, ye2)として同様の処理を行うことにより、スカラー倍点を求めることができる。
次に、本発明を署名検証システムに適用する実施形態を、図26と図2を用いて説明する。
In that case, the scalar multiplication calculation unit 135 of the computer B121 outputs the already-explained point (x e2 , y e2 ) on the elliptic curve and the scalar multiple (x d3 , y d3 ) based on the secret information a125. At this time, the scalar multiple is obtained by performing the same processing with the scalar value d explained in the above calculation method as the secret information a125 and the point P on the elliptic curve as the point (x e2 , y e2 ) on the elliptic curve. be able to.
Next, an embodiment in which the present invention is applied to a signature verification system will be described with reference to FIG. 26 and FIG.

図26の署名検証システムは、スマートカード2601と署名検証処理を行うコンピュータ2621とから成る。   The signature verification system of FIG. 26 includes a smart card 2601 and a computer 2621 that performs signature verification processing.

スマートカード2601は、図1のコンピュータAと類似の構成を備え、CPU2613やコプロセッサ2614などの演算装置が記憶部2602に格納されているプログラムを実行することにより、データ処理部ではなく、署名生成処理部2612を実現する。ただし、図1に示す外部記憶装置107、ディスプレイ108、キーボード109を備えなくてもよい。   The smart card 2601 has a configuration similar to that of the computer A in FIG. The processing unit 2612 is realized. However, the external storage device 107, the display 108, and the keyboard 109 shown in FIG.

コンピュータ2621は、コンピュータAと同様の構成を備え、CPU2633がプログラムを実行することによりデータ処理部ではなく、署名検証処理部2632を実現する。   The computer 2621 has the same configuration as the computer A, and the signature verification processing unit 2632 is realized instead of the data processing unit when the CPU 2633 executes the program.

スカラー倍計算部2615と2635は図1に示すスカラー倍計算部115または135と同様の機能を備える。   The scalar multiplication calculators 2615 and 2635 have the same functions as the scalar multiplication calculator 115 or 135 shown in FIG.

なお、本実施例において、コンピュータ2621内の各プログラムは、あらかじめ、上記コンピュータ内の記憶部に格納されていてもよいし、必要なときに、コンピュータ2621が利用可能な媒体を介して他の装置から上記記憶部に導入されてもよい。   In the present embodiment, each program in the computer 2621 may be stored in advance in the storage unit in the computer, or other devices via a medium that can be used by the computer 2621 when necessary. To the storage unit.

さらに、スマートカード2601内の各プログラムは、あらかじめ、上記スマートカード2601内の記憶部に格納されてもよいし、必要なときに、入出力インタフェース2610を介して接続するコンピュータ、または当該コンピュータが利用可能な媒体を介して上記記憶部に導入されてもよい。   Furthermore, each program in the smart card 2601 may be stored in advance in the storage unit in the smart card 2601, or when necessary, a computer connected via the input / output interface 2610 or the computer uses the program. The storage unit may be introduced via a possible medium.

媒体とは、例えば当該コンピュータに着脱可能な記憶媒体、または通信媒体(すなわちネットワークまたはネットワークを伝搬する搬送波)を指す。   The medium refers to, for example, a storage medium that can be attached to and detached from the computer, or a communication medium (that is, a network or a carrier wave that propagates through the network).

図26の署名検証システムにおける署名生成と署名検証動作を、図2を参照して説明する。   The signature generation and signature verification operation in the signature verification system of FIG. 26 will be described with reference to FIG.

コンピュータ2621は、ランダムに選んだ数値をチャレンジコード2643として、スマートカード2601に転送する。   The computer 2621 transfers the randomly selected numerical value to the smart card 2601 as the challenge code 2643.

署名生成処理部2612(図2の112)は、チャレンジコード2643を受付け、チャレンジコード2643のハッシュ値をとり、所定のビット長の数値fに変換する。   The signature generation processing unit 2612 (112 in FIG. 2) receives the challenge code 2643, takes the hash value of the challenge code 2643, and converts it into a numerical value f having a predetermined bit length.

署名生成処理部2612は、乱数uを生成し、記憶部2602(図2の102)に格納されている定数2604から読み出した(図2の205)楕円曲線上の定点Qとともにスカラー倍計算部2615(図2の115)へ送る(図2の206)。   The signature generation processing unit 2612 generates a random number u, and reads out from the constant 2604 stored in the storage unit 2602 (102 in FIG. 2) (205 in FIG. 2) together with the fixed point Q on the elliptic curve, the scalar multiplication calculation unit 2615 (115 in FIG. 2) (206 in FIG. 2).

スカラー倍計算部2615は、定点Q、乱数uによるスカラー倍点(xu,yu)を計算し、計算されたスカラー倍点を署名生成処理部2612へ送る(図2の207)。 The scalar multiplication unit 2615 calculates a scalar multiple (x u , y u ) based on the fixed point Q and the random number u, and sends the calculated scalar multiple to the signature generation processing unit 2612 (207 in FIG. 2).

署名生成部2612は、送られたスカラー倍点を用いて署名の生成を行う。例えば、非特許文献4に記載されているECDSA署名であれば、
s = xu mod q (式48)
t = u-1(f+ds) mod q (式49)
を計算することによりチャレンジコード2643に対応する署名(s,t)を得る(図2の208)。
The signature generation unit 2612 generates a signature using the sent scalar multiple. For example, if the ECDSA signature described in Non-Patent Document 4,
s = x u mod q (Formula 48)
t = u -1 (f + ds) mod q (Formula 49)
To obtain a signature (s, t) corresponding to the challenge code 2643 (208 in FIG. 2).

ここで、qは定点Qの位数、すなわち定点Qのq倍点qQが無限遠点になり、qより小さな数値mに対する定点Qのm倍点mQは無限遠点にはならない、というような数値のことである。   Where q is the order of the fixed point Q, that is, the q-fold point qQ of the fixed point Q is the infinity point, and the m-fold point mQ of the fixed point Q for a numerical value m smaller than q is not the infinity point. It is a numerical value.

スマートカード2601は、署名生成処理部2612で作成した署名2641を入出力インタフェース2610より出力し、コンピュータ2621へ転送する。   The smart card 2601 outputs the signature 2641 created by the signature generation processing unit 2612 from the input / output interface 2610 and transfers it to the computer 2621.

コンピュータ2621の署名検証処理部2632(図2の112)は、署名2641が入力される(図2の204)と、署名2641の数値s,tが適切な範囲内、すなわち1≦s,t<qであるかを調べる。   When the signature 2641 is input (204 in FIG. 2), the signature verification processing unit 2632 (112 in FIG. 2) of the computer 2621 has the values s and t of the signature 2641 within an appropriate range, that is, 1 ≦ s, t < Check if it is q.

数値s,tが上記範囲内になければチャレンジコード2643に対する署名の検証結果として「無効」を出力し、スマートカード2601を拒絶する。数値s,tが上記範囲内にあれば、署名検証処理部2632は、
h = t-1 mod q (式50)
h1 = fh mod q (式51)
h2 = sh mod q (式52)
を計算する。そして、記憶部2622(図2の102)に格納されている定数2624から読み出した(図2の205)公開鍵aQ及び定点Qと計算したh1,h2をスカラー倍計算部2635(図2の115)へ送る(図2の206)。
If the numerical values s and t are not within the above range, “invalid” is output as the signature verification result for the challenge code 2643, and the smart card 2601 is rejected. If the numerical values s and t are within the above range, the signature verification processing unit 2632
h = t-1 mod q (Formula 50)
h 1 = fh mod q (Formula 51)
h 2 = sh mod q (Formula 52)
Calculate Then, the public key aQ and the fixed point Q read out from the constant 2624 stored in the storage unit 2622 (102 in FIG. 2) and the calculated h 1 and h 2 are converted into a scalar multiplication unit 2635 (FIG. 2). No. 115) (206 in FIG. 2).

スカラー倍計算部2635は、定点Qとh1によるスカラー倍点h1Qと、公開鍵aQとh2によるスカラー倍点h2aQとを計算し、計算されたスカラー倍点を署名検証処理部2632へ送る(図2の207)。 The scalar multiplication unit 2635 calculates a scalar multiplication point h 1 Q based on the fixed points Q and h 1 and a scalar multiplication point h 2 aQ based on the public keys aQ and h 2, and uses the calculated scalar multiplication unit as a signature verification processing unit. It is sent to 2632 (207 in FIG. 2).

署名検証処理部2632は、送られたスカラー倍点を用いて、署名検証処理を行う。例えば、ECDSAの署名検証であれば、点R
R = h1Q+h2aQ (式53)
を計算し、そのx座標をxRとしたとき、
s' = xR mod q (式54)
を計算し、s'=sであればチャレンジコード2643に対する署名の検証結果として「有効」を出力し、スマートカード2601を認証し、受入れる(図2の208)。
The signature verification processing unit 2632 performs signature verification processing using the sent scalar multiple. For example, for ECDSA signature verification, point R
R = h 1 Q + h 2 aQ (Formula 53)
And the x coordinate is x R ,
s' = x R mod q (Formula 54)
If s ′ = s, “valid” is output as the signature verification result for the challenge code 2643, and the smart card 2601 is authenticated and accepted (208 in FIG. 2).

s'=sでなければ、「無効」を出力し、スマートカードを拒絶する(図2の208)。   If not s' = s, "invalid" is output and the smart card is rejected (208 in FIG. 2).

上記実施形態のスカラー倍計算部2615、2635は、図1のスカラー倍計算部115または135と同様の機能を備えるので、メモリ使用量が小さく、かつ高速に計算できるスカラー倍計算を実行できる。特に、式53の計算では、非特許文献1の方法を用いた場合、数十バイトの余分なRAM領域を必要としたが、本発明の方法を用いた場合、h1, h2 の値を数ビットずつ読み込むため、余分なRAM領域を必要としない。スマートカード2601は、一般的にRAM2603の大きさは小さいため、本発明の方法が特に有効である。 Since the scalar multiplication calculators 2615 and 2635 of the above embodiment have the same function as the scalar multiplication calculator 115 or 135 of FIG. 1, it is possible to execute a scalar multiplication calculation that requires a small amount of memory and can be calculated at high speed. In particular, in the calculation of Expression 53, when using the method of Non-Patent Document 1, an extra RAM area of several tens of bytes is required. However, when the method of the present invention is used, the values of h 1 and h 2 are set. Because it reads several bits at a time, no extra RAM area is required. Since the smart card 2601 generally has a small RAM 2603, the method of the present invention is particularly effective.

そのため、スマートカード2601は署名生成処理を行う際に、コンピュータ2621は署名検証処理を行う際に、メモリ使用量が小さく、かつ高速に計算ができる。
次に本発明を鍵交換システムに適用する実施形態を説明する。本実施形態においては、図1のシステム構成が応用できる。
Therefore, when the smart card 2601 performs a signature generation process, the computer 2621 performs a high-speed calculation with a small amount of memory when performing a signature verification process.
Next, an embodiment in which the present invention is applied to a key exchange system will be described. In the present embodiment, the system configuration of FIG. 1 can be applied.

図1のデータ処理部112、132は、本実施形態においては、それぞれ鍵交換処理部112、132として機能する。   The data processing units 112 and 132 in FIG. 1 function as the key exchange processing units 112 and 132, respectively, in this embodiment.

鍵交換システムのコンピュータA101が、入力されたデータ143から共有情報の導出を行う場合の動作について図1、図2を参照して説明する。   The operation when the computer A101 of the key exchange system derives the shared information from the input data 143 will be described with reference to FIGS.

コンピュータB121の鍵交換処理部132は、記憶部122(図2の102)の定数125から秘密鍵bを読み出し、コンピュータB121の公開鍵bQを計算する。そして、ネットワーク142を介して、公開鍵bQをデータ143としてコンピュータA101に転送する。   The key exchange processing unit 132 of the computer B121 reads the secret key b from the constant 125 of the storage unit 122 (102 in FIG. 2), and calculates the public key bQ of the computer B121. Then, the public key bQ is transferred as data 143 to the computer A101 via the network 142.

コンピュータA101の鍵交換処理部112(図2の112)は、コンピュータB121の公開鍵bQの入力を受付ける(図2の204)と、鍵交換処理部112は、記憶部102から読み出した(図2の205)秘密情報105であるコンピュータA101の秘密鍵aと、コンピュータB121の公開鍵bQとをスカラー倍計算部115へ送る(図2の206)。   When the key exchange processing unit 112 (112 in FIG. 2) of the computer A101 receives the input of the public key bQ of the computer B121 (204 in FIG. 2), the key exchange processing unit 112 reads out from the storage unit 102 (FIG. 2). 205) The secret key a of the computer A101, which is the secret information 105, and the public key bQ of the computer B121 are sent to the scalar multiplication unit 115 (206 in FIG. 2).

スカラー倍計算部115は、秘密鍵aと、公開鍵bQによるスカラー倍点abQを計算し、計算されたスカラー倍点を鍵交換処理部112へ送る(図2の207)。   The scalar multiplication calculation unit 115 calculates a scalar multiplication point abQ based on the secret key a and the public key bQ, and sends the calculated scalar multiplication point to the key exchange processing unit 112 (207 in FIG. 2).

鍵交換処理部112は、送られたスカラー倍点を用いて共有情報の導出を行ない、記憶部102に秘密情報105として格納する。例えば、スカラー倍点abQのx座標を、共有情報とする。   The key exchange processing unit 112 derives the shared information using the sent scalar multiple and stores it as the secret information 105 in the storage unit. For example, the x coordinate of the scalar multiple point abQ is used as shared information.

次に、コンピュータB121が、入力されたデータ141から共有情報の導出を行なう場合の動作について説明する。   Next, an operation when the computer B121 derives shared information from the input data 141 will be described.

コンピュータA101の鍵交換処理部112は、記憶部102(図2の102)の定数105から秘密鍵aを読み出し、コンピュータA101の公開鍵aQを計算する。そして、ネットワーク142を介して、公開鍵aQをデータ141としてコンピュータB121に転送する。   The key exchange processing unit 112 of the computer A101 reads the secret key a from the constant 105 of the storage unit 102 (102 in FIG. 2), and calculates the public key aQ of the computer A101. Then, the public key aQ is transferred as data 141 to the computer B 121 via the network 142.

コンピュータB121の鍵交換処理部132(図2の112)は、コンピュータA101の公開鍵aQの入力を受付ける(図2の204)と、鍵交換処理部132は、記憶部122から読み出した(図2の205)秘密情報125であるコンピュータB121の秘密鍵bと、コンピュータA101の公開鍵aQとをスカラー倍計算部135へ送る(図2の207)。   When the key exchange processing unit 132 (112 in FIG. 2) of the computer B121 accepts the input of the public key aQ of the computer A101 (204 in FIG. 2), the key exchange processing unit 132 reads out from the storage unit 122 (FIG. 2). 205) The secret key b of the computer B121, which is the secret information 125, and the public key aQ of the computer A101 are sent to the scalar multiplication unit 135 (207 in FIG. 2).

スカラー倍計算部135は、秘密鍵bと、公開鍵aQによるスカラー倍点baQを計算し、計算されたスカラー倍点を鍵交換処理部132へ送る(図2の207)。   The scalar multiplication calculation unit 135 calculates a scalar multiplication point baQ based on the secret key b and the public key aQ, and sends the calculated scalar multiplication point to the key exchange processing unit 132 (207 in FIG. 2).

鍵交換処理部132は、送られたスカラー倍点を用いて共有情報の導出を行ない、記憶部122に秘密情報125として格納する。例えば、スカラー倍点baQのx座標を、共有情報とする。   The key exchange processing unit 132 derives shared information using the sent scalar multiple and stores it as the secret information 125 in the storage unit 122. For example, the x coordinate of the scalar multiple baQ is used as shared information.

ここで、数abと数baは数値として等しいので、点abQと点baQは同一の点となり、同一の情報が導出されたことになる。   Here, since the number ab and the number ba are equal as numerical values, the point abQ and the point baQ are the same point, and the same information is derived.

ネットワーク142には、点aQと点bQが送信されるが、点abQ(もしくはbaQ)は送信されない。点abQ(もしくはbaQ)を計算するためには秘密鍵aもしくは秘密鍵bを用いなけらばならない。すなわち、秘密鍵aもしくは秘密鍵bを知らなければ、共有情報を得ることができない。このようにして得られた共有情報は、共通鍵暗号の秘密鍵として利用できる。   Point aQ and point bQ are transmitted to network 142, but point abQ (or baQ) is not transmitted. In order to calculate the point abQ (or baQ), the secret key a or secret key b must be used. That is, the shared information cannot be obtained without knowing the secret key a or the secret key b. The shared information obtained in this way can be used as a secret key for common key cryptography.

本実施形態においても、スカラー倍計算部115、135は、上述の特徴を備えるので、メモリ使用量が小さく、かつ高速に計算できるような鍵交換処理が可能となる。   Also in the present embodiment, the scalar multiplication calculators 115 and 135 have the above-described features, so that a key exchange process that allows a small amount of memory usage and high-speed calculation is possible.

また、上記各実施形態における暗号化処理部、復号化処理部、署名作成部、署名検証部、鍵交換処理部は、専用のハードウェアを用いて行ってもよい。また、スカラー倍計算部をコプロセッサまたはそれ以外の専用ハードウェアで実現してもよい。   In addition, the encryption processing unit, the decryption processing unit, the signature creation unit, the signature verification unit, and the key exchange processing unit in each of the above embodiments may be performed using dedicated hardware. The scalar multiplication calculation unit may be realized by a coprocessor or other dedicated hardware.

また、データ処理部は、上記暗号化処理、復号化処理、署名生成処理、署名検証処理、鍵交換処理のうち、任意の一つ以上の処理を行えるように構成してもよい。   The data processing unit may be configured to perform any one or more of the encryption processing, decryption processing, signature generation processing, signature verification processing, and key exchange processing.

実施形態におけるシステム構成図である。It is a system configuration diagram in an embodiment. 各実施形態における情報の受け渡しを示すシーケンス図である。It is a sequence diagram which shows delivery of the information in each embodiment. 第1実施例の実施形態におけるスカラー倍計算部の構成図である。FIG. 6 is a configuration diagram of a scalar multiplication calculator in the embodiment of the first example. 第1、第4の各実施例におけるBinaryToMOFエンコード部の行うエンコード方法を示すフローチャート図である。FIG. 10 is a flowchart showing an encoding method performed by a BinaryToMOF encoding unit in each of the first and fourth embodiments. 第1実施例におけるMOFTo2cMOFエンコード部の行うエンコード方法を示すフローチャート図である。FIG. 5 is a flowchart showing an encoding method performed by a MOFTo2cMOF encoding unit in the first embodiment. 第1、第2、第4、第5の各実施例における実計算部の行う計算方法を示すフローチャート図である。FIG. 10 is a flowchart showing a calculation method performed by an actual calculation unit in each of the first, second, fourth, and fifth embodiments. 第2実施例の実施形態におけるスカラー倍計算部の構成図である。FIG. 10 is a configuration diagram of a scalar multiplication calculator in an embodiment of a second example. 第2実施例におけるエンコード部の行うエンコード方法を示すフローチャート図である。FIG. 10 is a flowchart showing an encoding method performed by an encoding unit in the second embodiment. 第3実施例の実施形態におけるスカラー倍計算部の構成図である。FIG. 10 is a configuration diagram of a scalar multiplication calculator in an embodiment of a third example. 第3実施例における実計算部の行う計算方法を示すフローチャート図である。FIG. 10 is a flowchart showing a calculation method performed by an actual calculation unit in the third embodiment. 第3実施例における実計算部の行う計算方法を示すフローチャート図である。FIG. 10 is a flowchart showing a calculation method performed by an actual calculation unit in the third embodiment. 第4実施例の実施形態におけるスカラー倍計算部の構成図である。FIG. 10 is a configuration diagram of a scalar multiplication calculator in an embodiment of a fourth example. 第4実施例におけるMOFTowcMOFエンコード部の行うエンコード方法を示すフローチャート図である。FIG. 10 is a flowchart showing an encoding method performed by a MOFTowcMOF encoding unit in the fourth embodiment. 第4、第5の各実施例における前計算部の行う事前計算テーブル生成方法を示すフローチャート図である。It is a flowchart figure which shows the precomputation table production | generation method which the precomputation part in a 4th, 5th Example performs. 第5実施例の実施形態におけるスカラー倍計算部の構成図である。FIG. 10 is a configuration diagram of a scalar multiplication calculator in an embodiment of a fifth example. 第5実施例におけるエンコード用テーブル作成部の行うエンコード用テーブル作成方法を示すフローチャート図である。FIG. 10 is a flowchart showing an encoding table creation method performed by an encoding table creation unit in the fifth embodiment. 第5実施例におけるエンコード用テーブル作成部の行うエンコード用テーブル作成方法において入出力データの関連を示す図である。FIG. 10 is a diagram showing the relationship between input and output data in an encoding table creation method performed by an encoding table creation unit in the fifth embodiment. 第5実施例におけるBinaryTowcMOFエンコード部の行うエンコード方法を示すフローチャート図である。FIG. 10 is a flowchart showing an encoding method performed by a BinaryTowcMOF encoding unit in the fifth embodiment. 第6実施例の実施形態におけるスカラー倍計算部の構成図である。FIG. 10 is a configuration diagram of a scalar multiplication calculator in an embodiment of a sixth example. 第6実施例における実計算部の行う計算方法を示すフローチャート図である。FIG. 16 is a flowchart showing a calculation method performed by an actual calculation unit in the sixth embodiment. 第6実施例における実計算部の行う計算方法を示すフローチャート図である。It is a flowchart figure which shows the calculation method which the real calculation part in a 6th Example performs. 第7実施例の実施形態におけるスカラー倍計算部の構成図である。FIG. 20 is a configuration diagram of a scalar multiplication calculator in an embodiment of a seventh example. 第7実施例におけるMOFTowNAFエンコード部の行うエンコード方法を示すフローチャート図である。FIG. 10 is a flowchart showing an encoding method performed by a MOFTowNAF encoding unit in the seventh embodiment. 第8実施例の実施形態におけるスカラー倍計算部の構成図である。FIG. 29 is a configuration diagram of a scalar multiplication calculator in an embodiment of an eighth example. 第8実施例におけるBinaryToNAFエンコード部の行うエンコード方法を示すフローチャート図である。FIG. 20 is a flowchart showing an encoding method performed by a BinaryToNAF encoding unit in the eighth embodiment. 実施形態における署名検証システム構成図である。1 is a configuration diagram of a signature verification system in an embodiment.

符号の説明Explanation of symbols

101、121、2621:コンピュータ、2101:スマートカード、102、122、2602、2121:記憶部、111、131、2111、2631:処理部、115、135、2615、2635:スカラー倍計算部、112、132:データ処理部、2612:署名生成処理部、2632:署名検証処理部、104、124、2104、2624:定数、105、125、2605、2625:秘密情報、110、130、2610、2630:入出力インタフェース、108、128、2628:ディスプレイ、109、129、2629:キーボード、142:ネットワーク、141、143:データ、2641:署名、2643:チャレンジコード、302、702、1202、1502、2202、2402:エンコード部、1203、1503、1903、2203、2403:前計算部、304、704、904、1204、1504、1904、2204、2404:実計算部、305、1205、2205:BinaryToMOFエンコード部、306:MOFTo2cMOFエンコード部、1207:MOFTowcMOFエンコード部、1508:エンコード用テーブル作成部、1509:BinaryTowcMOFエンコード部、2207:MOFtowNAFエンコード部、2407:BinaryToNAFエンコード部、341、741、1241、1541、2241、2441:ビット値判定部、342、742、942、1242、1542、1942、2242、2442:加算部、343、743、943、1243、1543、1943、2243、2443:2倍算部、344、744、1244、1544、1944、2244、2444:繰り返し判定部、351、1251、2251:繰り返し判定部、352、1252、2252:変換部、361:繰り返し判定部、362:変換部、721:繰り返し判定部、722:変換部、941:変換判定部、944:繰り返し判定部、1271:繰り返し判定部、1272:変換部、1231、1531、1931、2231、2431:加算部、1232、1532、1932、2232、2432:2倍算部、1233、1533、1933、2233、2433:繰り返し判定部、1581:繰り返し判定部、1582:変換部、1591:繰り返し判定部、1592:変換部、1941:変換判定部、2271:繰り返し判定部、2272:変換部、2471:繰り返し判定部、2472:変換部
101, 121, 2621: Computer, 2101: Smart card, 102, 122, 2602, 2121: Storage unit, 111, 131, 2111, 2631: Processing unit, 115, 135, 2615, 2635: Scalar multiplication unit, 112, 132: Data processing unit, 2612: Signature generation processing unit, 2632: Signature verification processing unit, 104, 124, 2104, 2624: Constant, 105, 125, 2605, 2625: Confidential information, 110, 130, 2610, 2630: On Output interface, 108, 128, 2628: Display, 109, 129, 2629: Keyboard, 142: Network, 141, 143: Data, 2641: Signature, 2643: Challenge code, 302, 702, 1202, 1502, 2202, 2402: Encoding unit, 1203, 1503, 1903, 2203, 2403: Pre-calculation unit, 304, 704, 904, 1204, 1504, 1904, 2204, 2404: Real calculation unit, 305, 1205, 2205: BinaryToMOF encoding unit, 306: MOFTo2cMOF Encoding part, 1207: MOFTowcMOF encoding part, 1508: Encoding table creation part, 1509: BinaryTowcMOF encoding , 2207: MOFtowNAF encoding unit, 2407: BinaryToNAF encoding unit, 341, 741, 1241, 1541, 2241, 2441: bit value determination unit, 342, 742, 942, 1242, 1542, 1942, 2242, 2442: addition unit, 343 , 743, 943, 1243, 1543, 1943, 2243, 2443: doubling unit, 344, 744, 1244, 1544, 1944, 2244, 2444: repetition determination unit, 351, 1251, 2251: repetition determination unit, 352, 1252, 2252: Conversion unit, 361: Repeat determination unit, 362: Conversion unit, 721: Repeat determination unit, 722: Conversion unit, 941: Conversion determination unit, 944: Repeat determination unit, 1271: Repeat determination unit, 1272: Conversion Part, 1231, 1531, 1931, 2231, 2431: addition part, 1232, 1532, 1932, 2232, 2432: doubling part, 1233, 1533, 1933, 2233, 2433: repetition determination part, 1581: repetition determination part, 1582: Conversion unit, 1591: Repeat determination unit, 1592: Conversion unit, 1941: Conversion determination unit, 2271: Repeat determination unit, 2272: Conversion unit, 2471: Repeat determination unit, 2472: Conversion unit

Claims (23)

楕円曲線において、スカラー値と楕円曲線上の点からスカラー倍を計算する楕円曲線暗号におけるスカラー倍計算方法であって、
前記スカラー値における連続する2ビットに対する演算を行うステップ、
を有するスカラー倍計算方法。
In an elliptic curve, a scalar multiplication method in elliptic curve cryptography that calculates a scalar multiplication from a scalar value and a point on the elliptic curve,
Performing an operation on two consecutive bits in the scalar value;
A scalar multiplication method having:
請求項1記載のスカラー倍計算方法であって、さらに、
前記2ビットに対する演算は、2ビットの差分を計算する演算であるスカラー倍計算方法。
The scalar multiplication calculation method according to claim 1, further comprising:
The scalar multiplication calculation method, wherein the calculation for the 2 bits is an operation for calculating a 2-bit difference.
請求項1記載のスカラー倍計算方法であって、さらに、
前記2ビットに対する演算は、2ビットの値を比較する演算であるスカラー倍計算方法。
The scalar multiplication calculation method according to claim 1, further comprising:
The scalar multiplication calculation method in which the operation for the 2 bits is an operation for comparing values of 2 bits.
請求項1記載のスカラー倍計算方法であって、さらに、
前記2ビットに対する演算は、2ビットの排他的論理和を計算する演算であるスカラー倍計算方法。
The scalar multiplication calculation method according to claim 1, further comprising:
The scalar multiplication calculation method, wherein the operation on the 2 bits is an operation for calculating an exclusive OR of 2 bits.
請求項1記載のスカラー倍計算方法であって、さらに、
前記スカラー値を数値列にエンコードするステップと、
前記エンコードした数値列及び前記楕円曲線上の点からスカラー倍を計算するステップと、を有し、
前記エンコードするステップは、
前記2ビットに対する演算を含むスカラー倍計算方法。
The scalar multiplication calculation method according to claim 1, further comprising:
Encoding the scalar value into a numeric string;
Calculating a scalar multiple from the encoded numeric sequence and points on the elliptic curve, and
The encoding step includes
A scalar multiplication calculation method including an operation on the two bits.
請求項1記載のスカラー倍計算方法であって、さらに、
前記スカラー値を数値列にエンコードするステップと、
前記楕円曲線上の点から事前計算テーブルを作成するステップと、
前記エンコードした数値列及び前記事前計算テーブルからスカラー倍を計算するステップと、を有し、
前記エンコードするステップは、
前記2ビットに対する演算を含むスカラー倍計算方法。
The scalar multiplication calculation method according to claim 1, further comprising:
Encoding the scalar value into a numeric string;
Creating a pre-calculation table from points on the elliptic curve;
Calculating a scalar multiple from the encoded numeric sequence and the pre-calculation table,
The encoding step includes
A scalar multiplication calculation method including an operation on the two bits.
請求項1記載のスカラー倍計算方法であって、さらに、
前記楕円曲線上の点から事前計算テーブルを作成するステップと、
前記スカラー値及び前記事前計算テーブルからスカラー倍を計算するステップと、を有し、
前記スカラー倍を計算するステップは、
前記2ビットに対する演算を含むスカラー倍計算方法。
The scalar multiplication calculation method according to claim 1, further comprising:
Creating a pre-calculation table from points on the elliptic curve;
Calculating a scalar multiple from the scalar value and the pre-calculation table,
The step of calculating the scalar multiplication includes:
A scalar multiplication calculation method including an operation on the two bits.
請求項1記載のスカラー倍計算方法であって、
前記楕円曲線はワイエルシュトラス型楕円曲線、またはモンゴメリ型楕円曲線、または標数2の有限体上で定義された楕円曲線、またはOEF上で定義された楕円曲線であるスカラー倍計算方法。
The scalar multiplication calculation method according to claim 1,
The scalar multiplication calculation method, wherein the elliptic curve is a Weierstrass type elliptic curve, a Montgomery type elliptic curve, an elliptic curve defined on a finite field of characteristic 2, or an elliptic curve defined on OEF.
第1のデータから第2のデータを生成するデータ生成方法であって、
請求項1に記載のスカラー倍計算方法を用いてスカラー倍を計算するステップを有するデータ生成方法。
A data generation method for generating second data from first data,
A data generation method comprising a step of calculating a scalar multiplication using the scalar multiplication method according to claim 1.
データから署名データを生成する署名作成方法であって、
請求項1に記載のスカラー倍計算方法を用いてスカラー倍を計算するステップを有する署名作成方法。
A signature creation method for generating signature data from data,
2. A signature generation method comprising a step of calculating a scalar multiplication using the scalar multiplication method according to claim 1.
データと署名データから署名データの妥当性を検証する署名検証方法であって、
請求項1に記載のスカラー倍計算方法を用いてスカラー倍を計算するステップを有する署名検証方法。
A signature verification method for verifying the validity of signature data from data and signature data,
A signature verification method comprising a step of calculating a scalar multiplication using the scalar multiplication method according to claim 1.
データから暗号化されたデータを生成する暗号化方法であって、
請求項1に記載のスカラー倍計算方法を用いてスカラー倍を計算するステップを有する暗号化方法。
An encryption method for generating encrypted data from data,
2. An encryption method comprising a step of calculating a scalar multiplication using the scalar multiplication method according to claim 1.
暗号化されたデータから復号化されたデータを生成する復号化方法であって、
請求項1に記載のスカラー倍計算方法を用いてスカラー倍を計算するステップを有する復号化方法。
A decryption method for generating decrypted data from encrypted data,
A decoding method comprising a step of calculating a scalar multiplication using the scalar multiplication method according to claim 1.
楕円曲線暗号における楕円曲線において、スカラー値及び楕円曲線上の点からスカラー倍点を計算するスカラー倍計算装置であって、
前記スカラー値における連続する2ビットに対する演算を行う変換部を有するスカラー倍計算装置。
In an elliptic curve in elliptic curve cryptography, a scalar multiple calculation device for calculating a scalar multiple from a scalar value and a point on an elliptic curve,
A scalar multiplication calculation device including a conversion unit that performs an operation on two consecutive bits in the scalar value.
請求項14記載のスカラー倍計算装置であって、さらに、
前記スカラー値を数値列にエンコードするエンコード部と、
前記エンコードした数値列及び前記楕円曲線上の点からスカラー倍を計算する実計算部と、を有し、
前記エンコード部は、前記変換部を有するスカラー倍計算装置。
The scalar multiplication apparatus according to claim 14, further comprising:
An encoding unit for encoding the scalar value into a numeric string;
A real calculation unit for calculating a scalar multiplication from the encoded numerical sequence and the points on the elliptic curve,
The encoding unit is a scalar multiplication calculation device including the conversion unit.
請求項14記載のスカラー倍計算装置であって、さらに、
前記スカラー値を数値列にエンコードするエンコード部と、
前記楕円曲線上の点から事前計算テーブルを作成する前計算部と、
前記エンコードした数値列及び前記事前計算テーブルからスカラー倍を計算する実計算部と、を有し、
前記エンコード部は、前記変換部を有するスカラー倍計算装置。
The scalar multiplication apparatus according to claim 14, further comprising:
An encoding unit for encoding the scalar value into a numeric string;
A pre-calculation unit that creates a pre-calculation table from points on the elliptic curve;
A real calculation unit for calculating a scalar multiplication from the encoded numeric sequence and the pre-calculation table,
The encoding unit is a scalar multiplication calculation device including the conversion unit.
請求項14記載のスカラー倍計算装置であって、さらに、
前記楕円曲線上の点から事前計算テーブルを作成する前計算部と、
前記スカラー値及び前記事前計算テーブルからスカラー倍を計算する実計算部と、を有し、
前記実計算部は、前記変換部を有するスカラー倍計算装置。
The scalar multiplication apparatus according to claim 14, further comprising:
A pre-calculation unit that creates a pre-calculation table from points on the elliptic curve;
An actual calculation unit for calculating a scalar multiplication from the scalar value and the pre-calculation table,
The real calculation unit is a scalar multiplication calculation device including the conversion unit.
第1のデータから第2のデータを生成するデータ変換部と、前記データ変換部より依頼されてスカラー倍を計算するスカラー倍計算部とを有するデータ生成装置であって、
前記スカラー倍計算部は、請求項1に記載のスカラー倍計算方法を用いてスカラー倍を計算するステップを有するデータ生成装置。
A data generation device including a data conversion unit that generates second data from first data, and a scalar multiplication calculation unit that is requested by the data conversion unit to calculate a scalar multiplication,
2. The data generation apparatus including a step of calculating a scalar multiplication using the scalar multiplication calculation method according to claim 1.
データから署名データを生成する署名作成処理部と、前記署名生成処理部より依頼されてスカラー倍を計算するスカラー倍計算部とを有する署名生成装置であって、
前記スカラー倍計算部は、請求項1に記載のスカラー倍計算方法を用いてスカラー倍を計算するステップを有する署名生成装置。
A signature generation apparatus having a signature creation processing unit that generates signature data from data, and a scalar multiplication calculation unit that is requested by the signature generation processing unit and calculates a scalar multiplication,
2. The signature generation device including a step of calculating a scalar multiplication using the scalar multiplication calculation method according to claim 1.
データと署名データから署名データの妥当性を検証する署名検証処理部と、前記署名検証処理部より依頼されてスカラー倍を計算するスカラー倍計算部とを有する署名検証装置であって、
前記スカラー倍計算部は、請求項1に記載のスカラー倍計算方法を用いてスカラー倍を計算するステップを有する署名検証装置。
A signature verification apparatus having a signature verification processing unit that verifies the validity of signature data from data and signature data, and a scalar multiplication calculation unit that is requested by the signature verification processing unit to calculate a scalar multiplication,
2. The signature verification apparatus including a step of calculating a scalar multiplication using the scalar multiplication calculation method according to claim 1.
データから暗号化されたデータを生成する暗号部と、前記暗号部より依頼されてスカラー倍を計算するスカラー倍計算部とを有する暗号化装置であって、
前記スカラー倍計算部は、請求項1に記載のスカラー倍計算方法を用いてスカラー倍を計算するステップを有する暗号化装置。
An encryption device comprising: an encryption unit that generates encrypted data from data; and a scalar multiplication calculation unit that is requested by the encryption unit and calculates a scalar multiplication,
2. The encryption apparatus including a step of calculating a scalar multiplication using the scalar multiplication calculation method according to claim 1.
暗号化されたデータから復号化されたデータを生成する復号部と、前記復号部より依頼されてスカラー倍を計算するスカラー倍計算部とを有する復号化装置であって、
前記スカラー倍計算部は、請求項1に記載のスカラー倍計算方法を用いてスカラー倍を計算するステップを有する復号化装置。
A decryption device comprising: a decryption unit that generates decrypted data from encrypted data; and a scalar multiplication unit that calculates a scalar multiple upon request from the decryption unit,
The decoding apparatus according to claim 1, wherein the scalar multiplication calculator includes a step of calculating a scalar multiplication using the scalar multiplication calculation method according to claim 1.
請求項1に記載のスカラー倍計算方法を計算機に実行させるプログラム。
A program causing a computer to execute the scalar multiplication method according to claim 1.
JP2004132486A 2004-04-28 2004-04-28 Scalar multiple computing method, device, and program in elliptic curve cryptosystem Withdrawn JP2005316038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004132486A JP2005316038A (en) 2004-04-28 2004-04-28 Scalar multiple computing method, device, and program in elliptic curve cryptosystem

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004132486A JP2005316038A (en) 2004-04-28 2004-04-28 Scalar multiple computing method, device, and program in elliptic curve cryptosystem

Publications (2)

Publication Number Publication Date
JP2005316038A true JP2005316038A (en) 2005-11-10
JP2005316038A5 JP2005316038A5 (en) 2007-06-21

Family

ID=35443563

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004132486A Withdrawn JP2005316038A (en) 2004-04-28 2004-04-28 Scalar multiple computing method, device, and program in elliptic curve cryptosystem

Country Status (1)

Country Link
JP (1) JP2005316038A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013186204A (en) * 2012-03-06 2013-09-19 Canon Inc Arithmetic unit, arithmetic method, and program
JP2014225746A (en) * 2013-05-15 2014-12-04 トヨタ自動車株式会社 Electronic signature verification method and electronic signature verification system
US11128461B2 (en) 2017-03-06 2021-09-21 Canon Kabushiki Kaisha Encryption processing apparatus and encryption processing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013186204A (en) * 2012-03-06 2013-09-19 Canon Inc Arithmetic unit, arithmetic method, and program
JP2014225746A (en) * 2013-05-15 2014-12-04 トヨタ自動車株式会社 Electronic signature verification method and electronic signature verification system
US11128461B2 (en) 2017-03-06 2021-09-21 Canon Kabushiki Kaisha Encryption processing apparatus and encryption processing method

Similar Documents

Publication Publication Date Title
US7904498B2 (en) Modular multiplication processing apparatus
US7308096B2 (en) Elliptic scalar multiplication system
US7961874B2 (en) XZ-elliptic curve cryptography with secret key embedding
US20090136025A1 (en) Method for scalarly multiplying points on an elliptic curve
JP2004501385A (en) Elliptic curve encryption method
EP0952697B1 (en) Elliptic curve encryption method and system
JP2003098962A (en) Method and device for calculating elliptic curve scalar multiple, and recording medium
JP4690819B2 (en) Scalar multiplication calculation method and scalar multiplication calculation apparatus in elliptic curve cryptography
JP4423900B2 (en) Scalar multiplication calculation method, apparatus and program for elliptic curve cryptography
CN111897578A (en) Parallel processing method and device for scalar multiplication on elliptic curve with characteristic of 2
JP2003255831A (en) Method and device for calculating elliptic curve scalar multiple
Wang et al. An efficient elliptic curves scalar multiplication for wireless network
JP2004163687A (en) Device and program for elliptic curve ciphering
JP2005316038A (en) Scalar multiple computing method, device, and program in elliptic curve cryptosystem
JP4502817B2 (en) Elliptic curve scalar multiplication method and apparatus
Gutub Fast 160-bits GF (p) elliptic curve crypto hardware of high-radix scalable multipliers
JP4692022B2 (en) Scalar multiplication apparatus and program for elliptic curve cryptography
Realpe-Muñoz et al. High-performance elliptic curve cryptoprocessors over GF (2^ m) GF (2 m) on Koblitz curves
Nedjah et al. Parallel computation of modular exponentiation for fast cryptography
JP4783061B2 (en) Scalar multiplication unit for elliptic curve cryptography
JPH1152854A (en) Arithmetic unit device on finite field and group computing device on elliptic curve
KR100341507B1 (en) Elliptic Curve Cryptography and Digital Signature Method using fast finite field operations
JP2007212768A (en) Prior computing table creating device in elliptic curve cryptosystem
JP2006309201A (en) Multiplex scalar multiplying operation device in elliptic curve cryptosystem, signature verification device, and programs
KR20090090881A (en) Method and apparatus of elliptic curve cryptography processing in sensor mote and recording medium using it

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20060424

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070427

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070427

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20100323