Solinas prime

From testwiki
Jump to navigation Jump to search

Template:Short description 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:

Modular reduction algorithm

Let f(t)=td−cd−1td−1−...−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=02d−1Aj2mj

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,...,cd−1] 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,...,cd−1]. Then if we denote by B=(Bi) the integer vector given by:

(B0...Bd−1)=(A0...Ad−1)+(Ad...A2d−1)X,

it can be easily checked that:

∑j=0d−1Bj2mj≡∑j=02d−1Aj2mjmodp.

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 (n−p⋅(n/p)).

Examples

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

  • curve p-192 uses modulus 2192−264−1
  • curve p-224 uses modulus 2224−296+1
  • curve p-256 uses modulus 2256−2224+2192+296−1
  • curve p-384 uses modulus 2384−2128−296+232−1.

A newer Curve448 uses modulus 2448−2224−1.

A Solinas prime that fits into a typical 64-bit unsigned integer is 264−232+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)=2m−2n±1 with m≤2000, 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]

The Curve25519 uses 2255−19, which has also been called pseudo-Mersenne.[7]

See also

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

References

Template:Reflist

Template:Prime number classes

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