Squared result was stored in the wrong variable

This commit is contained in:
Dirkjan Bussink 2011-03-23 20:14:23 +01:00
parent 921be35779
commit e071a03b63

View File

@ -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;
}