summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libtommath/bn_mp_sqrt.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libtommath/bn_mp_sqrt.c b/libtommath/bn_mp_sqrt.c
index 84d521f..d342a32 100644
--- a/libtommath/bn_mp_sqrt.c
+++ b/libtommath/bn_mp_sqrt.c
@@ -21,7 +21,7 @@
int mp_sqrt(const mp_int *arg, mp_int *ret)
{
int res;
- mp_int t1,t2;
+ mp_int t1, t2;
int i, j, k;
#ifndef NO_FLOATING_POINT
volatile double d;
@@ -106,30 +106,30 @@ int mp_sqrt(const mp_int *arg, mp_int *ret)
#endif
/* t1 > 0 */
- if ((res = mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) {
+ if ((res = mp_div(arg, &t1, &t2, NULL)) != MP_OKAY) {
goto E1;
}
- if ((res = mp_add(&t1,&t2,&t1)) != MP_OKAY) {
+ if ((res = mp_add(&t1, &t2, &t1)) != MP_OKAY) {
goto E1;
}
- if ((res = mp_div_2(&t1,&t1)) != MP_OKAY) {
+ if ((res = mp_div_2(&t1, &t1)) != MP_OKAY) {
goto E1;
}
/* And now t1 > sqrt(arg) */
do {
- if ((res = mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) {
+ if ((res = mp_div(arg, &t1, &t2, NULL)) != MP_OKAY) {
goto E1;
}
- if ((res = mp_add(&t1,&t2,&t1)) != MP_OKAY) {
+ if ((res = mp_add(&t1, &t2, &t1)) != MP_OKAY) {
goto E1;
}
- if ((res = mp_div_2(&t1,&t1)) != MP_OKAY) {
+ if ((res = mp_div_2(&t1, &t1)) != MP_OKAY) {
goto E1;
}
/* t1 >= sqrt(arg) >= t2 at this point */
- } while (mp_cmp_mag(&t1,&t2) == MP_GT);
+ } while (mp_cmp_mag(&t1, &t2) == MP_GT);
- mp_exch(&t1,ret);
+ mp_exch(&t1, ret);
E1:
mp_clear(&t2);