Skip to content

Commit ae67939

Browse files
Fix entropy_calls when MBEDTLS_ENTROPY_NV_SEED is enabled
1 parent 85485c7 commit ae67939

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/suites/test_suite_entropy.function

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ void entropy_threshold( int threshold, int chunk_size, int result )
271271
{
272272
TEST_ASSERT( ret == 0 );
273273
#if defined(MBEDTLS_ENTROPY_NV_SEED)
274-
// Two times as much calls due to the NV seed update
274+
/* If the NV seed functionality is enabled, there are two entropy
275+
* updates: before and after updating the NV seed. */
275276
result *= 2;
276277
#endif
277278
TEST_ASSERT( dummy.calls == (size_t) result );
@@ -317,6 +318,11 @@ void entropy_calls( int strength1, int strength2,
317318
if( result >= 0 )
318319
{
319320
TEST_ASSERT( ret == 0 );
321+
#if defined(MBEDTLS_ENTROPY_NV_SEED)
322+
/* If the NV seed functionality is enabled, there are two entropy
323+
* updates: before and after updating the NV seed. */
324+
result *= 2;
325+
#endif
320326
TEST_ASSERT( dummy1.calls == (size_t) result );
321327
}
322328
else

0 commit comments

Comments
 (0)