mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
Fix bug in mpi_set_bit
This commit is contained in:
@@ -280,7 +280,8 @@ int mpi_set_bit( mpi *X, size_t pos, unsigned char val )
|
||||
MPI_CHK( mpi_grow( X, off + 1 ) );
|
||||
}
|
||||
|
||||
X->p[off] = ( X->p[off] & ~( 0x01 << idx ) ) | ( val << idx );
|
||||
X->p[off] &= ~( (t_uint) 0x01 << idx );
|
||||
X->p[off] |= (t_uint) val << idx;
|
||||
|
||||
cleanup:
|
||||
|
||||
|
Reference in New Issue
Block a user