Commit aab1b3d99f22a5f1c3d230f42e234c0821ac70dc

Francois Perrad 2017-08-28T22:34:46

split label & statement

diff --git a/bn_fast_mp_invmod.c b/bn_fast_mp_invmod.c
index 09023ab..884e4b8 100644
--- a/bn_fast_mp_invmod.c
+++ b/bn_fast_mp_invmod.c
@@ -138,7 +138,8 @@ top:
   c->sign = neg;
   res = MP_OKAY;
 
-LBL_ERR:mp_clear_multi(&x, &y, &u, &v, &B, &D, NULL);
+LBL_ERR:
+  mp_clear_multi(&x, &y, &u, &v, &B, &D, NULL);
   return res;
 }
 #endif
diff --git a/bn_mp_div.c b/bn_mp_div.c
index de318c2..df61e63 100644
--- a/bn_mp_div.c
+++ b/bn_mp_div.c
@@ -278,11 +278,16 @@ int mp_div (mp_int * a, mp_int * b, mp_int * c, mp_int * d)
 
   res = MP_OKAY;
 
-LBL_Y:mp_clear(&y);
-LBL_X:mp_clear(&x);
-LBL_T2:mp_clear(&t2);
-LBL_T1:mp_clear(&t1);
-LBL_Q:mp_clear(&q);
+LBL_Y:
+  mp_clear(&y);
+LBL_X:
+  mp_clear(&x);
+LBL_T2:
+  mp_clear(&t2);
+LBL_T1:
+  mp_clear(&t1);
+LBL_Q:
+  mp_clear(&q);
   return res;
 }
 
diff --git a/bn_mp_exptmod_fast.c b/bn_mp_exptmod_fast.c
index 76bb291..ebddb53 100644
--- a/bn_mp_exptmod_fast.c
+++ b/bn_mp_exptmod_fast.c
@@ -305,7 +305,8 @@ int mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode
   /* swap res with Y */
   mp_exch(&res, Y);
   err = MP_OKAY;
-LBL_RES:mp_clear(&res);
+LBL_RES:
+  mp_clear(&res);
 LBL_M:
   mp_clear(&M[1]);
   for (x = 1<<(winsize-1); x < (1 << winsize); x++) {
diff --git a/bn_mp_gcd.c b/bn_mp_gcd.c
index 0128078..8e45cb2 100644
--- a/bn_mp_gcd.c
+++ b/bn_mp_gcd.c
@@ -94,8 +94,10 @@ int mp_gcd (mp_int * a, mp_int * b, mp_int * c)
   }
   c->sign = MP_ZPOS;
   res = MP_OKAY;
-LBL_V:mp_clear(&u);
-LBL_U:mp_clear(&v);
+LBL_V:
+  mp_clear(&u);
+LBL_U:
+  mp_clear(&v);
   return res;
 }
 #endif
diff --git a/bn_mp_invmod_slow.c b/bn_mp_invmod_slow.c
index c343845..d3b6949 100644
--- a/bn_mp_invmod_slow.c
+++ b/bn_mp_invmod_slow.c
@@ -165,7 +165,8 @@ top:
   /* C is now the inverse */
   mp_exch(&C, c);
   res = MP_OKAY;
-LBL_ERR:mp_clear_multi(&x, &y, &u, &v, &A, &B, &C, &D, NULL);
+LBL_ERR:
+  mp_clear_multi(&x, &y, &u, &v, &A, &B, &C, &D, NULL);
   return res;
 }
 #endif
diff --git a/bn_mp_is_square.c b/bn_mp_is_square.c
index 8666b0b..75f919a 100644
--- a/bn_mp_is_square.c
+++ b/bn_mp_is_square.c
@@ -99,7 +99,8 @@ int mp_is_square(mp_int *arg, int *ret)
   }
 
   *ret = (mp_cmp_mag(&t, arg) == MP_EQ) ? MP_YES : MP_NO;
-ERR:mp_clear(&t);
+ERR:
+  mp_clear(&t);
   return res;
 }
 #endif
diff --git a/bn_mp_jacobi.c b/bn_mp_jacobi.c
index c6fe968..a476bd4 100644
--- a/bn_mp_jacobi.c
+++ b/bn_mp_jacobi.c
@@ -106,8 +106,10 @@ int mp_jacobi (mp_int * a, mp_int * n, int *c)
 
   /* done */
   res = MP_OKAY;
-LBL_P1:mp_clear(&p1);
-LBL_A1:mp_clear(&a1);
+LBL_P1:
+  mp_clear(&p1);
+LBL_A1:
+  mp_clear(&a1);
   return res;
 }
 #endif
diff --git a/bn_mp_karatsuba_mul.c b/bn_mp_karatsuba_mul.c
index d636708..635cee2 100644
--- a/bn_mp_karatsuba_mul.c
+++ b/bn_mp_karatsuba_mul.c
@@ -150,13 +150,20 @@ int mp_karatsuba_mul (mp_int * a, mp_int * b, mp_int * c)
   /* Algorithm succeeded set the return code to MP_OKAY */
   err = MP_OKAY;
 
-X1Y1:mp_clear(&x1y1);
-X0Y0:mp_clear(&x0y0);
-T1:mp_clear(&t1);
-Y1:mp_clear(&y1);
-Y0:mp_clear(&y0);
-X1:mp_clear(&x1);
-X0:mp_clear(&x0);
+X1Y1:
+  mp_clear(&x1y1);
+X0Y0:
+  mp_clear(&x0y0);
+T1:
+  mp_clear(&t1);
+Y1:
+  mp_clear(&y1);
+Y0:
+  mp_clear(&y0);
+X1:
+  mp_clear(&x1);
+X0:
+  mp_clear(&x0);
 ERR:
   return err;
 }
diff --git a/bn_mp_karatsuba_sqr.c b/bn_mp_karatsuba_sqr.c
index 944663a..a5cd2ec 100644
--- a/bn_mp_karatsuba_sqr.c
+++ b/bn_mp_karatsuba_sqr.c
@@ -105,12 +105,18 @@ int mp_karatsuba_sqr (mp_int * a, mp_int * b)
 
   err = MP_OKAY;
 
-X1X1:mp_clear(&x1x1);
-X0X0:mp_clear(&x0x0);
-T2:mp_clear(&t2);
-T1:mp_clear(&t1);
-X1:mp_clear(&x1);
-X0:mp_clear(&x0);
+X1X1:
+  mp_clear(&x1x1);
+X0X0:
+  mp_clear(&x0x0);
+T2:
+  mp_clear(&t2);
+T1:
+  mp_clear(&t1);
+X1:
+  mp_clear(&x1);
+X0:
+  mp_clear(&x0);
 ERR:
   return err;
 }
diff --git a/bn_mp_n_root_ex.c b/bn_mp_n_root_ex.c
index cf58e90..8b3b00f 100644
--- a/bn_mp_n_root_ex.c
+++ b/bn_mp_n_root_ex.c
@@ -120,9 +120,12 @@ int mp_n_root_ex (mp_int * a, mp_digit b, mp_int * c, int fast)
 
   res = MP_OKAY;
 
-LBL_T3:mp_clear(&t3);
-LBL_T2:mp_clear(&t2);
-LBL_T1:mp_clear(&t1);
+LBL_T3:
+  mp_clear(&t3);
+LBL_T2:
+  mp_clear(&t2);
+LBL_T1:
+  mp_clear(&t1);
   return res;
 }
 #endif
diff --git a/bn_mp_prime_fermat.c b/bn_mp_prime_fermat.c
index 961ad6c..1a327d7 100644
--- a/bn_mp_prime_fermat.c
+++ b/bn_mp_prime_fermat.c
@@ -52,7 +52,8 @@ int mp_prime_fermat (mp_int * a, mp_int * b, int *result)
   }
 
   err = MP_OKAY;
-LBL_T:mp_clear(&t);
+LBL_T:
+  mp_clear(&t);
   return err;
 }
 #endif
diff --git a/bn_mp_prime_is_prime.c b/bn_mp_prime_is_prime.c
index 00422d9..beb2e02 100644
--- a/bn_mp_prime_is_prime.c
+++ b/bn_mp_prime_is_prime.c
@@ -73,7 +73,8 @@ int mp_prime_is_prime (mp_int * a, int t, int *result)
 
   /* passed the test */
   *result = MP_YES;
-LBL_B:mp_clear(&b);
+LBL_B:
+  mp_clear(&b);
   return err;
 }
 #endif
diff --git a/bn_mp_prime_miller_rabin.c b/bn_mp_prime_miller_rabin.c
index f98a95c..ae00241 100644
--- a/bn_mp_prime_miller_rabin.c
+++ b/bn_mp_prime_miller_rabin.c
@@ -91,9 +91,12 @@ int mp_prime_miller_rabin (mp_int * a, mp_int * b, int *result)
 
   /* probably prime now */
   *result = MP_YES;
-LBL_Y:mp_clear(&y);
-LBL_R:mp_clear(&r);
-LBL_N1:mp_clear(&n1);
+LBL_Y:
+  mp_clear(&y);
+LBL_R:
+  mp_clear(&r);
+LBL_N1:
+  mp_clear(&n1);
   return err;
 }
 #endif
diff --git a/bn_mp_sqrt.c b/bn_mp_sqrt.c
index 779a896..ef0e739 100644
--- a/bn_mp_sqrt.c
+++ b/bn_mp_sqrt.c
@@ -69,8 +69,10 @@ int mp_sqrt(mp_int *arg, mp_int *ret)
 
   mp_exch(&t1, ret);
 
-E1: mp_clear(&t2);
-E2: mp_clear(&t1);
+E1:
+  mp_clear(&t2);
+E2:
+  mp_clear(&t1);
   return res;
 }
 
diff --git a/bn_s_mp_exptmod.c b/bn_s_mp_exptmod.c
index fc318b1..d376618 100644
--- a/bn_s_mp_exptmod.c
+++ b/bn_s_mp_exptmod.c
@@ -236,8 +236,10 @@ int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode)
 
   mp_exch(&res, Y);
   err = MP_OKAY;
-LBL_RES:mp_clear(&res);
-LBL_MU:mp_clear(&mu);
+LBL_RES:
+  mp_clear(&res);
+LBL_MU:
+  mp_clear(&mu);
 LBL_M:
   mp_clear(&M[1]);
   for (x = 1<<(winsize-1); x < (1 << winsize); x++) {