Solinas prime

From HandWiki
Short description: Prime number of the form that allows fast modular reduction

In mathematics, a Solinas prime, or generalized Mersenne prime, is a prime number that has the form f(2m), where f(x) is a low-degree polynomial with small integer coefficients.[1][2] These primes allow fast modular reduction algorithms and are widely used in cryptography. They are named after Jerome Solinas.

This class of numbers encompasses a few other categories of prime numbers:

  • Mersenne primes, which have the form 2k1,
  • Crandall or pseudo-Mersenne primes, which have the form 2kc for small odd c,[3] including c= 3 (sequence A050414 in the OEIS), 5 (sequence A059608 in the OEIS), 7 (sequence A059609 in the OEIS), 9 (sequence A059610 in the OEIS), etc.

Modular reduction algorithm

Let f(t)=tdcd1td1...c0 be a monic polynomial of degree d with coefficients in and suppose that p=f(2m) is a Solinas prime. Given a number n<p2 with up to 2md bits, we want to find a number congruent to n mod p with only as many bits as p – that is, with at most md bits.

First, represent n in base 2m:

n=j=02d1Aj2mj

Next, generate a d-by-d matrix X=(Xi,j) by stepping d times the linear-feedback shift register defined over by the polynomial f: starting with the d-integer register [0|0|...|0|1], shift right one position, injecting 0 on the left and adding (component-wise) the output value times the vector [c0,...,cd1] at each step (see [1] for details). Let Xi,j be the integer in the jth register on the ith step and note that the first row of X is given by (X0,j)=[c0,...,cd1]. Then if we denote by B=(Bi) the integer vector given by:

(B0...Bd1)=(A0...Ad1)+(Ad...A2d1)X,

it can be easily checked that:

j=0d1Bj2mjj=02d1Aj2mjmodp.

Thus B represents an md-bit integer congruent to n.

For judicious choices of f (again, see [1]), this algorithm involves only a relatively small number of additions and subtractions (and no divisions!), so it can be much more efficient than the naive modular reduction algorithm (np(n/p)).

Examples

In 1999, NIST recommended four Solinas primes as moduli for elliptic curve cryptography:[4]

  • curve p-192 uses modulus 21922641
  • curve p-224 uses modulus 2224296+1
  • curve p-256 uses modulus 22562224+2192+2961
  • curve p-384 uses modulus 23842128296+2321.

A newer Curve448 uses modulus 244822241.

A Solinas prime that fits into a typical 64-bit unsigned integer is 264232+1, it is Φ192(2) where Φ is the cyclotomic polynomial, thus it is a unique prime in base 2 (with period length 192). This size is too small for cryptography, but finds use in implementing a number-theoretic transform for efficient multiplication of large numbers.[5]

A complete list of f(2k)=2m2n±1 with m2000, a small modular reduction weight wt<15, and k=8,16,32,64 (i.e. multiples of a computer word size) was produced by José de Jesús Angel Angel and Guillermo Morales-Luna in 2010.[6]

See also

  • Proth prime: several examples on this page are also Proth primes

References

  1. Solinas, Jerome A. (1999). Generalized Mersenne Numbers (PDF) (Technical report). Center for Applied Cryptographic Research, University of Waterloo. CORR-99-39.
  2. Solinas, Jerome A. (2011). "Generalized Mersenne Prime". Encyclopedia of Cryptography and Security. Springer US. pp. 509–510. doi:10.1007/978-1-4419-5906-5_32. ISBN 978-1-4419-5905-8. https://archive.org/details/encyclopediacryp00tilb_374. 
  3. "Method and apparatus for public key exchange in a cryptographic system" US patent 5159632, issued 1992-10-27, assigned to NeXT Computer, Inc.
  4. Recommended Elliptic Curves for Federal Government Use (PDF) (Technical report). NIST. 1999.
  5. Craig-Wood, Nick. "Integer DWTs mod 2^64-2^32+1". https://www.craig-wood.com/nick/armprime/math/. 
  6. de Jesús Angel Angel, José; Morales-Luna, Guillermo (2010). "Solinas primes of small weight for fixed sizes". https://eprint.iacr.org/2010/058. 

fr:Nombre de Mersenne premier#Généralisations