mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-10-31 03:30:35 -04:00 
			
		
		
		
	mbedtls_mpi_lt_mpi_ct: Improve documentation
This commit is contained in:
		
							parent
							
								
									73ba9ec9a6
								
							
						
					
					
						commit
						bb5147f165
					
				| @ -1190,6 +1190,7 @@ int mbedtls_mpi_lt_mpi_ct( const mbedtls_mpi *X, const mbedtls_mpi *Y, | |||||||
|         unsigned *ret ) |         unsigned *ret ) | ||||||
| { | { | ||||||
|     size_t i; |     size_t i; | ||||||
|  |     /* The value of any of these variables is either 0 or 1 at all times. */ | ||||||
|     unsigned cond, done, sign_X, sign_Y; |     unsigned cond, done, sign_X, sign_Y; | ||||||
| 
 | 
 | ||||||
|     MPI_VALIDATE_RET( X != NULL ); |     MPI_VALIDATE_RET( X != NULL ); | ||||||
| @ -1208,14 +1209,14 @@ int mbedtls_mpi_lt_mpi_ct( const mbedtls_mpi *X, const mbedtls_mpi *Y, | |||||||
| 
 | 
 | ||||||
|     /*
 |     /*
 | ||||||
|      * If the signs are different, then the positive operand is the bigger. |      * If the signs are different, then the positive operand is the bigger. | ||||||
|      * That is if X is negative (sign bit 1), then X < Y is true and it is false |      * That is if X is negative (sign_X == 1), then X < Y is true and it is | ||||||
|      * if X is positive (sign bit 0). |      * false if X is positive (sign_X == 0). | ||||||
|      */ |      */ | ||||||
|     cond = ( sign_X ^ sign_Y ); |     cond = ( sign_X ^ sign_Y ); | ||||||
|     *ret = cond & sign_X; |     *ret = cond & sign_X; | ||||||
| 
 | 
 | ||||||
|     /*
 |     /*
 | ||||||
|      * This is a constant time function, we might have the result, but we still |      * This is a constant-time function. We might have the result, but we still | ||||||
|      * need to go through the loop. Record if we have the result already. |      * need to go through the loop. Record if we have the result already. | ||||||
|      */ |      */ | ||||||
|     done = cond; |     done = cond; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Janos Follath
						Janos Follath