projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updates. New data types.
[silc.git]
/
lib
/
silcmath
/
silcprimegen.c
diff --git
a/lib/silcmath/silcprimegen.c
b/lib/silcmath/silcprimegen.c
index decb9538edbe46c2ea00675b5377f98359a2bdde..beb07f285f87ea09d3cba6d34638a4f66c9682ce 100644
(file)
--- a/
lib/silcmath/silcprimegen.c
+++ b/
lib/silcmath/silcprimegen.c
@@
-53,7
+53,7
@@
*/
*/
-static u
nsigned int
primetable[] =
+static u
int32
primetable[] =
{
2, 3, 5, 7, 11, 13, 17, 19,
23, 29, 31, 37, 41, 43, 47, 53,
{
2, 3, 5, 7, 11, 13, 17, 19,
23, 29, 31, 37, 41, 43, 47, 53,
@@
-195,11
+195,11
@@
static unsigned int primetable[] =
If argument verbose is TRUE this will display some status information
about the progress of generation. */
If argument verbose is TRUE this will display some status information
about the progress of generation. */
-int silc_math_gen_prime(SilcInt *prime, u
nsigned int
bits, int verbose)
+int silc_math_gen_prime(SilcInt *prime, u
int32
bits, int verbose)
{
unsigned char *numbuf;
{
unsigned char *numbuf;
- u
nsigned int
i, b, k;
- u
nsigned int
*spmods;
+ u
int32
i, b, k;
+ u
int32
*spmods;
SilcInt r, base, tmp, tmp2, oprime;
silc_mp_init(&r);
SilcInt r, base, tmp, tmp2, oprime;
silc_mp_init(&r);
@@
-229,7
+229,7
@@
int silc_math_gen_prime(SilcInt *prime, unsigned int bits, int verbose)
/* Init modulo table with the prime candidate and the primes
in the primetable. */
/* Init modulo table with the prime candidate and the primes
in the primetable. */
- spmods = silc_calloc(1, sizeof(primetable) * sizeof(u
nsigned int
));
+ spmods = silc_calloc(1, sizeof(primetable) * sizeof(u
int32
));
for (i = 0; primetable[i] != 0; i++) {
silc_mp_mod_ui(&tmp, prime, primetable[i]);
spmods[i] = silc_mp_get_ui(&tmp);
for (i = 0; primetable[i] != 0; i++) {
silc_mp_mod_ui(&tmp, prime, primetable[i]);
spmods[i] = silc_mp_get_ui(&tmp);