Solinas prime explained

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:

2k-1

,

2k-c

for small odd

c

.[3]

Modular reduction algorithm

Let

f(t)=td-cd-1td-1-...-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=

2d-1
\sum
j=0
mj
A
j2

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,...,cd-1]

at each step (see [1] for details). Let

Xi,j

be the integer in the

j

th register on the

i

th 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:

d-1
\sum
j=0
mj
B
j2
2d-1
\equiv\sum
j=0
mj
A
j2

\modp

.

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

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

2192-264-1

2224-296+1

2256-2224+2192+296-1

2384-2128-296+232-1

Curve448 uses the Solinas prime

2448-2224-1.

See also

Notes and References

  1. Jerome A. . Solinas . Generalized Mersenne Numbers . CORR-99-39 . Center for Applied Cryptographic Research, University of Waterloo . 1999 .
  2. Book: Solinas, Jerome A.. Encyclopedia of Cryptography and Security. limited. Henk C. A. van. Tilborg. Sushil. Jajodia. 2011. Springer US. 509–510. 10.1007/978-1-4419-5906-5_32. Generalized Mersenne Prime. 978-1-4419-5905-8.
  3. US . 5159632 . patent . Method and apparatus for public key exchange in a cryptographic system . 1992-10-27 . 1991-09-17 . Richard E. Crandall . NeXT Computer, Inc. .