diff --git a/library/timing.c b/library/timing.c index a8c1371d5..aee9dd4e7 100644 --- a/library/timing.c +++ b/library/timing.c @@ -429,25 +429,25 @@ int mbedtls_timing_self_test( int verbose ) if( verbose != 0 ) mbedtls_printf( " TIMING test #2 (set/get_delay ): " ); - for( a = 100; a <= 200; a += 100 ) + for( a = 200; a <= 400; a += 200 ) { - for( b = 100; b <= 200; b += 100 ) + for( b = 200; b <= 400; b += 200 ) { mbedtls_timing_set_delay( &ctx, a, a + b ); - busy_msleep( a - a / 10 ); + busy_msleep( a - a / 8 ); if( mbedtls_timing_get_delay( &ctx ) != 0 ) FAIL; - busy_msleep( a / 5 ); + busy_msleep( a / 4 ); if( mbedtls_timing_get_delay( &ctx ) != 1 ) FAIL; - busy_msleep( b - a / 5 ); + busy_msleep( b - a / 8 - b / 8 ); if( mbedtls_timing_get_delay( &ctx ) != 1 ) FAIL; - busy_msleep( b / 5 ); + busy_msleep( b / 4 ); if( mbedtls_timing_get_delay( &ctx ) != 2 ) FAIL; }