From c0b9304f921d38dc05efea904c42def23346d7ea Mon Sep 17 00:00:00 2001 From: Gabor Mezei Date: Tue, 2 Aug 2022 11:52:37 +0200 Subject: [PATCH] Use value as numerical value instead of bitfield value Signed-off-by: Gabor Mezei --- library/bignum_new.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/bignum_new.c b/library/bignum_new.c index 3f25fad6c..51e141604 100644 --- a/library/bignum_new.c +++ b/library/bignum_new.c @@ -454,10 +454,10 @@ int mbedtls_mpi_mod_raw_read( mbedtls_mpi_uint *X, { 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 ); - 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 ); else return( MBEDTLS_ERR_MPI_BAD_INPUT_DATA ); @@ -481,10 +481,10 @@ int mbedtls_mpi_mod_raw_write( mbedtls_mpi_uint *X, unsigned char *buf, 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 ); - 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 ); else