mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Generalise mbedtls_ct_error_if to mbedtls_ct_int_if
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
@ -397,15 +397,15 @@ static inline mbedtls_mpi_uint mbedtls_ct_mpi_uint_if_else_0(mbedtls_ct_conditio
|
||||
|
||||
#endif /* MBEDTLS_BIGNUM_C */
|
||||
|
||||
static inline int mbedtls_ct_error_if(mbedtls_ct_condition_t condition, int if1, int if0)
|
||||
static inline int mbedtls_ct_int_if(mbedtls_ct_condition_t condition, int if1, int if0)
|
||||
{
|
||||
return -((int) mbedtls_ct_if(condition, (mbedtls_ct_uint_t) (-if1),
|
||||
(mbedtls_ct_uint_t) (-if0)));
|
||||
int a[2] = {if0, if1};
|
||||
return a[mbedtls_ct_uint_if_else_0(condition, 1)];
|
||||
}
|
||||
|
||||
static inline int mbedtls_ct_error_if_else_0(mbedtls_ct_condition_t condition, int if1)
|
||||
static inline int mbedtls_ct_int_if_else_0(mbedtls_ct_condition_t condition, int if1)
|
||||
{
|
||||
return -((int) (condition & (-if1)));
|
||||
return mbedtls_ct_int_if(condition, if1, 0);
|
||||
}
|
||||
|
||||
static inline mbedtls_ct_condition_t mbedtls_ct_uint_eq(mbedtls_ct_uint_t x,
|
||||
|
Reference in New Issue
Block a user