FourQlib is an efficient and portable math library that provides functions for computing essential elliptic curve operations on a new, high-performance curve called FourQ. The code is based on the paper “FourQ: four-dimensional decompositions on a Q-curve over the Mersenne prime” by Craig Costello and Patrick Longa, in Advances in Cryptology. The FourQLib library can be downloaded from Microsoft Research. FourQlib v1.0 is supported on a wide range of platforms including x64, x86 and ARM devices running Windows or Linux OS.
On Intel’s Haswell, Ivy Bridge and Sandy Bridge architectures, the software computes a variable-base scalar multiplication in 73,000 cycles and 76,000 cycles, and a Diffie-Hellman shared secret in 119,000 cycles and 126,000 cycles. FourQ is around four to five times faster than the original NIST P-256 curve and between two and three times faster than NIST alternatives such as Curve25519.