JP5606516B2 - NAF converter - Google Patents

NAF converter Download PDF

Info

Publication number
JP5606516B2
JP5606516B2 JP2012279603A JP2012279603A JP5606516B2 JP 5606516 B2 JP5606516 B2 JP 5606516B2 JP 2012279603 A JP2012279603 A JP 2012279603A JP 2012279603 A JP2012279603 A JP 2012279603A JP 5606516 B2 JP5606516 B2 JP 5606516B2
Authority
JP
Japan
Prior art keywords
state
bit
input
outputs
naf
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.)
Active
Application number
JP2012279603A
Other languages
Japanese (ja)
Other versions
JP2013077313A (en
Inventor
秀夫 清水
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2012279603A priority Critical patent/JP5606516B2/en
Publication of JP2013077313A publication Critical patent/JP2013077313A/en
Application granted granted Critical
Publication of JP5606516B2 publication Critical patent/JP5606516B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は2進表現された整数を冗長2進表現に変換するNAF変換装置に関する。   The present invention relates to a NAF conversion device that converts an integer represented in binary to a redundant binary representation.

乗数を冗長2進表現に変換してから乗算することで乗算を効率化できることについては、例えばBoothの方法として1950年代には既に知られている(例えば非特許文献1、非特許文献2を参照)。最近では、暗号処理の高速化という文脈で冗長2進表現の1種であるNAFが使われることが多い(例えば非特許文献3、非特許文献2を参照)。   The fact that multiplication can be made efficient by converting the multiplier into a redundant binary representation and already being known, for example, as the Booth method in the 1950s (see, for example, Non-Patent Document 1 and Non-Patent Document 2) ). Recently, NAF, which is a kind of redundant binary representation, is often used in the context of speeding up cryptographic processing (see, for example, Non-Patent Document 3 and Non-Patent Document 2).

NAFについては、例えば非特許文献2の第98頁に説明されている。NAFとは、冗長2進表現の1種であり、整数kは唯一の対応するNAF表現NAF(k)をもつ。NAF(k)の非零の桁の数は任意の冗長2進表現の中でも最小であることが証明されている。非零の桁の数の平均は1/3である。   NAF is described on page 98 of Non-Patent Document 2, for example. NAF is a kind of redundant binary representation, and the integer k has only one corresponding NAF representation NAF (k). The number of non-zero digits in NAF (k) has proven to be the smallest among any redundant binary representations. The average number of non-zero digits is 1/3.

通常の2進表現では、各桁に0または1の2種類の数字が現れるが、NAFでは−1,0,1の数字が現れるという違いがある。   In normal binary representation, two types of numbers, 0 or 1, appear in each digit, but in NAF, there is a difference that numbers of -1, 0, 1 appear.

NAF表現では、引き続く2つの桁の少なくとも一方は0であるという特徴があり、密度が低い理由にもなっている。また、Non−adjacent formという名前の由来でもある。   The NAF expression has a feature that at least one of the subsequent two digits is 0, which is also a reason for the low density. It is also the origin of the name Non-adjacent form.

例として、2進数11011(10進では59=32+16+8+2+1)をNAFに変換すると1000−10−1(64−4−1=59)になる。   As an example, if the binary number 11011 (59 = 32 + 16 + 8 + 2 + 1 in decimal) is converted to NAF, 1000-10-1 (64-4-1 = 59) is obtained.

4ビット以下の2進数をNAFに変換した例を表1に示す。

Figure 0005606516
Table 1 shows an example in which a binary number of 4 bits or less is converted to NAF.
Figure 0005606516

整数kをNAF表現NAF(k)に変換するアルゴリズムはいくつも知られている。例えば、非特許文献4の第39頁(表3.2)、非特許文献3の第98頁(アルゴリズム3.30)、非特許文献2の第151(アルゴリズム9.14)に記載されている。   A number of algorithms for converting an integer k into a NAF representation NAF (k) are known. For example, it is described in page 39 (Table 3.2) of Non-Patent Document 4, page 98 (Algorithm 3.30) of Non-Patent Document 3, and 151 (Algorithm 9.14) of Non-Patent Document 2. .

NAFの拡張としてw−NAFがある(例えば非特許文献3の第99頁参照)。   There is w-NAF as an extension of NAF (see, for example, page 99 of Non-Patent Document 3).

w−NAFと通常のNAFの違いは、w−NAFでは各桁に使える数字がもっと多くなっていることである。3−NAFであれば−3,−1,0,1,3の5種類を使用できる。上記のNAFは2−NAFと考えることができる。   The difference between w-NAF and normal NAF is that w-NAF has more numbers available for each digit. If it is 3-NAF, five types of -3, -1, 0, 1, 3 can be used. The above NAF can be considered as 2-NAF.

以下、表2および表3にw−NAFの特徴を示す。   Tables 2 and 3 below show the characteristics of w-NAF.

表2は、各NAFで使う数字を一覧にしたものである。

Figure 0005606516
Table 2 lists the numbers used in each NAF.
Figure 0005606516

但し、「^」はべき(冪)であり、例えば2^wは2のw乗を意味する。   However, “^” is a power (冪). For example, 2 ^ w means 2 to the power of w.

表3は、各NAFの非零の桁の密度を一覧にしたものである。

Figure 0005606516
Table 3 lists the non-zero digit density of each NAF.
Figure 0005606516

w−NAFでは、引き続くw個の桁の内、非零である桁は多くても1つであるという特徴がある。密度が低い方が処理する桁が少なくなるのでクロック数は少なくなるが、事前準備が多くなるのでトレードオフがある。   The w-NAF is characterized in that at least one non-zero digit among the following w digits is at most. The lower the density, the fewer the number of digits to process, so the number of clocks decreases. However, there is a trade-off because more preparations are required.

w−NAFの変換アルゴリズムについては、非特許文献3の第100頁(アルゴリズム3.35)、非特許文献2の第153頁(アルゴリズム9.20)がある。   Regarding the conversion algorithm of w-NAF, there are Non-Patent Document 3 page 100 (Algorithm 3.35) and Non-Patent Document 2 page 153 (Algorithm 9.20).

従来のNAF変換アルゴリズムについて検討する。   Consider the conventional NAF conversion algorithm.

非特許文献3のアルゴリズム3.35や、非特許文献2のアルゴリズム9.20は、任意のwに対して適用できるというスケーラビリティの高さが特長であるが、反面、以下のような問題点がある。   The algorithm 3.35 of Non-Patent Document 3 and the algorithm 9.20 of Non-Patent Document 2 are characterized by high scalability that can be applied to any w, but on the other hand, there are the following problems: is there.

・逐次的にkを入力することができない。つまり最初にkを読み込んでおかなければならない。これはkそのものを変更するからである。 ・ K cannot be input sequentially. In other words, k must be read first. This is because k itself is changed.

・kに対する変更は多倍長演算なので、回路規模が大きくなったり、1桁を求めるのに必要なクロック数が多くなる。 Since the change to k is a multiple-length operation, the circuit scale increases, and the number of clocks required to obtain one digit increases.

非特許文献4の表3.2について、非特許文献4にはNAF変換であるという記述はないが、結果として出力されるものはNAF変換になっている。このアルゴリズムは上の2つのアルゴリズムのもつ欠点を持たない。つまり、逐次的にkを処理できるし、多倍長演算も不要である。ただし、w=2の場合にしか適用できないのでスケーラビリティがないという問題がある。非特許文献2のアルゴリズム9.14も同じ特長と欠点をもつ。   Regarding Table 3.2 of Non-Patent Document 4, there is no description that NAF conversion is in Non-Patent Document 4, but what is output as a result is NAF conversion. This algorithm does not have the disadvantages of the above two algorithms. That is, k can be processed sequentially and multiple length arithmetic is not necessary. However, since it can be applied only when w = 2, there is a problem that there is no scalability. The algorithm 9.14 of Non-Patent Document 2 has the same features and disadvantages.

A.D.Booth, "A signed binary multiplication technique", Quart. J. Mech. Appl. Math., 4, 2, 236-240, 1951.A.D.Booth, "A signed binary multiplication technique", Quart. J. Mech. Appl. Math., 4, 2, 236-240, 1951. "Handbook of Elliptic and Hyperelliptic Curve Cryptography", CRC, 2006"Handbook of Elliptic and Hyperelliptic Curve Cryptography", CRC, 2006 "Guide to Elliptic Curve Cryptography", Springer, 2003"Guide to Elliptic Curve Cryptography", Springer, 2003 「算術演算のVLSIアルゴリズム」コロナ社,2005"VLSI algorithms for arithmetic operations" Corona, 2005

上述したように、既に知られているNAF変換アルゴリズムには、スケーラビリティと回路規模が両立しないという問題点がある。   As described above, the known NAF conversion algorithm has a problem that scalability and circuit scale are not compatible.

本発明はかかる事情を考慮してなされたものであり、回路規模が小さくスケーラブルなw−NAF変換装置を提供することを目的とする。   The present invention has been made in view of such circumstances, and an object of the present invention is to provide a scalable w-NAF conversion device with a small circuit scale.

本発明の一観点に係るNAF変換装置は、2進表現された整数をw−NAF表現された冗長2進表現に変換するNAF変換装置であって、前記2進表現された整数を下位から1ビットずつ受け付ける受付手段と、1ビットで表現される状態の値を記憶する記憶手段と、w−1ビットで表現される状態の値を記憶するシフトレジスタと、前記受付手段が受け付けた1ビットの値と、前記記憶手段の状態の値と、前記w−1ビットのシフトレジスタの状態の値を参照し、次の時刻における前記記憶手段の状態と前記w−1ビットのシフトレジスタの状態とを決定し、現時刻におけるwビットのパラレル出力を決定する更新手段と、を具備することを特徴とする。   A NAF conversion device according to an aspect of the present invention is a NAF conversion device that converts a binary-represented integer into a redundant binary representation represented by w-NAF. Accepting means for receiving bit by bit, storage means for storing a value of a state expressed by 1 bit, a shift register for storing a value of a state expressed by w−1 bits, and a 1-bit received by the receiving means With reference to the value, the state value of the storage means, and the state value of the w-1 bit shift register, the state of the storage means and the state of the w-1 bit shift register at the next time Updating means for determining and determining w-bit parallel output at the current time.

本発明によれば、回路規模が小さくスケーラブルなw−NAF変換装置を提供できる。特に、任意のwについて異なる部分がほとんどない(シフトレジスタの長さだけ)ので、動的にwを変更するといったことも可能である。また、回路規模は知られている2−NAF専用の変換アルゴリズムよりも小型であり、さらには公知のw−NAF変換アルゴリズムと較べても小型である。   According to the present invention, a scalable w-NAF conversion device with a small circuit scale can be provided. In particular, since there is almost no different part for an arbitrary w (only the length of the shift register), it is possible to dynamically change w. In addition, the circuit scale is smaller than the known conversion algorithm dedicated to 2-NAF, and further smaller than the known w-NAF conversion algorithm.

w−NAF変換装置の機能構成を示すブロック図Block diagram showing the functional configuration of the w-NAF converter 2−NAF変換装置を示す図Diagram showing 2-NAF converter セレクタの記述方法の説明図Illustration of the selector description method 2−NAF変換装置の変換例を示す図A diagram showing a conversion example of a 2-NAF conversion device 3−NAF変換装置を示す図Diagram showing a 3-NAF converter 3−NAF変換装置の変換例を示す図The figure which shows the example of a conversion of 3-NAF converter 4−NAF変換装置を示す図Diagram showing a 4-NAF converter 2〜4−NAF変換装置を示す図Diagram showing 2-4-NAF converter 2−NAF状態遷移表を示す図Figure showing the 2-NAF state transition table 2−NAF状態遷移図を示す図Figure showing a 2-NAF state transition diagram 3−NAF状態遷移表を示す図Figure showing the 3-NAF state transition table 3−NAF状態遷移図を示す図Diagram showing 3-NAF state transition diagram 4−NAF状態遷移表を示す図Figure showing the 4-NAF state transition table 5−NAF状態遷移表を示す図Figure showing the 5-NAF state transition table

以下、図面を参照しながら本発明の実施形態を説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、本発明の実施形態に係るNAF変換装置の機能構成を示すブロック図である。本装置は、1ビットシリアル入力を受け付ける受付手段1と、受付手段1に接続される更新手段2と、更新手段2に接続され、w−NAF表現されたwビットの値をパラレル出力するw−1ビットシフトレジスタ3と、更新手段2に接続される1ビット記憶手段4とを有する。なお、NAF変換装置がハードウェアで構成される場合は、受付手段1は独立して設けられる必要はなく、信号線と更新手段とが接続される接続部分が該当することになる。   FIG. 1 is a block diagram showing a functional configuration of a NAF conversion device according to an embodiment of the present invention. This apparatus receives a 1-bit serial input, an updating unit 2 connected to the receiving unit 1, an updating unit 2 connected to the updating unit 2, and outputs a w-bit value expressed in w-NAF in parallel. It has a 1-bit shift register 3 and a 1-bit storage means 4 connected to the update means 2. When the NAF conversion device is configured by hardware, the reception unit 1 does not need to be provided independently, and a connection portion where the signal line and the update unit are connected corresponds.

1ビット記憶手段4とw−1ビットシフトレジスタ3の初期値は0とする。   The initial values of the 1-bit storage means 4 and the w-1 bit shift register 3 are 0.

本実施形態に係るNAF変換装置においては、w−NAF表現に変換すべき整数の2進表現を下位ビットから順にクロックに合わせて1ビットずつ受付手段1が受け付ける。この受け付けた値を1ビットシリアル入力という。1ビット記憶手段4とw−1ビットシフトレジスタ3の内容はクロック毎に、つまり1ビット入力される毎に更新手段2によって新たな内容に置き換えられる。   In the NAF conversion device according to the present embodiment, the reception unit 1 receives a binary representation of an integer to be converted into a w-NAF representation bit by bit in order from the lower bit in accordance with the clock. This accepted value is called 1-bit serial input. The contents of the 1-bit storage means 4 and the w-1 bit shift register 3 are replaced with new contents by the update means 2 every clock, that is, every time 1 bit is input.

更新手段2は更新前の1ビット記憶手段4とw−1ビットシフトレジスタ3の内容および1ビットシリアル入力に応じて、1ビット記憶手段4とw−1ビットシフトレジスタ3の新たな内容を計算する。また更新手段2はwビットのパラレル出力を決定する。つまり、クロック毎にwビットの変換結果が出力される。この際、有効な出力はw−1クロック後から出力される。なお、最下位ビット出力の値“1”は、w−1ビットシフトレジスタ3をクリアするトリガーのクリア入力として、w−1ビットシフトレジスタ3に与えられる。最下位ビット出力の値“1”がw−1ビットシフトレジスタ2に与えられると、w−1ビットシフトレジスタ2の値はクリアされる。   The updating unit 2 calculates the new contents of the 1-bit storage unit 4 and the w-1 bit shift register 3 according to the contents of the 1-bit storage unit 4 and the w-1 bit shift register 3 and the 1-bit serial input before the update. To do. The updating means 2 determines w-bit parallel output. That is, a w-bit conversion result is output for each clock. At this time, a valid output is output after w-1 clocks. The value “1” of the least significant bit output is given to the w−1 bit shift register 3 as a clear input of a trigger for clearing the w−1 bit shift register 3. When the value “1” of the least significant bit output is given to the w−1 bit shift register 2, the value of the w−1 bit shift register 2 is cleared.

図2を参照して、図1のNAF変換装置をさらに具体化した2−NAF変換装置を説明する。図2に示すように2−NAF変換装置が有するCは図1の構成における1ビット記憶手段4に対応する。同様に、S0は1ビットのシフトレジスタ3(w=2なのでw−1=1ビット)に対応する。Y1とY0は2ビットのパラレル出力に対応する。+は1ビットの加算器であり、図1の更新手段2の要素に対応する。   With reference to FIG. 2, a 2-NAF conversion device that further embodies the NAF conversion device of FIG. 1 will be described. As shown in FIG. 2, C included in the 2-NAF conversion device corresponds to the 1-bit storage unit 4 in the configuration of FIG. Similarly, S0 corresponds to 1-bit shift register 3 (w = 2 = 1 because w = 2). Y1 and Y0 correspond to 2-bit parallel output. + Is a 1-bit adder and corresponds to the element of the updating means 2 in FIG.

特別な記号を図3で説明する。セレクタを図3のように記述することにする。つまり選択信号Sが1のとき出力はC=Aであり、Sが0のとき出力はC=Bとなる。   Special symbols are illustrated in FIG. The selector is described as shown in FIG. That is, when the selection signal S is 1, the output is C = A, and when S is 0, the output is C = B.

図1において、最下位ビット出力がw−1ビットシフトレジスタのクリア入力として与えられる構成は、図2において、パラレル出力の一部であるY0がセレクタの選択信号S0として与えられる構成に対応する。   In FIG. 1, the configuration in which the least significant bit output is given as the clear input of the w-1 bit shift register corresponds to the configuration in which Y0, which is a part of the parallel output, is given as the selector selection signal S0 in FIG.

CとS0の初期値は0である。S0が1のとき、Cの次の値は入力+Cの下位ビットであり、S0の次の値は0であり、Y1は入力+Cの下位ビットであり、Y0はS0つまり1となる。一方、S0が0のとき、Cの次の値は入力+Cの上位ビットであり、S0の次の値は入力+Cの下位ビットであり、Y1は入力+Cの下位ビットであり、Y0はS0つまり0となる。なお、次のクロックのタイミングでY1の値がS0に書き込まれる。   The initial values of C and S0 are zero. When S0 is 1, the next value of C is the lower bit of the input + C, the next value of S0 is 0, Y1 is the lower bit of the input + C, and Y0 is S0, that is, 1. On the other hand, when S0 is 0, the next value of C is the upper bit of input + C, the next value of S0 is the lower bit of input + C, Y1 is the lower bit of input + C, and Y0 is S0, 0. Note that the value of Y1 is written to S0 at the timing of the next clock.

図4を参照して、この2−NAF変換装置の実際の変換例を示す。図4はタイミングチャートの形式になっており、クロックが入るたびに色々な値が更新されている。図4においてclkはクロック、startは開始信号、inは入力、cは1ビット記憶手段4、sは1ビットシフトレジスタ3、outは2ビットパラレル出力である。   Referring to FIG. 4, an actual conversion example of this 2-NAF conversion device will be shown. FIG. 4 is in a timing chart format, and various values are updated each time a clock is input. In FIG. 4, clk is a clock, start is a start signal, in is an input, c is a 1-bit storage means 4, s is a 1-bit shift register 3, and out is a 2-bit parallel output.

2進数111011(10進では59=32+16+8+2+1)を入力した例を示す。inの行を見ると111011がクロック毎に下位から順に入力されていることが分かる。出力は入力より1クロック遅れている。   An example in which a binary number 1111011 (59 = 32 + 16 + 8 + 2 + 1 in decimal) is input is shown. Looking at the in line, it can be seen that 111011 are inputted in order from the lower order for each clock. The output is delayed by one clock from the input.

出力outの読み方は、「00」または「10」のとき「0」であり、「01」のとき「1」であり、「11」のとき「−1」である。   The way to read the output out is “0” when “00” or “10”, “1” when “01”, and “−1” when “11”.

上記のように0を表現する複数の出力があるが、全て偶数であり、最下位ビットが0のときは出力を0とみなすだけでよい。また、出力が0以外のときは、2ビットの2の補数表現になっていることに注意する。一般にw−NAFの場合は、出力の最下位ビットが0なら0、1ならwビットの2の補数表現となる。出力の最下位ビット以外を最下位ビットとANDをとることできれいな0を出力することもできる。結果も下位から出力される。図4によれば、下位から順に−10−10001と出力されていることが分かる。これは、上位から読むと1000−10−1であり、64−4−1=59なので、元の2進数と同じ数を表現していることが分かる。元の2進数で非零の(1の)ビットは5個であるが、NAF変換後は3個と非零の桁の数が減っている。NAF変換では、出力のビット数は、最大で元のビット数+1になることがあり、この例もそのようになっている。   As described above, there are a plurality of outputs expressing 0, but when all are even numbers and the least significant bit is 0, it is only necessary to regard the output as 0. Note that when the output is other than 0, it is expressed in 2-bit 2's complement. In general, in the case of w-NAF, if the least significant bit of the output is 0, it is 0, and if it is 1, the w bit is represented in 2's complement. A clear 0 can also be output by ANDing the least significant bit with the least significant bit other than the least significant bit of the output. The result is also output from the lower order. According to FIG. 4, it can be seen that the output is −10−10000 from the lower order. This is 1000-10-1 when read from the top, and since 64-4-1 = 59, it can be seen that the same number as the original binary number is expressed. The original binary number of non-zero (1) bits is 5, but after NAF conversion, the number of non-zero digits is reduced to 3 after NAF conversion. In the NAF conversion, the number of output bits may be up to the original number of bits + 1, and this example is also the same.

図5は図1のNAF変換装置をさらに別の例として具体化した3−NAFの変換装置を示している。図5に示すように3−NAF変換装置が有するCは図1の構成における1ビット記憶手段4に対応する。同様に、S1とS0は2ビットのシフトレジスタ3(w=3なのでw−1=2ビット)に対応する。Y2とY1とY0は3ビットのパラレル出力に対応する。+は1ビットの加算器であり、図1の更新手段2の要素に対応する。図1において、最下位ビット出力がw−1ビットシフトレジスタのクリア入力として与えられる構成は、図5において、パラレル出力の一部であるY0が2つのセレクタのそれぞれの選択信号S0として与えられる構成に対応する。   FIG. 5 shows a 3-NAF conversion device which is an embodiment of the NAF conversion device of FIG. As shown in FIG. 5, C included in the 3-NAF conversion device corresponds to the 1-bit storage unit 4 in the configuration of FIG. Similarly, S1 and S0 correspond to a 2-bit shift register 3 (w = 3, so w-1 = 2 bits). Y2, Y1, and Y0 correspond to 3-bit parallel output. + Is a 1-bit adder and corresponds to the element of the updating means 2 in FIG. In FIG. 1, the configuration in which the least significant bit output is given as the clear input of the w-1 bit shift register is the configuration in which Y0 which is a part of the parallel output is given as the selection signal S0 of each of the two selectors in FIG. Corresponding to

図2の2−NAF変換装置と図5の3−NAFの変換装置とを較べると、Y2とS1が増えただけである。動作は2−NAF変換装置と同様である。   Comparing the 2-NAF conversion device of FIG. 2 with the 3-NAF conversion device of FIG. 5, only Y2 and S1 are increased. The operation is the same as that of the 2-NAF converter.

CとS0の初期値は0である。S0が1のとき、Cの次の値は入力+Cの下位ビットであり、S1とS0の次の値は0であり、Y2は入力+Cの下位ビットであり、Y1はS1であり、Y0はS0つまり1となる。一方、S1が0のとき、Cの次の値は入力+Cの上位ビットであり、S1の次の値は入力+Cの下位ビットであり、S0の次の値はS1であり、Y2は入力+Cの下位ビットであり、Y1はS1であり、Y0はS0つまり0となる。   The initial values of C and S0 are zero. When S0 is 1, the next value of C is the lower bit of input + C, the next value of S1 and S0 is 0, Y2 is the lower bit of input + C, Y1 is S1, and Y0 is S0, that is, 1. On the other hand, when S1 is 0, the next value of C is the upper bit of input + C, the next value of S1 is the lower bit of input + C, the next value of S0 is S1, and Y2 is input + C Y1 is S1, and Y0 is S0, that is, 0.

図6を参照して、この3−NAF変換装置の実際の変換例を示す。図6はタイミングチャートの形式になっており、クロックが入るたびに色々な値が更新されている。図6において、clkはクロック、startは開始信号、inは入力、cは1ビット記憶手段4、sは2ビットシフトレジスタ3、outは3ビットパラレル出力である。   With reference to FIG. 6, an actual conversion example of the 3-NAF conversion device will be described. FIG. 6 is in a timing chart format, and various values are updated each time a clock is input. In FIG. 6, clk is a clock, start is a start signal, in is an input, c is a 1-bit storage means 4, s is a 2-bit shift register 3, and out is a 3-bit parallel output.

2進数111011(10進では59=32+16+8+2+1)を入力した例を示す。inの行を見ると111011がクロック毎に下位から順に入力されていることが分かる。出力は入力より2クロック遅れている。出力outの読み方は、「000」,「010」,「100」,「110」のとき、「0」であり、「001」のとき「1」であり、「011」のとき「3」であり、「101」のとき「−3」であり、「111」のとき「−1」である。   An example in which a binary number 1111011 (59 = 32 + 16 + 8 + 2 + 1 in decimal) is input is shown. Looking at the in line, it can be seen that 111011 are inputted in order from the lower order for each clock. The output is 2 clocks behind the input. The way to read the output out is “0” when “000”, “010”, “100”, “110”, “1” when “001”, and “3” when “011”. Yes, "-3" when "101", "-1" when "111".

上記のように0を表現する複数の出力があるが、全て偶数であり、最下位ビットが0のときは出力を0とみなすだけでよい。また、出力が0以外のときは、3ビットの2の補数表現になっていることに注意する。結果も下位から出力される。下位から順に300−1001と出力されていることが分かる。これは、上位から読むと100−1003であり、64−8+3=59なので、元の2進数と同じ数を表現していることが分かる。NAF変換では、出力のビット数は、最大で元のビット数+1になることがあり、この例もそのようになっている。   As described above, there are a plurality of outputs expressing 0, but when all are even numbers and the least significant bit is 0, it is only necessary to regard the output as 0. Also, note that when the output is other than 0, it is expressed in 2's complement notation. The result is also output from the lower order. It can be seen that 300-1001 is output in order from the lower order. This is 100-1003 when read from the top, and 64-8 + 3 = 59, so it can be seen that the same number as the original binary number is expressed. In the NAF conversion, the number of output bits may be up to the original number of bits + 1, and this example is also the same.

図7は図1のNAF変換装置をさらに別の例として具体化した4−NAFの変換装置である。図7に示すように、4−NAFの変換装置が有するCは図1の構成における1ビット記憶手段4に対応する。同様に、S2とS1とS0は3ビットのシフトレジスタ3(w=4なのでw−1=3ビット)に対応する。Y3とY2とY1とY0は4ビットのパラレル出力に対応する。+は1ビットの加算器であり、図1の更新手段2の要素である。   FIG. 7 shows a 4-NAF conversion device that is a further embodiment of the NAF conversion device of FIG. As shown in FIG. 7, C included in the 4-NAF converter corresponds to the 1-bit storage unit 4 in the configuration of FIG. Similarly, S2, S1, and S0 correspond to the 3-bit shift register 3 (w = 1 = 3 because w = 4). Y3, Y2, Y1, and Y0 correspond to 4-bit parallel output. + Is a 1-bit adder, which is an element of the updating means 2 in FIG.

図2の2−NAF変換装置や図5の3−NAF変換装置と図7の4−NAF変換装置とを見比べてみると、シフトレジスタ3と出力が増えただけで同じ構造をもつことが分かる。   When comparing the 2-NAF conversion device of FIG. 2 or the 3-NAF conversion device of FIG. 5 with the 4-NAF conversion device of FIG. 7, it can be seen that the shift register 3 and the output have the same structure just by increasing the output. .

図8を参照して、kを可変とするk−NAF変換装置の例を示す。この例ではkの値として2,3,4を選択できる。図8においてk−NAF変換装置のCは図1に示した構成における1ビット記憶手段4に対応する。S2とS1とS0は図1の構成における3ビットのシフトレジスタ3(w=4なのでw−1=3ビット)に対応する。Y3とY2とY1とY0は4ビットのパラレル出力に対応する。+は1ビットの加算器である。   Referring to FIG. 8, an example of a k-NAF conversion device that makes k variable is shown. In this example, 2, 3 and 4 can be selected as the value of k. In FIG. 8, C of the k-NAF conversion device corresponds to the 1-bit storage means 4 in the configuration shown in FIG. S2, S1, and S0 correspond to the 3-bit shift register 3 (w = 1 = 3 because w = 4) in the configuration of FIG. Y3, Y2, Y1, and Y0 correspond to 4-bit parallel output. + Is a 1-bit adder.

Sはkによって変わる最下位ビットである。k=2、つまりこの装置を2−NAF変換装置として動作させるには、最下位ビットSとしてS2を採用すればよく、同様に3−NAF変換装置として動作させるためには、最下位ビットSとしてS1を採用すればよく、4−NAF変換装置の場合の最下位ビットはS=S0とすればよい。このとき、出力は2−NAFのときはY3とY2とし、3−NAFのときはY3,Y2,Y1とし、4−NAFのときはY4,Y3,Y2,Y1,Y0とする。   S is the least significant bit depending on k. In order to operate k = 2, that is, to operate this apparatus as a 2-NAF conversion apparatus, it is sufficient to adopt S2 as the least significant bit S. Similarly, to operate as a 3-NAF conversion apparatus, as the least significant bit S, S1 may be adopted, and the least significant bit in the case of the 4-NAF conversion device may be S = S0. At this time, the output is Y3 and Y2 for 2-NAF, Y3, Y2, Y1 for 3-NAF, and Y4, Y3, Y2, Y1, Y0 for 4-NAF.

携帯機器のようにメモリが限られているような場面では、wを小さくすることで計算自体は遅くなるが、メモリを節約することができる。一般にwを大きくすることで計算は速くなるがメモリ消費量が増える。例えばメモリの空きが少ないときはwを小さくし、メモリの空きが多いときはwを大きくすることで計算を速くすることができる。また、wを小さくし不要なレジスタへの給電を止めることで、電力を節約できる。   In a situation where the memory is limited as in a portable device, the calculation itself is slowed down by reducing w, but the memory can be saved. In general, increasing w increases calculation speed but increases memory consumption. For example, the calculation can be speeded up by reducing w when the memory is low and increasing w when the memory is high. Further, power can be saved by reducing w and stopping power supply to unnecessary registers.

図9を参照して、上述した2−NAF変換装置を他の観点から説明する。すなわち、図9のような状態遷移表の形式で本実施形態に係る2−NAF変換装置を説明する。図9において、sは今の状態(取りうる状態は3状態である)、inは1ビットの入力、s’は次の状態、outは出力である。初期状態はs=0である。入力inが1ビットずつ入るたびにsとinで決まるs’に状態遷移し、出力outを出力する。   With reference to FIG. 9, the above-described 2-NAF conversion device will be described from another viewpoint. That is, the 2-NAF conversion device according to this embodiment will be described in the form of a state transition table as shown in FIG. In FIG. 9, s is the current state (possible states are 3 states), in is a 1-bit input, s' is the next state, and out is an output. The initial state is s = 0. Each time the input in is input bit by bit, the state transitions to s' determined by s and in, and the output out is output.

第1の状態において、入力が0のときは、第1の状態に状態遷移し、0を出力し、入力が1のときは、第2の状態に状態遷移し、0を出力する。第2の状態において、入力が0のときは、第1の状態に状態遷移し、1を出力し、入力が1のときは、第3の状態に状態遷移し、−1を出力する。第3の状態において、入力が0のときは、第2の状態に状態遷移し、0を出力し、入力が1のときは、第3の状態に状態遷移し、0を出力する。このようにして2進表現された整数を下位から1ビットずつ入力すると2−NAF表現された冗長2進表現を2ビットずつ出力する。   In the first state, when the input is 0, the state transitions to the first state and outputs 0, and when the input is 1, the state transitions to the second state and 0 is output. In the second state, when the input is 0, the state transitions to the first state and 1 is output, and when the input is 1, the state transitions to the third state and -1 is output. In the third state, when the input is 0, the state transitions to the second state and outputs 0, and when the input is 1, the state transitions to the third state and 0 is output. When the integer expressed in binary is input bit by bit from the lower order, a redundant binary expression expressed in 2-NAF is output bit by bit.

図10を参照して、2−NAF変換装置をさらに説明する。図10において、丸で囲まれているのが状態であり、状態遷移表のsと対応する。3つの状態がある。数字/数字は、左の数字がin、右の数字がoutで、左の数字を入力したときに、右の数字を出力することを意味する。このような図10は、図9の状態遷移表を状態遷移図の形に書き直したものである。初期状態は状態0である。   The 2-NAF conversion device will be further described with reference to FIG. In FIG. 10, states are circled and correspond to s in the state transition table. There are three states. Number / number means that when the left number is in and the right number is out and the left number is input, the right number is output. FIG. 10 like this is a rewrite of the state transition table of FIG. 9 into a state transition diagram. The initial state is state 0.

図11を参照して、上述した3−NAF変換装置を他の観点から説明する。すなわち、図11のような状態遷移表の形式に沿って本実施形態に係る3−NAF変換装置を説明する。状態sとして取りうる値が0から4の5状態に増えており、出力は、3−NAFなので−3,−1,0,1,3の5通りになっている。   With reference to FIG. 11, the above-described 3-NAF conversion device will be described from another viewpoint. That is, the 3-NAF conversion device according to the present embodiment will be described along the format of the state transition table as shown in FIG. The value that can be taken as the state s has increased from 0 to 4 to 5 states, and since the output is 3-NAF, there are five types of -3, -1, 0, 1, and 3.

第1の状態において、入力が0のときは、第1の状態に状態遷移し、0を出力し、入力が1のときは、第3の状態に状態遷移し、0を出力する。第2の状態において、入力が0のときは、第1の状態に状態遷移し、1を出力し、入力が1のときは、第5の状態に状態遷移し、−3を出力する。第3の状態において、入力が0のときは、第2の状態に状態遷移し、0を出力し、入力が1のときは、第4の状態に状態遷移し、0を出力する。第4の状態において、入力が0のときは、第1の状態に状態遷移し、3を出力し、入力が1のときは、第5の状態に状態遷移し、−1を出力する。第5の状態において、入力が0のときは、第3の状態に状態遷移し、0を出力し、入力が1のときは、第5の状態に状態遷移し、0を出力する。こうして、2進表現された整数を下位から1ビットずつ入力すると、3−NAF表現された冗長2進表現を3ビットずつ出力する。   In the first state, when the input is 0, the state transitions to the first state and outputs 0, and when the input is 1, the state transitions to the third state and 0 is output. In the second state, when the input is 0, the state transitions to the first state and outputs 1, and when the input is 1, the state transitions to the fifth state and -3 is output. In the third state, when the input is 0, the state transitions to the second state and outputs 0, and when the input is 1, the state transitions to the fourth state and 0 is output. In the fourth state, when the input is 0, the state transitions to the first state and 3 is output, and when the input is 1, the state transitions to the 5th state and −1 is output. In the fifth state, when the input is 0, the state transitions to the third state and outputs 0, and when the input is 1, the state transitions to the 5th state and outputs 0. Thus, when an integer expressed in binary is input bit by bit from the lower order, a redundant binary expression expressed in 3-NAF is output in units of 3 bits.

図12は、図11の状態遷移表を状態遷移図に書き直したものであり、図10と同様である。   FIG. 12 is a rewrite of the state transition table of FIG. 11 into a state transition diagram, and is the same as FIG.

図13を参照して、上述した4−NAF変換装置を他の観点から説明する。すなわち、図13のような状態遷移表の形式に沿って本実施形態に係る4−NAF変換装置を説明する。状態sとして取りうる値が0から8の9状態に増えている。出力は、4−NAFであので−7,−5,−3,−1,0,1,3,5,7の9種類である。   With reference to FIG. 13, the above-described 4-NAF conversion device will be described from another viewpoint. That is, the 4-NAF conversion device according to the present embodiment will be described according to the format of the state transition table as shown in FIG. The possible values for state s have increased from 0 to 9 states. Since the output is 4-NAF, there are nine outputs of -7, -5, -3, -1, 0, 1, 3, 5, and 7.

第1の状態において、入力が0のときは、第1の状態に状態遷移し、0を出力し、入力が1のときは、第5の状態に状態遷移し、0を出力する。第2の状態において、入力が0のときは、第1の状態に状態遷移し、1を出力し、入力が1のときは、第9の状態に状態遷移し、−7を出力する。第3の状態において、入力が0のときは、第2の状態に状態遷移し、0を出力し、入力が1のときは、第6の状態に状態遷移し、0を出力する。第4の状態において、入力が0のときは、第1の状態に状態遷移し、3を出力し、入力が1のときは、第9の状態に状態遷移し、−5を出力する。第5の状態において、入力が0のときは、第3の状態に状態遷移し、0を出力し、入力が1のときは、第7の状態に状態遷移し、0を出力する。第6の状態において、入力が0のときは、第1の状態に状態遷移し、5を出力し、入力が1のときは、第9の状態に状態遷移し、−3を出力する。第7の状態において、入力が0のときは、第4の状態に状態遷移し、0を出力し、入力が1のときは、第8の状態に状態遷移し、0を出力する。第8の状態において、入力が0のときは、第1の状態に状態遷移し、7を出力し、入力が1のときは、第9の状態に状態遷移し、−1を出力する。第9の状態において、入力が0のときは、第5の状態に状態遷移し、0を出力し、入力が1のときは、第9の状態に状態遷移し、0を出力する。こうして2進表現された整数を下位から1ビットずつ入力すると4−NAF表現された冗長2進表現を4ビットずつ出力する。   In the first state, when the input is 0, the state transitions to the first state and outputs 0, and when the input is 1, the state transitions to the 5th state and 0 is output. In the second state, when the input is 0, the state transitions to the first state and outputs 1, and when the input is 1, the state transitions to the 9th state and outputs -7. In the third state, when the input is 0, the state transitions to the second state and outputs 0, and when the input is 1, the state transitions to the sixth state and 0 is output. In the fourth state, when the input is 0, the state transitions to the first state and 3 is output, and when the input is 1, the state transitions to the 9th state and −5 is output. In the fifth state, when the input is 0, the state transitions to the third state and outputs 0, and when the input is 1, the state transitions to the 7th state and outputs 0. In the sixth state, when the input is 0, the state transitions to the first state and 5 is output, and when the input is 1, the state transitions to the 9th state and -3 is output. In the seventh state, when the input is 0, the state transitions to the fourth state and outputs 0, and when the input is 1, the state transitions to the 8th state and outputs 0. In the eighth state, when the input is 0, the state transitions to the first state and 7 is output, and when the input is 1, the state transitions to the 9th state and -1 is output. In the ninth state, when the input is 0, the state transitions to the fifth state and outputs 0, and when the input is 1, the state transitions to the 9th state and outputs 0. When an integer expressed in binary is input bit by bit from the lower order, a redundant binary expression expressed in 4-NAF is output every 4 bits.

図14によって5−NAF変換装置を示す。状態遷移表については図9の説明と同様である。状態sとして取りうる値が0から16の17状態に増えている。一般に、w−NAFの場合は、2^(w−1)+1状態を取る。   FIG. 14 shows a 5-NAF converter. The state transition table is the same as that described in FIG. The value that can be taken as the state s has increased from 0 to 17 states. In general, in the case of w-NAF, 2 ^ (w-1) +1 state is taken.

上述した実施形態は順序回路によって実現できるが、同期回路としても非同期回路としても実現可能である。   Although the above-described embodiment can be realized by a sequential circuit, it can be realized as a synchronous circuit or an asynchronous circuit.

サイドチャネル攻撃のような新たな暗号攻撃法が登場している。以上説明した実施形態によれば、楕円曲線暗号のスカラー倍の途中でwを変化させることで、サイドチャネル攻撃を防ぐことが可能になる。wを変更できるのは、シフトレジスタが0の場合である。つまり、直前に0以外の値を出力したときである。   New cryptographic attack methods such as side channel attacks have appeared. According to the embodiment described above, it is possible to prevent a side channel attack by changing w during the scalar multiplication of elliptic curve cryptography. w can be changed when the shift register is zero. That is, it is when a value other than 0 is output immediately before.

なお、本発明は上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。さらに、異なる実施形態にわたる構成要素を適宜組み合わせてもよい。   Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. In addition, various inventions can be formed by appropriately combining a plurality of components disclosed in the embodiment. For example, some components may be deleted from all the components shown in the embodiment. Furthermore, constituent elements over different embodiments may be appropriately combined.

1…受付手段;
2…更新手段;
3…w−1ビットシフトレジスタ;
4…1ビット記憶手段
1 ... acceptance means;
2 ... Update means;
3 ... w-1 bit shift register;
4 ... 1 bit storage means

Claims (3)

2進表現された整数を最下位桁から順に1ビットずつ入力する1ビットシリアル入力と、
前記整数が2−NAF表現された冗長2進表現を最下位桁から順に2ビットずつ出力する2ビットパラレル出力と、
第1の状態、第2の状態および第3の状態を含む3つの状態を記憶する記憶手段と、
初期状態が前記第1の状態であって、
前記第1の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第1の状態に状態遷移し、0を表す2ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第2の状態に状態遷移し、0を表す2ビットを出力し、
前記第2の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第1の状態に状態遷移し、1を表す2ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第3の状態に状態遷移し、−1を表す2ビットを出力し、
前記第3の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第2の状態に状態遷移し、0を表す2ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第3の状態に状態遷移し、0を表す2ビットを出力する更新手段と、
を具備し、
前記2ビットパラレル出力は、前記整数の(i+1)番目(iは1以上の整数)に小さい桁のビットが前記1ビットシリアル入力によって入力された場合に前記更新手段によって出力される2ビットを前記冗長2進表現のi番目に小さい桁として出力する、
2−NAF変換装置。
1-bit serial input for inputting an integer expressed in binary one bit at a time starting from the least significant digit ;
A 2-bit parallel output that outputs a redundant binary representation in which the integer is represented by 2-NAF in an order of 2 bits from the least significant digit ;
Storage means for storing three states including a first state, a second state, and a third state ;
The initial state is the first state,
In the first state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the first state, and outputs a 2-bit represents 0,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to the second state, and outputs a 2-bit represents 0,
In the second state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the first state, and outputs a 2-bit representing a,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to said third state, and outputs a 2 bits representing -1,
In the third state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the second state, and outputs a 2-bit represents 0,
Wherein when 1 bit input by 1-bit serial input is 1, and updating means for the state changes to said third state, and outputs the two bits represents 0,
Comprising
The 2-bit parallel output is the 2-bit output by the updating means when a bit of the (i + 1) -th integer (i is an integer of 1 or more) is input by the 1-bit serial input. Output as the i-th smallest digit of the redundant binary representation,
2-NAF converter.
2進表現された整数を最下位桁から順に1ビットずつ入力する1ビットシリアル入力と、
前記整数が3−NAF表現された冗長2進表現を最下位桁から順に3ビットずつ出力する3ビットパラレル出力と、
第1の状態、第2の状態、第3の状態、第4の状態および第5の状態を含む5つの状態を記憶する記憶手段と、
初期状態が前記第1の状態であって、
前記第1の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第1の状態に状態遷移し、0を表す3ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第3の状態に状態遷移し、0を表す3ビットを出力し、
前記第2の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第1の状態に状態遷移し、1を表す3ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第5の状態に状態遷移し、−3を表す3ビットを出力し、
前記第3の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第2の状態に状態遷移し、0を表す3ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第4の状態に状態遷移し、0を表す3ビットを出力し、
前記第4の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第1の状態に状態遷移し、3を表す3ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第5の状態に状態遷移し、−1を表す3ビットを出力し、
前記第5の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第3の状態に状態遷移し、0を表す3ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第5の状態に状態遷移し、0を表す3ビットを出力する更新手段と、
を具備し、
前記3ビットパラレル出力は、前記整数の(i+2)番目(iは1以上の整数)に小さい桁のビットが前記1ビットシリアル入力によって入力された場合に前記更新手段によって出力される3ビットを前記冗長2進表現のi番目に小さい桁として出力する、
3−NAF変換装置。
1-bit serial input for inputting an integer expressed in binary one bit at a time starting from the least significant digit ;
A 3-bit parallel output for outputting a redundant binary representation in which the integer is expressed in 3-NAF in an order of 3 bits from the least significant digit ;
Storage means for storing five states including a first state, a second state, a third state, a fourth state, and a fifth state ;
The initial state is the first state,
In the first state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the first state to output the three bits represents 0,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to said third state to output the three bits represents 0,
In the second state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the first state, and outputs a 3-bit representing a,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to the fifth state to output the three bits representing the -3,
In the third state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the second state, and outputs the three bits represents 0,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to the fourth state, and outputs the three bits represents 0,
In the fourth state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the first state to output the three bits representing the 3,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to the fifth state to output the 3 bits representing -1,
In the fifth state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to said third state to output the three bits represents 0,
Wherein when 1 bit input by 1-bit serial input is 1, and updating means for state transition to the fifth state, and outputs the three bits represents 0,
Comprising
The 3-bit parallel output is obtained by outputting the 3 bits output by the updating means when a bit of the integer (i + 2) th (i is an integer of 1 or more) is input by the 1-bit serial input. Output as the i-th smallest digit of the redundant binary representation,
3-NAF converter.
2進表現された整数を最下位桁から順に1ビットずつ入力する1ビットシリアル入力と、
前記整数が4−NAF表現された冗長2進表現を最下位桁から順に4ビットずつ出力する4ビットパラレル出力と、
第1の状態、第2の状態、第3の状態、第4の状態、第5の状態、第6の状態、第7の状態、第8の状態および第9の状態を含む9つの状態を記憶する記憶手段と、
初期状態が前記第1の状態であって、
前記第1の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第1の状態に状態遷移し、0を表す4ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第5の状態に状態遷移し、0を表す4ビットを出力し、
前記第2の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第1の状態に状態遷移し、1を表す4ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第9の状態に状態遷移し、−7を表す4ビットを出力し、
前記第3の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第2の状態に状態遷移し、0を表す4ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第6の状態に状態遷移し、0を表す4ビットを出力し、
前記第4の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第1の状態に状態遷移し、3を表す4ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第9の状態に状態遷移し、−5を表す4ビットを出力し、
前記第5の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第3の状態に状態遷移し、0を表す4ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第7の状態に状態遷移し、0を表す4ビットを出力し、
前記第6の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第1の状態に状態遷移し、5を表す4ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第9の状態に状態遷移し、−3を表す4ビットを出力し、
前記第7の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第4の状態に状態遷移し、0を表す4ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第8の状態に状態遷移し、0を表す4ビットを出力し、
前記第8の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第1の状態に状態遷移し、7を表す4ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第9の状態に状態遷移し、−1を表す4ビットを出力し、
前記第9の状態において、
前記1ビットシリアル入力によって入力された1ビットが0のときは、前記第5の状態に状態遷移し、0を表す4ビットを出力し、
前記1ビットシリアル入力によって入力された1ビットが1のときは、前記第9の状態に状態遷移し、0を表す4ビットを出力する更新手段と、
を具備し、
前記4ビットパラレル出力は、前記整数の(i+3)番目(iは1以上の整数)に小さい桁のビットが前記1ビットシリアル入力によって入力された場合に前記更新手段によって出力される4ビットを前記冗長2進表現のi番目に小さい桁として出力する、
4−NAF変換装置。
1-bit serial input for inputting an integer expressed in binary one bit at a time starting from the least significant digit ;
A 4-bit parallel output that outputs a redundant binary representation in which the integer is expressed in 4-NAF in order of 4 bits from the least significant digit ;
Nine states including a first state, a second state, a third state, a fourth state, a fifth state, a sixth state, a seventh state, an eighth state, and a ninth state Storage means for storing;
The initial state is the first state,
In the first state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the first state, and outputs a 4-bit represents 0,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to the fifth state, and outputs a 4-bit represents 0,
In the second state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the first state, and outputs a 4-bit representing a,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to the state of the ninth, and outputs a 4-bit representing the -7,
In the third state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the second state, and outputs a 4-bit represents 0,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to the state of the sixth, and outputs a 4-bit represents 0,
In the fourth state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the first state, and outputs a 4-bit representing a 3,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to the state of the ninth, and outputs a 4-bit representing a -5,
In the fifth state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to said third state, and outputs a 4-bit represents 0,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to the state of the seventh, and outputs a 4-bit represents 0,
In the sixth state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the first state, and outputs a 4-bit representing a 5,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to the state of the ninth, and outputs a 4-bit representing the -3,
In the seventh state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the fourth state, and outputs a 4-bit represents 0,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to the state of the eighth, and outputs a 4-bit represents 0,
In the eighth state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the first state, and outputs a 4-bit representing a 7,
Wherein when 1 bit input by 1-bit serial input is 1, the state changes to the state of the ninth, and outputs a 4-bit representing a -1,
In the ninth state,
Wherein when 1 bit input by 1-bit serial input is 0, the state changes to the fifth state, and outputs a 4-bit represents 0,
Wherein when 1 bit input by 1-bit serial input is 1, and updating means for the state changes to the state of the ninth, and outputs a 4-bit represents 0,
Comprising
The 4-bit parallel output is the 4-bit output by the updating means when the (i + 3) th bit (i is an integer of 1 or more) of the integer is input by the 1-bit serial input. Output as the i-th smallest digit of the redundant binary representation,
4-NAF converter.
JP2012279603A 2012-12-21 2012-12-21 NAF converter Active JP5606516B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012279603A JP5606516B2 (en) 2012-12-21 2012-12-21 NAF converter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012279603A JP5606516B2 (en) 2012-12-21 2012-12-21 NAF converter

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2009006797A Division JP5225115B2 (en) 2009-01-15 2009-01-15 NAF converter

Publications (2)

Publication Number Publication Date
JP2013077313A JP2013077313A (en) 2013-04-25
JP5606516B2 true JP5606516B2 (en) 2014-10-15

Family

ID=48480677

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012279603A Active JP5606516B2 (en) 2012-12-21 2012-12-21 NAF converter

Country Status (1)

Country Link
JP (1) JP5606516B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018146766A (en) 2017-03-06 2018-09-20 キヤノン株式会社 Scalar multiple arithmetic device, scalar multiple arithmetic method and program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4243179B2 (en) * 2003-12-26 2009-03-25 三洋電機株式会社 Arithmetic unit

Also Published As

Publication number Publication date
JP2013077313A (en) 2013-04-25

Similar Documents

Publication Publication Date Title
EP1471420A2 (en) Montgomery modular multiplier and method thereof using carry save addition
EP1855190A2 (en) Montgomery modular multiplier and method therof using carry save addition
CN115344237A (en) Data processing method combining Karatsuba and Montgomery modular multiplication
JP5225115B2 (en) NAF converter
JP2002215385A (en) Calculation device, calculation method, and program utilizing residue number system expression
KR102496446B1 (en) Word-parallel calculation method for modular arithmetic
JP5606516B2 (en) NAF converter
JP5175983B2 (en) Arithmetic unit
US10387492B2 (en) Information processing system, information processing method, and program
JP3660075B2 (en) Dividing device
US20200097257A1 (en) Electronic calculating device arranged to calculate the product of integers
US20210141601A1 (en) Digital calculation processing circuit
Caffarena et al. Architectural synthesis of fixed-point dsp datapaths using fpgas
Lou et al. High-speed multiplier block design based on bit-level critical path optimization
JP2004166274A (en) Method and apparatus for basis conversion in finite field
Mohan et al. Implementation of Quaternary Signed Adder System
Wu et al. Modular multiplier by folding Barrett modular reduction
US7472154B2 (en) Multiplication remainder calculator
JP2004220377A (en) Reconfigurable circuit, and integrated circuit device and data conversion device capable of using it
JP5975682B2 (en) Arithmetic apparatus, arithmetic method, and program
JP4408727B2 (en) Digital circuit
JP4954019B2 (en) Arithmetic unit
Peijun et al. A 1024-bit RSA cryptosystem hardware design based on modified Montgomery's algorithm
JP2015114434A (en) Device for encrypting stream cipher, device for decrypting stream cipher, method for encrypting stream cipher, method for decrypting stream cipher, and program
JP2011180966A (en) Product-sum computing unit

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20131219

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20131226

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131227

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20140109

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140128

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140326

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140826

R151 Written notification of patent or utility model registration

Ref document number: 5606516

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151