mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-10-30 03:00:21 -04:00 
			
		
		
		
	- Const correctness mpi_get_bit()
- Documentation mpi_lsb(), mpi_msb()
This commit is contained in:
		
							parent
							
								
									05ef835b6a
								
							
						
					
					
						commit
						6b906e5095
					
				| @ -21,6 +21,8 @@ Features | |||||||
| Changes | Changes | ||||||
|    * Removed redundant POLARSSL_DEBUG_MSG define |    * Removed redundant POLARSSL_DEBUG_MSG define | ||||||
|    * AES code only check for Padlock once |    * AES code only check for Padlock once | ||||||
|  |    * Fixed const-correctness mpi_get_bit() | ||||||
|  |    * Documentation for mpi_lsb() and mpi_msb() | ||||||
| 
 | 
 | ||||||
| Bugfix | Bugfix | ||||||
|    * Fixed handling error in mpi_cmp_mpi() on longer B values (found by |    * Fixed handling error in mpi_cmp_mpi() on longer B values (found by | ||||||
|  | |||||||
| @ -192,7 +192,7 @@ int mpi_lset( mpi *X, t_sint z ); | |||||||
|  * |  * | ||||||
|  * \return         Either a 0 or a 1 |  * \return         Either a 0 or a 1 | ||||||
|  */ |  */ | ||||||
| int mpi_get_bit( mpi *X, size_t pos ); | int mpi_get_bit( const mpi *X, size_t pos ); | ||||||
| 
 | 
 | ||||||
| /*
 | /*
 | ||||||
|  * \brief          Set a bit of X to a specific value of 0 or 1 |  * \brief          Set a bit of X to a specific value of 0 or 1 | ||||||
| @ -211,14 +211,20 @@ int mpi_get_bit( mpi *X, size_t pos ); | |||||||
| int mpi_set_bit( mpi *X, size_t pos, unsigned char val ); | int mpi_set_bit( mpi *X, size_t pos, unsigned char val ); | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  * \brief          Return the number of least significant bits |  * \brief          Return the number of zero-bits before the least significant | ||||||
|  |  *                 '1' bit | ||||||
|  |  * | ||||||
|  |  * Note: Thus also the zero-based index of the least significant '1' bit | ||||||
|  * |  * | ||||||
|  * \param X        MPI to use |  * \param X        MPI to use | ||||||
|  */ |  */ | ||||||
| size_t mpi_lsb( const mpi *X ); | size_t mpi_lsb( const mpi *X ); | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  * \brief          Return the number of most significant bits |  * \brief          Return the number of bits up to and including the most | ||||||
|  |  *                 significant '1' bit' | ||||||
|  |  * | ||||||
|  |  * Note: Thus also the one-based index of the most significant '1' bit | ||||||
|  * |  * | ||||||
|  * \param X        MPI to use |  * \param X        MPI to use | ||||||
|  */ |  */ | ||||||
|  | |||||||
| @ -173,7 +173,7 @@ cleanup: | |||||||
| /*
 | /*
 | ||||||
|  * Get a specific bit |  * Get a specific bit | ||||||
|  */ |  */ | ||||||
| int mpi_get_bit( mpi *X, size_t pos ) | int mpi_get_bit( const mpi *X, size_t pos ) | ||||||
| { | { | ||||||
|     if( X->n * biL <= pos ) |     if( X->n * biL <= pos ) | ||||||
|         return( 0 ); |         return( 0 ); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Paul Bakker
						Paul Bakker