mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
Fix bug in mpi_set_bit
This commit is contained in:
parent
a0179b8c4a
commit
9a4a5ac4de
3 changed files with 9 additions and 1 deletions
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue