mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-08 07:55:38 +00:00
Move part of timing module out of the library
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
This commit is contained in:
parent
8cad2e22fc
commit
d854083773
11 changed files with 251 additions and 480 deletions
|
|
@ -85,12 +85,6 @@ static void custom_entropy_init( mbedtls_entropy_context *ctx )
|
|||
MBEDTLS_ENTROPY_MIN_PLATFORM,
|
||||
MBEDTLS_ENTROPY_SOURCE_STRONG );
|
||||
#endif
|
||||
#if defined(MBEDTLS_TIMING_C)
|
||||
if( custom_entropy_sources_mask & ENTROPY_SOURCE_TIMING )
|
||||
mbedtls_entropy_add_source( ctx, mbedtls_hardclock_poll, NULL,
|
||||
MBEDTLS_ENTROPY_MIN_HARDCLOCK,
|
||||
MBEDTLS_ENTROPY_SOURCE_WEAK );
|
||||
#endif
|
||||
#if defined(MBEDTLS_ENTROPY_HARDWARE_ALT)
|
||||
if( custom_entropy_sources_mask & ENTROPY_SOURCE_HARDWARE )
|
||||
mbedtls_entropy_add_source( ctx, mbedtls_hardware_poll, NULL,
|
||||
|
|
|
|||
|
|
@ -1,15 +1,6 @@
|
|||
Timing: hardclock
|
||||
timing_hardclock:
|
||||
|
||||
Timing: get timer
|
||||
timing_get_timer:
|
||||
|
||||
Timing: set alarm with no delay
|
||||
timing_set_alarm:0:
|
||||
|
||||
Timing: set alarm with 1s delay
|
||||
timing_set_alarm:1:
|
||||
|
||||
Timing: delay 0ms
|
||||
timing_delay:0:
|
||||
|
||||
|
|
|
|||
|
|
@ -16,15 +16,6 @@
|
|||
* END_DEPENDENCIES
|
||||
*/
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void timing_hardclock( )
|
||||
{
|
||||
(void) mbedtls_timing_hardclock();
|
||||
/* This goto is added to avoid warnings from the generated code. */
|
||||
goto exit;
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void timing_get_timer( )
|
||||
{
|
||||
|
|
@ -36,23 +27,6 @@ void timing_get_timer( )
|
|||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void timing_set_alarm( int seconds )
|
||||
{
|
||||
if( seconds == 0 )
|
||||
{
|
||||
mbedtls_set_alarm( seconds );
|
||||
TEST_ASSERT( mbedtls_timing_alarmed == 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
mbedtls_set_alarm( seconds );
|
||||
TEST_ASSERT( mbedtls_timing_alarmed == 0 ||
|
||||
mbedtls_timing_alarmed == 1 );
|
||||
}
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void timing_delay( int fin_ms )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue