aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-05-13 19:07:07 +0200
committerMattias Andrée <maandree@kth.se>2016-05-13 19:07:07 +0200
commitfd9c83cbb9d80a8108cd5112d12f475406b44a20 (patch)
tree6b66452ffb406e00688566e4addaf24db1f84471
parentOn greatest common divisor (diff)
downloadlibzahl-fd9c83cbb9d80a8108cd5112d12f475406b44a20.tar.gz
libzahl-fd9c83cbb9d80a8108cd5112d12f475406b44a20.tar.bz2
libzahl-fd9c83cbb9d80a8108cd5112d12f475406b44a20.tar.xz
zptest: if n is even, let the witness be 2
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/zptest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/zptest.c b/src/zptest.c
index 406cedc..1a44069 100644
--- a/src/zptest.c
+++ b/src/zptest.c
@@ -28,7 +28,7 @@ zptest(z_t witness, z_t n, int t)
}
if (unlikely(zeven(n))) {
if (witness)
- SET(witness, n);
+ zsetu(witness, 2);
return NONPRIME;
}