Use value as numerical value instead of bitfield value
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
parent
d8f5bc2d3d
commit
c0b9304f92
1 changed files with 4 additions and 4 deletions
|
@ -454,10 +454,10 @@ int mbedtls_mpi_mod_raw_read( mbedtls_mpi_uint *X,
|
||||||
{
|
{
|
||||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||||
|
|
||||||
if( m->ext_rep & MBEDTLS_MPI_MOD_EXT_REP_LE )
|
if( m->ext_rep == MBEDTLS_MPI_MOD_EXT_REP_LE )
|
||||||
ret = mbedtls_mpi_core_read_le( X, m->n, buf, buflen );
|
ret = mbedtls_mpi_core_read_le( X, m->n, buf, buflen );
|
||||||
|
|
||||||
else if( m->ext_rep & MBEDTLS_MPI_MOD_EXT_REP_BE )
|
else if( m->ext_rep == MBEDTLS_MPI_MOD_EXT_REP_BE )
|
||||||
ret = mbedtls_mpi_core_read_be( X, m->n, buf, buflen );
|
ret = mbedtls_mpi_core_read_be( X, m->n, buf, buflen );
|
||||||
else
|
else
|
||||||
return( MBEDTLS_ERR_MPI_BAD_INPUT_DATA );
|
return( MBEDTLS_ERR_MPI_BAD_INPUT_DATA );
|
||||||
|
@ -481,10 +481,10 @@ int mbedtls_mpi_mod_raw_write( mbedtls_mpi_uint *X,
|
||||||
unsigned char *buf,
|
unsigned char *buf,
|
||||||
size_t buflen )
|
size_t buflen )
|
||||||
{
|
{
|
||||||
if( m->ext_rep & MBEDTLS_MPI_MOD_EXT_REP_LE )
|
if( m->ext_rep == MBEDTLS_MPI_MOD_EXT_REP_LE )
|
||||||
return mbedtls_mpi_core_write_le( X, m->n, buf, buflen );
|
return mbedtls_mpi_core_write_le( X, m->n, buf, buflen );
|
||||||
|
|
||||||
else if( m->ext_rep & MBEDTLS_MPI_MOD_EXT_REP_BE )
|
else if( m->ext_rep == MBEDTLS_MPI_MOD_EXT_REP_BE )
|
||||||
return mbedtls_mpi_core_write_be( X, m->n, buf, buflen );
|
return mbedtls_mpi_core_write_be( X, m->n, buf, buflen );
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue