Commit e071a03b630f8c790a5dde434fdcc3f8f84a5a3b

Dirkjan Bussink 2011-03-23T20:14:23

Squared result was stored in the wrong variable

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/bn_mp_expt_d.c b/bn_mp_expt_d.c
index 427ef06..2b0b095 100644
--- a/bn_mp_expt_d.c
+++ b/bn_mp_expt_d.c
@@ -38,7 +38,7 @@ int mp_expt_d (mp_int * a, mp_digit b, mp_int * c)
     }
 
     /* square */
-    if (b > 1 && (res = mp_sqr (c, c)) != MP_OKAY) {
+    if (b > 1 && (res = mp_sqr (&g, &g)) != MP_OKAY) {
       mp_clear (&g);
       return res;
     }