diff options
| author | Mattias Andrée <maandree@kth.se> | 2016-05-13 04:38:09 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2016-05-13 04:38:09 +0200 |
| commit | 16a001c8fe4e5ca99d5aafdd8ed02a35f09b6caa (patch) | |
| tree | fe1116e5d8ce39e032c777003caa6d03ce667c78 /src/zmodpowu.c | |
| parent | Exponentiation: clarification of a mathematical expression (diff) | |
| download | libzahl-16a001c8fe4e5ca99d5aafdd8ed02a35f09b6caa.tar.gz libzahl-16a001c8fe4e5ca99d5aafdd8ed02a35f09b6caa.tar.bz2 libzahl-16a001c8fe4e5ca99d5aafdd8ed02a35f09b6caa.tar.xz | |
Miscellaneous stuff
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/zmodpowu.c')
| -rw-r--r-- | src/zmodpowu.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/zmodpowu.c b/src/zmodpowu.c index 72aa96f..beb17c2 100644 --- a/src/zmodpowu.c +++ b/src/zmodpowu.c @@ -25,10 +25,11 @@ zmodpowu(z_t a, z_t b, unsigned long long int c, z_t d) zmod(tb, b, d); zset(td, d); - zsetu(a, 1); if (c & 1) - zmodmul(a, a, tb, td); + zset(a, tb); + else + zsetu(a, 1); while (c >>= 1) { zmodsqr(tb, tb, td); if (c & 1) |
