split label & statement
This commit is contained in:
		
							parent
							
								
									d263dc727c
								
							
						
					
					
						commit
						aab1b3d99f
					
				| @ -138,7 +138,8 @@ top: | |||||||
|   c->sign = neg; |   c->sign = neg; | ||||||
|   res = MP_OKAY; |   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; |   return res; | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  | |||||||
							
								
								
									
										15
									
								
								bn_mp_div.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								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; |   res = MP_OKAY; | ||||||
| 
 | 
 | ||||||
| LBL_Y:mp_clear(&y); | LBL_Y: | ||||||
| LBL_X:mp_clear(&x); |   mp_clear(&y); | ||||||
| LBL_T2:mp_clear(&t2); | LBL_X: | ||||||
| LBL_T1:mp_clear(&t1); |   mp_clear(&x); | ||||||
| LBL_Q:mp_clear(&q); | LBL_T2: | ||||||
|  |   mp_clear(&t2); | ||||||
|  | LBL_T1: | ||||||
|  |   mp_clear(&t1); | ||||||
|  | LBL_Q: | ||||||
|  |   mp_clear(&q); | ||||||
|   return res; |   return res; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -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 */ |   /* swap res with Y */ | ||||||
|   mp_exch(&res, Y); |   mp_exch(&res, Y); | ||||||
|   err = MP_OKAY; |   err = MP_OKAY; | ||||||
| LBL_RES:mp_clear(&res); | LBL_RES: | ||||||
|  |   mp_clear(&res); | ||||||
| LBL_M: | LBL_M: | ||||||
|   mp_clear(&M[1]); |   mp_clear(&M[1]); | ||||||
|   for (x = 1<<(winsize-1); x < (1 << winsize); x++) { |   for (x = 1<<(winsize-1); x < (1 << winsize); x++) { | ||||||
|  | |||||||
| @ -94,8 +94,10 @@ int mp_gcd (mp_int * a, mp_int * b, mp_int * c) | |||||||
|   } |   } | ||||||
|   c->sign = MP_ZPOS; |   c->sign = MP_ZPOS; | ||||||
|   res = MP_OKAY; |   res = MP_OKAY; | ||||||
| LBL_V:mp_clear(&u); | LBL_V: | ||||||
| LBL_U:mp_clear(&v); |   mp_clear(&u); | ||||||
|  | LBL_U: | ||||||
|  |   mp_clear(&v); | ||||||
|   return res; |   return res; | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  | |||||||
| @ -165,7 +165,8 @@ top: | |||||||
|   /* C is now the inverse */ |   /* C is now the inverse */ | ||||||
|   mp_exch(&C, c); |   mp_exch(&C, c); | ||||||
|   res = MP_OKAY; |   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; |   return res; | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  | |||||||
| @ -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; |   *ret = (mp_cmp_mag(&t, arg) == MP_EQ) ? MP_YES : MP_NO; | ||||||
| ERR:mp_clear(&t); | ERR: | ||||||
|  |   mp_clear(&t); | ||||||
|   return res; |   return res; | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  | |||||||
| @ -106,8 +106,10 @@ int mp_jacobi (mp_int * a, mp_int * n, int *c) | |||||||
| 
 | 
 | ||||||
|   /* done */ |   /* done */ | ||||||
|   res = MP_OKAY; |   res = MP_OKAY; | ||||||
| LBL_P1:mp_clear(&p1); | LBL_P1: | ||||||
| LBL_A1:mp_clear(&a1); |   mp_clear(&p1); | ||||||
|  | LBL_A1: | ||||||
|  |   mp_clear(&a1); | ||||||
|   return res; |   return res; | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  | |||||||
| @ -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 */ |   /* Algorithm succeeded set the return code to MP_OKAY */ | ||||||
|   err = MP_OKAY; |   err = MP_OKAY; | ||||||
| 
 | 
 | ||||||
| X1Y1:mp_clear(&x1y1); | X1Y1: | ||||||
| X0Y0:mp_clear(&x0y0); |   mp_clear(&x1y1); | ||||||
| T1:mp_clear(&t1); | X0Y0: | ||||||
| Y1:mp_clear(&y1); |   mp_clear(&x0y0); | ||||||
| Y0:mp_clear(&y0); | T1: | ||||||
| X1:mp_clear(&x1); |   mp_clear(&t1); | ||||||
| X0:mp_clear(&x0); | Y1: | ||||||
|  |   mp_clear(&y1); | ||||||
|  | Y0: | ||||||
|  |   mp_clear(&y0); | ||||||
|  | X1: | ||||||
|  |   mp_clear(&x1); | ||||||
|  | X0: | ||||||
|  |   mp_clear(&x0); | ||||||
| ERR: | ERR: | ||||||
|   return err; |   return err; | ||||||
| } | } | ||||||
|  | |||||||
| @ -105,12 +105,18 @@ int mp_karatsuba_sqr (mp_int * a, mp_int * b) | |||||||
| 
 | 
 | ||||||
|   err = MP_OKAY; |   err = MP_OKAY; | ||||||
| 
 | 
 | ||||||
| X1X1:mp_clear(&x1x1); | X1X1: | ||||||
| X0X0:mp_clear(&x0x0); |   mp_clear(&x1x1); | ||||||
| T2:mp_clear(&t2); | X0X0: | ||||||
| T1:mp_clear(&t1); |   mp_clear(&x0x0); | ||||||
| X1:mp_clear(&x1); | T2: | ||||||
| X0:mp_clear(&x0); |   mp_clear(&t2); | ||||||
|  | T1: | ||||||
|  |   mp_clear(&t1); | ||||||
|  | X1: | ||||||
|  |   mp_clear(&x1); | ||||||
|  | X0: | ||||||
|  |   mp_clear(&x0); | ||||||
| ERR: | ERR: | ||||||
|   return err; |   return err; | ||||||
| } | } | ||||||
|  | |||||||
| @ -120,9 +120,12 @@ int mp_n_root_ex (mp_int * a, mp_digit b, mp_int * c, int fast) | |||||||
| 
 | 
 | ||||||
|   res = MP_OKAY; |   res = MP_OKAY; | ||||||
| 
 | 
 | ||||||
| LBL_T3:mp_clear(&t3); | LBL_T3: | ||||||
| LBL_T2:mp_clear(&t2); |   mp_clear(&t3); | ||||||
| LBL_T1:mp_clear(&t1); | LBL_T2: | ||||||
|  |   mp_clear(&t2); | ||||||
|  | LBL_T1: | ||||||
|  |   mp_clear(&t1); | ||||||
|   return res; |   return res; | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  | |||||||
| @ -52,7 +52,8 @@ int mp_prime_fermat (mp_int * a, mp_int * b, int *result) | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   err = MP_OKAY; |   err = MP_OKAY; | ||||||
| LBL_T:mp_clear(&t); | LBL_T: | ||||||
|  |   mp_clear(&t); | ||||||
|   return err; |   return err; | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  | |||||||
| @ -73,7 +73,8 @@ int mp_prime_is_prime (mp_int * a, int t, int *result) | |||||||
| 
 | 
 | ||||||
|   /* passed the test */ |   /* passed the test */ | ||||||
|   *result = MP_YES; |   *result = MP_YES; | ||||||
| LBL_B:mp_clear(&b); | LBL_B: | ||||||
|  |   mp_clear(&b); | ||||||
|   return err; |   return err; | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  | |||||||
| @ -91,9 +91,12 @@ int mp_prime_miller_rabin (mp_int * a, mp_int * b, int *result) | |||||||
| 
 | 
 | ||||||
|   /* probably prime now */ |   /* probably prime now */ | ||||||
|   *result = MP_YES; |   *result = MP_YES; | ||||||
| LBL_Y:mp_clear(&y); | LBL_Y: | ||||||
| LBL_R:mp_clear(&r); |   mp_clear(&y); | ||||||
| LBL_N1:mp_clear(&n1); | LBL_R: | ||||||
|  |   mp_clear(&r); | ||||||
|  | LBL_N1: | ||||||
|  |   mp_clear(&n1); | ||||||
|   return err; |   return err; | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  | |||||||
| @ -69,8 +69,10 @@ int mp_sqrt(mp_int *arg, mp_int *ret) | |||||||
| 
 | 
 | ||||||
|   mp_exch(&t1, ret); |   mp_exch(&t1, ret); | ||||||
| 
 | 
 | ||||||
| E1: mp_clear(&t2); | E1: | ||||||
| E2: mp_clear(&t1); |   mp_clear(&t2); | ||||||
|  | E2: | ||||||
|  |   mp_clear(&t1); | ||||||
|   return res; |   return res; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -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); |   mp_exch(&res, Y); | ||||||
|   err = MP_OKAY; |   err = MP_OKAY; | ||||||
| LBL_RES:mp_clear(&res); | LBL_RES: | ||||||
| LBL_MU:mp_clear(&mu); |   mp_clear(&res); | ||||||
|  | LBL_MU: | ||||||
|  |   mp_clear(&mu); | ||||||
| LBL_M: | LBL_M: | ||||||
|   mp_clear(&M[1]); |   mp_clear(&M[1]); | ||||||
|   for (x = 1<<(winsize-1); x < (1 << winsize); x++) { |   for (x = 1<<(winsize-1); x < (1 << winsize); x++) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user