Timing self test: increased tolerance
mbedtls_timing_self_test fails annoyingly often when running on a busy
machine such as can be expected of a continous integration system.
Increase the tolerances in the delay test, to reduce the chance of
failures that are only due to missing a deadline on a busy machine.
diff --git a/library/timing.c b/library/timing.c
index 77e0147..93e1826 100644
--- a/library/timing.c
+++ b/library/timing.c
@@ -445,19 +445,19 @@
{
mbedtls_timing_set_delay( &ctx, a, a + b );
- busy_msleep( a - a / 8 );
+ busy_msleep( a - a / 4 );
if( mbedtls_timing_get_delay( &ctx ) != 0 )
FAIL;
- busy_msleep( a / 4 );
+ busy_msleep( a / 2 );
if( mbedtls_timing_get_delay( &ctx ) != 1 )
FAIL;
- busy_msleep( b - a / 8 - b / 8 );
+ busy_msleep( b - a / 4 - b / 4 );
if( mbedtls_timing_get_delay( &ctx ) != 1 )
FAIL;
- busy_msleep( b / 4 );
+ busy_msleep( b / 2 );
if( mbedtls_timing_get_delay( &ctx ) != 2 )
FAIL;
}