Solinas prime

From HandWiki
Revision as of 14:09, 6 February 2024 by Raymond Straus (talk | contribs) (over-write)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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]

Modular reduction algorithm

Let f(t)=tdcd1td1...c0 be a monic polynomial of degree d with coefficients in Z 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 Z 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

Four of the recommended primes in NIST's document "Recommended Elliptic Curves for Federal Government Use" are Solinas primes:

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

Curve448 uses the Solinas prime 244822241.

See also

References

  1. Template:Cite tech report
  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.

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