JP4423900B2 - Scalar multiplication calculation method, apparatus and program for elliptic curve cryptography - Google Patents

Scalar multiplication calculation method, apparatus and program for elliptic curve cryptography Download PDF

Info

Publication number
JP4423900B2
JP4423900B2 JP2003205896A JP2003205896A JP4423900B2 JP 4423900 B2 JP4423900 B2 JP 4423900B2 JP 2003205896 A JP2003205896 A JP 2003205896A JP 2003205896 A JP2003205896 A JP 2003205896A JP 4423900 B2 JP4423900 B2 JP 4423900B2
Authority
JP
Japan
Prior art keywords
unit
scalar
numerical value
value
scalar multiplication
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2003205896A
Other languages
Japanese (ja)
Other versions
JP2005055488A (en
JP2005055488A5 (en
Inventor
勝幸 桶屋
剛 高木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2003205896A priority Critical patent/JP4423900B2/en
Publication of JP2005055488A publication Critical patent/JP2005055488A/en
Publication of JP2005055488A5 publication Critical patent/JP2005055488A5/ja
Application granted granted Critical
Publication of JP4423900B2 publication Critical patent/JP4423900B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明はセキュリティ技術に係り、特に楕円曲線演算を用いたメッセージ処理方法に関する。
【0002】
【従来の技術】
楕円曲線暗号はN. Koblitz, V. S. Millerにより提案された公開鍵暗号の一種である。公開鍵暗号には、公開鍵と呼ばれる一般に公開してよい情報と、秘密鍵(Private Key)と呼ばれる秘匿しなければならない秘密情報がある。与えられたメッセージの暗号化や署名の検証には公開鍵を用い、与えられたメッセージの復号化や署名の作成には秘密鍵を用いる。
【0003】
楕円曲線暗号における秘密鍵は、スカラー値が担っている。また、楕円曲線暗号の安全性は楕円曲線上の離散対数問題の求解が困難であることに由来している。楕円曲線上の離散対数問題とは、楕円曲線上のある点Pとそのスカラー倍の点dPが与えられた時、スカラー値dを求める問題である。
【0004】
楕円曲線上の点とは、楕円曲線の定義方程式をみたす数の組をいい、楕円曲線上の点全体には、無限遠点という仮想的な点を単位元とした演算、すなわち楕円曲線上の加法(乃至は加算)が定義される。そして、同じ点同士による楕円曲線上の加法のことを、特に楕円曲線上の2倍算という。
【0005】
楕円曲線上の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の等式が成り立つ。
【0006】
楕円曲線上の点の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)
を計算することにより得られる。
【0007】
ある点に対し、特定の回数だけ加法を行うことをスカラー倍といい、その結果をスカラー倍点、その回数のことをスカラー値という。
【0008】
楕円曲線上の離散対数問題の求解の困難性が理論的に確立されてきている一方で、実際の実装においては秘密鍵等の秘密情報に関連する情報(計算時間や電力消費量など)が暗号処理において漏洩する場合があり、その漏洩情報をもとに秘密情報を復元するといった、サイドチャネル攻撃という攻撃法が提案されている。
【0009】
楕円曲線暗号に対するサイドチャネル攻撃が、非特許文献1に記載されている。
【0010】
楕円曲線暗号においては、与えられたメッセージの暗号化、復号化、署名の作成またはその検証は、楕円曲線演算を用いて行う必要がある。特に楕円曲線上のスカラー倍の計算は、秘密情報であるスカラー値を用いた暗号処理において用いられる。
【0011】
楕円曲線暗号に対するサイドチャネル攻撃の防御法が、非特許文献2に記載されている。
【0012】
【非特許文献1】
J.Coron, Resistance against Differential Power Analysis for Elliptic Curve Cryptosystems, Cryptographic Hardware and Embedded Systems: Proceedings of CHES'99, LNCS 1717, Springer-Verlag, (1999) pp.292-302.
【非特許文献2】
K.Okeya, T.Takagi, The Width-w NAF Method Provides Small Memory and Fast Elliptic Scalar Multiplications Secure against Side Channel Attacks, RSA conference cryptographer's track (CT-RSA 2003), LNCS 2612, Springer-Verlag, (2003), pp.328-341.
【0013】
【発明が解決しようとする課題】
情報通信ネットワークの進展と共に電子情報に対する秘匿や認証の為に暗号技術は不可欠な要素となってきている。暗号技術に課せられる要件としては、安全性以外にも、処理速度や少ないメモリ使用量などがあるが、一般的に安全性、処理速度、メモリ使用量の間にはトレードオフの関係があり、全ての要件をみたすことは難しい。他方、楕円曲線上の離散対数問題が非常に困難である為に、素因数分解の困難性を安全性の根拠にしている暗号と比べて、楕円曲線暗号は鍵長を比較的短くすることができる。そのため計算能力、メモリ容量などのリソースが比較的少なくても暗号処理を行うことが可能である。しかしながら、スマートカード(ICカードともいう)等においては利用可能なリソースは少なく、限られたリソース内で最適な暗号処理を行うように処理速度やメモリ使用量をカスタマイズできる暗号処理が必要となる。
【0014】
上記技術は、サイドチャネル攻撃を防ぐ方法として有効であるが、処理速度やメモリ使用量をカスタマイズするという点については考慮されていない。
【0015】
【課題を解決するための手段】
本発明は、サイドチャネル攻撃を防ぐことができる、かつ処理速度とメモリ使用量をカスタマイズできる、楕円曲線演算方法を提供する。
【0016】
本発明は更に、上記楕円曲線演算方法を用いた、暗号化処理方法、復号化処理方法、署名作成方法、署名検証方法、データ共有方法を提供する。
【0017】
本発明は、楕円曲線演算において、スカラー値と楕円曲線上の点からスカラー倍点を計算するスカラー倍計算方法であって、上記スカラー値を数値列にエンコードするステップと、上記楕円曲線上の点から前計算テーブルを作成するステップと、上記エンコードした数値列及び前記前計算テーブルからスカラー倍点を計算するステップとを有し、上記前計算テーブルはランダムに選ばれた要素を含む。
【0018】
本発明は、また、上記エンコードするステップは、前記スカラー値の剰余を選択するステップを含むように構成してもよい。
【0019】
本発明は、また、上記エンコードするステップは、上記スカラー値に対する第1の剰余と第2の剰余からどちらか一方の剰余を選択するステップを含み、上記剰余を選択するステップは、上記第1の剰余の大きさが予め定められた大きさより小さい場合は、予め定めた確率により上記第1の剰余もしくは上記第2の剰余を選択するステップと、上記第1の剰余の大きさが上記大きさ以上の場合は、上記第1の剰余に付随する楕円曲線上の点が前計算テーブルに存在するか否かにより判定するステップとを含むように構成してもよい。
【0020】
本発明は、また、上記スカラー倍点を計算するステップは、第1の演算を予め定められた回数を実行するステップと、第1の演算とは異なる第2の演算を実行するステップとを含むように構成してもよい。
【0021】
本発明は、また、楕円曲線演算において、スカラー値と楕円曲線上の点からスカラー倍点を計算するスカラー倍計算方法であって、上記楕円曲線上の点から前計算テーブルを作成するステップと、上記スカラー値及び上記前計算テーブルからスカラー倍点を計算するステップとを有し、上記前計算テーブルはランダムに選ばれた要素を含むように構成してもよい。
【0022】
以上のように本発明のスカラー倍計算方法によれば、前計算テーブルに格納する点の個数の選択範囲が広く、かつ前計算テーブルの要素はランダムに選ばれるため、サイドチャネル攻撃を防ぐことができ、かつ処理速度とメモリ使用量をカスタマイズできるスカラー倍計算方法が利用可能になる。
【0023】
【発明の実施の形態】
以下、本発明の実施例を図面により説明する。
【0024】
図1はネットワーク142によって接続された本発明による楕円曲線演算方法を適用したコンピュータA101、コンピュータB121がネットワーク142により接続されたシステム構成を示すものである。
【0025】
図1の暗号通信システムにおけるコンピュータA101でメッセージの暗号化を行うには、
Pm+k(aQ)及びkQを計算して出力し、コンピュータB121で暗号文の復号化を行うには、
秘密鍵a及びkQより-a(kQ)を計算し、
(Pm+k(aQ))-a(kQ) (式6)
を計算して出力すればよい。ここでPmはメッセージ、kは乱数、aは秘密鍵を示す定数、Qは定点、aQは公開鍵を示す点である。
【0026】
ネットワーク142には、Pm+k(aQ),kQのみ送信され、メッセージPmを復元するためには、kaQ、すなわちkQのa倍を計算する必要がある。ところが、秘密鍵aはネットワーク142には送信されないため、秘密鍵aを保持しているものだけが、Pmを復元できることになる。
【0027】
図1において、コンピュータA101は、CPU113やコプロセッサ114などの演算装置、RAM103、ROM106や外部記憶装置107などの記憶装置、コンピュータ外部とのデータ入出力を行う入出力インタフェース110を装備しており、外部にはコンピュータA101をユーザが操作するためのディスプレイ108、キーボード109、着脱可能な可搬型記憶媒体の読み書き装置などが接続されている。
【0028】
更にコンピュータA101は、RAM103、ROM106や外部記憶装置107などの記憶装置によって、記憶部102を実現し、CPU113やコプロセッサ114などの演算装置が、記憶部102に格納されたプログラムを実行することにより、データ処理部112、スカラー倍計算部115とそれらに含まれる各処理部を実現する。
【0029】
データ処理部112は、本実施形態においては、暗号化処理部112として機能し、入力されたメッセージの暗号化を行う。
【0030】
スカラー倍計算部115は、暗号処理部112で暗号化を行うのに必要なパラメタを計算する。記憶部102は、定数104(例えば、楕円曲線の定義式や楕円曲線上の定点である)、秘密情報105(例えば、秘密鍵である)などを記憶している。
【0031】
コンピュータB121は、コンピュータA101と同様のハードウェア構成を備える。
【0032】
更にコンピュータB121は、RAM123、ROM126や外部記憶装置107などの記憶装置によって、記憶部122を実現し、CPU133やコプロセッサ134などの演算装置が、記憶部122に格納されたプログラムを実行することにより、データ処理部132、スカラー倍計算部135とそれらに含まれる各処理部を実現する。
【0033】
データ処理部132は、本実施形態においては、復号化処理部132として機能し、暗号化されたメッセージである暗号文141の復号化を行う。
【0034】
スカラー倍計算部135は、復号化処理部132で復号化を行うのに必要なパラメタを計算する。記憶部122は、定数124(例えば、楕円曲線の定義式や楕円曲線上の定点である。)、秘密情報125(例えば、秘密鍵である。)などを記憶している。
【0035】
なお、上記各プログラムは、あらかじめ、上記コンピュータ内の記憶部に格納されていても良いし、必要なときに、入出力インタフェース110と上記コンピュータ721が利用可能な媒体を介して、他の装置から上記記憶部に導入されてもよい。媒体とは、たとえば、入出力インタフェース110に着脱可能な記憶媒体、または通信媒体(すなわちネットワークまたはネットワークを伝搬する搬送波)を指す。
【0036】
図2は、コンピュータA101、コンピュータB121の各処理部が行う情報の受け渡しの様子を示したものである。
【0037】
次に、図1のコンピュータA101が、入力されたメッセージを暗号化する場合の動作について説明する。メッセージはディジタル化されたデータであれば良く、テキスト、画像、映像、音などの種類は問わない。
【0038】
暗号化処理部112は、入出力インタフェース110を介して、平文メッセージ(図2の入力メッセージ204)を受け取ると、入力された平文メッセージのビット長が予め定めたビット長か否かを判断する。予め定めたビット長より長い場合には、予め定めたビット長となるように平文メッセージを区切る。以下、所定のビット長に区切られている部分メッセージ(単にメッセージともいう)について説明する。
【0039】
次に、暗号化処理部112は、メッセージのビット列によって表される数値をx座標(x1)にもつ楕円曲線上の点Pmのy座標の値(y1)を計算する。
【0040】
例えば、ワイエルシュトラス型楕円曲線は、A,Bをそれぞれ定数とするとき、
y1 2=x1 3+Ax1+B (式7)
で表されるので、これよりy座標の値を求めることができる。
【0041】
次に、暗号化処理部112は、乱数kを生成する。そして、記憶部102に格納されている定数104から読み出した(図2の205)公開鍵aQとQのx座標と、求めたy座標の値と乱数kとをスカラー倍計算部115へ送る(図2の206)。
【0042】
スカラー倍計算部115は、Qのx座標、y座標の値、乱数kによるスカラー倍点(xd1,yd1)=kQと、公開鍵aQのx座標、y座標の値、乱数によるスカラー倍点(xd2,yd2)=k(aQ)とを計算し、計算されたスカラー倍点を暗号化処理部112へ送る(図2の207)。
【0043】
暗号化処理部112は、送られたスカラー倍点を用いて、暗号化処理を行う。例えば、ワイエルシュトラス型の楕円曲線については、Pm+k(aQ)とkQを計算する。すなわち、
xe1=((yd1-y1)/(xd1-x1))2-x1-xd1, (式8)
xe2=xd2 (式9)
を計算し、暗号化されたメッセージxe1,xe2を得る。
【0044】
コンピュータA101は暗号化処理部112で暗号化された1つ以上の部分メッセージから暗号化された出力メッセージを組み立てる(図2の208)。
【0045】
コンピュータA101は、暗号化された出力メッセージをデータ141として入出力インタフェース110より出力し、ネットワーク142を介してコンピュータB121へ転送する。
【0046】
なお、図2の記憶部102からの情報読み出しは、スカラー計算部115へ当該情報を送る前で有れば、入力メッセージを受け付ける前であっても良い。
【0047】
次に、コンピュータB121が、暗号化されたメッセージ141を復号化する場合の動作について、図2を参照しつつ説明する。
【0048】
復号化処理部132(図2のデータ処理部112)は、入出力インタフェース110を介して、暗号化されたデータ141(図2の入力メッセージ204)が入力されると、入力された暗号化されたデータ141のビット長が予め定めたビット長か否かを判断する。予め定めたビット長より長い場合には、予め定めたビット長となるように暗号化されたデータを区切る。以下、所定のビット長に区切られている部分データ(単にデータともいう)について説明する。
【0049】
データ141のビット列によって表される数値をx座標にもつ楕円曲線上のy座標の値を計算する。
【0050】
暗号化されたメッセージがxe1,xe2のビット列であり、ワイエルシュトラス型楕円曲線の場合、y座標の値(ye1)は
ye1 2=xe1 3+Axe1+B (式10)
(ただし、A,Bはそれぞれ定数である)
から得ることができる。
【0051】
復号化処理部132は、記憶部122(図2の102)に格納されている秘密情報125から読み出した(図2の205)秘密鍵aと、x座標、y座標の値(xe1,ye1)を、スカラー倍計算部135(図2の115)へ送る(図2の206)。
【0052】
スカラー倍計算部135は、x座標、y座標の値、秘密情報a125からスカラー倍点(xd3,yd3)=a(xe2,ye2)を計算する。スカラー倍計算部135は、計算されたスカラー倍点を復号化処理部132へ送る(図2の207)。復号化処理部132は、送られたスカラー倍点を用いて、復号化処理を行う。
【0053】
例えば、暗号化されたメッセージが、xe1,xe2のビット列であり、ワイエルシュトラス型の楕円曲線の場合は、
(Pm+k(aQ))-a(kQ)=(xe1,ye1)-(xd3,yd3)
を計算することにより達成する。すなわち、
xf1=((ye1+yd3)/(xe1-xd3))2-xe1-xd3 (式11)
を計算し、暗号化される前の部分メッセージx1に相当するxf1を得る。
【0054】
コンピュータB121は、復号化処理部132で復号化された部分メッセージから平文メッセージを組み立て(図2の208)、入出力インタフェース110を介して、ディスプレイ108などから出力する。
【0055】
次に、コンピュータB121が、復号化処理を行う場合の、スカラー倍計算部135の処理を詳細に説明する。
【0056】
第1実施例では、図3で示されるスカラー倍計算部の機能ブロックを用いる。スカラー倍計算部115(図1の135)は、エンコード部302、前計算部303、実計算部304からなる。エンコード部302は、剰余取得部321、インデックス集合生成部322、剰余選択部323、繰り返し判定部324、格納部325からなる。前計算部303は、加算部331、2倍算部332、繰り返し判定部333からなる。実計算部304は、ビット値判定部341、加算部342、2倍算部343、繰り返し判定部344からなる。
【0057】
スカラー倍計算部115がスカラー値d及び楕円曲線上の点Pから、楕円曲線におけるスカラー倍点dPを計算する第1の計算方法を説明する。
【0058】
スカラー倍計算部115が復号化処理部132からスカラー値dと楕円曲線上の点Pを受け取ると、エンコード部302は、入力されたスカラー値dを数値列dw[j]にエンコードする。すなわち、
d=dw[n+w0-1]2n w0-1+dw[n+w0-2]2n w0-2+・・・+dw[j]2j+・・・ +dw[0]
(式12)
-2w0-1≦dw[j]≦2w0-1 or dw[j]∈B (式13)
をみたすdw[j]に、スカラー値dを変換する。ここで、nはスカラー値dを2進表記した場合のビット長であり、wはあらかじめ定めた小さな正有理数で、ウィンドウ幅と呼ばれる。w0は正整数であり、w0=ceil(w)をみたす。ただし、ceil(w)はw以上の最小の整数を表す。Bはランダムに選ばれたインデックス集合であり、
B={±b1,±b2,・・・,±bm}と表される。ただし、m個の相異なるb1,b2,・・・,bm
{2w0-1+1,2w0-1+3,・・・,2w0-1}の範囲から選ばれる。
ここで、m=w12w0-2, w1=w-(w0-1)である。計算時間を優先する場合はwを大きな値とする。メモリ使用量を小さくする場合はwを小さな値にする。尚、ウィンドウ幅wはmが整数となるように定められる。正整数w0を固定し、ウィンドウ幅wを動かした場合、整数mは0から2w0-2までの値を取り得る。
【0059】
前計算部303は、入力された楕円曲線上の点Pから、インデックス集合Bを用いて前計算テーブルを作成する。前計算テーブルはP, 3P, ・・・, (2w0-1-1)P及びbjP, j=1,・・・,mにより構成される。
【0060】
実計算部304は、エンコードされたスカラー値と楕円曲線上の点Pから、前計算テーブルを用いてスカラー倍点dPを計算する。
【0061】
次にエンコード部302、前計算部303、実計算部304の行う各処理について詳細に説明する。
【0062】
まず、図4を用いて、エンコード部302がスカラー値dをエンコードする方法を説明する。
【0063】
変数d'にスカラー値dを代入する。w0にceil(w)を、w1にw-(w0-1)をそれぞれ割り当てる(401)。
【0064】
インデックス集合生成部322は、m=w12w0-2とし、m個の相異なる
b1,b2,・・・,bmを{2w0-1+1,2w0-1+3,・・・,2w0-1}よりランダムに選び、インデックス集合BをB={±b1,±b2,・・・,±bm}とする。確率を示す数値Pwにw1を割り当てる(402)。
【0065】
変数rに初期値0を、変数iに初期値0をそれぞれ代入する(403)。
【0066】
繰り返し判定部324は、変数d'が1より大きいかどうかを判定する。
【0067】
d'が1より大きければステップ411へ行く。1以下であればステップ431へ行く(404)。
【0068】
ステップ404でd'が1より大きい場合、
剰余取得部321は、スカラー値d'の2w0 1による剰余から2w0を引いた値をx[i]に、スカラー値d'の2w0による剰余から2w0-1を引いた値をy[i]に、それぞれ格納する(411)。
【0069】
剰余選択部323は、|x[i]|<2w0-1であるかどうかを判定する。ここで、|x[i]|はx[i]の絶対値を表す。|x[i]|<2w0-1であればステップ413へ行く。|x[i]|≧ 2w0-1であればステップ421へ行く(412)。
【0070】
ステップ412で|x[i]|<2w0-1 の場合、
剰余選択部323は、確率Pwでriにw0を、u[i]にx[i]をそれぞれ格納し、確率1-Pwでriにw0-1を、u[i]にy[i]をそれぞれ格納し、ステップ414へ行く(413)。
【0071】
ステップ412で|x[i]|≧ 2w0-1の場合、
剰余選択部323は、x[i]が集合Bに属するかどうかを判定する。x[i]がBに属する場合はステップ422へ行く。x[i]がBに属さない場合はステップ423へ行く(421)。
【0072】
ステップ421でx[i]がBに属する場合、
剰余選択部323は、riにw0を、u[i]にx[i]をそれぞれ格納し、ステップ414へ行く(422)。
【0073】
ステップ421でx[i]がBに属さない場合、
剰余選択部323は、riにw0-1を、u[i]にy[i]をそれぞれ格納し、ステップ414へ行く(423)。
【0074】
剰余取得部321は、(d'-u[i])/2riを計算し、それを新たなd'とする(414)。
【0075】
格納部325は、dw[r+ri-1], dw[r+ri-2], ・・・, dw[r]にそれぞれ、0,0,・・・,0,u[i]を格納する(415)。
【0076】
変数rをriだけ増加させ、変数iを1増加させ、ステップ404へ戻る(416)。
【0077】
ステップ404でd'が1以下であった場合、
格納部325は、dw[n+w0-1],・・・,dw[r+1],dw[r]にそれぞれ、0,・・・,0,1を格納する(431)。
【0078】
エンコード部302は、dw[n+w0-1],・・・,dw[0]及びBを実計算部304へ出力する(432)。
【0079】
次に、図5を用いて、前計算部303が楕円曲線上の点から、インデックス集合Bを用いて前計算テーブルを作成する方法を説明する。
【0080】
点PをECDBLにより2倍し、その結果を2Pに格納する(501)。
【0081】
変数jに初期値1を代入する(502)。
【0082】
繰り返し判定部333により、jが2w0-1より小さいかどうかを判定する。jが2w0-1より小さい場合はステップ504へ行く。jが2w0-1以上の場合はステップ511へ行く(503)。
【0083】
ステップ503でjが2w0-1より小さい場合、
点jPと点2PをECADDにより加算し、その結果を(j+2)Pに格納する(504)。
【0084】
変数jを2増加させ、ステップ503へ戻る(505)。
【0085】
ステップ503でjが2w0-1以上の場合、
点(2w0-1-1)Pと点PをECADDにより加算し、その結果を2w0-1Pに格納する(511)。
【0086】
変数jに1を代入する(512)。
【0087】
繰り返し判定部333により、jがm以下であるかどうかを判定する。jがm以下であればステップ514へ行く。jがmより大きい場合はステップ521へ行く(513)。
【0088】
ステップ513でjがm以下の場合、
点2w0-1Pと点(bj-2w0-1)PをECADDにより加算し、その結果をbjPに格納する(514)。
【0089】
変数jを1増加させ、ステップ513へ戻る(515)。
【0090】
ステップ513でjがmより大きい場合、
P, 3P, ・・・, (2w0-1-1)P及びbjP, j=1,・・・,mを前計算テーブルとして出力する(521)。
【0091】
ただし、ECADD, ECDBLはそれぞれ楕円曲線における加算、2倍算を表す。加算は式1,2を用いて、2倍算は式4,5を用いてそれぞれ計算される。なお、加算、2倍算の計算には式1,2、および式4,5を用いる以外にも、射影座標やヤコビアン座標における計算公式があり、
非特許文献3:Cohen, H., Miyaji, A., Ono, T., Efficient Elliptic Curve Exponentiation Using Mixed Coordinates, Advances in Cryptology - ASIACRYPT 1998, LNCS 1514, Springer-Verlag, (1998), pp.51-65.
に記載されている。
【0092】
また、楕円曲線上の点Q=(x,y)に対して、楕円曲線加算に関する逆元の点-Qは、-Q=(x,-y)と表されるため、点Qの座標が与えられていれば容易に計算できる。そのため、
点P, 3P, ・・・, (2w0-1-1)P及びbjP, j=1,・・・,m のみを前計算テーブルとして格納する。その後の実計算部304が行う計算で必要となる
点-P, -3P, ・・・, -(2w0-1-1)P及び-bjP, j=1,・・・,m は、それらから導出すればよく、前計算テーブルには格納する必要はない。
【0093】
なお、点-P, -3P, ・・・, -(2w-1)P及び-bjP, j=1,・・・,mの導出を省くために、それらの点のy座標の値のみを前計算テーブルに格納しておいてもよい。
【0094】
なお、前計算部303の行う前計算テーブルの作成処理は、
点P, 3P, ・・・, (2w0-1-1)P及びbjP, j=1,・・・,mが計算されればよい。そのため、モンゴメリトリックを用いて、楕円曲線演算で必要となる逆元演算の計算の共通化を行うことにより、高速化をはかってもよい。
【0095】
モンゴメリトリックによる逆元演算共通化方法が
非特許文献4:Cohen, H., A course in computational algebraic number theory, GTM138, Springer -Verlag, (1993).
の481ページに記載されている。
【0096】
また、点Pが固定点である場合、前計算部303の行う前計算テーブルの作成処理のうち、
点P, 3P, ・・・, (2w0-1-1)Pの計算、すなわち、ステップ501からステップ511の処理は、ただ一度行えばよい。なぜならば、
点P, 3P, ・・・, (2w0-1-1)Pは、インデックス集合Bに依存していないからである。そのため、一旦
点P, 3P, ・・・, (2w0-1-1)Pを計算すれば、それ以降のスカラー倍計算では、
点P, 3P, ・・・, (2w0-1-1)Pを再計算する必要はなく、インデックス集合Bに依存する部分のみを再計算すればよい。
【0097】
最後に、図6を用いて、実計算部304がエンコードされたスカラー値と楕円曲線上の点から、楕円曲線におけるスカラー倍点を計算する方法を説明する。
【0098】
変数cに初期値n+w0-1を代入する(601)。
【0099】
dw[c]が0か0でないかを判定する。
【0100】
dw[c]が0の場合はステップ603へ行く。0でなければステップ611へ行く(602)。
【0101】
変数cを1減少させ、ステップ602へ戻る(603)。
【0102】
ステップ602でdw[c]が0でない場合、点Qにdw[c]Pを代入する(611)。
【0103】
変数jに初期値c-1を代入する(612)。
【0104】
jが0より小さいかどうかを判定する。jが0より小さい場合はステップ621へ行く。0以上の場合はステップ614へ行く(613)。
【0105】
点QをECDBLにより2倍し、点Qに再び格納する(614)。
【0106】
dw[j]が0か0でないかを判定する。
【0107】
dw[j]が0の場合はステップ617へ行く。0でなければステップ616へ行く(615)。
【0108】
ステップ615でdw[j]が0でない場合、
点Qとdw[j]PとをECADDにより加算する。ただし、dw[j]が負の場合は(-dw[j])Pのy座標を反転したものを用いて加算を行う。その結果を点Qに格納し、ステップ617へ行く(616)。
なお、dw[j]が0でない場合は、dw[j]は式13をみたす奇数である。そのため、dw[j]Pもしくは(-dw[j])Pのいずれかが、前計算テーブルに必ず存在する。
【0109】
変数jを1減少させ、ステップ613へと戻る(617)。
【0110】
ステップ613でjが0より小さい場合、点Qを出力する(621)。
【0111】
エンコード部302が行う処理により出力されるdw[j]は、式12, 式13をみたす。この理由は次の通りである。
ステップ404からステップ416のループにおいて、i回目のd'の値をd'[i]とおく。すなわち、ステップ414で
d'[i+1]=(d'[i]-u[i])/2ri (式14)
が計算される。0回目のループでは
d=d'[0] (式15)
となる。1回目のループでは
d=d'[1]2r0+u[0] (式16)
となる。以下同様にして、i回目のループでは
d=(・・・(d'[i]2ri+u[i])2ri-1+・・・+u[1])2r0+u[0] (式48)
となる。ステップ414の計算は、d'[i]<2ri 1のとき、
d'-((d'mod 2ri 1)-2ri)=2ri (式17)
となるため、d'[i+1]=1となる。ステップ415で、dw[r]以外に0が割り当てられていることに注意すれば、dが式12をみたすことがわかる。
ステップ411で計算されるy[i]は、
-2w0-1≦y[i]≦2w0-1 (式18)
の範囲となることは容易にわかる。
x[i]が
-2w0-1≦x[i]≦2w0-1 (式19)
の範囲にある場合は特に問題はない。
x[i]が式19の範囲外の場合は、ステップ412の判定結果によりステップ421へ行く。ステップ421ではx[i]∈Bの場合に、ステップ422へ行き、x[i]が選択される。すなわち、
x[i]∈B (式20)
をみたす。u[i]はx[i],y[i]のいずれかが割り当てられ、0以外のdw[r]はu[i]が割り当てられる。
したがって、式13をみたす。
【0112】
エンコード部302が行う処理で計算されるu[i]はi=0を除き全て奇数となる。この理由は次の通りである。ステップ411で、d'[i]が奇数であれば、x[i],y[i]は奇数となる。そのため、d'[i]が奇数の場合、u[i]は奇数となる。一方、ステップ414で、d'[i+1]=(d'[i]-u[i])/2riが計算される。
d'[i]-((d'[i] mod 2ri 1)-2ri) mod 2ri 1 = 2ri (式21)
であるため、d'[i+1]は奇数となる。したがって、i=0を除き、u[i]は全て奇数である。
【0113】
なお、u[0]も奇数とするためには、スカラー値dが奇数であればよい。そのためには、入力されたスカラー値dが偶数の時は、d+1を改めてスカラー値d'としてエンコードする。すなわち、dを奇数に変換する。そして、スカラー倍点d'Pを計算する。
d'P=(d+1)P=dP+P (式22)
であるので、d'Pから点Pを引き、その値をスカラー倍点dPとして出力すればよい。
【0114】
また、入力されたdが奇数の時は、d+2を改めてスカラー値d'としてエンコードし、
d'P=(d+2)P=dP+2P (式23)
を利用して、スカラー倍点dPを求めてもよい。この場合、dが奇数の場合も偶数の場合も、行う処理が一致するという利点がある。
【0115】
実計算部304が出力する点Qはスカラー倍点dPに等しい。この理由は次の通りである。
【0116】
ステップ613において点Qが
(dw[c]2c-(j 1)+dw[c-1]2(c-1)-(j 1)+・・・+ dw[j+1]2(j 1)-(j 1))P
(式24)
と表されるとする。このとき、次にステップ613に来る時も点Qは式24をみたすことを示す。
【0117】
点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
(式25)
となる。したがってdw[j]=0の時も含めて、ステップ617の直前で、点Qは式25をみたす。ステップ617でjが1減少するので、式25のjにj+1を代入すると式24になる。すなわち、次にステップ613に来る時も点Qは式24をみたす。
【0118】
j>cに対するdw[j]の値は0であるので、ステップ621で出力される点Qの値は
(dw[n]2n+dw[n-1]2n-1+・・・+dw[0])P (式26)
に等しい。実計算部304に入力されるスカラー値は、エンコード部302によりエンコードされたdw[j]であるので、そのdw[j]は式12をみたす。したがって、Q=dPである。
【0119】
上記スカラー倍におけるメモリ使用量は、前計算部303の前計算テーブルの大きさにより定まる。上記スカラー倍計算方法では、前計算テーブルは
P,3P,・・・,(2w0-1-1)P及びbjP, j=1,・・・,m により構成される。すなわち、格納する点の個数は(2w0-2+m)個である。正整数w0を固定し、ウィンドウ幅wを動かした場合、整数mは0から2w0-2までの値を取り得る。そのため、ウィンドウ幅wを適切に選択することにより、格納する点の個数は任意の値にできる。一方、非特許文献2の方法では、前計算テーブルに格納する点の個数は1,2,4,8,・・・ と2ベキの値しか選択できない。そのため、上記スカラー倍計算方法は、非特許文献2の方法と比べて、前計算テーブルに格納する点の個数の選択範囲が広く、処理速度やメモリ使用量をカスタマイズすることができる。
【0120】
また、上記スカラー倍方法は、サイドチャネル攻撃に対する防御法に関しても有効である。この理由は次の通りである。
【0121】
エンコード部302によりスカラー値dは数値列dw[j]にエンコードされる。この数値列dw[j]はパターン
|0・・・0x|0・・・0x|・・・|0・・・0x| (式27)
をもつ。ここで各xは各々非0の値であり、それぞれu[i]に対応する。ここで0・・・0はri個、すなわちw0-1個もしくはw0-2個連続する。実計算部304がスカラー倍点を計算する際に、ステップ613-617の繰り返し処理において、|0・・・0x|のブロックに対応する楕円曲線演算は、|D・・・DA|、すなわちw0回もしくはw0-1回のDの後にAとなる。ただし、DはECDBLを、AはECADDをそれぞれ表す。一方riは、確率Pwでw0となり、確率1-Pwでw0+1となる。
なぜならば、|x[i]|<2w0-1の場合、ステップ413において確率Pwでri=w0、確率1-Pwでri=w0+1となる。
また|x[i]|≧2w0-1の場合、x[i]∈Bとなる確率は、
(Bの要素数)/(2w0-1≦|k|<2w0をみたす奇数kの個数)=w1であるので、Pwとなる。この場合、
x[i]∈Bの時にri=w0、そうでない時にri=w0-1となる。したがって、いずれの場合においても、riは、確率Pwでw0となり、確率1-Pwでw0-1となる。確率Pwは公開情報であるw1にのみ依存し、秘密情報には依存していない。結果として、全てのスカラー値に対して、実行する楕円曲線演算は
|D・・・DA|D・・・DA|・・・|D・・・DA| (式28)
となり、Dの連続する回数は各々riであるが、この値は公開情報w1にのみ依存し、秘密情報には依存しない。特に、式28のみからは、スカラー値dに関する情報を引き出すことができない。
【0122】
なお、非特許文献1のランダム化射影座標を併用してスカラー倍計算を行ってもよい。そうすると、同じ点Pを入力しても実行毎に異なる値に変換してスカラー倍計算を行うので、攻撃者が中間値の値を予測できなくなる。
【0123】
また、前計算テーブルに格納されている点が読み出されるたびに、再びランダム化して、前計算テーブルに書き込んでもよい。そうすると、同じデータの再使用がなくなるため、より一層、サイドチャネル攻撃への耐性が増す。
【0124】
また、一つのスカラー倍計算中に一度以上、当該計算中に参照する前計算テーブルを再作成してもよい。そうすることにより、テーブルから引用される値がより頻繁に変更されることになり、サイドチャネル攻撃への耐性がさらに増す。
【0125】
また、任意回数のスカラー倍計算において、同一の前計算テーブルを再利用してもよい。そうすることにより、前計算テーブルの作成処理に掛かる時間を減らせるため、計算時間を短縮することができる。
【0126】
また、スカラー倍計算毎に、必要とされる計算速度、同時に使用する他のアプリケーションの優先度などの状況に応じて、前計算テーブルのサイズを変更してもよい。
【0127】
より具体的には、利用可能なワーク領域を調べて、そのワーク領域に応じた前計算テーブルサイズを選択し、スカラー倍を計算してもよい。そうすることにより、個別状況に応じたカスタマイズをより繊細に行うことができる。
【0128】
あるいは、スカラー倍以外のモジュールの処理に優先的にワーク領域を割り当てるために、前計算テーブルのサイズを小さくしてスカラー倍計算を行ってもよい。
【0129】
あるいは、スカラー倍計算を高速に行うため、前計算テーブルのサイズを大きくしてスカラー倍計算を行なってもよい。
【0130】
以上の通り、上記計算方法は、サイドチャネル攻撃に有用な情報を与えないので、サイドチャネル攻撃に対して耐性がある。また、前計算テーブルに格納する点の個数の選択範囲が広いため、処理速度やメモリ使用量をカスタマイズすることができる。
【0131】
なお、第1の計算方法では楕円曲線としてワイエルシュトラス型楕円曲線を用いたが、標数2の有限体上で定義された楕円曲線や、OEF(Optimal Extension Field)上で定義された楕円曲線、もしくはモンゴメリ型楕円曲線を用いてもよい。OEFについては、
非特許文献5:D.V. Bailey, C. Paar, Optimal Extension Fields for Fast Arithmetic in Public-Key Algorithms, Advances in Cryptology Crypto '98, LNCS 1462, (1998), 472-485.
に記載されている。
【0132】
第2実施例では、図7で示されるスカラー倍計算部の機能ブロックを用いる。スカラー倍計算部115(図1の135)は、前計算部703、実計算部704からなる。前計算部703は、加算部331、2倍算部332、繰り返し判定部333、インデックス集合生成部734からなる。実計算部304は、加算部342、2倍算部343、繰り返し判定部344、スカラー値表現変換部745、ウィンドウ幅選択部746からなる。
【0133】
スカラー倍計算部115がスカラー値d及び楕円曲線上の点Pから、楕円曲線におけるスカラー倍点dPを計算する第2の計算方法を説明する。第2の計算方法では、スカラー値dを数値列にエンコードすることなくスカラー倍点を計算するという特徴がある。
【0134】
スカラー倍計算部115が復号化処理部132からスカラー値dと楕円曲線上の点Pを受け取ると、前計算部703は、インデックス集合Bを生成し、入力された楕円曲線上の点Pとインデックス集合Bを用いて前計算テーブルを作成する。前計算テーブルは
P, 3P, ・・・, (2w0-1-1)P及びbjP, j=1,・・・,mにより構成されることは、第1の計算方法と同様である。インデックス集合Bが
B={±b1,±b2,・・・,±bm}と表され、m個の相異なるb1,b2,・・・,bm
{2w0-1+1,2w0-1+3,・・・,2w0-1}の範囲から選ばれることも第1の計算方法と同様である。
【0135】
実計算部304は、入力されたスカラー値dと楕円曲線上の点Pから、インデックス集合と前計算テーブルを用いてスカラー倍点dPを計算する。
【0136】
次に前計算部703、実計算部704の行なう各処理について詳細に説明する。
【0137】
まず、図8を用いて、前計算部703が楕円曲線上の点から、前計算テーブル及びインデックス集合Bを作成する方法を説明する。
【0138】
点PをECDBLにより2倍し、その結果を2Pに格納する(801)。
【0139】
変数jに初期値1を代入する(802)。
【0140】
繰り返し判定部733により、jが2w0-1より小さいかどうかを判定する。jが2w0-1より小さい場合はステップ804へ行く。jが2w0-1以上の場合はステップ811へ行く(803)。
【0141】
ステップ803でjが2w0-1より小さい場合、
点jPと点2PをECADDにより加算し、その結果を(j+2)Pに格納する(804)。
【0142】
変数jを2増加させ、ステップ803へ戻る(805)。
【0143】
ステップ803でjが2w0-1以上の場合、
点(2w0-1-1)Pと点PをECADDにより加算し、その結果を2w0-1Pに格納する(811)。
【0144】
インデックス集合Bに空集合を初期値として代入し、変数jに1を代入する(812)。
【0145】
繰り返し判定部733により、jがm以下であるかどうかを判定する。jがm以下であればステップ814へ行く。jがmより大きい場合はステップ821へ行く(813)。
【0146】
ステップ813でjがm以下の場合、
インデックス集合生成部734は、{2w0-1+1,2w0-1+3,・・・,2w0-1}の範囲よりbjをランダムに選ぶ(814)。
【0147】
インデックス集合生成部734により、bjがBの要素として既に含まれているかどうかを判定する。BjがBの要素として含まれていればステップ814へ戻る、bjがBの要素として含まれていなければステップ816へ行く(815)。
【0148】
点2w0-1Pと点(bj-2w0-1)PをECADDにより加算し、その結果をbjPに格納する(816)。
【0149】
インデックス集合生成部734は、インデックス集合Bにbjを要素として追加する(817)。
【0150】
変数jを1増加させ、ステップ813へ戻る(818)。
【0151】
ステップ813でjがmより大きい場合、
P, 3P, ・・・, (2w0-1-1)P及びbjP, j=1,・・・,mを前計算テーブルとして出力する。インデックス集合Bを出力する(821)。
【0152】
また、点P, 3P, ・・・, (2w-1)Pのみを前計算テーブルとして格納し、
点-P, -3P, ・・・, -(2w-1)Pを前計算テーブルには格納する必要はないことは第1の計算方法と同様である。
【0153】
なお、点-P, -3P, ・・・, -(2w-1)P及び-bjP, j=1,・・・,mの導出を省くために、それらの点のy座標の値のみを前計算テーブルに格納しておいてもよいことも第1の計算方法と同様である。
【0154】
点Pが固定点である場合、前計算部303の行う前計算テーブルの作成処理のうち、
点P, 3P, ・・・, (2w0-1-1)Pの計算、すなわち、ステップ801からステップ811の処理は、ただ一度行えばよいことは第1の計算方法と同様である。
【0155】
前計算部703の行う前計算テーブルの作成処理は、
点P, 3P, ・・・, (2w-1)Pが計算されればよい。そのため、モンゴメリトリックを用いて、楕円曲線演算で必要となる逆元演算の計算の共通化を行うことにより、高速化をはかってもよいことも、第1の計算方法と同様である。
【0156】
次に、図9、図10を用いて、実計算部704が入力されたスカラー値dと楕円曲線上の点Pから、インデックス集合Bと前計算テーブルを用いて楕円曲線におけるスカラー倍点を計算する方法を説明する。
【0157】
点Qに無限遠点を代入する(901)。
【0158】
スカラー値表現変換部745は、スカラー値dを1,-1により表現したd~に変換する(902)。すなわち、d~は整数としてdに等しく、かつ
d~=dn-1~2n-1+dn-2~2n-2+・・・+d0~, di~=1 or -1 (式29)
と表される。この変換を達成するためには、スカラー値dを
d=dn-12n-1+dn-22n-2+・・・+d0, di= 0 or 1 (式30)
と表したとき、
dn-1~=1 (式31)
di~=1 if di 1 = 1 for i=0,・・・,n-2 (式32)
di~=-1 if di 1 = 0 for i=0,・・・,n-2 (式33)
により変換すると、式29をみたす。尚、d~に変換できるのは、dが奇数の時のみである。
【0159】
変数iに初期値nを代入する(903)。
【0160】
繰り返し判定部733は、iがw0-1より大きいかどうかを判定する。iがw0-1よ大きい場合はステップ911へ行く。w0-1以下であればステップ1001へ行く(904)。
【0161】
ステップ904でiがw0-1より大きい場合、
ウィンドウ幅選択部746は、変数xに整数MSBw0(d~)を格納する(911)。ただし、MSBw0(d~)はd~の上位w0ビットにより構成される数値を表す。
【0162】
ウィンドウ幅選択部746は、変数xの値がインデックス集合Bの要素として含まれている場合はbに1を格納する。含まれていない場合はbに0を格納する(912)。
【0163】
ウィンドウ幅選択部746は、確率Pwでpに1を格納し、確率1-Pwでpを格納する(913)。
【0164】
ウィンドウ幅選択部746は、変数uに
1-|MSB2(d~)/2|を格納する(914)。
【0165】
ウィンドウ幅選択部746は、変数rに
w0-1+((u∧p)∨((1-u)∧b))を代入する(915)。
【0166】
変数jに1を代入する(916)。
【0167】
点QをECDBLにより2倍し、点Qに再び格納する(917)。
【0168】
繰り返し判定部733は、jがr以上であるかどうかを判定する。jがr以上であればステップ921へ行く。rより小さければステップ919へ行く(918)。
【0169】
ステップ918でjがr以上の場合、変数jを1増加させ、ステップ917へ戻る(919)。
【0170】
ステップ918でjがrより小さい場合、点QとMSBr(d~)PとをECADDにより加算する。ただし、MSBr(d~)が負の場合は(-MSBr(d~))Pのy座標を反転したものを用いて加算を行う。その結果を点Qに格納する。(921)。
【0171】
変数iをr減少させ、ステップ904へ戻る(922)。
【0172】
ステップ904でiがw0-1以下の場合、
繰り返し判定部733は、iが0以下であるかどうかを判定する。iが0以下の場合はステップ1007へ行く。iが0より大きい場合はステップ1002へ行く(1001)。
【0173】
ステップ1001でiが0より大きい場合、
変数jに1を代入する(1002)。
【0174】
点QをECDBLにより2倍し、点Qに再び格納する(1003)。
【0175】
繰り返し判定部733は、jがi以上であるかを判定する。jがi以上であればステップ1006へ行く。iより小さければステップ1005へ行く(1005)。
【0176】
ステップ1004でjがiより小さい場合、
変数jを1増加させ、ステップ1003へ戻る(1005)。
【0177】
ステップ1004でjがi以上の場合、点Qとd~PとをECADDにより加算する。ただし、d~が負の場合は(-d~)Pのy座標を反転したものを用いて加算を行う。その結果を点Qに格納する。(1006)。
【0178】
点Qを出力する(1007)。
【0179】
実計算部704が行う処理により出力されるスカラー倍点はdPに一致する。この理由は次の通りである。
ステップ904からステップ922のループにおいて、k回目のループにおけるrの値をrkとおく。
ステップ901で楕円曲線上の点Qに無限遠点が代入される。
1回目のループ終了後では
Q=r1P (式34)
となる。2回目のループ終了後では
Q=(r12r2+r2)P (式35)
となる。以下同様にして、k回目のループ終了後では
Q=((・・・(r12r2+r2)2r3+・・・+rk-1)2rk+rk)P (式36)
となる。ステップ1002からステップ1006の処理も同様であることに注意すれば、ステップ1007における点QはQ=d~Pをみたすことがわかる。数値としてd=d~であるため、Q=dPとなる。
【0180】
実計算部704のステップ921の楕円加算で用いる点MSBr(d~)Pに対して、MSBr(d~)Pもしくは(-MSBr(d~))Pのいずれかが前計算テーブルに必ず存在する。この理由は次の通りである。まず、
MSBr(d~) mod 2 = 1であり、MSBr(d~)は奇数である。ステップ915で変数rにw0-1, w0のいずれかの値が代入される。r=w0-1の場合、前計算テーブルは
P,3P,・・・,(2w0-1-1)Pを含むので、MSBr(d~)Pもしくは(-MSBr(d~))Pのいずれかが前計算テーブルに必ず存在する。次にr=w0の場合を考える。r=w0となるためには、(u∧p)=1であるか、もしくは
((1-u)∧b)=1である必要がある。(u∧p)=1の時、u=1であるので、d~の最上位ビットの符号と上位2番目のビットの符号は異なる。そのため
-2w0-1≦MSBw0(d~)≦2w0-1 (式37)
となり、MSBr(d~)Pもしくは(-MSBr(d~))Pのいずれかが前計算テーブルに存在する。
((1-u)∧b)=1の時、b=1であるので、MSBw0(d~)はインデックス集合Bの要素である。そのため、MSBr(d~)Pもしくは(-MSBr(d~))Pのいずれかが前計算テーブルに存在する。結果として、いずれの場合も、MSBr(d~)Pもしくは(-MSBr(d~))Pのいずれかが前計算テーブルに必ず存在する。
【0181】
なお、dをd~に変換するためには、スカラー値dが奇数である必要がある。そのためには、入力されたスカラー値dが偶数の時は、d+1を改めてスカラー値d'としてエンコードする。すなわち、dを奇数に変換する。そして、スカラー倍点d'Pを計算する。
d'P=(d+1)P=dP+P (式38)
であるので、d'Pから点Pを引き、その値をスカラー倍点dPとして出力すればよい。
【0182】
また、入力されたdが奇数の時は、d+2を改めてスカラー値d'としてエンコードし、
d'P=(d+2)P=dP+2P (式39)
を利用して、スカラー倍点dPを求めてもよい。この場合、dが奇数の場合も偶数の場合も、行う処理が一致するという利点がある。
【0183】
上記スカラー倍におけるメモリ使用量は、前計算部703の前計算テーブルの大きさにより定まる。上記スカラー倍計算方法では、前計算テーブルは
P,3P,・・・,(2w0-1-1)P及びbjP, j=1,・・・,m により構成され、格納する点の個数は(2w0-2+m)個である。正整数w0を固定し、ウィンドウ幅wを動かした場合、整数mは0から2w0-2までの値を取り得る。そのため、ウィンドウ幅wを適切に選択することにより、格納する点の個数は任意の値にできる。一方、非特許文献2が開示する従来の方法では、前計算テーブルに格納する点の個数は1,2,4,8,・・・ と2ベキの値しか選択できない。そのため、上記スカラー倍計算方法は、非特許文献2の方法と比べて、前計算テーブルに格納する点の個数の選択範囲が広く、高速処理性能やメモリ容量を考慮してカスタマイズすることができる。
【0184】
また、上記スカラー倍方法は、サイドチャネル攻撃に対する防御法に関しても有効である。この理由は次の通りである。
【0185】
実計算部704がスカラー倍点を計算する際に、ステップ904-921の繰り返し処理において実行される楕円曲線演算は、一回のループにつき |D・・・DA| となる。すなわちw0回もしくはw0-1回のDの後にAとなる。ただし、DはECDBLを、AはECADDをそれぞれ表す。一方rは、確率Pwでw0となり、確率1-Pwでw0+1となる。
【0186】
この理由について、まずu=1の場合について考察する。変数pは、ステップ913において確率Pwでp=1、確率1-Pwでp=0が割り当てられる。そのため、確率Pwでr=w0、確率1-Pwでr=w0-1となる。
【0187】
次にu=0の場合について考察する。変数bは、ステップにおいてxがBの要素であるときb=1、xがBの要素でないときb=0が割り当てられる。
|x|≧2w0-1の場合、x∈Bとなる確率は、
(Bの要素数)/(2w0-1≦|k|<2w0をみたす奇数kの個数)=w1であるので、Pwとなる。変数uは、ステップ914で
u=1-|MSB2(d~)/2|が割り当てられる。すなわち、u=0は|x|≧2w0-1と同値である。そのため、u=0の場合、確率Pwでr=w0、確率1-Pwでr=w0-1となる。
【0188】
したがって、いずれの場合においても、rは、確率Pwでw0となり、確率1-Pwでw0-1となる。確率Pwは公開情報であるw1にのみ依存し、秘密情報には依存していない。結果として、全てのスカラー値に対して、実行する楕円曲線演算は
|D・・・DA|D・・・DA|・・・|D・・・DA| (式40)
となり、Dの連続する回数は各々w0もしくはw0-1であるが、どちらの値が選択されるかは公開情報w1にのみ依存し、秘密情報には依存しない。特に、式35のみからは、スカラー値dに関する情報を引き出すことができない。
【0189】
なお、第2の計算方法でも、第1の計算方法と同様に、非特許文献1のランダム化射影座標を併用してスカラー倍計算を行ってもよい。そうすると、同じ点Pを入力しても実行毎に異なる値に変換してスカラー倍計算を行うので、攻撃者が中間値の値を予測できなくなる。
【0190】
また、第1の計算方法と同様に、前計算テーブルに格納されている点が読み出されるたびに、再びランダム化して、前計算テーブルに書き込んでもよい。そうすると、同じデータの再使用がなくなるため、より一層、サイドチャネル攻撃への耐性が増す。
【0191】
以上の通り、第2の計算方法は、サイドチャネル攻撃に有用な情報を与えないので、サイドチャネル攻撃に対して耐性がある。また、前計算テーブルに格納する点の個数の選択範囲が広いため、処理速度やメモリ使用量をカスタマイズすることができる。
【0192】
なお、第2の計算方法では楕円曲線としてワイエルシュトラス型楕円曲線を用いたが、標数2の有限体上で定義された楕円曲線や、OEF(Optimal Extension Field)上で定義された楕円曲線、もしくはモンゴメリ型楕円曲線を用いてもよい。OEFについては非特許文献5に記載されている。
【0193】
以上、コンピュータB121が、暗号化されたデータ141を復号化する場合のスカラー倍計算部135の動作を説明したが、コンピュータA101が入力メッセージを暗号化する場合も同様である。
【0194】
その場合には、コンピュータA101のスカラー倍計算部115は、既に説明した楕円曲線上の点Q、乱数kによるスカラー倍点kQと、公開鍵aQと乱数kによるスカラー倍点k(aQ)を出力する。このとき、上記計算方法で説明したスカラー値dを乱数k、楕円曲線上の点Pを楕円曲線上の点Q、公開鍵aQとして同様の処理を行うことにより、それぞれのスカラー倍点を求めることができる。
【0195】
次に本発明を署名検証システムに適用する実施形態を、図11と図2を用いて説明する。
【0196】
図11の署名検証システムは、スマートカード1101と署名検証処理を行うコンピュータ1121とから成る。
【0197】
スマートカード1101は、図1のコンピュータA101と類似の構成を備え、CPU113やコプロセッサ114などの演算装置とが記憶部102に格納されているプログラムを実行することにより、データ処理部112ではなく、署名生成処理部1112を実現する。ただし、図1に示す外部記憶装置107、ディスプレイ108、キーボード109を備えなくてもよい。
【0198】
コンピュータ1121は、コンピュータA101と同様の構成を備え、CPU113がプログラムを実行することによりデータ処理部112ではなく、署名検証処理部1132を実現する。
【0199】
スカラー倍計算部1115と1135は、図1に示すスカラー倍計算部115または135と同様の機能を備える。
【0200】
なお、本実施例において、コンピュータ1121内の各プログラムは、あらかじめ、上記コンピュータ内の記憶部に格納されていても良いし、必要なときに、コンピュータ1121が利用可能な媒体を介して他の装置から上記記憶部に導入されてもよい。
【0201】
さらに、スマートカード1101内の各プログラムは、あらかじめ、上記スマートカード1101内の記憶部に格納されていても良いし、必要なときに、入出力インタフェースを介して接続するコンピュータ、または当該コンピュータが利用可能な媒体を介して上記記憶部に導入されてもよい。
【0202】
媒体とは、たとえば当該コンピュータに着脱可能な記憶媒体、または通信媒体(すなわちネットワークまたはネットワークを伝搬する搬送波)を指す。
【0203】
図11の署名検証システムにおける署名作成と署名検証動作を、図2を参照して説明する。
【0204】
コンピュータ1121は、ランダムに選んだ数値をチャレンジコード1143として、インタフェース1142を介してスマートカード1101に転送する。
【0205】
署名生成処理部1112(図2の112)は、チャレンジコード1143を受け付け、チャレンジコード1143のハッシュ値をとり、所定のビット長の数値fに変換する。
【0206】
署名生成処理部1112は、乱数uを生成し、記憶部1102(図2の102)に格納されている定数1104から読み出した(図2の205)楕円曲線上の定点Qとともにスカラー倍計算部1115(図2の115)へ送る(図2の206)。
【0207】
スカラー倍計算部1115は、定点Q、乱数uによるスカラー倍点(xu,yu)を計算し、計算されたスカラー倍点を署名生成処理部1112へ送る(図2の207)。
【0208】
署名生成処理部1112は、送られたスカラー倍点を用いて署名の生成を行う。例えば、ECDSA署名であれば、
s = xu mod q (式41)
t = u-1(f+ds) mod q (式42)
を計算することによりチャレンジコード1143に対応する署名(s,t)を得る(図2の208)。
【0209】
ここで、qは定点Qの位数、すなわち定点Qのq倍点qQが無限遠点になり、qより小さな数値mに対する定点Qのm倍点mQは無限遠点にはならない、というような数値のことである。
【0210】
ECDSA署名については、例えば、
非特許文献6:ANSI X9.62 Public Key Cryptography for the Financial Services Industry, The Elliptic Curve Digital Signature Algorithm (ECDSA), (1998)
に記載されている。
【0211】
スマートカード1101は、署名生成処理部1112で作成した署名1141を入出力インタフェース1110より出力し、インタフェース1142を介してコンピュータ1121へ転送する。
【0212】
コンピュータ1121の署名検証処理部1132(図2の112)は、署名1141が入力される(図2の204)と、署名1141の数値s,tが適切な範囲内すなわち1≦s, t<qであるかを調べる。
【0213】
数値s, tが上記範囲内になければチャレンジコード1143に対する署名の検証結果として「無効」を出力し、スマートカード1101を拒絶する。数値s, tが上記範囲内にあれば、署名検証処理部1132は、
h = t-1 mod q (式43)
h1 = fh mod q (式44)
h2 = sh mod q (式45)
を計算する。そして、記憶部1122(図2の102)に格納されている定数1124から読み出した(図2の205)公開鍵aQ及び定点Qと計算したh1,h2をスカラー倍計算部1135(図2の115)へ送る(図2の206)。
【0214】
スカラー倍計算部1135は、定点Qとh1によるスカラー倍点h1Qと、公開鍵aQとh2によるスカラー倍点h2aQとを計算し、計算されたスカラー倍点を署名検証処理部1132へ送る(図2の207)。
【0215】
署名検証処理部1132は、送られたスカラー倍点を用いて、署名検証処理を行う。例えば、ECDSAの署名検証であれば、点R
R=h1Q+h2aQ (式46)
を計算し、そのx座標をxRとしたとき、
s' = xR mod q (式47)
を計算し、s'=sであればチャレンジコード1143に対する署名の検証結果として「有効」を出力し、スマートカード1101を認証し、受け入れる(図2の208)。
【0216】
s'=sでなければ「無効」を出力し、スマートカードを拒絶する(図2の208)。
【0217】
上記実施形態のスカラー倍計算部1115、1135は、図1のスカラー倍計算部115または135と同様の機能を備えるので、サイドチャネル攻撃を防ぐことができる、かつ処理速度やメモリ使用量をカスタマイズすることができるスカラー倍計算を実行できる。
【0218】
そのためスマートカード1101は署名作成処理を行う際に、コンピュータ1121は署名検証処理を行う際に、サイドチャネル攻撃を防ぐことができる、そのうえ処理速度やメモリ使用量をカスタマイズすることができる。
【0219】
次に本発明を鍵交換システムに適用する実施形態を説明する。本実施形態においては、図1のシステム構成が応用できる。
【0220】
図1のデータ処理部112、132は、本実施形態においては、それぞれ鍵交換処理部112、132として機能する。
【0221】
鍵交換システムのコンピュータA101が、入力されたデータ143から共有情報の導出を行う場合の動作について図1、図2を参照して説明する。
【0222】
コンピュータB121のデータ処理部132(図2の112)は、記憶部122(図2の102)の定数125から秘密鍵bを読み出しコンピュータB121の公開鍵bQを計算する。そして、ネットワーク142を介して、公開鍵bQをデータ143としてコンピュータA101に転送する。
【0223】
コンピュータA101の鍵交換処理部112(図2の112)はコンピュータB121の公開鍵bQの入力を受け付ける(図2の204)と、鍵交換処理部112は、記憶部102から読み出した(図2の205)秘密情報105であるコンピュータA101の秘密鍵aと、コンピュータB121の公開鍵bQとをスカラー倍計算部115へ送る(図2の206)。
【0224】
スカラー倍計算部115は、秘密鍵aと、公開鍵bQによるスカラー倍点abQを計算し、計算されたスカラー倍点を鍵交換処理部112へ送る(図2の207)。
【0225】
鍵交換処理部112は、送られたスカラー倍点を用いて共有情報の導出を行い、記憶部102に秘密情報105として格納する。例えば、スカラー倍点abQのx座標を、共有情報とする。
【0226】
次に、コンピュータ121が、入力されたデータ141から共有情報の導出を行う場合の動作について説明する。
【0227】
コンピュータA101のデータ処理部112は、記憶部102の定数105から秘密鍵aを読み出しコンピュータA101の公開鍵aQを計算する。そして、ネットワーク142を介して、公開鍵aQをデータ141としてコンピュータB121に転送する。
【0228】
コンピュータB121の鍵交換処理部132(図2の112)はコンピュータA101の公開鍵aQの入力を受け付ける(図2の204)と、鍵交換処理部132は、記憶部122(図2の102)の定数125から読み出した(図2の205) 秘密情報125であるコンピュータB121の秘密鍵bと、コンピュータA101の公開鍵aQとをスカラー倍計算部135(図2の115)へ送る(図2の206)。
【0229】
スカラー倍計算部135は、秘密鍵bと、公開鍵aQによるスカラー倍点baQを計算し、計算されたスカラー倍点を鍵交換処理部132へ送る(図2の207)。
【0230】
鍵交換処理部132は、送られたスカラー倍点を用いて共有情報の導出を行い、記憶部122に秘密情報125として格納する。例えば、スカラー倍点baQのx座標を、共有情報とする。
【0231】
ここで、数abと数baは数値として同じなので、点abQと点baQは同じ点となり、同じ情報が導出されたことになる。
【0232】
ネットワーク142には、点aQと点bQが送信されるが、点abQ(もしくは点baQ)を計算するには秘密鍵aもしくは秘密鍵bを用いなければならない。すなわち、秘密鍵aもしくは秘密鍵bを知らなければ、共有情報を得ることができない。このようにして得られた共有情報は、共通鍵暗号の秘密鍵として利用できる。
【0233】
本実施形態においても、スカラー倍計算部115、135は、上述の特徴を備えるので、サイドチャネル攻撃を防ぐことができる、そのうえ処理速度やメモリ使用量をカスタマイズすることができるような鍵交換処理が可能になる。
【0234】
また、上記各実施形態における暗号化処理部、復号化処理部、署名作成部、署名検証部、鍵交換処理部は、専用のハードウェアを用いて行ってもよい。また、スカラー倍計算部をコプロセッサまたはそれ以外の専用ハードウェアで実現しても良い。
【0235】
また、データ処理部は、上記暗号化処理、復号化処理、署名作成処理、署名検証処理、鍵交換処理のうち、任意の一つ以上の処理を行えるように構成してもよい。
【0236】
【発明の効果】
本発明によれば、サイドチャネル攻撃に対して安全で、かつ処理速度やメモリ使用量をカスタマイズすることができる、楕円曲線演算を用いたメッセージ処理が可能になる。
【図面の簡単な説明】
【図1】実施形態におけるシステム構成図である。
【図2】各実施形態における情報の受け渡しを示すシーケンス図である。
【図3】第1実施例の実施形態におけるスカラー倍計算部の構成図である。
【図4】第1実施例におけるエンコード部の行うエンコード方法を示すフローチャート図である。
【図5】第1実施例における前計算部の行う前計算方法を示すフローチャート図である。
【図6】第1実施例における実計算部の行う実計算方法を示すフローチャート図である。
【図7】第2実施例の実施形態におけるスカラー倍計算部の構成図である。
【図8】第2実施例における前計算部の行う前計算方法を示すフローチャート図である。
【図9】第2実施例における実計算部の行う実計算方法を示すフローチャート図である。
【図10】第2実施例における実計算部の行う実計算方法を示すフローチャート図である。
【図11】実施形態における署名検証システム構成図である。
【符号の説明】
101、121、1121:コンピュータ、1101:スマートカード、102、122、1102、1122:記憶部、111、131、1111、1131:処理部、115、135、1115、1135:スカラー倍計算部、112、132:データ処理部、1112:署名生成処理部、1132:署名検証処理部、104、124、1104、1124:定数、105、125、1105、1125:秘密情報、110、130、1110、1130:入出力インタフェース、108、128、1128:ディスプレイ、109、129、1129:キーボード、142:ネットワーク、1142:インタフェース、141、143:データ、302:エンコード部、303:前計算部、304:実計算部、321:剰余取得部、322:インデックス集合生成部、323:剰余選択部、324:繰り返し判定部、325:格納部、331:加算部、332:2倍算部、333:繰り返し判定部、341:ビット値判定部、342:加算部、343:2倍算部、344:繰り返し判定部、703:前計算部、704:実計算部、731:加算部、732:2倍算部、733:繰り返し判定部、734:インデックス集合生成部、742:加算部、743:2倍算部、744:繰り返し判定部、745:スカラー値表現変換部、746:ウィンドウ幅選択部。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to security technology, and more particularly to a message processing method using elliptic curve calculation.
[0002]
[Prior art]
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.
[0003]
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.
[0004]
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 (or addition) is defined. The addition on the elliptic curve by the same points is particularly called doubling on the elliptic curve.
[0005]
The addition of two points on an elliptic curve is calculated as follows: When you draw a straight line that passes through two points, the straight line intersects the elliptic curve at another point. The point that is symmetric with respect to the intersecting point and the x-axis is the result of the addition. For example, in the case of a Weierstrass-type elliptic curve, the point (x1, y1) And point (x2, y2) Addition
(xThree, yThree) = (x1, y1) + (X2, y2)
xThree= ((y2-y1) / (x2-x1))2-x1-x2          (Formula 1)
yThree= ((y2-y1) / (x2-x1)) (x1-xThree) -y1      (Formula 2)
Is obtained by calculating. Here, the defining formula of the Weierstrass-form elliptic curve is
y2= xThree+ Ax + B (Formula 3)
Given in. That is, each of x and y in Equation 3 is xi, yi When substituting (i = 1,2,3), the equation of Equation 3 holds.
[0006]
The doubling of points on the elliptic curve is calculated as follows. When a tangent at a point on the elliptic curve is drawn, the tangent intersects at another point on the elliptic curve. The intersected 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 point (x1, y1)
(xThree, yThree) = 2 (x1, y1) = (x1, y1) + (X1, y1)
xThree= ((3x1 2+ A) / (2y1))2-2x1            (Formula 4)
yThree= ((3x1 2+ A) / (2y1)) (x1-xThree) -y1      (Formula 5)
Is obtained by calculating.
[0007]
Adding a certain number of times to a certain point is called scalar multiplication, the result is called a scalar multiple, and the number of times is called a scalar value.
[0008]
While the difficulty of solving the discrete logarithm problem on an elliptic curve has been theoretically established, information related to secret information such as a secret key (calculation time, power consumption, etc.) is encrypted in an actual implementation. An attack method called a side channel attack has been proposed in which there is a case of leaking in processing, and secret information is restored based on the leaked information.
[0009]
A non-patent document 1 describes a side channel attack against elliptic curve cryptography.
[0010]
In elliptic curve cryptography, encryption, decryption, signature generation or verification of a given message must be performed using elliptic curve computation. In particular, calculation of scalar multiplication on an elliptic curve is used in cryptographic processing using a scalar value that is secret information.
[0011]
A non-patent document 2 describes a defense method against side channel attacks against elliptic curve cryptography.
[0012]
[Non-Patent Document 1]
J. Coron, Resistance against Differential Power Analysis for Elliptic Curve Cryptosystems, Cryptographic Hardware and Embedded Systems: Proceedings of CHES'99, LNCS 1717, Springer-Verlag, (1999) pp.292-302.
[Non-Patent Document 2]
K.Okeya, T.Takagi, The Width-w NAF Method Provides Small Memory and Fast Elliptic Scalar Multiplications Secure against Side Channel Attacks, RSA conference cryptographer's track (CT-RSA 2003), LNCS 2612, Springer-Verlag, (2003), pp.328-341.
[0013]
[Problems to be solved by the invention]
Cryptographic technology has become an indispensable element for concealing and authenticating electronic information with the development of information and communication networks. In addition to security, requirements imposed on cryptographic technology include processing speed and low memory usage, but generally there is a trade-off relationship between security, processing speed, and memory usage. It is difficult to meet all requirements. On the other hand, since the discrete logarithm problem on the elliptic curve is very difficult, the elliptic curve cryptosystem can make the key length relatively short compared to the cipher that uses the difficulty of prime factorization as the basis of security. . For this reason, encryption processing can be performed even if resources such as calculation capacity and memory capacity are relatively small. 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 can customize processing speed and memory usage is required so as to perform optimal cryptographic processing within the limited resources.
[0014]
Although the above technique is effective as a method for preventing side channel attacks, it does not take into consideration the point of customizing the processing speed and memory usage.
[0015]
[Means for Solving the Problems]
The present invention provides an elliptic curve calculation method capable of preventing side channel attacks and customizing the processing speed and memory usage.
[0016]
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.
[0017]
The present invention provides a scalar multiple calculation method for calculating a scalar multiple from a scalar value and a point on an elliptic curve in an elliptic curve calculation, the step of encoding the scalar value into a numerical sequence, and a point on the elliptic curve And a step of calculating a scalar multiple from the encoded numerical sequence and the pre-calculation table, wherein the pre-calculation table includes randomly selected elements.
[0018]
In the present invention, the encoding step may include a step of selecting a remainder of the scalar value.
[0019]
In the present invention, the encoding step includes a step of selecting one of a first residue and a second residue with respect to the scalar value, and the step of selecting the residue includes the first residue. When the size of the remainder is smaller than a predetermined size, the step of selecting the first residue or the second residue with a predetermined probability, and the size of the first residue is equal to or larger than the size In this case, it may be configured to include a step of determining whether or not a point on the elliptic curve associated with the first remainder exists in the previous calculation table.
[0020]
In the present invention, the step of calculating the scalar multiple includes a step of executing the first operation a predetermined number of times and a step of executing a second operation different from the first operation. You may comprise as follows.
[0021]
The present invention is also a scalar multiple calculation method for calculating a scalar multiple from a scalar value and a point on an elliptic curve in an elliptic curve calculation, and a step of creating a pre-calculation table from the point on the elliptic curve; Calculating a scalar multiple from the scalar value and the pre-calculation table, and the pre-calculation table may be configured to include randomly selected elements.
[0022]
As described above, according to the scalar multiplication calculation method of the present invention, since the selection range of the number of points to be stored in the pre-calculation table is wide and the elements of the pre-calculation table are randomly selected, side channel attacks can be prevented. A scalar multiplication method capable of customizing processing speed and memory usage becomes available.
[0023]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings.
[0024]
FIG. 1 shows a system configuration in which a computer A 101 and a computer B 121 to which an elliptic curve calculation method according to the present invention connected by a network 142 is applied are connected by a network 142.
[0025]
To encrypt a message with the computer A101 in the cryptographic communication system of FIG.
PmTo calculate and output + k (aQ) and kQ, and decrypt the ciphertext with the computer B121,
Calculate -a (kQ) from secret key a and kQ,
(Pm+ K (aQ))-a (kQ) (Equation 6)
Can be calculated and output. Where PmIs 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.
[0026]
Network 142 has PmOnly + k (aQ), kQ is sent and message PmIn order to restore, it is necessary to calculate kaQ, that is, a times kQ. However, since the private key a is not transmitted to the network 142, only the one holding the private key amCan be restored.
[0027]
In FIG. 1, a computer A101 is equipped with an arithmetic 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.
[0028]
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 the arithmetic device such as the CPU 113 and 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.
[0029]
In the present embodiment, the data processing unit 112 functions as the encryption processing unit 112 and encrypts the input message.
[0030]
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.
[0031]
The computer B121 has the same hardware configuration as the computer A101.
[0032]
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 107, and the arithmetic device such as the CPU 133 or 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.
[0033]
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.
[0034]
The scalar multiplication calculation unit 135 calculates parameters necessary for the decoding processing unit 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.
[0035]
Each of the above programs may be stored in advance in a storage unit in the computer, or when necessary, from another device via a medium that can be used by the input / output interface 110 and the computer 721. It may be introduced into the storage unit. The medium refers to, for example, a storage medium that is detachable from the input / output interface 110, or a communication medium (that is, a network or a carrier wave that propagates through the network).
[0036]
FIG. 2 shows how information is transferred by each processing unit of the computer A101 and the computer B121.
[0037]
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 text, image, video, or sound.
[0038]
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.
[0039]
Next, the encryption processing unit 112 converts the numerical value represented by the bit string of the message into the x coordinate (x1) Point P on the elliptic curvemY coordinate value (y1).
[0040]
For example, the Weierstrass-form elliptic curve has constants A and B, respectively.
y1 2= X1 Three+ Ax1+ B (Formula 7)
Therefore, the y-coordinate value can be obtained from this.
[0041]
Next, the encryption processing unit 112 generates a random number k. Then, the public key aQ and the x coordinate of Q read out 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 ( 206 in FIG.
[0042]
The scalar multiplication calculator 115 calculates the x-coordinate of Q, the value of the y-coordinate, and the scalar multiple (xd1, yd1) = kQ, x-coordinate of public key aQ, y-coordinate value, scalar multiple (xd2, yd2) = k (aQ) and sends the calculated scalar multiple to the encryption processing unit 112 (207 in FIG. 2).
[0043]
The encryption processing unit 112 performs encryption processing using the sent scalar multiple. For example, for the Weierstrass elliptic curve, PmCalculate + k (aQ) and kQ. That is,
xe1= ((yd1-y1) / (xd1-x1))2-x1-xd1, (Equation 8)
xe2= xd2                              (Formula 9)
Calculate the encrypted message xe1, xe2Get.
[0044]
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).
[0045]
The computer A101 outputs the encrypted output message as data 141 from the input / output interface 110, and transfers it to the computer B121 via the network 142.
[0046]
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 transmitted to the scalar calculation unit 115.
[0047]
Next, the operation when the computer B 121 decrypts the encrypted message 141 will be described with reference to FIG.
[0048]
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. When 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.
[0049]
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.
[0050]
The encrypted message is xe1, xe2For a Weierstrass-type elliptic curve, the y-coordinate value (ye1)
ye1 2= xe1 Three+ Axe1+ B (Formula 10)
(However, A and B are constants)
Can be obtained from
[0051]
The decryption processing unit 132 (205 in FIG. 2) read from the secret information 125 stored in the storage unit 122 (102 in FIG. 2) and the values of the x and y coordinates (xe1, ye1) Is sent to the scalar multiplication unit 135 (115 in FIG. 2) (206 in FIG. 2).
[0052]
The scalar multiplication unit 135 calculates the scalar multiple (xd3, yd3) = a (xe2, ye2). The scalar multiplication calculation unit 135 sends the calculated scalar multiples to the decoding processing unit 132 (207 in FIG. 2). The decoding processing unit 132 performs a decoding process using the sent scalar multiple.
[0053]
For example, if the encrypted message is xe1, xe2In the case of a Weierstrass-type elliptic curve,
(Pm+ K (aQ))-a (kQ) = (xe1, ye1)-(xd3, yd3)
This is achieved by calculating That is,
xf1= ((ye1+ Yd3) / (xe1-xd3))2-xe1-xd3        (Formula 11)
Calculate the partial message x before being encrypted1X corresponding tof1Get.
[0054]
The computer B 121 assembles a plaintext 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.
[0055]
Next, the process of the scalar multiplication unit 135 when the computer B121 performs the decoding process will be described in detail.
[0056]
In the first embodiment, the functional block of the scalar multiplication calculator shown in FIG. 3 is used. The scalar multiplication calculation unit 115 (135 in FIG. 1) includes an encoding unit 302, a previous calculation unit 303, and an actual calculation unit 304. The encoding unit 302 includes a residue acquisition unit 321, an index set generation unit 322, a residue selection unit 323, a repetition determination unit 324, and a storage unit 325. The pre-calculation unit 303 includes an addition unit 331, a doubling unit 332, and a repetition determination unit 333. 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.
[0057]
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.
[0058]
When the scalar multiplication calculation unit 115 receives the scalar value d and the point P on the elliptic curve from the decoding processing unit 132, the encoding unit 302 converts the input scalar value d into a numerical sequence d.wEncode to [j]. That is,
d = dw[n + w0-1] 2n + w0-1+ Dw[n + w0-2] 2n + w0-2+ ... + dw[j] 2j+ ... + dw[0]
(Formula 12)
-2w0-1≦ dw[j] ≦ 2w0-1 or dw[j] ∈B (Formula 13)
DwConvert the scalar value d to [j]. Here, n is the bit length when the scalar value d is expressed in binary, and w is a predetermined small positive rational number called the window width. w0Is a positive integer and w0= ceil (w) is satisfied. However, ceil (w) represents the smallest integer greater than or equal to w. B is a randomly selected index set,
B = {± b1, ± b2, ..., ± bm}. However, m different b1, b2, ..., bmIs
{2w0-1+1,2w0-1+3, ..., 2w0-1}.
Where m = w12w0-2, w1= w- (w0-1). If priority is given to calculation time, set w to a large value. Set w to a small value to reduce memory usage. The window width w is determined so that m is an integer. Positive integer w0Is fixed and the window width w is moved, the integer m is 0 to 2w0-2Can take values up to.
[0059]
The pre-calculation unit 303 creates a pre-calculation table from the input point P on the elliptic curve using the index set B. The pre-calculation table is P, 3P, ..., (2w0-1-1) P and bjIt is composed of P, j = 1, ..., m.
[0060]
The actual calculation unit 304 calculates a scalar multiple dP from the encoded scalar value and the point P on the elliptic curve using the pre-calculation table.
[0061]
Next, each process performed by the encoding unit 302, the previous calculation unit 303, and the actual calculation unit 304 will be described in detail.
[0062]
First, a method in which the encoding unit 302 encodes the scalar value d will be described with reference to FIG.
[0063]
Substitute the scalar value d for the variable d '. w0Ceil (w), w1W- (w0-1) is assigned (401).
[0064]
The index set generation unit 322 sets m = w12w0-2And m different
b1, b2, ..., bm{2w0-1+1,2w0-1+3, ..., 2w0-1} at random, and index set B is B = {± b1, ± b2, ..., ± bm}. Numerical value P indicating probabilitywTo w1Is assigned (402).
[0065]
The initial value 0 is assigned to the variable r, and the initial value 0 is assigned to the variable i (403).
[0066]
The repetition determination unit 324 determines whether the variable d ′ is greater than 1.
[0067]
If d 'is greater than 1, go to step 411. If it is less than 1, go to step 431 (404).
[0068]
If d 'is greater than 1 in step 404,
The remainder acquisition unit 321 calculates the scalar value d ′ to 2w0 + 12 from the remainder byw0X [i] after subtracting 2 from the scalar value d 'w02 from the remainder byw0-1Each value obtained by subtracting is stored in y [i] (411).
[0069]
The remainder selection unit 323 determines | x [i] | <2w0-1It is determined whether or not. Here, | x [i] | represents the absolute value of x [i]. | x [i] | <2w0-1If so, go to Step 413. | x [i] | ≧ 2w0-1If so, go to Step 421 (412).
[0070]
In step 412 | x [i] | <2w0-1 in the case of,
The remainder selection unit 323 has a probability PwAt riTo w0And u [i] store x [i] respectively, and the probability 1-PwAt riTo w0−1 and y [i] are stored in u [i], respectively, and the process goes to Step 414 (413).
[0071]
In step 412 | x [i] | ≧ 2w0-1in the case of,
The remainder selection unit 323 determines whether x [i] belongs to the set B. If x [i] belongs to B, go to step 422. If x [i] does not belong to B, go to step 423 (421).
[0072]
If x [i] belongs to B in step 421,
The remainder selection unit 323 is riTo w0, X [i] is stored in u [i], and the process goes to step 414 (422).
[0073]
If x [i] does not belong to B in step 421,
The remainder selection unit 323 is riTo w0-1 and u [i] are stored in y [i], respectively, and the process goes to Step 414 (423).
[0074]
The remainder acquisition unit 321 calculates (d'-u [i]) / 2riAnd set it as a new d ′ (414).
[0075]
The storage unit 325 is dw[r + ri-1], dw[r + ri-2], ..., dw[r] stores 0, 0,..., 0, u [i], respectively (415).
[0076]
Variable r to riThe variable i is incremented by 1, and the variable i is incremented by 1. The process returns to step 404 (416).
[0077]
If d 'is 1 or less in step 404,
The storage unit 325 is dw[n + w0-1], ..., dw[r + 1], dw[r] stores 0,..., 0, 1 respectively (431).
[0078]
The encoding unit 302 is dw[n + w0-1], ..., dw[0] and B are output to the actual calculation unit 304 (432).
[0079]
Next, a method in which the pre-calculation unit 303 creates a pre-calculation table using the index set B from points on the elliptic curve will be described with reference to FIG.
[0080]
The point P is doubled by ECDBL, and the result is stored in 2P (501).
[0081]
The initial value 1 is assigned to the variable j (502).
[0082]
The repeat determination unit 333 causes j to be 2w0-1Determine if less than. j is 2w0-1If smaller, go to step 504. j is 2w0-1In the above case, go to Step 511 (503).
[0083]
J is 2 in step 503w0-1If less than
The points jP and 2P are added by ECADD, and the result is stored in (j + 2) P (504).
[0084]
The variable j is incremented by 2, and the process returns to step 503 (505).
[0085]
J is 2 in step 503w0-1If this is the case,
Dot (2w0-1-1) Add P and point P by ECADD, and add 2w0-1Store in P (511).
[0086]
Assign 1 to variable j (512).
[0087]
The iterative determination unit 333 determines whether j is less than or equal to m. If j is less than or equal to m, go to step 514. If j is greater than m, go to step 521 (513).
[0088]
If j is less than or equal to m in step 513,
Point 2w0-1P and dot (bj-2w0-1) P is added by ECADD and the result is bjStore in P (514).
[0089]
The variable j is incremented by 1, and the process returns to step 513 (515).
[0090]
If j is greater than m in step 513,
P, 3P, ..., (2w0-1-1) P and bjP, j = 1,..., M are output as a pre-calculation table (521).
[0091]
However, 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. There are calculation formulas in projective coordinates and Jacobian coordinates in addition to using Equations 1, 2 and Equations 4 and 5 for addition and doubling calculations.
Non-Patent Document 3: Cohen, H., Miyaji, A., Ono, T., Efficient Elliptic Curve Exponentiation Using Mixed Coordinates, Advances in Cryptology-ASIACRYPT 1998, LNCS 1514, Springer-Verlag, (1998), pp.51- 65.
It is described in.
[0092]
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. for that reason,
Point P, 3P, ..., (2w0-1-1) P and bjOnly P, j = 1, ..., m are stored as a pre-calculation table. Necessary for subsequent calculations performed by the actual calculation unit 304
Dots -P, -3P, ...,-(2w0-1-1) P and -bjP, j = 1,..., M may be derived from them, and need not be stored in the pre-calculation table.
[0093]
Note that the points -P, -3P, ...,-(2w-1) P and -bjIn order to omit the derivation of P, j = 1,..., M, only the y-coordinate values of those points may be stored in the pre-calculation table.
[0094]
The pre-calculation table creation process performed by the pre-calculation unit 303 is as follows.
Point P, 3P, ..., (2w0-1-1) P and bjP, j = 1,..., M may be calculated. Therefore, the speed may be increased by using the Montgomery trick to share the calculation of the inverse element calculation required for the elliptic curve calculation.
[0095]
Montgomery tricks to share inverse operations
Non-Patent Document 4: Cohen, H., A course in computational algebraic number theory, GTM138, Springer-Verlag, (1993).
Page 481.
[0096]
Further, when the point P is a fixed point, in the creation process of the pre-calculation table performed by the pre-calculation unit 303,
Point P, 3P, ..., (2w0-1-1) The calculation of P, that is, the processing from step 501 to step 511 may be performed only once. because,
Point P, 3P, ..., (2w0-1-1) P does not depend on the index set B. Therefore, once
Point P, 3P, ..., (2w0-1-1) If P is calculated, the subsequent scalar multiplication is
Point P, 3P, ..., (2w0-1-1) It is not necessary to recalculate P, and only the part depending on the index set B needs to be recalculated.
[0097]
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.
[0098]
Initial value n + w for variable c0Substitute -1 (601).
[0099]
dwDetermine whether [c] is 0 or 0.
[0100]
dwIf [c] is 0, go to Step 603. If not 0, go to step 611 (602).
[0101]
The variable c is decreased by 1, and the process returns to step 602 (603).
[0102]
D in step 602wIf [c] is not 0, d at point Qw[c] Substitute P (611).
[0103]
The initial value c-1 is assigned to the variable j (612).
[0104]
Determine if j is less than 0. If j is smaller than 0, go to Step 621. If it is greater than 0, go to step 614 (613).
[0105]
The point Q is doubled by ECDBL and stored again at the point Q (614).
[0106]
dwDetermine whether [j] is 0 or not 0.
[0107]
dwIf [j] is 0, go to Step 617. If not 0, go to step 616 (615).
[0108]
D in step 615wIf [j] is not 0,
Points Q and dw[j] P and ECADD are added. Where dwIf [j] is negative (-dw[j]) Addition is performed using the inverted y coordinate of P. The result is stored at point Q and the process goes to step 617 (616).
DwIf [j] is not 0, dw[j] is an odd number that satisfies Equation 13. Therefore, dw[j] P or (-dw[j]) P is always present in the previous calculation table.
[0109]
The variable j is decreased by 1, and the process returns to step 613 (617).
[0110]
If j is smaller than 0 in step 613, a point Q is output (621).
[0111]
D output by processing performed by the encoding unit 302w[j] satisfies Equations 12 and 13. The reason is as follows.
In the loop from step 404 to step 416, the value of d 'for the i-th time is set to d' [i]. That is, in step 414
d '[i + 1] = (d' [i] -u [i]) / 2ri        (Formula 14)
Is calculated. In the 0th loop
d = d '[0] (Formula 15)
It becomes. In the first loop
d = d '[1] 2r0+ U [0] (Formula 16)
It becomes. Similarly, in the i-th loop,
d = (... (d '[i] 2ri+ U [i]) 2ri-1+ ... + u [1]) 2r0+ U [0] (Formula 48)
It becomes. The calculation in step 414 is d '[i] <2ri + 1When,
d '-((d'mod 2ri + 1) -2ri) = 2ri        (Formula 17)
Therefore, d ′ [i + 1] = 1. In step 415, dwIf we note that 0 is assigned in addition to [r], we can see that d satisfies Equation 12.
Y [i] calculated in step 411 is
-2w0-1≦ y [i] ≦ 2w0-1                (Formula 18)
It is easy to see that
x [i]
-2w0-1≦ x [i] ≦ 2w0-1                (Formula 19)
If it is in the range, there is no problem.
If x [i] is outside the range of Expression 19, the process proceeds to Step 421 based on the determination result of Step 412. In step 421, when x [i] εB, the process goes to step 422 and x [i] is selected. That is,
x [i] ∈B (Equation 20)
Meet. u [i] is assigned either x [i] or y [i], and d other than 0w[r] is assigned u [i].
Therefore, Equation 13 is satisfied.
[0112]
U [i] calculated in the process performed by the encoding unit 302 is all odd except for i = 0. The reason is as follows. In step 411, if d ′ [i] is an odd number, x [i], y [i] are an odd number. Therefore, when d ′ [i] is an odd number, u [i] is an odd number. On the other hand, in step 414, d '[i + 1] = (d' [i] -u [i]) / 2riIs calculated.
d '[i]-((d' [i] mod 2ri + 1) -2rimod 2ri + 1 = 2ri     (Formula 21)
Therefore, d ′ [i + 1] is an odd number. Therefore, except for i = 0, u [i] are all odd numbers.
[0113]
In order to make u [0] odd, the scalar value d may be an odd number. For this purpose, when the input scalar value d is an even number, d + 1 is re-encoded as the scalar value d ′. That is, d is converted to an odd number. Then, a scalar multiple d′ P is calculated.
d'P = (d + 1) P = dP + P (Formula 22)
Therefore, the point P is subtracted from d′ P and the value is output as the scalar multiple dP.
[0114]
When the input d is an odd number, d + 2 is encoded again as a scalar value d ′,
d'P = (d + 2) P = dP + 2P (Formula 23)
The scalar multiple dP may be obtained using In this case, there is an advantage that the processing to be performed is the same regardless of whether d is an odd number or an even number.
[0115]
The point Q output from the actual calculation unit 304 is equal to the scalar multiple dP. The reason is as follows.
[0116]
In step 613, point Q is
(dw[c] 2c- (j + 1)+ Dw[c-1] 2(c-1)-(j + 1)+ ... + dw[j + 1] 2(j + 1)-(j + 1)) P
(Formula 24)
It is assumed that At this time, the point Q also indicates that the expression 24 is satisfied when the next step 613 is reached.
[0117]
Point Q is doubled at step 614 and dwIf [j] is not 0, d in step 616w[j] P is added. So immediately after step 616, the value of point Q is
(dw[c] 2cj+ Dw[c-1] 2(c-1) -j+ ... + dw[j + 1] 2(j + 1) -j+ Dw[j] 2jj) P
(Formula 25)
It becomes. Therefore dwThe point Q satisfies Equation 25 just before step 617, including when [j] = 0. Since j is decreased by 1 in step 617, substituting j + 1 for j in equation 25 yields equation 24. That is, the next time when the step 613 is reached, the point Q satisfies the equation 24.
[0118]
d for j> cwSince the value of [j] is 0, the value of point Q output in step 621 is
(dw[n] 2n+ Dw[n-1] 2n-1+ ... + dw[0]) P (Formula 26)
be equivalent to. The scalar value input to the actual calculation unit 304 is d encoded by the encoding unit 302.w[j] so that dw[j] satisfies Equation 12. Therefore, Q = dP.
[0119]
The memory usage in the scalar multiplication is determined by the size of the pre-calculation table of the pre-calculation unit 303. In the above scalar multiplication method, the pre-calculation table is
P, 3P, ..., (2w0-1-1) P and bjIt consists of P, j = 1, ..., m. That is, the number of points to store is (2w0-2+ M). Positive integer w0Is fixed and the window width w is moved, the integer m is 0 to 2w0-2Can take values up to. Therefore, the number of points to be stored can be set to an arbitrary value by appropriately selecting the window width w. On the other hand, in the method of Non-Patent Document 2, the number of points to be stored in the pre-calculation table can only be selected as 1, 2, 4, 8,. Therefore, the scalar multiplication calculation method has a wider selection range of the number of points stored in the previous calculation table than the method of Non-Patent Document 2, and the processing speed and memory usage can be customized.
[0120]
The scalar multiplication method is also effective for a defense method against side channel attacks. The reason is as follows.
[0121]
The encoding unit 302 converts the scalar value d into a numeric string d.wEncoded to [j]. This numeric column dw[j] is the pattern
| 0 ... 0x | 0 ... 0x | ... | 0 ... 0x | (Equation 27)
It has. Here, each x is a non-zero value and corresponds to u [i]. Where 0 ... 0 is riPieces, ie w0-1 or w0-Two consecutive. When the real calculation unit 304 calculates a scalar multiple, in the iterative processing of steps 613-617, the elliptic curve operation corresponding to the block of | 0 ... 0x | is | D ... DA |, that is, w0Times or w0-1 after D However, D represents ECDBL, and A represents ECADD. RiIs the probability PwIn w0And probability 1-PwIn w0+1.
Because | x [i] | <2w0-1In step 413, the probability PwAt ri= w0, Probability 1-PwAt ri= w0+1.
| X [i] | ≧ 2w0-1Then the probability that x [i] ∈B is
(Number of elements in B) / (2w0-1≦ | k | <2w0(Number of odd-numbered k)1So PwIt becomes. in this case,
r when x [i] ∈Bi= w0Otherwise, ri= w0-1. Therefore, in either case, riIs the probability PwIn w0And probability 1-PwIn w0-1. Probability PwIs public information1Rely on only, not on confidential information. As a result, for all scalar values, the elliptic curve operation to perform is
| D ... DA | D ... DA | ... | D ... DA | (Equation 28)
And the number of consecutive D's is riBut this value is public information w1It depends only on, and not on confidential information. In particular, information relating to the scalar value d cannot be derived from only the expression 28.
[0122]
Note that the scalar multiplication calculation may be performed using the randomized projection coordinates of Non-Patent Document 1. Then, even if the same point P is input, it is converted into a different value every time execution is performed, and the scalar multiplication is performed, so that the attacker cannot predict the intermediate value.
[0123]
Alternatively, each time a point stored in the precalculation table is read, it may be randomized again and written to the precalculation table. In this case, since the same data is not reused, the resistance to side channel attacks is further increased.
[0124]
Further, the pre-calculation table referred to during the calculation may be recreated once or more during one scalar multiplication calculation. By doing so, the values quoted from the table will be changed more frequently, further increasing resistance to side channel attacks.
[0125]
Further, the same pre-calculation table may be reused in any number of scalar multiplication calculations. By doing so, the time required for the process for creating the pre-calculation table can be reduced, so that the calculation time can be shortened.
[0126]
In addition, for each scalar multiplication, the size of the pre-calculation table may be changed according to the situation such as the required calculation speed and the priority of other applications used at the same time.
[0127]
More specifically, the available work area may be examined, a pre-calculation table size corresponding to the work area may be selected, and the scalar multiplication may be calculated. By doing so, customization according to an individual situation can be performed more delicately.
[0128]
Alternatively, in order to preferentially allocate a work area to processing of modules other than scalar multiplication, the size of the pre-calculation table may be reduced to perform scalar multiplication calculation.
[0129]
Alternatively, in order to perform the scalar multiplication at high speed, the size of the pre-calculation table may be increased and the scalar multiplication may be performed.
[0130]
As described above, the above calculation method does not give useful information for the side channel attack, and is resistant to the side channel attack. In addition, since the selection range of the number of points to be stored in the pre-calculation table is wide, the processing speed and memory usage can be customized.
[0131]
In the first 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) A curve or a Montgomery-type elliptic curve may be used. About OEF
Non-Patent Document 5: D.V.Bailey, C. Paar, Optimal Extension Fields for Fast Arithmetic in Public-Key Algorithms, Advances in Cryptology Crypto '98, LNCS 1462, (1998), 472-485.
It is described in.
[0132]
In the second embodiment, the functional block of the scalar multiplication calculator shown in FIG. 7 is used. The scalar multiplication calculation unit 115 (135 in FIG. 1) includes a pre-calculation unit 703 and an actual calculation unit 704. The pre-calculation unit 703 includes an addition unit 331, a doubling unit 332, a repetition determination unit 333, and an index set generation unit 734. The actual calculation unit 304 includes an addition unit 342, a doubling unit 343, a repetition determination unit 344, a scalar value expression conversion unit 745, and a window width selection unit 746.
[0133]
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. The second calculation method is characterized in that a scalar multiple is calculated without encoding the scalar value d into a numerical string.
[0134]
When the scalar multiplication calculation unit 115 receives the scalar value d and the point P on the elliptic curve from the decoding processing unit 132, the pre-calculation unit 703 generates an index set B, and the input point P and index on the elliptic curve Create a pre-calculation table using set B. The pre-calculation table is
P, 3P, ..., (2w0-1-1) P and bjIt is the same as the first calculation method that P, j = 1,. Index set B is
B = {± b1, ± b2, ..., ± bm} And m different b1, b2, ..., bmIs
{2w0-1+1,2w0-1+3, ..., 2w0-1} is selected in the same manner as in the first calculation method.
[0135]
The actual calculation unit 304 calculates a scalar multiple dP from the input scalar value d and the point P on the elliptic curve using the index set and the pre-calculation table.
[0136]
Next, each process performed by the pre-calculation unit 703 and the actual calculation unit 704 will be described in detail.
[0137]
First, a method in which the pre-calculation unit 703 creates a pre-calculation table and an index set B from points on an elliptic curve will be described using FIG.
[0138]
The point P is doubled by ECDBL, and the result is stored in 2P (801).
[0139]
The initial value 1 is assigned to the variable j (802).
[0140]
J is 2 by the repeat determination unit 733w0-1Determine if less than. j is 2w0-1If it is smaller, go to Step 804. j is 2w0-1In the above case, go to Step 811 (803).
[0141]
J is 2 in step 803w0-1If less than
The points jP and 2P are added by ECADD, and the result is stored in (j + 2) P (804).
[0142]
The variable j is incremented by 2 and the process returns to step 803 (805).
[0143]
J is 2 in step 803w0-1If this is the case,
Dot (2w0-1-1) Add P and point P by ECADD, and add 2w0-1Store in P (811).
[0144]
An empty set is assigned as an initial value to index set B, and 1 is assigned to variable j (812).
[0145]
The repeat determination unit 733 determines whether j is less than or equal to m. If j is less than or equal to m, go to step 814. If j is greater than m, go to step 821 (813).
[0146]
If j is less than or equal to m in step 813,
The index set generation unit 734 uses {2w0-1+1,2w0-1+3, ..., 2w0-1} than the range bjIs randomly selected (814).
[0147]
By the index set generation unit 734, bjIs already included as an element of B. BjIf is included as an element of B, return to step 814, bjIf is not included as an element of B, go to step 816 (815).
[0148]
Point 2w0-1P and dot (bj-2w0-1) P is added by ECADD and the result is bjStore in P (816).
[0149]
The index set generation unit 734 sets the index set B to bjIs added as an element (817).
[0150]
The variable j is incremented by 1, and the process returns to Step 813 (818).
[0151]
If j is greater than m in step 813,
P, 3P, ..., (2w0-1-1) P and bjP, j = 1, ..., m are output as a pre-calculation table. The index set B is output (821).
[0152]
Also, the points P, 3P, ..., (2w-1) Store only P as pre-calculation table,
Dots -P, -3P, ...,-(2w-1) As in the first calculation method, it is not necessary to store P in the previous calculation table.
[0153]
Note that the points -P, -3P, ...,-(2w-1) P and -bjSimilarly to the first calculation method, in order to omit the derivation of P, j = 1, ..., m, only the y-coordinate values of those points may be stored in the pre-calculation table. .
[0154]
When the point P is a fixed point, in the process of creating the pre-calculation table performed by the pre-calculation unit 303,
Point P, 3P, ..., (2w0-1-1) Similar to the first calculation method, the calculation of P, that is, the processing from step 801 to step 811 only needs to be performed once.
[0155]
The pre-calculation table creation process performed by the pre-calculation unit 703 is as follows.
Point P, 3P, ..., (2w-1) P may be calculated. Therefore, as in the first calculation method, the speed can be increased by using Montgomery trick to share the calculation of the inverse element calculation necessary for the elliptic curve calculation.
[0156]
Next, using Fig. 9 and Fig. 10, the actual calculation unit 704 calculates the scalar multiple in the elliptic curve from the scalar value d and the point P on the elliptic curve using the index set B and the previous calculation table. How to do it.
[0157]
The point at infinity is assigned to the point Q (901).
[0158]
The scalar value expression conversion unit 745 converts the scalar value d into d ~ expressed by 1, -1 (902). That is, d ~ is equal to d as an integer, and
d ~ = dn-1~ 2n-1+ Dn-2~ 2n-2+ ... + d0~, di~ = 1 or -1 (Formula 29)
It is expressed. To achieve this transformation, the scalar value d is
d = dn-12n-1+ Dn-22n-2+ ... + d0, di= 0 or 1 (Equation 30)
When
dn-1~ = 1 (Formula 31)
di~ = 1 if di + 1 = 1 for i = 0, ..., n-2 (Formula 32)
di~ = -1 if di + 1 = 0 for i = 0, ..., n-2 (Formula 33)
When converted by the following equation 29 is satisfied. Note that d can be converted only when d is an odd number.
[0159]
An initial value n is substituted for variable i (903).
[0160]
The repeat determination unit 733 determines that i is w0Determine if greater than -1. i is w0If it is larger than -1, go to step 911. w0If it is less than -1, go to Step 1001 (904).
[0161]
I in step 9040If greater than -1,
The window width selector 746 sets the integer MSB to the variable x.w0(d ~) is stored (911). However, MSBw0(d ~) is the top w of d ~0Represents a numeric value composed of bits.
[0162]
The window width selection unit 746 stores 1 in b when the value of the variable x is included as an element of the index set B. Otherwise, 0 is stored in b (912).
[0163]
The window width selection unit 746 has a probability PwStores 1 in p with probability 1-PwThen p is stored (913).
[0164]
The window width selection unit 746 sets the variable u to
1- | MSB2(d ~) / 2 | is stored (914).
[0165]
The window width selection unit 746 sets the variable r to
w0−1 + ((u∧p) ∨ ((1-u) ∧b)) is substituted (915).
[0166]
Substitute 1 for variable j (916).
[0167]
The point Q is doubled by ECDBL and stored again at the point Q (917).
[0168]
The repetition determination unit 733 determines whether j is greater than or equal to r. If j is greater than or equal to r, go to step 921. If it is smaller than r, go to step 919 (918).
[0169]
If j is greater than or equal to r in step 918, the variable j is incremented by 1, and the process returns to step 917 (919).
[0170]
If j is less than r in step 918, point Q and MSBr(d ~) P and ECADD are added. However, MSBrIf (d ~) is negative (-MSBr(d ~)) Addition is performed using the inverted y coordinate of P. The result is stored at point Q. (921).
[0171]
The variable i is decreased by r, and the process returns to step 904 (922).
[0172]
I in step 9040-1 or less,
The repetition determination unit 733 determines whether i is 0 or less. If i is 0 or less, go to Step 1007. If i is larger than 0, go to step 1002 (1001).
[0173]
If i is greater than 0 in step 1001,
Assign 1 to variable j (1002).
[0174]
The point Q is doubled by ECDBL and stored again at the point Q (1003).
[0175]
The repetition determination unit 733 determines whether j is i or more. If j is greater than or equal to i, go to step 1006. If it is smaller than i, go to Step 1005 (1005).
[0176]
If j is less than i in step 1004,
The variable j is incremented by 1, and the process returns to step 1003 (1005).
[0177]
If j is greater than or equal to i in step 1004, the points Q and d to P are added by ECADD. However, when d˜ is negative, addition is performed using the inverted y coordinate of (−d˜) P. The result is stored at point Q. (1006).
[0178]
The point Q is output (1007).
[0179]
The scalar multiple output by the processing performed by the actual calculation unit 704 matches dP. The reason is as follows.
In the loop from step 904 to step 922, the value of r in the k-th loop is set to rkfar.
In step 901, the point at infinity is assigned to the point Q on the elliptic curve.
After the end of the first loop
Q = r1P (Formula 34)
It becomes. After the end of the second loop
Q = (r12r2+ R2) P (Formula 35)
It becomes. Similarly, after the kth loop is completed,
Q = ((... (r12r2+ R2) 2r3+ ... + rk-1) 2rk+ Rk) P (Formula 36)
It becomes. If it is noted that the processing from step 1002 to step 1006 is the same, it can be seen that the point Q in step 1007 satisfies Q = d˜P. Since d = d˜ as a numerical value, Q = dP.
[0180]
Point MSB used in ellipse addition in step 921 of the actual calculation unit 704rFor (d ~) P, MSBr(d ~) P or (-MSBr(d ~)) P is always present in the previous calculation table. The reason is as follows. First,
MSBr(d ~) mod 2 = 1, MSBr(d ~) is an odd number. In step 915, set variable r to w0-1, w0One of the values is substituted. r = w0If -1, the pre-calculation table is
P, 3P, ..., (2w0-1-1) MSB because it contains Pr(d ~) P or (-MSBr(d ~)) P is always present in the previous calculation table. Then r = w0Consider the case. r = w0To be (u∧p) = 1, or
((1-u) ∧b) = 1. When (u∧p) = 1, since u = 1, the sign of the most significant bit of d˜ and the sign of the second most significant bit are different. for that reason
-2w0-1≦ MSBw0(d ~) ≦ 2w0-1              (Formula 37)
MSBr(d ~) P or (-MSBrAny of (d ~)) P exists in the previous calculation table.
((1-u) ∧b) = 1, b = 1, so MSBw0(d ~) is an element of the index set B. Therefore, MSBr(d ~) P or (-MSBrAny of (d ~)) P exists in the previous calculation table. As a result, in either case, the MSBr(d ~) P or (-MSBr(d ~)) P is always present in the previous calculation table.
[0181]
In order to convert d to d˜, the scalar value d needs to be an odd number. For this purpose, when the input scalar value d is an even number, d + 1 is re-encoded as the scalar value d ′. That is, d is converted to an odd number. Then, a scalar multiple d′ P is calculated.
d'P = (d + 1) P = dP + P (Formula 38)
Therefore, the point P is subtracted from d′ P and the value is output as the scalar multiple dP.
[0182]
When the input d is an odd number, d + 2 is encoded again as a scalar value d ′,
d'P = (d + 2) P = dP + 2P (Formula 39)
The scalar multiple dP may be obtained using In this case, there is an advantage that the processing to be performed is the same regardless of whether d is an odd number or an even number.
[0183]
The memory usage in the scalar multiplication is determined by the size of the pre-calculation table of the pre-calculation unit 703. In the above scalar multiplication method, the pre-calculation table is
P, 3P, ..., (2w0-1-1) P and bjP, j = 1, ..., m, and the number of points to store is (2w0-2+ M). Positive integer w0Is fixed and the window width w is moved, the integer m is 0 to 2w0-2Can take values up to. Therefore, the number of points to be stored can be set to an arbitrary value by appropriately selecting the window width w. On the other hand, in the conventional method disclosed in Non-Patent Document 2, the number of points to be stored in the pre-calculation table can only be selected as 1, 2, 4, 8,. Therefore, the scalar multiplication calculation method has a wider selection range of the number of points stored in the previous calculation table than the method of Non-Patent Document 2, and can be customized in consideration of high-speed processing performance and memory capacity.
[0184]
The scalar multiplication method is also effective for a defense method against side channel attacks. The reason is as follows.
[0185]
When the actual calculation unit 704 calculates a scalar multiple, the elliptic curve calculation executed in the repetitive processing of steps 904-921 is | D... DA | per loop. Ie w0Times or w0-1 after D However, D represents ECDBL, and A represents ECADD. R is the probability PwIn w0And probability 1-PwIn w0+1.
[0186]
For this reason, first consider the case of u = 1. The variable p is a probability P in step 913.wP = 1, probability 1-PwP = 0 is assigned. Therefore, the probability PwAt r = w0, Probability 1-PwAt r = w0-1.
[0187]
Next, consider the case of u = 0. The variable b is assigned b = 1 when x is an element of B in the step and b = 0 when x is not an element of B.
| x | ≧ 2w0-1Then the probability of x∈B is
(Number of elements in B) / (2w0-1≦ | k | <2w0(Number of odd-numbered k)1So PwIt becomes. Variable u in step 914
u = 1- | MSB2(d ~) / 2 | is assigned. That is, u = 0 is | x | ≧ 2w0-1Is equivalent to Therefore, if u = 0, the probability PwAt r = w0, Probability 1-PwAt r = w0-1.
[0188]
Thus, in any case, r is the probability PwIn w0And probability 1-PwIn w0-1. Probability PwIs public information1Rely on only, not on confidential information. As a result, for all scalar values, the elliptic curve operation to perform is
| D ... DA | D ... DA | ... | D ... DA | (Equation 40)
And the number of consecutive D's is w0Or w0-1, but which value is selected is public information w1It depends only on, and not on confidential information. In particular, information relating to the scalar value d cannot be extracted from the expression 35 alone.
[0189]
Note that, in the second calculation method, similarly to the first calculation method, the scalar multiplication calculation may be performed using the randomized projection coordinates of Non-Patent Document 1 together. Then, even if the same point P is input, it is converted into a different value every time execution is performed, and the scalar multiplication is performed, so that the attacker cannot predict the intermediate value.
[0190]
Similarly to the first calculation method, each time a point stored in the previous calculation table is read, it may be randomized again and written to the previous calculation table. In this case, since the same data is not reused, the resistance to side channel attacks is further increased.
[0191]
As described above, the second calculation method is resistant to side channel attacks because it does not provide useful information for side channel attacks. In addition, since the selection range of the number of points to be stored in the pre-calculation table is wide, the processing speed and memory usage can be customized.
[0192]
In the second 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) A curve or a Montgomery-type elliptic curve may be used. OEF is described in Non-Patent Document 5.
[0193]
The operation of the scalar multiplication calculation unit 135 when the computer B121 decrypts the encrypted data 141 has been described above, but the same applies to the case where the computer A101 encrypts the input message.
[0194]
In that case, the scalar multiplication calculation unit 115 of the computer A101 outputs the already-explained point Q on the elliptic curve, the scalar multiplication point kQ by the random number k, and the scalar multiplication point k (aQ) by the public key aQ and the random number k. To do. At this time, the scalar value d described in the above calculation method is a random number k, the point P on the elliptic curve is the point Q on the elliptic curve, and the same processing is performed to obtain the respective scalar multiples. Can do.
[0195]
Next, an embodiment in which the present invention is applied to a signature verification system will be described with reference to FIG. 11 and FIG.
[0196]
The signature verification system in FIG. 11 includes a smart card 1101 and a computer 1121 that performs signature verification processing.
[0197]
The smart card 1101 has a configuration similar to that of the computer A101 of FIG. 1, and an arithmetic device such as the CPU 113 and the coprocessor 114 executes a program stored in the storage unit 102, thereby not the data processing unit 112, A signature generation processing unit 1112 is realized. However, the external storage device 107, the display 108, and the keyboard 109 shown in FIG.
[0198]
The computer 1121 has the same configuration as the computer A101, and the signature verification processing unit 1132 is realized instead of the data processing unit 112 when the CPU 113 executes the program.
[0199]
The scalar multiplication calculators 1115 and 1135 have the same functions as the scalar multiplication calculator 115 or 135 shown in FIG.
[0200]
In the present embodiment, each program in the computer 1121 may be stored in advance in a storage unit in the computer, or may be stored in another device via a medium that can be used by the computer 1121 when necessary. To the storage unit.
[0201]
Furthermore, each program in the smart card 1101 may be stored in advance in the storage unit in the smart card 1101, or when necessary, a computer connected via the input / output interface or used by the computer. The storage unit may be introduced via a possible medium.
[0202]
The medium refers to, for example, a storage medium removable from the computer or a communication medium (that is, a network or a carrier wave propagating through the network).
[0203]
A signature creation and signature verification operation in the signature verification system of FIG. 11 will be described with reference to FIG.
[0204]
The computer 1121 transfers the randomly selected numerical value as the challenge code 1143 to the smart card 1101 via the interface 1142.
[0205]
The signature generation processing unit 1112 (112 in FIG. 2) receives the challenge code 1143, takes a hash value of the challenge code 1143, and converts it into a numerical value f having a predetermined bit length.
[0206]
The signature generation processing unit 1112 generates a random number u, and reads out from the constant 1104 stored in the storage unit 1102 (102 in FIG. 2) (205 in FIG. 2) together with the fixed point Q on the elliptic curve, the scalar multiplication calculation unit 1115 (115 in FIG. 2) (206 in FIG. 2).
[0207]
The scalar multiplication calculator 1115 is a scalar multiple (xu, yu) And sends the calculated scalar multiple to the signature generation processing unit 1112 (207 in FIG. 2).
[0208]
The signature generation processing unit 1112 generates a signature using the sent scalar multiple. For example, if it is an ECDSA signature,
s = xu mod q (Formula 41)
t = u-1(f + ds) mod q (Formula 42)
To obtain a signature (s, t) corresponding to the challenge code 1143 (208 in FIG. 2).
[0209]
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.
[0210]
For ECDSA signatures, for example:
Non-Patent Document 6: ANSI X9.62 Public Key Cryptography for the Financial Services Industry, The Elliptic Curve Digital Signature Algorithm (ECDSA), (1998)
It is described in.
[0211]
The smart card 1101 outputs the signature 1141 created by the signature generation processing unit 1112 from the input / output interface 1110 and transfers it to the computer 1121 via the interface 1142.
[0212]
When the signature 1141 is input (204 in FIG. 2), the signature verification processing unit 1132 (112 in FIG. 2) of the computer 1121 has the numerical values s and t of the signature 1141 within an appropriate range, that is, 1 ≦ s, t <q Find out if it is.
[0213]
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 1143, and the smart card 1101 is rejected. If the numerical values s and t are within the above range, the signature verification processing unit 1132
h = t-1 mod q (Formula 43)
h1 = fh mod q (Formula 44)
h2 = sh mod q (Formula 45)
Calculate Then, the public key aQ and fixed point Q calculated from the constant 1124 stored in the storage unit 1122 (102 in FIG. 2) (205 in FIG. 2) are calculated.1, h2To the scalar multiplication unit 1135 (115 in FIG. 2) (206 in FIG. 2).
[0214]
The scalar multiplication unit 1135 calculates the fixed points Q and h1By scalar multiple h1Q and public keys aQ and h2By scalar multiple h2aQ is calculated, and the calculated scalar multiple is sent to the signature verification processing unit 1132 (207 in FIG. 2).
[0215]
The signature verification processing unit 1132 performs signature verification processing using the sent scalar multiple. For example, for ECDSA signature verification, point R
R = h1Q + h2aQ (Formula 46)
And its x coordinate is xRWhen
s' = xR mod q (Formula 47)
If s ′ = s, “valid” is output as the signature verification result for the challenge code 1143, and the smart card 1101 is authenticated and accepted (208 in FIG. 2).
[0216]
If s ′ = s, “invalid” is output and the smart card is rejected (208 in FIG. 2).
[0217]
Since the scalar multiplication calculators 1115 and 1135 of the above embodiment have the same functions as the scalar multiplication calculator 115 or 135 of FIG. 1, side channel attacks can be prevented, and the processing speed and memory usage can be customized. A scalar multiplication calculation can be performed.
[0218]
Therefore, when the smart card 1101 performs a signature creation process, the computer 1121 can prevent a side channel attack when performing a signature verification process, and in addition, the processing speed and memory usage can be customized.
[0219]
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.
[0220]
The data processing units 112 and 132 in FIG. 1 function as the key exchange processing units 112 and 132, respectively, in this embodiment.
[0221]
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.
[0222]
The data processing unit 132 (112 in FIG. 2) 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.
[0223]
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 it 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).
[0224]
The scalar multiplication calculator 115 calculates a scalar multiple abQ based on the secret key a and the public key bQ, and sends the calculated scalar multiple to the key exchange processing unit 112 (207 in FIG. 2).
[0225]
The key exchange processing unit 112 derives shared information using the sent scalar multiple, and stores it as the secret information 105 in the storage unit 102. For example, the x coordinate of the scalar multiple point abQ is used as shared information.
[0226]
Next, an operation when the computer 121 derives shared information from the input data 141 will be described.
[0227]
The data processing unit 112 of the computer A101 reads the secret key a from the constant 105 of the storage unit 102 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.
[0228]
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 stores in the storage unit 122 (102 in FIG. 2). The private key b of the computer B121 and the public key aQ of the computer A101, which are the secret information 125, read from the constant 125 (205 in FIG. 2) are sent to the scalar multiplication unit 135 (115 in FIG. 2) (206 in FIG. 2). ).
[0229]
The scalar multiplication calculation unit 135 calculates a scalar multiplication point baQ using 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).
[0230]
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.
[0231]
Here, since the number ab and the number ba are the same as numerical values, the point abQ and the point baQ are the same point, and the same information is derived.
[0232]
A point aQ and a point bQ are transmitted to the network 142. To calculate the point abQ (or point baQ), the secret key a or the 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.
[0233]
Also in the present embodiment, the scalar multiplication calculators 115 and 135 have the above-described features, so that a key exchange process that can prevent a side channel attack and customize the processing speed and the memory usage is also possible. It becomes possible.
[0234]
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. Further, the scalar multiplication calculation unit may be realized by a coprocessor or other dedicated hardware.
[0235]
Further, the data processing unit may be configured to perform any one or more of the encryption process, the decryption process, the signature creation process, the signature verification process, and the key exchange process.
[0236]
【The invention's effect】
According to the present invention, it is possible to perform message processing using elliptic curve calculation which is safe against side channel attacks and can customize processing speed and memory usage.
[Brief description of the drawings]
FIG. 1 is a system configuration diagram according to an embodiment.
FIG. 2 is a sequence diagram showing information delivery in each embodiment.
FIG. 3 is a configuration diagram of a scalar multiplication calculator in the first embodiment.
FIG. 4 is a flowchart showing an encoding method performed by an encoding unit in the first embodiment.
FIG. 5 is a flowchart showing a pre-calculation method performed by a pre-calculation unit in the first embodiment.
FIG. 6 is a flowchart showing an actual calculation method performed by an actual calculation unit in the first embodiment.
FIG. 7 is a configuration diagram of a scalar multiplication calculator in the second embodiment.
FIG. 8 is a flowchart showing a pre-calculation method performed by a pre-calculation unit in the second embodiment.
FIG. 9 is a flowchart showing an actual calculation method performed by an actual calculation unit in the second embodiment.
FIG. 10 is a flowchart showing an actual calculation method performed by an actual calculation unit in the second embodiment.
FIG. 11 is a configuration diagram of a signature verification system in the embodiment.
[Explanation of symbols]
101, 121, 1121: Computer, 1101: Smart card, 102, 122, 1102, 1122: Storage unit, 111, 131, 1111, 1131: Processing unit, 115, 135, 1115, 1135: Scalar multiplication calculation unit, 112, 132: Data processing unit, 1112: Signature generation processing unit, 1132: Signature verification processing unit, 104, 124, 1104, 1124: Constant, 105, 125, 1105, 1125: Confidential information, 110, 130, 1110, 1130: On Output interface, 108, 128, 1128: Display, 109, 129, 1129: Keyboard, 142: Network, 1142: Interface, 141, 143: Data, 302: Encoding unit, 303: Precalculation unit, 304: Actual calculation unit, 321: Remainder acquisition unit, 322: Index set generation unit, 323: Remainder selection unit, 324: Repetition determination unit, 325: Storage unit, 331: Adder, 332: Double multiplication unit, 333: Repetition determination unit, 341: Bit value determination unit, 342: addition unit, 343: doubling unit, 344: repetition determination unit, 703: previous calculation unit, 704: actual calculation unit 731: Addition unit, 732: Double calculation unit, 733: Repeat determination unit, 734: Index set generation unit, 742: Addition unit, 743: Double calculation unit, 744: Repeat determination unit, 745: Scalar value expression conversion unit 746: Window width selection part.

Claims (8)

楕円曲線暗号に用いる楕円曲線上の点と、与えられたスカラー値と、からスカラー倍点を計算するスカラー倍計算装置であって、
前記スカラー値を数値列にエンコードするエンコード部と、
前記楕円曲線上の点から前計算テーブルを作成する前計算部と、
前記エンコードした数値列と、前記前計算テーブルと、から前記スカラー倍点を計算する実計算部と、
を具備し、
前記エンコード部は、
予め定められた個数m個(m=w 2 w0-2 であり、w は正整数であり、w =w-(w -1)であり、wは予め定められた正有理数である)の数値からな、{2 w0-1 +1,2 w0-1 +3,…,2 w0 -1}からランダムに選ばれた数値を含むインデックス集合を生成するインデックス集合生成部と、
前記スカラー値から第一の数値(前記第一の数値は、前記スカラー値の2 w0+1 による剰余から2 w0 を引いた値である)第二の数値(前記第二の数値は、前記スカラー値の2 w0 による剰余から2 w0-1 を引いた値とする)とを生成する数値取得部と、
前記第一の数値の大きさが予め定められた大きさである2 w0-1 より小さい場合は、予め定めた確率により前記第一の数値もしくは前記第二の数値のいずれか一方を選択し、前記第一の数値の大きさが前記予め定められた大きさである2 w0-1 以上の場合であり、かつ、前記インデックス集合生成部が生成した前記数値のいずれかと前記第一の数値とが一致する場合は、前記第一の数値を選択し、前記第一の数値の大きさが前記予め定められた大きさである2 w0-1 以上の場合であり、かつ、前記インデックス集合生成部が生成した前記数値のいずれかと前記第一の数値とが一致しない場合は、前記第二の数値を選択する数値選択部と、を有し、
前記前計算部は、前記インデックス集合を構成する前記数値を用いて、前記前計算テーブルを作成し、
前記エンコード部は、前記スカラー値を前記数値列にエンコードする際に、前記数値取得部での前記第一の数値と前記第二の数値を生成する処理と、前記数値選択部での前記第一の数値又は前記第二の数値を選択する処理と、前記スカラー値を前記数値列にエンコードするための処理とを繰り返し、
前記エンコード部は、前記選択した数値を用いて前記スカラー値を前記数値列にエンコードするための処理の際には、u[i]に前記数値選択部で前記選択された数値を代入し、{0,0,…,0,u[i]}を数値列{dw[r+r i -1],dw[r+r i -2],…,dw[r+1],dw[r]}(rは変数であり、u[i]が前記第一の数値の場合r i はw 0 であり、u[i]が前記第二の数値の場合r i はw 0 -1である。iは処理が繰り返される毎に1ずつ増える変数である)に代入し、
前記エンコード部は前記各処理を繰り返すことにより得られた数値列を前記実計算部に出力する
ことを特徴とするスカラー倍計算装置。
A scalar multiplication device for calculating a scalar multiple from a point on an elliptic curve used for elliptic curve cryptography and a given scalar value,
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;
An actual calculation unit for calculating the scalar multiple from the encoded numeric sequence and the pre-calculation table;
Comprising
The encoding unit is
A predetermined number m (m = w 1 2 w0-2 , w 0 is a positive integer, w 1 = w- (w 0 -1), and w is a predetermined positive rational number. Ri figures there) Tona, and {2 w0-1 +1,2 w0-1 + 3, ..., 2 w0 -1} index set generation unit that generates an index set comprising a number randomly selected from,
A first numerical value from the scalar value (the first numerical value is a value obtained by subtracting 2 w0 from the remainder of the scalar value by 2 w0 + 1 ) and a second numerical value (the second numerical value is the A numerical value acquisition unit that generates a value obtained by subtracting 2 w0-1 from the remainder of the scalar value 2 w0 ,
If the size of the first numerical value is smaller than 2 w0-1 which is a predetermined size , select either the first numerical value or the second numerical value with a predetermined probability, The first numerical value is a case where the predetermined value is 2 w0-1 or more, and any one of the numerical values generated by the index set generation unit and the first numerical value is If they match, the first numerical value is selected, the size of the first numerical value is 2 w0-1 or more which is the predetermined size , and the index set generation unit If any of the generated numerical values does not match the first numerical value, a numerical value selection unit that selects the second numerical value ,
The pre-calculation unit creates the pre-calculation table using the numerical values constituting the index set,
The encoding unit generates the first numerical value and the second numerical value in the numerical value acquisition unit when the scalar value is encoded into the numerical value sequence, and the first numerical value in the numerical value selection unit. The process of selecting the numeric value of the second or the second numeric value, and the process of encoding the scalar value into the numeric string,
The encoding unit substitutes the numerical value selected by the numerical value selection unit for u [i] in the process for encoding the scalar value into the numerical value sequence using the selected numerical value, and { 0, 0, ..., 0, u [i]} is converted to a numeric string {dw [r + r i -1], dw [r + r i -2], ..., dw [r + 1], dw [r] } (r is a variable, r i is w 0 when u [i] is the first numerical value , and r i is w 0 −1 when u [i] is the second numerical value . i is a variable that increases by 1 each time the process is repeated)
The scalar multiplication apparatus according to claim 1, wherein the encoding unit outputs a numerical sequence obtained by repeating the processes to the actual calculation unit .
請求項1記載のスカラー倍計算装置であって、
前記前計算部は、前記前計算テーブルが読み出されるたびに、再びランダム化した数値を用いた前計算テーブルを作成する
ことを特徴とするスカラー倍計算装置。
A scalar multiplication unit according to claim 1 Symbol placement,
The pre-calculation unit creates a pre-calculation table using a randomized numerical value every time the pre-calculation table is read out .
請求項記載のスカラー倍計算装置であって、
前記前計算部は、一つのスカラー倍計算中に、参照する前計算テーブルを一度以上再作成する
ことを特徴とするスカラー倍計算装置。
The scalar multiplication apparatus according to claim 1 , wherein
The pre-calculation unit re-creates a pre-calculation table to be referred to at least once during one scalar multiplication calculation.
請求項記載のスカラー倍計算装置であって、
前記インデックス集合生成部は、前記インデックス集合を構成する前記数値の個数を、外部から設定されるウィンドウ幅に基づいて決定する
ことを特徴とするスカラー倍計算装置。
The scalar multiplication apparatus according to claim 1 , wherein
The scalar set calculation unit, wherein the index set generation unit determines the number of numerical values constituting the index set based on a window width set from the outside .
請求項記載のスカラー倍計算装置であって、
楕円曲線としてワイエルシュトラス型楕円曲線、モンゴメリ型楕円曲線、標数2の有限体上で定義された楕円曲線、OEF上で定義された楕円曲線のいずれか一つを用いる
ことを特徴とするスカラー倍計算装置。
The scalar multiplication apparatus according to claim 1 , wherein
As an elliptic curve, one of a Weierstrass type elliptic curve, a Montgomery type elliptic curve, an elliptic curve defined on a finite field of characteristic 2 and an elliptic curve defined on the OEF is used. A scalar multiplication calculator.
第一のデータから第二のデータを生成するデータ変換部と、前記データ変換部より依頼されてスカラー倍を計算するスカラー倍計算部とを有するデータ生成装置であって、
前記スカラー倍計算部は、請求項1に記載のスカラー倍計算装置を用いてスカラー倍を計算する
ことを特徴とするデータ生成装置
A data generation device having 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,
The scalar multiplication unit calculates a scalar multiplication using the scalar multiplication apparatus according to claim 1.
A data generation apparatus characterized by that .
データから署名データを生成する署名部と、前記署名部より依頼されてスカラー倍を計算するスカラー倍計算部とを有する署名作成装置であって、
前記スカラー倍計算部は、請求項1に記載のスカラー倍計算装置を用いてスカラー倍を計算する
ことを特徴とする署名作成装置
A signature creation device having a signature unit that generates signature data from data, and a scalar multiplication calculation unit that is requested by the signature unit and calculates a scalar multiplication,
The scalar multiplication unit calculates a scalar multiplication using the scalar multiplication apparatus according to claim 1.
A signature creation device .
暗号化されたデータから復号化されたデータを生成する復号部と、前記復号部より依頼されてスカラー倍を計算するスカラー倍計算部とを有する復号化装置であって、
前記スカラー倍計算部は、請求項1に記載のスカラー倍計算装置を用いてスカラー倍を計算する
ことを特徴とする復号化装置
A decryption device comprising: a decryption unit that generates decrypted data from encrypted data; and a scalar multiplication calculation unit that is requested by the decryption unit to calculate a scalar multiplication,
The scalar multiplication unit calculates a scalar multiplication using the scalar multiplication apparatus according to claim 1.
A decoding device characterized by the above .
JP2003205896A 2003-08-05 2003-08-05 Scalar multiplication calculation method, apparatus and program for elliptic curve cryptography Expired - Fee Related JP4423900B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003205896A JP4423900B2 (en) 2003-08-05 2003-08-05 Scalar multiplication calculation method, apparatus and program for elliptic curve cryptography

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003205896A JP4423900B2 (en) 2003-08-05 2003-08-05 Scalar multiplication calculation method, apparatus and program for elliptic curve cryptography

Publications (3)

Publication Number Publication Date
JP2005055488A JP2005055488A (en) 2005-03-03
JP2005055488A5 JP2005055488A5 (en) 2006-05-11
JP4423900B2 true JP4423900B2 (en) 2010-03-03

Family

ID=34362944

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003205896A Expired - Fee Related JP4423900B2 (en) 2003-08-05 2003-08-05 Scalar multiplication calculation method, apparatus and program for elliptic curve cryptography

Country Status (1)

Country Link
JP (1) JP4423900B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10693625B2 (en) 2016-11-25 2020-06-23 Samsung Electronics Co., Ltd. Security processor, application processor including the same, and operating method of security processor

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100891323B1 (en) 2005-05-11 2009-03-31 삼성전자주식회사 Method and apparatus to increase complexity of power analysis based on random point representation in binary field Elliptic Curve CryptographyECC
US7602907B2 (en) * 2005-07-01 2009-10-13 Microsoft Corporation Elliptic curve point multiplication
JP5505173B2 (en) * 2010-07-30 2014-05-28 富士通株式会社 LIST GENERATION DEVICE, LIST GENERATION METHOD, AND LIST GENERATION PROGRAM
WO2013065117A1 (en) * 2011-10-31 2013-05-10 富士通株式会社 Encryption device, method, and program
KR101989950B1 (en) * 2017-04-28 2019-06-17 삼성에스디에스 주식회사 Apparatus and method for performing operation being secure against side channel attack
KR101914028B1 (en) * 2017-04-28 2018-11-01 삼성에스디에스 주식회사 Apparatus and method for performing operation being secure against side channel attack
KR101989943B1 (en) * 2017-04-28 2019-06-17 삼성에스디에스 주식회사 Apparatus and method for performing operation being secure against side channel attack

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10693625B2 (en) 2016-11-25 2020-06-23 Samsung Electronics Co., Ltd. Security processor, application processor including the same, and operating method of security processor

Also Published As

Publication number Publication date
JP2005055488A (en) 2005-03-03

Similar Documents

Publication Publication Date Title
US7961874B2 (en) XZ-elliptic curve cryptography with secret key embedding
US7961873B2 (en) Password protocols using XZ-elliptic curve cryptography
US7864951B2 (en) Scalar multiplication method with inherent countermeasures
US7379546B2 (en) Method for XZ-elliptic curve cryptography
CN109039640B (en) Encryption and decryption hardware system and method based on RSA cryptographic algorithm
US20100166174A1 (en) Hash functions using elliptic curve cryptography
US20110161390A1 (en) Modular multiplication processing apparatus
JP2008252299A (en) Encryption processing system and encryption processing method
US7483533B2 (en) Elliptic polynomial cryptography with multi x-coordinates embedding
JP4662802B2 (en) Calculation method, calculation apparatus, and computer program
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
KR100457177B1 (en) Serial-Parallel Multiplier to Multiply Two Elements in the Finite Field
KR100340102B1 (en) High speed rsa public key cryptographic apparatus and method
JP2003255831A (en) Method and device for calculating elliptic curve scalar multiple
Gligoroski Stream cipher based on quasigroup string transformations in $ Z_p^* $
Wang et al. An efficient elliptic curves scalar multiplication for wireless network
JP4502817B2 (en) Elliptic curve scalar multiplication method and apparatus
JPWO2005013243A1 (en) Apparatus, method and program for calculating conversion parameter in Montgomery modular multiplication
JP4692022B2 (en) Scalar multiplication apparatus and program for elliptic curve cryptography
US20070121935A1 (en) Method for countermeasuring in an electronic component
JP4783061B2 (en) Scalar multiplication unit for elliptic curve cryptography
KR100341507B1 (en) Elliptic Curve Cryptography and Digital Signature Method using fast finite field operations

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060315

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060315

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20060420

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090825

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091020

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20091117

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20091130

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

Free format text: PAYMENT UNTIL: 20121218

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20131218

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees