Solinas prime explained
In mathematics, a Solinas prime, or generalized Mersenne prime, is a prime number that has the form
, where
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:
,
- Crandall or pseudo-Mersenne primes, which have the form
for small
odd
.
[3] Modular reduction algorithm
Let
be a
monic polynomial of degree
with coefficients in
and suppose that
is a Solinas prime. Given a number
with up to
bits, we want to find a number
congruent to
mod
with only as many bits as
– that is, with at most
bits.
First, represent
in base
:
Next, generate a
-by-
matrix
by stepping
times the
linear-feedback shift register defined over
by the polynomial
: starting with the
-integer register
, shift right one position, injecting
on the left and adding (component-wise) the output value times the vector
at each step (see [1] for details). Let
be the integer in the
th register on the
th step and note that the first row of
is given by
. Then if we denote by
the integer vector given by:
(B0...Bd-1)=(A0...Ad-1)+(Ad...A2d-1)X
,
it can be easily checked that:
.
Thus
represents an
-bit integer congruent to
.
For judicious choices of
(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 (
).
Examples
Four of the recommended primes in NIST's document "Recommended Elliptic Curves for Federal Government Use" are Solinas primes:
Curve448 uses the Solinas prime
See also
Notes and References
- Jerome A. . Solinas . Generalized Mersenne Numbers . CORR-99-39 . Center for Applied Cryptographic Research, University of Waterloo . 1999 .
- 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.
- 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. .