Modular Inverse for Integers using Fast Constant Time GCD Algorithm and its Applications

Modular inversion, the multiplicative inverse of an integer in the ring of integers modulo a prime number, is widely used in public-key cryptography. However, it is one of the most computationally intensive operations, thus, it remains the main performance bottleneck for many cryptographic algorithms.This paper presents to the best of the author’s knowledge, the first FPGA-based hardware design for computing the multiplicative inverse using the recently proposed fast constant-time Greatest Common Divisor (GCD) algorithm. This paper introduces two distinct design architectures targeting different applications: (a) a full-width design and (b) a sequential design. The presented designs are compact, parameterizable, and scalable in terms of area and speed. The evaluation shows the proposed designs, which are constant-time and protect against timing-based attacks, outperform existing software and hardware implementations that use other modular inversion techniques. As a specific example, this work presents an evaluation focusing on the use of the multiplicative inverse hardware module to accelerate the ElGamal cryptosystem. The proposed design achieves a speed-up of 90% in the modular inverse calculation and a speed-up of 45% in the overall ElGamal decryption algorithm using our sequential hardware design of fast constant-time GCD algorithm.In addition to developing the fast hardware implementation, this work potentially opens up a new direction for designing cryptosystems: the inverse operation is often avoided when designing algorithms, due to its complexity. With the new hardware module, using the inverse becomes more tractable, making it more appealing to use in the design of new cryptosystems.

[1]  Alfred Menezes,et al.  Guide to Elliptic Curve Cryptography , 2004, Springer Professional Computing.

[2]  Martin Langhammer RSA & Public Key Cryptography in FPGAs , 2005 .

[3]  Diego F. Aranha,et al.  Curve 25519 for the Cortex-M 4 and beyond , 2017 .

[4]  Michael J. Schulte,et al.  Design alternatives for barrel shifters , 2002, SPIE Optics + Photonics.

[5]  Alexandre F. Tenca,et al.  An algorithm and hardware architecture for integrated modular division and multiplication in GF(p) and GF(2/sup n/) , 2004 .

[6]  R. PaulGigliotti Implementing Barrel Shifters Using Multipliers , .

[7]  A TawalbehLo'ai,et al.  Hardware Design and Implementation of ElGamal Public-Key Cryptography Algorithm , 2010 .

[8]  Xin Zhou,et al.  Efficient Implementation of FDFM Approach for Euclidean Algorithms on the FPGA , 2016, Int. J. Netw. Comput..

[9]  Images Produced via Modular Multiplicative Inverse Filters , 2019 .

[10]  Patrick Longa,et al.  A Compact and Scalable Hardware/Software Co-design of SIKE , 2020, IACR Cryptol. ePrint Arch..

[11]  Victor Shoup,et al.  A computational introduction to number theory and algebra , 2005 .

[12]  Musical Scales and Multiplicative Groups , 2018 .

[13]  Dan Boneh,et al.  Digital Signature Standard , 2005, Encyclopedia of Cryptography and Security.

[14]  Trio Adiono,et al.  FPGA implementation of modified serial montgomery modular multiplication for 2048-bit RSA cryptosystems , 2015, 2015 International Seminar on Intelligent Technology and Its Applications (ISITIA).

[15]  Paul Barrett,et al.  Implementing the Rivest Shamir and Adleman Public Key Encryption Algorithm on a Standard Digital Signal Processor , 1986, CRYPTO.

[16]  Bo-Yin Yang,et al.  Fast constant-time gcd computation and modular inversion , 2019, IACR Cryptol. ePrint Arch..

[17]  Reza Azarderakhsh,et al.  Fast, Small, and Area-Time Efficient Architectures for Key-Exchange on Curve25519 , 2020, 2020 IEEE 27th Symposium on Computer Arithmetic (ARITH).

[18]  Oystein Ore,et al.  Number Theory and Its History , 1949 .

[19]  Adi Shamir,et al.  A method for obtaining digital signatures and public-key cryptosystems , 1978, CACM.

[20]  Bernard P. Zajac Applied cryptography: Protocols, algorithms, and source code in C , 1994 .

[21]  Bryce D. Allen Implementing several attacks on plain ElGamal encryption , 2008 .

[22]  Adrian Marotzke A Constant Time Full Hardware Implementation of Streamlined NTRU Prime , 2020, IACR Cryptol. ePrint Arch..

[23]  Thomas Plantard,et al.  Efficient regular modular exponentiation using multiplicative half-size splitting , 2016, Journal of Cryptographic Engineering.

[24]  Taher El Gamal A public key cryptosystem and a signature scheme based on discrete logarithms , 1984, IEEE Trans. Inf. Theory.

[25]  Jean-Pierre Serre,et al.  Fermat ’ s Last Theorem , 2017 .

[26]  Diego F. Aranha,et al.  Curve25519 for the Cortex-M4 and Beyond , 2017, LATINCRYPT.

[27]  Saadeh Sweidan,et al.  Hardware Design and Implementation of ElGamal Public-Key Cryptography Algorithm , 2010, Inf. Secur. J. A Glob. Perspect..

[28]  Pallab Maji,et al.  Application of Residue Arithmetic in Communication and Signal Processing , 2011 .

[29]  Lo'ai Ali Tawalbeh,et al.  An algorithm and hardware architecture for integrated modular division and multiplication in GF(p) and GF(2/sup n/) , 2004, Proceedings. 15th IEEE International Conference on Application-Specific Systems, Architectures and Processors, 2004..

[30]  Pascal Lafourcade,et al.  Linear Generalized ElGamal Encryption Scheme , 2020, IACR Cryptol. ePrint Arch..