mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
Add a new self test to entropy module
The self test is a quick way to check at startup whether the entropy sources are functioning correctly. The self test only polls 8 bytes from the default entropy source and performs the following checks: - The bytes are not all 0x00 or 0xFF. - The hardware does not return an error when polled. - The entropy does not provide data in a patter. Only check pattern at byte, word and long word sizes.
This commit is contained in:
parent
0e7d38739f
commit
b34e42e69e
4 changed files with 106 additions and 0 deletions
|
|
@ -381,5 +381,8 @@ void entropy_nv_seed( char *read_seed_str )
|
|||
void entropy_selftest( )
|
||||
{
|
||||
TEST_ASSERT( mbedtls_entropy_self_test( 0 ) == 0 );
|
||||
#if !defined(MBEDTLS_TEST_NULL_ENTROPY) && defined(MBEDTLS_ENTROPY_HARDWARE_ALT)
|
||||
TEST_ASSERT( mbedtls_entropy_self_test_bias( 0 ) == 0 );
|
||||
#endif
|
||||
}
|
||||
/* END_CASE */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue