@@ -2031,11 +2031,11 @@ \subsection{Required Number of Tests}
20312031\begin {alltt }
20322032mp_err mp_prime_rabin_miller_trials(int size) 
20332033\end {alltt }
2034- This  returns the number of trials required for a low probability of failure for a given 
2035- \texttt {size } expressed in bits.   This comes in handy specially since larger numbers are slower to 
2036- test. For example, a 512--bit number would require 18 tests for a probability of  $ 2 ^{-160} $  whereas 
2037- a 1024--bit number would only require 12  tests for a probability of $ 2 ^{-192} $ . The exact values as 
2038- implemented are listed in table \ref {table:millerrabinrunsimpl }.
2034+ The function  returns the number of trials
2035+ required for a low probability of failure for a given  \texttt {size } expressed in bits. This comes in
2036+ handy specially since larger numbers are slower to  test. For example, a 512--bit number would require
2037+ 18  tests for a probability of $ 2 ^{-160} $  whereas a 1024--bit number would only require 12 tests for a 
2038+ probability of  $ 2 ^{-192} $ . The exact values as  implemented are listed in table \ref {table:millerrabinrunsimpl }.
20392039
20402040\begin {table }[h]
20412041  \begin {center }
@@ -2206,12 +2206,31 @@ \subsection{Required Number of Tests}
22062206implemented only one or two rounds of the Miller--Rabin test with a random base is necessary for
22072207numbers larger than or equal to $ 1024 $   bits.
22082208
2209- This function is meant for RSA. The number of rounds for DSA is $ \lceil  -log_2 (p)/2 \rceil $   with $ p$ 
2209+ This function is meant for RSA.
2210+ 
2211+ \index {mp\_ prime\_ rabin\_ miller\_ trials\_ rsa}
2212+ \begin {alltt }
2213+ mp_err mp_prime_rabin_miller_trials_rsa(int size) 
2214+ \end {alltt }
2215+ This function is synonym to \texttt {mp\_ prime\_ rabin\_ miller\_ trials\_ rsa(int size) }
2216+ 
2217+ \index {mp\_ prime\_ rabin\_ miller\_ trials\_ dea}
2218+ \begin {alltt }
2219+ mp_err mp_prime_rabin_miller_trials_dea(int error) 
2220+ \end {alltt }
2221+ The number of rounds for DSA is $ \lceil  -log_2 (p)/2 \rceil $   with $ p$ 
22102222the probability which is just the half of the absolute value of $ p$   if given as a power of two.
2211- E.g.: with $ p = 2 ^{-128}$  , $ \lceil  -log_2 (p)/2 \rceil  = 64 $  .
2223+ E.g.: with $ p = 2 ^{-128}$  , $ \lceil  -log_2 (p)/2 \rceil  = 64 $  . This function
2224+ takes the error $ p$   and computes $ \lceil  -p/2 \rceil $   to return the necessary number of rounds
2225+ for DEA primes with Miller-Rabin tests alone.
22122226
2213- This function can be used to test a DSA prime directly if these rounds are followed by a Lucas
2214- test.
2227+ If the Miller-Rabin tests are followed by a Lucas test, the number of rounds computed by the
2228+ functions
2229+ \begin {alltt }
2230+ mp_err mp_prime_rabin_miller_trials(int size) 
2231+ mp_err mp_prime_rabin_miller_trials_rsa(int size) 
2232+ \end {alltt }
2233+ are sufficient.
22152234
22162235See also table C.1 in FIPS 186-4.
22172236
0 commit comments