Vol.7, No.6 (01, pp.69-74 http://dx.doi.org/10.1457/ijsia.01.7.6.7 Some Explicit Formulae of NAF ad its Left-to-Right Aalogue Based o Booth Ecodig Dog-Guk Ha, Okyeo Yi, ad Tsuyoshi Takagi Kookmi Uiversity, Kyushu Uiversity Abstract. No-Adjacet Form (NAF is a caoical form of siged biary represetatio of itegers. Joye-Ye proposed a left-to-right aalogue of NAF (FAN. It is kow that NAF ad FAN ca be geerated by applyig a slidig widow method with width- to the Booth ecodig i right-to-left ad left-to-right directio, respectively. I this article, we derive some properties of Booth ecodig such as patter, classificatio, extesio, adjacecy, ad legth. 1 Keywords: siged biary represetatio, o-adjacet form, Booth ecodig. 1 Itroductio I some expoetiatio-based public-key cryptosystems icludig RSA ad Elliptic Curve Cryptosystems (ECC, a biary represetatio of a give iteger (which may be a secret i most cases is commoly used as a stadard techique. While a o-siged represetatio of a iteger is uique, we have some ways for represetig the iteger i siged form. For example, a iteger 1 ca be represeted i siged form such as 10 101, 100 1 1, or 10 11 1, where 1 deotes 1. Such siged biary represetatios are especially useful i ECC, sice iversios of arbitrary poits ca be obtaied with almost free operatios over elliptic curves. Some properties of such siged biary represetatios are related to the cost of a expoetiatio. Especially, the umber of o-zero bits (Hammig weight is importat sice this value rules the umber of multiplicatios i the expoetiatio. Thus aalyzig siged represetatios implies a cost evaluatio of expoetiatios. The o-adjacet form (NAF is a well-kow siged biary represetatio [7]. A NAF of a positive iteger a is a expressio a = 1 i=0 ν i i where ν i { 1, 0, 1}, ν 1 0 ad o two successive digits are o-zero, i.e. ν i ν i+1 = 0 for i = 0, 1,..., [7]. Each iteger a has a uique NAF represetatio deoted by Naf(a. Moreover, Naf(a ca be efficietly computed by right-to-left operatios ([], for example. The average Hammig weight of NAF has bee foud by Gollma et al. (Corollary.6 i [], ad more recetly Wu ad Hasa have preseted a closed form expressio for the average umber of Hammig weight ad legth i a miimal weight radix-r siged-digit represetatio where the special case r = is NAF [8]. I [4], Joye-Ye proposed a left-to-right aalogue of NAF. We call it FAN as the reverse order of NAF. It is kow that NAF ad FAN ca be geerated by applyig a slidig widow method with width- to the Booth ecodig [1] i right-to-left ad left-to-right, respectively. Note that the Booth ecodig was also itroduced as the reversed biary represetatio by Kuth [5, Exercise 4.1-7]. The Booth ecodig ad FAN of a iteger a are deoted by Booth(a ad Fa(a, respectively. 1 Correspodig Author ISSN: 178-9976 IJSIA Copyright c 01 SERSC
Vol.7, No.6 (01 Iteger NAF Right-to-Left Booth Ecodig Left-to-Right FAN Fig. 1. A relatio of the Booth ecodig, NAF, ad FAN. I this paper, we provide some explicit formulae of NAF ad FAN by usig fudametal properties iduced from Booth ecodig. We propose some results for properties of Booth ecodig ad relatios about Patter, Classificatio, Extesio, Adjacecy, ad Legth amog Booth, NAF, ad FAN(Sectio. Prelimiaries.1 Booth Ecodig, NAF ad FAN The -bit Booth ecodig [1] is a -bit siged biary represetatio that satisfies the followig two coditios: Sigs of adjacet o-zero bits (without cosiderig zero bits are opposite. The most sigificat o-zero bit ad the least sigificat o-zero bit are 1 ad 1, respectively, uless all bits are zero. I [6], they proved that for each iteger there exists oly oe represetatio that satisfies the Booth recodig properties ad showed a simple coversio method from a -bit biary strig to ( + 1-bit Booth ecodig. Give a iteger a, the Booth ecodig of a is obtaied by a a, where stads for a bitwise subtractio. The o-adjacet form (NAF also represets a iteger i siged form [7]. Sice there is o successive o-zero bits i the represetatio, NAF is a stadard techique for computig expoetiatios []. NAF ca be iterpreted as a combiatio of the Booth ecodig ad a right-to-left slidig widow method with width- (SW r t l, i.e. width- widow, movig right-to-left, skippig cosecutive zero etries after a ozero digit is processed. 01, 0 1, 1 1, ad 11 are coverted to 01, 0 1, 01, ad 0 1, respectively. Iteger = Booth Recodig SW r t l = NAF represetatio FAN was itroduced as a left-to-right aalogue of NAF [4]. I fact, FAN ca be also iterpreted as a combiatio of the Booth ecodig ad a left-to-right slidig widow method with width- (SW l t r. 10, 10, 1 1, ad 11 are coverted to 10, 10, 01, ad 0 1, respectively. Iteger = Booth Recodig SW l t r = FAN represetatio 70 Copyright 01 SERSC
Vol.7, No.6 (01. Notatios For a give biary -bit iteger a (betwee 0 ad 1 we use the followig otatios: Biary(a, Booth(a, Naf(a, ad Fa(a deote the biary, Booth ecodig, NAF, ad FAN represetatio of the iteger a respectively. Biary(a := (a 1,..., a 1, a 0 with a i {0, 1}, Booth(a := (β,..., β 1, β 0 with β i { 1, 0, 1}, Naf(a := (ν,..., ν 1, ν 0 with ν i { 1, 0, 1}, Fa(a := (φ,..., φ 1, φ 0 with φ i { 1, 0, 1}. Note that throughout this paper each of the symbols β i, ν i, ad φ i are oly utilized to deote a digit of the represetatio of Booth, NAF, ad FAN respectively. B( := {Booth(a 0 a 1}, that is a set of all Booth ecodigs of itegers betwee 0 ad 1. Case I B( := {Booth(a with β = 0 0 a 1}. Case II B( := {Booth(a with (β, β 1 = (1, 1 0 a 1}. Case III B( := {Booth(a with (β, β 1 = (1, 0 0 a 1}. N ( := {Naf(a 0 a 1}, that is a set of all NAF represetatios of itegers betwee 0 ad 1. F( := {Fa(a 0 a 1}, that is a set of all FAN represetatios of itegers betwee 0 ad 1. ε is the egligible fuctio i, amely for every costat c 0 there exists a iteger m such that ε 1/ c for all m. If t is a real umber, the t is the largest iteger t ad t is the smallest iteger t.. Some cases of NAF ad FAN I this sectio, we show that how to compute NAF ad FAN represetatios from the Booth ecodig. For example, for a iteger 1 = (1, 1, 0, 1, we have Booth(1 = (1, 0, 1, 1, 1 from Algorithm??. The we divide Booth(1 (as a strig ito width- widows from right to left: 01, 0 1, 1 1 (the leftmost 0 was padded, ad covert 1 1 to 01 ad 11 to 0 1, if ay. Thus we have Naf(1 = (1, 0, 1, 0, 1. I order to geerate FAN represetatio of 1, we divide the strig of Booth(1 ito width- widows from left to right: 10, 11, 10 (the rightmost 0 was padded. The, similarly to NAF, covert 1 1 to 01 ad 11 to 0 1, if ay. Thus we have Fa(1 = (1, 0, 0, 1, 1. Note that FAN ca have successive o-zero bits ulike NAF. Several results of Booth ecodigs I this sectio, we prove several results for the Booth ecodigs such as Patter, Classificatios, Extesio, Adjacecy, ad Legth..1 Some Properties of Booth Ecodig Property 1. Due to the defiitio of Booth ecodig (refer to Sectio.1, the Hammig weight of Booth(a is always eve, if the origial iteger a is positive. Copyright 01 SERSC 71
Vol.7, No.6 (01 Table 1. NAF, FAN, Booth ecodig represetatios of some itegers Iteger Siged Biary No-siged a Naf(a Fa(a Booth(a Biary 0 0000000 0000000 0000000 0000000 1 0000001 0000001 000001 1 0000001 0000010 0000010 00001 10 0000010 000010 1 000010 1 000010 1 0000011 4 0000100 0000100 0001 100 0000100 5 0000101 0000101 0001 11 1 0000101 6 00010 10 00010 10 00010 10 0000110 7 000100 1 000100 1 000100 1 0000111 8 0001000 0001000 001 1000 0001000 9 0001001 0001001 001 101 1 0001001 10 0001010 0001010 001 11 10 0001010 11 0010 10 1 000110 1 001 110 1 0001011 1 0010 100 0010 100 0010 100 0001100 1 0010 101 00100 1 1 0010 11 1 0001101 14 00100 10 00100 10 00100 10 0001110 15 001000 1 001000 1 001000 1 0001111 Let 1 1 k be a patter of o-zero bits i Booth ecodig such that k 1 {}}}}{ 1, 1,..., 1, 1, 1, 1 (exactly k-times after omittig all zero bits betwee 1 ad 1. Let #[ 1 1 k ] be the total umber of strigs havig 1 1 k patter. For example, i B(4, #[ 1 1 1 ] = 10 (i.e. itegers 1,,,4,6,7,8,1,14,15 ad #[ 1 1 ] = 5 (i.e. itegers 5,9,10,11,1. Refer to the fourth colum of Table 1. Theorem 1 (Patter. B( cosists of exactly all possible represetatios with 1 1 k patter for 0 k /. Proof. For 0 k /, #[ 1 1 0 ] = + 1, #[ 1 1 1 ] = + 1 0,..., #[ 1 1 k ] = + 1 k,..., #[ 1 1 / ] = + 1, / where the biomial coefficiet ( a b deotes the umber of b-combiatios from a set S with a elemets. Thus / #[ 1 1 k ] = / ( +1 k = from +1 ( +1 k = +1 ad ( +1 ( k = +1 k+1. This implies that there are differet represetatios with 1 1 k patter. As the Booth recodig is uique, the assertio is proved. Theorem (Classificatio. B( ca be divided ito the followig three cases; i Case I B( with #[Case I B(]= 1, ii Case II B( with #[Case II B(] =, iii Case III B( with #[Case III B(] =. 7 Copyright 01 SERSC
Vol.7, No.6 (01 Proof. From Property 1 ad Lemma 1, #[Case I B(] = #[Case II B(] = 1 #[Case III B(] = = = 1, k 1 =, k { 1 1 k+1, (if is eve 1 k+1 (otherwise Theorem (Extesio. B( ca be costructed from B( 1 accordig to the followig rules; i Case I B( = {(β = 0 (β 1,..., β 0 (β 1,..., β 0 B( 1}, ii Case II B(= (β, β 1 =(1, 1 (β,..., β 0 (β,..., β 0 B(, iii Case III B( = (β, β 1 = (1, 0 (β,..., β 0 (1, β,..., β 0 {B( 1 Case I B( 1}. Proof. From Property 1 ad Lemma 1,, we ca see that the assertio is true. Theorem 4 (Case II-Classificatio. i # [ a Case II B( the umber of most sigificat cosecutive o-zero bits of a is t, where t is eve ] = 1 +κ, ii # [ a Case II B( the umber of most sigificat cosecutive o-zero bits of a is t, where t is odd ] = κ, where κ = if is odd ad κ = 1 if is eve. Especially, iii # [ a Case II B( the umber of most sigificat cosecutive o-zero bits of a is ] =. Proof. Let be eve ad s t := # [ a Case II B( the umber of most sigificat cosecutive o-zero bits of a is eve t ]. The, based o Property 1 1 ( ( 4 t ( t s = =, s 4 = = 5,, s t = = t 1, k k k 1 (, s = =, s = 1. k Thus, the result of Lemma 4.i whe is eve is k=1 s k = 1 +1. From Lemma.ii, we ca derive the result of Lemma 4.ii whe is eve from the above result that is 1 +1 = 1. Similarly, the result of Lemma 4.i whe is odd is 1 + ad the result of Lemma 4.ii whe is odd is + = 1. The third oe is clearly s.. Relatios amog Booth, NAF, ad FAN Theorem 5 (Adjacet. A substrig with a odd umber (> 1 of cosecutive ozero bits i Booth represetatios is coverted ito a substrig with 11 or 1 1 at the least sigificat bits of the substrig whe trasformig to FAN represetatio. Moreover, Copyright 01 SERSC 7
Vol.7, No.6 (01 the resultig strig i FAN is shorter tha the origial strig i Booth, i.e. the most sigificat 1 of the FAN strig will be oe positio lower tha that of the Booth strig. I the case of NAF strig, the most sigificat 1 or 1 stays at the same positio. Naf... 0 10 10 10 1 } 0... SW r t l = Booth... 0 1 11 1 1 11 } 0... #odd SW l t r = Fa... 0 0101 011 } 0... Naf Booth Fa r t l... 0 1010 101 } 0... SW SW =... 0 } 11 11 {{ 11 1 l t r } 0... =... 0 0 10 1 0 1 1 } 0... #odd Defie L[a] as the bit-legth of a represetatio of a, coutig the bits from the least sigificat to the most sigificat 1. For example, if a = (10110 the L[Biary(a] = 5. The results of Lemma 5 directly serves the proof of Lemma 6. Theorem 6 (Legth. For a arbitrary iteger a i. L[Booth(a with #(the most sigif icat cosecutive ozero bits = eve] = L[Naf(a] + 1, = L[Fa(a] + 1, ii. L[Booth(a with #(the most sigif icat cosecutive ozero bits = odd (> 1] = L[Naf(a] = L[Fa(a] + 1, iii. L[Booth(a with #(the most sigif icat cosecutive ozero bits = 1] = L[Naf(a] = L[Fa(a]. 4 Coclusio I this article, we derived several iterestig cotributios from the relatio betwee NAF ad FAN based o the Booth ecodig. The results would be applied to aalyze the probability of the NAF represetatio of a -bit iteger, the average Hammig weight of NAF ad FAN, ad the average legth of zero rus i both the NAF ad FAN. This work was supported by the IT R&D program of MKE/KEIT[1009140, Developemet of Crypto Algorithms(ARIA, SEED, KCDSA, etc. for Smart Devices(ARM7,9,11, UICC]. Refereces 1. A. Booth, A siged biary multiplicatio techique, Jour. Mech. ad Applied Math., 4(, pp.6-40, 1951.. D. Gollma, Y. Ha, ad C.J. Mitchell, Redudat Iteger Represetatios ad Fast Expoetatio, Desigs, Codes, ad Cryptography, vol. 7, pp.15-151, 1996.. IEEE 16-000, IEEE Stadard Specificatios for Public-Key Cryptography, 000. 4. M. Joye, ad S.-M. Ye, Optimal Left-to-Right Biary Siged-digit Expoet Recodig, IEEE Trasactios o Computers 49(7, pp.740-748, 000. 5. D.E. Kuth, The Art of Computer Programmig, vol., Semiumerical Algorithms, d ed., Addiso-Wesley, Readig, Mass, 1981. 6. K. Okeya, K. Schmidt-Samoa, C. Spah, ad T. Takagi, Siged Biary Represetatios Revisited, IACR Cryptology eprit Archive, 004. 7. G.W. Reitwieser, Biary arithmetic, Advaces i Computers, vol.1, pp.1-08, 1960. 8. H. Wu, ad M.A. Hasa, Closed-Form Expressio for the Average Weight of Siged-Digit Represetatios, IEEE Trasactios o Computers 48(8, pp.848-851, 1999. 74 Copyright 01 SERSC