Fast Implementation of Curve25519 Using AVX2

  • Armando Faz-HernándezEmail author
  • Julio López
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9230)


AVX2 is the newest instruction set on the Intel Haswell processor that provides simultaneous execution of operations over vectors of 256 bits. This work presents the advances on the applicability of AVX2 on the development of an efficient software implementation of the elliptic curve Diffie-Hellman protocol using the Curve25519 elliptic curve. Also, we will discuss some advantages that vector instructions offer as an alternative method to accelerate prime field and elliptic curve arithmetic. The performance of our implementation shows a slight improvement against the fastest state-of-the-art implementations.


AVX2 SIMD Vector instructions Elliptic Curve Cryptography Prime Field Arithmetic Curve25519 Diffie-Hellman Protocol 



The authors would like to thank the anonymous reviewers for their helpful suggestions and comments. Additionally, they would like to show their gratitude to Jérémie Detrey for his valuable comments on an earlier version of the manuscript.

Supplementary material


  1. 1.
    Aranha, D.F., Gouvêa, C.P.L.: RELIC is an Efficient LIbrary for Cryptography.
  2. 2.
    Aranha, D.F., Barreto, P.S.L.M., Pereira, G.C.C.F., Ricardini, J.E.: A note on high-security general-purpose elliptic curves. Cryptology ePrint Archive, Report 2013/647 (2013).
  3. 3.
    Bernstein, D.J.: Curve25519: new Diffie-Hellman speed records. In: Yung, M., Dodis, Y., Kiayias, A., Malkin, T. (eds.) PKC 2006. LNCS, vol. 3958, pp. 207–228. Springer, Heidelberg (2006) CrossRefGoogle Scholar
  4. 4.
    Bernstein, D.J.: Cryptography in NaCl, March 2009.
  5. 5.
    Bernstein, D.J.: DNSCurve: usable security for DNS, June 2009.
  6. 6.
    Bernstein, D.J., Lange, T.: eBACS: ECRYPT benchmarking of cryptographic systems, March 2015. Accessed on 20 March 2015
  7. 7.
    Bernstein, D.J., Lange, T.: SafeCurves: choosing safe curves for elliptic-curve cryptography (2015). Accessed 20 March 2015
  8. 8.
    Bernstein, D.J., Lange, T., Schwabe, P.: NaCl: Networking and Cryptography library, October 2013.
  9. 9.
    Bernstein, D.J., Schwabe, P.: NEON Crypto. In: Prouff, E., Schaumont, P. (eds.) CHES 2012. LNCS, vol. 7428, pp. 320–339. Springer, Heidelberg (2012). CrossRefGoogle Scholar
  10. 10.
    Bos, J.W., Costello, C., Longa, P., Naehrig, M.: Selecting Elliptic Curves for Cryptography: An Efficiency and Security Analysis. Cryptology ePrint Archive, Report 2014/130 (2014).
  11. 11.
    Cohen, H., Frey, G., Avanzi, R., Doche, C., Lange, T., Nguyen, K., Vercauteren, F.: Handbook of Elliptic and Hyperelliptic Curve Cryptography, (2nd edn). Chapman & Hall/CRC (2012)Google Scholar
  12. 12.
    Corporation, I.: Intel Pentium processor with MMX technology documentation, January 2008.
  13. 13.
    Corporation, I.: Define SSE2, SSE3 and SSE4, January 2009.
  14. 14.
    Corporation, I.: Intel Advanced Vector Extensions Programming Reference, June 2011.
  15. 15.
    Fog, A.: Instruction tables: Lists of instruction latencies, throughputs and micro-operation breakdowns for Intel, AMD and VIA CPUs, December 2014Google Scholar
  16. 16.
    Granger, R., Scott, M.: Faster ECC over \(\mathbb{F}_{2^{521}-1}\). Cryptology ePrint Archive, Report 2014/852 (2014).
  17. 17.
    Granlund, T., the GMP development team: GNU MP: The GNU Multiple Precision Arithmetic Library, (5.0.5 edn) (2012).
  18. 18.
    Itoh, T., Tsujii, S.: A fast algorithm for computing multiplicative inverses in GF\((2^m)\) using normal bases. Inf. Comput. 78(3), 171–177 (1988).–7 MathSciNetCrossRefGoogle Scholar
  19. 19.
    Montgomery, P.L.: Speeding the pollard and elliptic curve methods of factorization. Math. Comput. 48(177), 243–264 (1987). CrossRefGoogle Scholar
  20. 20.
    National Institute of Standards and Technology: Digital Signature Standard (DSS). FIPS Publication 186, may 1994.
  21. 21.
    Shell, O.S.: OpenSSH, January 2014.
  22. 22.
    Solinas, J.A.: Generalized Mersenne Numbers. Technical report,Center of Applied Cryptographic Research (CACR) (1999)Google Scholar
  23. 23.
    The OpenSSL Project: OpenSSL: The Open Source toolkit for SSL/TLS, April 2003.

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  1. 1.Institute of ComputingUniversity of CampinasCampinasBrazil

Personalised recommendations