aboutsummaryrefslogtreecommitdiffstats
path: root/src/zptest.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-03-04 09:28:01 +0100
committerMattias Andrée <maandree@kth.se>2016-03-04 09:28:01 +0100
commit0a7e36380717fe926d43ab30ef6162db9bd71723 (patch)
treeb0ad75c7525688f8e54319e440b251213a4ef3db /src/zptest.c
parentAdd zptest (diff)
downloadlibzahl-0a7e36380717fe926d43ab30ef6162db9bd71723.tar.gz
libzahl-0a7e36380717fe926d43ab30ef6162db9bd71723.tar.bz2
libzahl-0a7e36380717fe926d43ab30ef6162db9bd71723.tar.xz
Add makefile and fix errors
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/zptest.c')
-rw-r--r--src/zptest.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/zptest.c b/src/zptest.c
index db40527..a1d112c 100644
--- a/src/zptest.c
+++ b/src/zptest.c
@@ -1,11 +1,11 @@
/* See LICENSE file for copyright and license details. */
-#include "internals"
+#include "internals.h"
#define x libzahl_tmp_ptest_x
#define a libzahl_tmp_ptest_a
#define d libzahl_tmp_ptest_d
#define n1 libzahl_tmp_ptest_n1
-#define n2 libzahl_tmp_ptest_n4
+#define n4 libzahl_tmp_ptest_n4
enum zprimality
@@ -39,16 +39,16 @@ zptest(z_t witness, z_t n, int t)
zrsh(d, n1, r);
while (t--) {
- zrand(a, n4, FAST_RANDOM, UNIFORM);
+ zrand(a, FAST_RANDOM, UNIFORM, n4);
zadd_unsigned(a, a, libzahl_const_2);
- zmodpow(x, a, d, tn);
+ zmodpow(x, a, d, n);
if (!zcmp(x, libzahl_const_1) || !zcmp(x, n1))
continue;
for (i = 1; i < r; i++) {
zsqr(x, x);
- zmod(x, x, tn);
+ zmod(x, x, n);
if (!zcmp(x, libzahl_const_1)) {
if (witness)
zswap(witness, a);