Computing Mod with a Variable Lookup Table

  • Mark A. WillEmail author
  • Ryan K. L. Ko
Conference paper
Part of the Communications in Computer and Information Science book series (CCIS, volume 625)


Encryption algorithms are designed to be difficult to break without knowledge of the secrets or keys. To achieve this, the algorithms require the keys to be large, with some having a recommend size of 2048-bits or more. However most modern processors only support computation on 64-bits at a time. Therefore standard operations with large numbers are more complicated to implement. One operation that is particularly challenging to efficiently implement is modular reduction. In this paper we propose a highly-efficient algorithm for solving large modulo operations; it has several advantages over current approaches as it supports the use of a variable sized lookup table, has good spatial and temporal locality allowing data to be streamed, and only requires basic processor instructions. Our proposed algorithm is theoretically compared to widely used modular algorithms, and shows improvements over other algorithms using predefined lookup tables.



This research is supported by STRATUS (Security Technologies Returning Accountability, Trust and User-Centric Services in the Cloud) (, a science investment project funded by the New Zealand Ministry of Business, Innovation and Employment (MBIE). The authors would also like to thank Sabu M. Thampi for his kind invitation to submit this invited paper for the SSCC 2016 proceedings.


  1. 1.
    Daemen, J., Rijmen, V.: The Design of Rijndael: AES-The Advanced Encryption Standard. Springer, Heidelberg (2002)CrossRefzbMATHGoogle Scholar
  2. 2.
    Gentry, C.: Fully homomorphic encryption using ideal lattices. STOC 9, 169–178 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  3. 3.
    Rivest, R., Shamir, A., Adleman, L.: A method for obtaining digital signatures and public-key cryptosystems. Commun. ACM 21, 120–126 (1978)MathSciNetCrossRefzbMATHGoogle Scholar
  4. 4.
    Intel 64 and IA-32 architectures software developer’s manual. Accessed 27 Aug 2014
  5. 5.
    Kaliski, B.: Twirl and RSA key size. RSA Laboratories Technical Note (2003)Google Scholar
  6. 6.
    Barrett, P.: Implementing the Rivest Shamir and Adleman public key encryption algorithm on a standard digital signal processor. In: Odlyzko, A.M. (ed.) CRYPTO 1986. LNCS, vol. 263, pp. 311–323. Springer, Heidelberg (1987)Google Scholar
  7. 7.
    Cao, Z., Wei, R., Lin, X.: A fast modular reduction method. IACR Cryptol. ePrint Arch. 2014, 40 (2014)Google Scholar
  8. 8.
    Dupaquis, V., Venelli, A.: Redundant modular reduction algorithms. In: Prouff, E. (ed.) CARDIS 2011. LNCS, vol. 7079, pp. 102–114. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  9. 9.
    Montgomery, P.L.: Modular multiplication without trial division. Math. Comput. 44(170), 519–521 (1985)MathSciNetCrossRefzbMATHGoogle Scholar
  10. 10.
    Denis, S.T., Rose, G.: BigNum Math: Implementing Cryptographic Multiple Precision Arithmetic. Syngress Publishing, Boston (2006)Google Scholar
  11. 11.
    Kwon, T.-W., You, C.-S., Heo, W.-S., Kang, Y.-K., Choi, J.-R.: Two implementation methods of a 1024-bit RSA cryptoprocessor based on modified montgomery algorithm. In: The 2001 IEEE International Symposium on Circuits and Systems, ISCAS 2001, vol. 4, pp. 650–653. IEEE (2001)Google Scholar
  12. 12.
    Batina, L., Muurling, G.: Montgomery in practice: how to do it more efficiently in hardware. In: Preneel, B. (ed.) CT-RSA 2002. LNCS, vol. 2271, p. 40. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  13. 13.
    Lim, C.H., Lee, P.J.: Generating efficient primes for discretelog cryptosystems, POSTECH Information Research LaboratoriesGoogle Scholar
  14. 14.
    Lim, C.H., Hwang, H.S., Lee, P.J.: Fast modular reduction with precomputation. In: Proceedings of Korea-Japan Joint Workshop on Information Security and Cryptology (JWISC 1997), pp. 65–79. Citeseer (1997)Google Scholar

Copyright information

© Springer Nature Singapore Pte Ltd. 2016

Authors and Affiliations

  1. 1.Cyber Security LabThe University of WaikatoHamiltonNew Zealand

Personalised recommendations