COMPARISON ANALYSIS OF THE FUNCTIONS A COMPUTATION OF MODULAR EXPONENTIATION

2022;
: 63-67
https://doi.org/10.23939/ujit2022.01.063
Received: March 24, 2022
Accepted: May 19, 2022

Ци­ту­вання за ДСТУ: Проць­ко І. О., Рикмас Р. В., Гри­щук О. В. По­рівняль­ний ана­ліз фун­кцій обчислення мо­дуль­ної ек­спо­ненти. Укра­їнсь­кий журнал інформа­ційних техно­ло­гій. 2022, т. 4, № 1. С. 63–67.

Ci­ta­ti­on APA: Protsko, I. O., Rykmas, R. V., & Gryshchuk, O. V. (2022). Compa­ri­son analysis of the functi­ons a compu­ta­ti­on of mo­du­lar expo­nenti­ati­on. Ukra­ini­an Jo­urnal of Informa­ti­on Techno­logy, 4(1), 63–67. https://doi.org/10.23939/ujit2022.01.063

1
Lviv Polytechnic National University, Lviv, Ukraine
2
LtdS "Uniservice", Lviv, Ukraine
3
LtdS "Softserve", Lviv, Ukraine

The computation of the modular exponentiation for big numbers is widely used to find the discrete logarithm, in number-theoretic transforms and in cryptographic algorithms. To efficient compute the modular exponent, new methods, algorithms and means of their implementation are being developed. There are three directions of computational method of modular exponentiation: general modular exponentiation, and computation of the modular exponentiation with a fixed exponent or with a fixed base. Special functions have been developed to perform modular exponentiation in mathematical and cryptographic software libraries. The paper compares the freely available functions of computing the modular exponentiation from the Crypto ++, OpenSSL, Pari / GP and MPIR libraries and developed three functions based on the right-to-left binary shift algorithm. A separate type of numeric data from the MPIR library is used to work with big numbers in the developed functions. The developed functions implement a binary iterative algorithm in one main stream, in two streams and one stream using precomputation. The comparison is based on the average time of execution of the modular exponentiation for pseudo-random data with 1K and 2K bits, which corresponds to the size of about 300 and 600 decimal signs. The runtime results summarized in the table show that the modular exponentiation is computed the fastest by a function from the OpenSSL library, which is almost twice smaller than the function from the Crypto ++ library and three times smaller than the MPIR function in universal computer systems. The implementation of the function of computing the modular exponentiation by mathematical and cryptographic software libraries uses a more optimal modulus multiplication algorithm, the so-called Montgomery multiplication. The developed three functions use multiplication by modulo operations for factors smaller than the module value. The function using precomputation of the remainders for the fixed basis and the module is analyzed separately. After all, in the testing process, the time of precomputation and determination of the periodicity of residues for this function is not taken into account. Further parallelization of the computation of parts of a multi-bit exponent and the use of the Montgomery multiplication algorithm will allow efficient use of the developed function with precomputation for the calculation of the discrete logarithm.

[1]     Stud­hol­me, C. (2002). The Discre­te Log Prob­lem. Ret­ri­eved from: http://www.cs.to­ron­to.edu/~cvs/dlog/re­se­arch_pa­per.pdf

[2]     Sat­ya­na­ra­ya­na, V. N., & Ra­ma­sub­ra­ma­ni­an, U. T. (2021). Energy-Ef­fi­ci­ent Mo­du­lar Ex­po­nen­ti­al Techniq­ues for Pub­lic-Key Cryptog­raphy. Sprin­ger Na­tu­re Sin­ga­pur Pte Ltd. 255 p.
https://doi.org/10.1007/978-3-030-74524-0

[3]     Tandrup, M. B., Jen­sen, M. H., An­der­sen, R. N., & Han­sen, T. F. (2004). Fast Ex­po­nen­ti­ati­on In prac­ti­ce. Ret­ri­eved from: https://cs.au.dk/~ivan/Fas­tExppro­ject.pdf

[4]     Ja­kubski, A., & Per­liński, R. (2011). Re­vi­ew of Ge­ne­ral Ex­po­nen­ti­ati­on Al­go­rithms. Sci­en­ti­fic Re­se­arch of the Insti­tu­te of Mat­he­ma­tics and Com­pu­ter Sci­en­ce, 2(10), 87–98. Ret­ri­eved from: http://amcm.pcz.pl/2011_2/art_10.pdf

[5]     Re­zai, A., & Kes­ha­var­zi, P. (2015). Al­go­rithm de­sign and the­ore­ti­cal analysis of a no­vel CMM mo­du­lar ex­po­nen­ti­ati­on al­go­rithm for lar­ge in­te­gers. RA­IRO – The­ore­ti­cal In­for­ma­tics and Appli­ca­ti­ons, 49(3), 255–268.
https://doi.org/10.1051/ita/2015007

[6]     Ma­ro­uf, I., Asad, M. M., & Al-Ha­ija, Q. A. (2017). Com­pa­ra­ti­ve Study of Ef­fi­ci­ent Mo­du­lar Ex­po­nen­ti­ati­on Al­go­rithms. COM­PU­SOFT, In­ter­na­ti­onal jo­ur­nal of ad­van­ced com­pu­ter techno­logy, 6(8), 2381–2392.

[7]     Vol­la­la, S., Ge­et­ha, K., & Ra­ma­sub­ra­ma­ni­an, N. (2016). Ef­fi­ci­ent mo­du­lar ex­po­nen­ti­al al­go­rithms com­pa­tib­le with hardwa­re imple­men­ta­ti­on of pub­lic-key cryptog­raphy. Se­cu­rity and Com­mu­ni­ca­ti­on Net­works, 9(16), 3105–3115.
https://doi.org/10.1002/sec.1511

[8]     Me­ne­zes, A. J., van Oorschot, P. C., & Vansto­ne, S. A. (1996). Handbo­ok of appli­ed cryptog­raphy. CRC Press, Bo­ca Ra­ton.
https://doi.org/10.1201/9780429466335

[9]     Knuth, D. E. (1998). The art of com­pu­ter prog­ram­ming. 3 d ed. Re­ading (Mass): Ad­di­son-Wes­ley, cop. 712 p.

[10]  Bach, E., & Shal­lit, J. (1996). Al­go­rithmic Num­ber The­ory. Vo­lu­me I: Ef­fi­ci­ent Al­go­rithms. Cambrid­ge, USA: MIT Press. 516 p.

[11]  Co­hen, H. (1993). A co­ur­se in com­pu­ta­ti­onal al­geb­ra­ic num­ber the­ory. Ber­lin, He­idel­berg: Sprin­ger. 536 p.
https://doi.org/10.1007/978-3-662-02945-9

[12]  Ro­bert, J.-M., Neg­re, C., & Plan­tard, T. (2019). Ef­fi­ci­ent Fi­xed Ba­se Ex­po­nen­ti­ati­on and Sca­lar Mul­tip­li­ca­ti­on ba­sed on a Mul­tip­li­ca­ti­ve Split­ting Ex­po­nent Re­co­ding. Jo­ur­nal of Cryptog­rap­hic En­gi­ne­ering, Sprin­ger, 9(2), 115–136. https://doi.org/10.1007/s13389-018-0196-7

[13]  La­ra, P., Bor­ges, F., Por­tu­gal, R., & Ned­jah, N. (2012). Pa­ral­lel mo­du­lar ex­po­nen­ti­ati­on using lo­ad ba­lan­cing wit­ho­ut pre­com­pu­ta­ti­on. Jo­ur­nal of Com­pu­ter and System Sci­en­ces, 78(2), 575–582.
https://doi.org/10.1016/j.jcss.2011.07.002

[14]  Ned­jah, N., & Mou­rel­le, Ld. M. (2006). Three hardwa­re archi­tec­tu­res for the bi­nary mo­du­lar ex­po­nen­ti­ati­on: Seq­uen­ti­al, pa­ral­lel, and systo­lic. Cir­cu­its and Systems I: Re­gu­lar Pa­pers, IEEE Tran­sac­ti­ons, 53(3), 627–633. https://doi.org/10.1109/TCSI.2005.858767

[15]  Em­mart, N., Zheng, F., & We­ems, C. (2018). Fas­ter Mo­du­lar Ex­po­nen­ti­ati­on using Do­ub­le Pre­ci­si­on Flo­ating Po­int Arithme­tic on the GPU. 25th IEEE Sympo­si­um on Com­pu­ter Arithme­tic, 126–133.
https://doi.org/10.1109/ARITH.2018.8464792

[16]  Go­pal, V., Gu­il­ford, J., Oz­turk, E., Feg­ha­li, W, Wol­rich, G., & Di­xon, M. (2009). Fast and Constant-Ti­me Imple­men­ta­ti­on of Mo­du­lar Ex­po­nen­ti­ati­on. 28th In­ter­na­ti­onal Sympo­si­um on Re­li­ab­le Distri­bu­ted Systems. Ni­aga­ra Falls, New York, USA. Ret­ri­eved from: https://cse.buf­fa­lo.edu/srds2009/escs2009_sub­mis­si­on_Go­pal.pdf

[17]  Com­pa­ri­son of cryptog­raphy lib­ra­ri­es. Ret­ri­eved from: https://en.wi­ki­pe­dia.org/wi­ki/Com­pa­ri­son_of_cryptog­raphy_lib­ra­ri­es

[18]  Neg­re, C., & Plan­tard, T. (2017). Ef­fi­ci­ent Re­gu­lar Mo­du­lar Ex­po­nen­ti­ati­on Using Mul­tip­li­ca­ti­ve Half-Si­ze Split­ting. Jo­ur­nal of Cryptog­rap­hic En­gi­ne­ering, Sprin­ger, 7(3), 245–253.
https://doi.org/10.1007/s13389-016-0134-5

[19]  Gue­ron, S. (2012). Ef­fi­ci­ent softwa­re imple­men­ta­ti­ons of mo­du­lar ex­po­nen­ti­ati­on. Jo­ur­nal of Cryptog­rap­hic En­gi­ne­ering, 2, 31–43.
https://doi.org/10.1007/s13389-012-0031-5

[20]  Protsko, I., Kryvinska, N., & Gryshchuk, O. (2021). The Run­ti­me Analysis of Com­pu­ta­ti­on of Mo­du­lar Ex­po­nen­ti­ati­on. Ra­dio Electro­nics, Com­pu­ter Sci­en­ce, Control, 3, 42–47.
https://doi.org/10.15588/1607-3274-2021-3-4

[21]  Protsko, I., & Gryshchuk, O. (2022). The Mo­du­lar Ex­po­nen­ti­ati­on with pre­com­pu­ta­ti­on of re­du­sed set of re­sed­ues for fi­xed-ba­se. Ra­dio Electro­nics, Com­pu­ter Sci­en­ce, Control, 1. (ac­cep­ted).

[22]  PA­RI/GP ho­me. Ret­ri­eved from: http://pa­ri.math.u-bor­de­aux.fr/

[23]  MPIR: Mul­tip­le Pre­ci­si­on In­te­gers and Ra­ti­onals. Ret­ri­eved from: http://mpir.org/

[24]  Crypto++ Lib­rary 8.6. Ret­ri­eved from: https://www.cryptopp.com

[25]  OpenSSL. Cryptog­raphy and SSL/TLS To­ol­kit. Ret­ri­eved from: http://www.openssl.org/

[26]  Montgo­mery, P. (1985). Mo­du­lar Mul­tip­li­ca­ti­on wit­ho­ut Tri­al Di­vi­si­on. Mat­he­ma­tics of Com­pu­ta­ti­on, 44(170), 519–521.
https://doi.org/10.1090/S0025-5718-1985-0777282-X

[27]  Hars, L. (2004). Long Mo­du­lar Mul­tip­li­ca­ti­on for Cryptog­rap­hic Appli­ca­ti­ons. Ret­ri­eved from: https://ep­rint.iacr.org/2004/198.pdf

[28]  Protsko, I. (2020). Bi­nar­no-bi­to­vi al­horytmy: proh­ra­mu­vannya i zas­to­su­vannya. Navchalʹnyy po­sibnyk. Lviv: "Tri­ada plyus". 120 p. [In Uk­ra­ini­an].