mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-07 13:22:46 +00:00
Use ternary operator with the most common case first
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
c7eeeb1e8d
commit
87823d7913
@ -2488,10 +2488,7 @@ int mbedtls_mpi_random( mbedtls_mpi *X,
|
|||||||
* is small, use a higher repeat count, otherwise the probability of
|
* is small, use a higher repeat count, otherwise the probability of
|
||||||
* failure is macroscopic.
|
* failure is macroscopic.
|
||||||
*/
|
*/
|
||||||
if( n_bytes <= 4 )
|
count = ( n_bytes > 4 ? 30 : 250 );
|
||||||
count = 250;
|
|
||||||
else
|
|
||||||
count = 30;
|
|
||||||
|
|
||||||
/* Ensure that target MPI has exactly the same number of limbs
|
/* Ensure that target MPI has exactly the same number of limbs
|
||||||
* as the upper bound, even if the upper bound has leading zeros.
|
* as the upper bound, even if the upper bound has leading zeros.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user