Improving Modular Inversion in RNS Using the Plus-Minus Method

  • Karim Bigou
  • Arnaud Tisserand
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8086)


The paper describes a new RNS modular inversion algorithm based on the extended Euclidean algorithm and the plus-minus trick. In our algorithm, comparisons over large RNS values are replaced by cheap computations modulo 4. Comparisons to an RNS version based on Fermat’s little theorem were carried out. The number of elementary modular operations is significantly reduced: a factor 12 to 26 for multiplications and 6 to 21 for additions. Virtex 5 FPGAs implementations show that for a similar area, our plus-minus RNS modular inversion is 6 to 10 times faster.


Residue Number System Modular Representation Extended Euclidean Algorithm Hardware Implementation ECC RSA 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Bajard, J.-C., Didier, L.-S., Kornerup, P.: An RNS montgomery modular multiplication algorithm. IEEE Transactions on Computers 47(7), 766–776 (1998)MathSciNetCrossRefGoogle Scholar
  2. 2.
    Bajard, J.-C., Imbert, L.: A full RNS implementation of RSA. IEEE Transactions on Computers 53(6), 769–774 (2004)CrossRefGoogle Scholar
  3. 3.
    Bajard, J.-C., Imbert, L., Liardet, P.-Y., Teglia, Y.: Leak resistant arithmetic. In: Joye, M., Quisquater, J.-J. (eds.) CHES 2004. LNCS, vol. 3156, pp. 62–75. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  4. 4.
    Bajard, J.-C., Meloni, N., Plantard, T.: Study of modular inversion in RNS. In: Luk, F.T. (ed.) Proc. Advanced Signal Processing Algorithms, Architectures, and Implementations XV, San Diego, CA, USA, vol. 5910, pp. 247–255. SPIE (July 2005)Google Scholar
  5. 5.
    Brent, R.P., Kung, H.T.: Systolic VLSI arrays for polynomial GCD computation. IEEE Transactions on Computers C-33(8), 731–736 (1984)CrossRefGoogle Scholar
  6. 6.
    Cheney, P.W.: A digital correlator based on the residue number system. IRE Transactions on Electronic Computers EC-10(1), 63–70 (1961)CrossRefGoogle Scholar
  7. 7.
    Cheung, R.C.C., Duquesne, S., Fan, J., Guillermin, N., Verbauwhede, I., Yao, G.X.: FPGA implementation of pairings using residue number system and lazy reduction. In: Preneel, B., Takagi, T. (eds.) CHES 2011. LNCS, vol. 6917, pp. 421–441. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  8. 8.
    Ciet, M., Neve, M., Peeters, E., Quisquater, J.-J.: Parallel FPGA implementation of RSA with residue number systems – can side-channel threats be avoided? In: Proc. 46th Midwest Symposium on Circuits and Systems (MWSCAS), vol. 2, pp. 806–810. IEEE, Cairo (2003)Google Scholar
  9. 9.
    Meurice de Dormale, G., Bulens, P., Quisquater, J.-J.: Efficient modular division implementation. In: Becker, J., Platzner, M., Vernalde, S. (eds.) FPL 2004. LNCS, vol. 3203, pp. 231–240. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  10. 10.
    Deschamps, J.-P., Sutter, G.: Hardware implementation of finite-field division. Acta Applicandae Mathematicae 93(1-3), 119–147 (2006)MathSciNetCrossRefGoogle Scholar
  11. 11.
    Duquesne, S.: RNS arithmetic in \(\mathbb{F}_p^k\) and application to fast pairing computation. Journal of Mathematical Cryptology 5, 51–88 (2011)MathSciNetCrossRefGoogle Scholar
  12. 12.
    Gandino, F., Lamberti, F., Paravati, G., Bajard, J.-C., Montuschi, P.: An algorithmic and architectural study on montgomery exponentiation in RNS. IEEE Transactions on Computers 61(8), 1071–1083 (2012)MathSciNetCrossRefGoogle Scholar
  13. 13.
    Garner, H.L.: The residue number system. IRE Transactions on Electronic Computers EC-8(2), 140–147 (1959)CrossRefGoogle Scholar
  14. 14.
    Guillermin, N.: A high speed coprocessor for elliptic curve scalar multiplications over \(\mathbb{F}_p\). In: Mangard, S., Standaert, F.-X. (eds.) CHES 2010. LNCS, vol. 6225, pp. 48–64. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  15. 15.
    Guillermin, N.: A coprocessor for secure and high speed modular arithmetic. Technical Report 354, Cryptology ePrint Archive (2011)Google Scholar
  16. 16.
    Guillermin, N.: Implémentation matérielle de coprocesseurs haute performance pour la cryptographie asymétrique. Phd thesis, Université Rennes 1 (January 2012)Google Scholar
  17. 17.
    Hankerson, D., Menezes, A., Vanstone, S.: Guide to Elliptic Curve Cryptography. Springer (2004)Google Scholar
  18. 18.
    Kaihara, M.E., Takagi, N.: A hardware algorithm for modular multiplication/division. IEEE Transactions on Computers 54(1), 12–21 (2005)CrossRefGoogle Scholar
  19. 19.
    Kawamura, S., Koike, M., Sano, F., Shimbo, A.: Cox-Rower architecture for fast parallel montgomery multiplication. In: Preneel, B. (ed.) EUROCRYPT 2000. LNCS, vol. 1807, pp. 523–538. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  20. 20.
    Knuth, D.E.: Seminumerical Algorithms, 3rd edn. The Art of Computer Programming, vol. 2. Addison-Wesley (1997)Google Scholar
  21. 21.
    Lim, Z., Phillips, B.J.: An RNS-enhanced microprocessor implementation of public key cryptography. In: Proc. 41th Asilomar Conference on Signals, Systems and Computers, pp. 1430–1434. IEEE, Pacific Grove (November 2007)Google Scholar
  22. 22.
    Lim, Z., Phillips, B.J., Liebelt, M.: Elliptic curve digital signature algorithm over GF(p) on a residue number system enabled microprocessor. In: Proc. IEEE Region 10 Conference (TENCON), Singapore, pp. 1–6 (January 2009)Google Scholar
  23. 23.
    Nozaki, H., Motoyama, M., Shimbo, A., Kawamura, S.: Implementation of RSA algorithm based on RNS montgomery multiplication. In: Koç, Ç.K., Naccache, D., Paar, C. (eds.) CHES 2001. LNCS, vol. 2162, pp. 364–376. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  24. 24.
    National Institute of Standards and Technology (NIST). FIPS 186-2, digital signature standard, DSS (2000)Google Scholar
  25. 25.
    Peled, A., Liu, B.: A new hardware realization of digital filters. IEEE Transactions on Acoustics, Speech, and Signal Processing 22(6), 456–462 (1974)CrossRefGoogle Scholar
  26. 26.
    Phillips, B.J., Kong, Y., Lim, Z.: Highly parallel modular multiplication in the residue number system using sum of residues reduction. Applicable Algebra in Engineering, Communication and Computing 21(3), 249–255 (2010)MathSciNetCrossRefGoogle Scholar
  27. 27.
    Posch, K.C., Posch, R.: Modulo reduction in residue number systems. IEEE Transactions on Parallel and Distributed Systems 6(5), 449–454 (1995)CrossRefGoogle Scholar
  28. 28.
    Schinianaki, D.M., Fournaris, A.P., Michail, H.E., Kakarountas, A.P., Stouraitis, T.: An RNS implementation of an \(\mathbb{F}_p\) elliptic curve point multiplier. IEEE Transactions on Circuits and Systems I: Regular Papers 56(6), 1202–1213 (2009)MathSciNetCrossRefGoogle Scholar
  29. 29.
    Soderstrand, M., Jenkins, W.K., Jullien, G., Taylor, F.: Residue Number System Arithmetic - Modern Applications in Digital Signal Processing. IEEE (1986)Google Scholar
  30. 30.
    Stein, J.: Computational problems associated with Racah algebra. Journal of Computational Physics 1(3), 397–405 (1967)CrossRefGoogle Scholar
  31. 31.
    Svoboda, A., Valach, M.: Operátorové obvody (operator circuits in czech). Stroje na Zpracování Informací (Information Processing Machines) 3, 247–296 (1955)Google Scholar
  32. 32.
    Szabo, N.S., Tanaka, R.I.: Residue arithmetic and its applications to computer technology. McGraw-Hill (1967)Google Scholar

Copyright information

© International Association for Cryptologic Research 2013

Authors and Affiliations

  • Karim Bigou
    • 2
    • 1
  • Arnaud Tisserand
    • 3
    • 1
  1. 1.IRISAFrance
  2. 2.INRIA Centre Rennes - Bretagne AtlantiqueFrance
  3. 3.CNRSUniversity Rennes 1Lannion cedexFrance

Personalised recommendations