You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/bn.tex
+12-29Lines changed: 12 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -173,7 +173,7 @@ \subsubsection{OpenBSD}
173
173
cc -I./ -Wall -Wsign-compare -Wextra -Wshadow -Wsystem-headers -Wdeclaration-afo...
174
174
cc -I./ -Wall -Wsign-compare -Wextra -Wshadow -Wsystem-headers -Wdeclaration-afo...
175
175
cc -I./ -Wall -Wsign-compare -Wextra -Wshadow -Wsystem-headers -Wdeclaration-afo...
176
-
libtool --mode=link --tag=CC cc bn_error.lo bn_s_mp_invmod_fast.lo bn_fast_mp_mo
176
+
libtool --mode=link --tag=CC cc bn_error.lo bn_s_mp_invmod_fast.lo bn_fast_mp_mo
177
177
libtool: link: cc bn_error.lo bn_s_mp_invmod_fast.lo bn_s_mp_montgomery_reduce_fast0
178
178
bn_error.lo: file not recognized: File format not recognized
179
179
cc: error: linker command failed with exit code 1 (use -v to see invocation)
@@ -187,7 +187,7 @@ \subsubsection{OpenBSD}
187
187
\end{alltt}
188
188
At this time two versions of \texttt{libtool} are installed and both are named \texttt{libtool}, unfortunately but GNU \texttt{libtool} has been placed in \texttt{/usr/local/bin/} and the native version in \texttt{/usr/bin/}. The path might be different in other versions of OpenBSD but both programms differ in the output of \texttt{libtool --version}
189
189
\begin{alltt}
190
-
$ /usr/local/bin/libtool --version
190
+
$ /usr/local/bin/libtool --version
191
191
libtool (GNU libtool) 2.4.2
192
192
Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
193
193
@@ -2076,38 +2076,21 @@ \section{Next Prime}
2076
2076
want only the next prime congruent to $3\mbox{ mod } 4$, otherwise set it to zero to find any next prime.
2077
2077
2078
2078
\section{Random Primes}
2079
-
\index{mp\_prime\_random}
2080
-
\begin{alltt}
2081
-
int mp_prime_random(mp_int *a, int t, int size, int bbs,
2082
-
ltm_prime_callback cb, void *dat)
2083
-
\end{alltt}
2084
-
This will find a prime greater than $256^{size}$ which can be ``bbs\_style'' or not depending on $bbs$ and must pass
2085
-
$t$ rounds of tests but see the documentation for mp\_prime\_is\_prime for details regarding the use of the argument $t$.
2086
-
The ``ltm\_prime\_callback'' is a typedef for
2087
-
2079
+
\index{mp\_prime\_random\_ex}
2088
2080
\begin{alltt}
2089
-
typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat);
2081
+
int mp_prime_rand(mp_int *a, int t,
2082
+
int size, int flags);
2090
2083
\end{alltt}
2084
+
This will generate a prime in $a$ using $t$ tests of the primality testing algorithms.
2085
+
See the documentation for mp\_prime\_is\_prime for details regarding the use of the argument $t$.
2086
+
The variable $size$ specifies the bit length of the prime desired.
2087
+
The variable $flags$ specifies one of several options available
2088
+
(see fig. \ref{fig:primeopts}) which can be OR'ed together.
2091
2089
2092
-
Which is a function that must read $len$ bytes (and return the amount stored) into $dst$. The $dat$ variable is simply
2093
-
copied from the original input. It can be used to pass RNG context data to the callback. The function
2094
-
mp\_prime\_random() is more suitable for generating primes which must be secret (as in the case of RSA) since there
2090
+
The function mp\_prime\_rand() is suitable for generating primes which must be secret (as in the case of RSA) since there
2095
2091
is no skew on the least significant bits.
2096
2092
2097
-
\textit{Note:} As of v0.30 of the LibTomMath library this function has been deprecated. It is still available
2098
-
but users are encouraged to use the new mp\_prime\_random\_ex() function instead.
2099
-
2100
-
\subsection{Extended Generation}
2101
-
\index{mp\_prime\_random\_ex}
2102
-
\begin{alltt}
2103
-
int mp_prime_random_ex(mp_int *a, int t,
2104
-
int size, int flags,
2105
-
ltm_prime_callback cb, void *dat);
2106
-
\end{alltt}
2107
-
This will generate a prime in $a$ using $t$ tests of the primality testing algorithms. The variable $size$
2108
-
specifies the bit length of the prime desired. The variable $flags$ specifies one of several options available
2109
-
(see fig. \ref{fig:primeopts}) which can be OR'ed together. The callback parameters are used as in
2110
-
mp\_prime\_random().
2093
+
\textit{Note:} This function replaces the deprecated mp\_prime\_random and mp\_prime\_random\_ex functions.
0 commit comments