Part 1: Basics

 

The chapters in part 1 of the book cover finite field arithmetic, elliptic curve mathematics, and cryptographic primitives. Finite fields based on prime numbers are the essence of elliptic curve cryptography. They form the basis of everything else that follows.

Large integers consisting of 160 to more than 500 bits make up the finite fields used in cryptography. Large integer libraries have been around for a long time, and the one I chose for this book is called the GNU Multiple Precision Arithmetic Library or GMP. There are many routines not included within GMP that are required for elliptic curve implementations. These are discussed in chapter 2. One of the major routines covered includes taking square roots using a modulus. There are several routines that will be mentioned that use only a few calls to the GMP library. These routines are used throughout all the code in this book, so while they are simple, they are very important. Chapter 3 dives into elliptic curve mathematics. The idea of algebra on an elliptic curve is described along with some abstract pictures. The ideas are important and having some mental image can help you understand the mathematics. I’ll discuss the idea of embedding values onto a curve and then describe code to add and multiply points.