blob: c34c1854ac827fd9490504e9da311946600c219a [file] [log] [blame]
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +02001/* BEGIN_HEADER */
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +00002#include "mbedtls/entropy.h"
Paul Bakkerffbfb4c2016-06-01 15:36:18 +01003#include "mbedtls/entropy_poll.h"
Mohammad Azim Khan67735d52017-04-06 11:55:43 +01004#include "string.h"
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +02005
6/*
7 * Number of calls made to entropy_dummy_source()
8 */
9static size_t entropy_dummy_calls;
10
11/*
12 * Dummy entropy source
13 *
14 * If data is NULL, write exactly the requested length.
15 * Otherwise, write the length indicated by data or error if negative
16 */
17static int entropy_dummy_source( void *data, unsigned char *output,
18 size_t len, size_t *olen )
19{
20 entropy_dummy_calls++;
21
22 if( data == NULL )
23 *olen = len;
24 else
25 {
26 int *d = (int *) data;
27
28 if( *d < 0 )
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020029 return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +020030 else
31 *olen = *d;
32 }
33
34 memset( output, 0x2a, *olen );
35
36 return( 0 );
37}
Paul Bakkerffbfb4c2016-06-01 15:36:18 +010038
Paul Bakker4a6c6fc2016-06-01 16:34:25 +010039#if defined(MBEDTLS_ENTROPY_NV_SEED)
Paul Bakkerffbfb4c2016-06-01 15:36:18 +010040/*
41 * Ability to clear entropy sources to allow testing with just predefined
42 * entropy sources. This function or tests depending on it might break if there
43 * are internal changes to how entropy sources are registered.
44 *
45 * To be called immediately after mbedtls_entropy_init().
46 *
47 * Just resetting the counter. New sources will overwrite existing ones.
48 * This might break memory checks in the future if sources need 'free-ing' then
49 * as well.
50 */
51static void entropy_clear_sources( mbedtls_entropy_context *ctx )
52{
53 ctx->source_count = 0;
54}
55
56/*
57 * NV seed read/write functions that use a buffer instead of a file
58 */
59static unsigned char buffer_seed[MBEDTLS_ENTROPY_BLOCK_SIZE];
60
61static int buffer_nv_seed_read( unsigned char *buf, size_t buf_len )
62{
63 if( buf_len != MBEDTLS_ENTROPY_BLOCK_SIZE )
64 return( -1 );
65
66 memcpy( buf, buffer_seed, MBEDTLS_ENTROPY_BLOCK_SIZE );
67 return( 0 );
68}
69
70static int buffer_nv_seed_write( unsigned char *buf, size_t buf_len )
71{
72 if( buf_len != MBEDTLS_ENTROPY_BLOCK_SIZE )
73 return( -1 );
74
75 memcpy( buffer_seed, buf, MBEDTLS_ENTROPY_BLOCK_SIZE );
76 return( 0 );
77}
78
79/*
80 * NV seed read/write helpers that fill the base seedfile
81 */
82static int write_nv_seed( unsigned char *buf, size_t buf_len )
83{
84 FILE *f;
85
86 if( buf_len != MBEDTLS_ENTROPY_BLOCK_SIZE )
87 return( -1 );
88
89 if( ( f = fopen( MBEDTLS_PLATFORM_STD_NV_SEED_FILE, "w" ) ) == NULL )
90 return( -1 );
91
92 if( fwrite( buf, 1, MBEDTLS_ENTROPY_BLOCK_SIZE, f ) !=
93 MBEDTLS_ENTROPY_BLOCK_SIZE )
94 return( -1 );
95
96 fclose( f );
97
98 return( 0 );
99}
100
101static int read_nv_seed( unsigned char *buf, size_t buf_len )
102{
103 FILE *f;
104
105 if( buf_len != MBEDTLS_ENTROPY_BLOCK_SIZE )
106 return( -1 );
107
108 if( ( f = fopen( MBEDTLS_PLATFORM_STD_NV_SEED_FILE, "rb" ) ) == NULL )
109 return( -1 );
110
111 if( fread( buf, 1, MBEDTLS_ENTROPY_BLOCK_SIZE, f ) !=
112 MBEDTLS_ENTROPY_BLOCK_SIZE )
113 return( -1 );
114
115 fclose( f );
116
117 return( 0 );
118}
Paul Bakker4a6c6fc2016-06-01 16:34:25 +0100119#endif /* MBEDTLS_ENTROPY_NV_SEED */
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200120/* END_HEADER */
121
122/* BEGIN_DEPENDENCIES
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200123 * depends_on:MBEDTLS_ENTROPY_C
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200124 * END_DEPENDENCIES
125 */
126
Simon Butcherb7f45c52016-09-15 18:42:26 +0100127/* BEGIN_CASE depends_on:MBEDTLS_ENTROPY_NV_SEED:MBEDTLS_FS_IO */
Azim Khanf1aaec92017-05-30 14:23:15 +0100128void entropy_seed_file( char * path, int ret )
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200129{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200130 mbedtls_entropy_context ctx;
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200131
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200132 mbedtls_entropy_init( &ctx );
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200133
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200134 TEST_ASSERT( mbedtls_entropy_write_seed_file( &ctx, path ) == ret );
135 TEST_ASSERT( mbedtls_entropy_update_seed_file( &ctx, path ) == ret );
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200136
Paul Bakkerbd51b262014-07-10 15:26:12 +0200137exit:
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200138 mbedtls_entropy_free( &ctx );
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200139}
140/* END_CASE */
141
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200142/* BEGIN_CASE */
Azim Khanf1aaec92017-05-30 14:23:15 +0100143void entropy_too_many_sources( )
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200144{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200145 mbedtls_entropy_context ctx;
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200146 size_t i;
147
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200148 mbedtls_entropy_init( &ctx );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200149
150 /*
151 * It's hard to tell precisely when the error will occur,
152 * since we don't know how many sources were automatically added.
153 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200154 for( i = 0; i < MBEDTLS_ENTROPY_MAX_SOURCES; i++ )
Manuel Pégourié-Gonnard7580ba42015-06-19 10:26:32 +0200155 (void) mbedtls_entropy_add_source( &ctx, entropy_dummy_source, NULL,
156 16, MBEDTLS_ENTROPY_SOURCE_WEAK );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200157
Manuel Pégourié-Gonnard7580ba42015-06-19 10:26:32 +0200158 TEST_ASSERT( mbedtls_entropy_add_source( &ctx, entropy_dummy_source, NULL,
159 16, MBEDTLS_ENTROPY_SOURCE_WEAK )
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200160 == MBEDTLS_ERR_ENTROPY_MAX_SOURCES );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200161
Paul Bakkerbd51b262014-07-10 15:26:12 +0200162exit:
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200163 mbedtls_entropy_free( &ctx );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200164}
165/* END_CASE */
166
Hanno Beckerd4a872e2017-09-07 08:09:33 +0100167/* BEGIN_CASE depends_on:ENTROPY_HAVE_STRONG */
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200168void entropy_func_len( int len, int ret )
169{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200170 mbedtls_entropy_context ctx;
171 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE + 10] = { 0 };
172 unsigned char acc[MBEDTLS_ENTROPY_BLOCK_SIZE + 10] = { 0 };
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200173 size_t i, j;
174
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200175 mbedtls_entropy_init( &ctx );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200176
177 /*
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200178 * See comments in mbedtls_entropy_self_test()
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200179 */
180 for( i = 0; i < 8; i++ )
181 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200182 TEST_ASSERT( mbedtls_entropy_func( &ctx, buf, len ) == ret );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200183 for( j = 0; j < sizeof( buf ); j++ )
184 acc[j] |= buf[j];
185 }
186
187 if( ret == 0 )
188 for( j = 0; j < (size_t) len; j++ )
189 TEST_ASSERT( acc[j] != 0 );
190
191 for( j = len; j < sizeof( buf ); j++ )
192 TEST_ASSERT( acc[j] == 0 );
193}
194/* END_CASE */
195
196/* BEGIN_CASE */
Azim Khanf1aaec92017-05-30 14:23:15 +0100197void entropy_source_fail( char * path )
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200198{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200199 mbedtls_entropy_context ctx;
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200200 int fail = -1;
201 unsigned char buf[16];
202
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200203 mbedtls_entropy_init( &ctx );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200204
Manuel Pégourié-Gonnard7580ba42015-06-19 10:26:32 +0200205 TEST_ASSERT( mbedtls_entropy_add_source( &ctx, entropy_dummy_source,
206 &fail, 16,
207 MBEDTLS_ENTROPY_SOURCE_WEAK )
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200208 == 0 );
209
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200210 TEST_ASSERT( mbedtls_entropy_func( &ctx, buf, sizeof( buf ) )
211 == MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
212 TEST_ASSERT( mbedtls_entropy_gather( &ctx )
213 == MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
Simon Butcherb7f45c52016-09-15 18:42:26 +0100214#if defined(MBEDTLS_FS_IO) && defined(MBEDTLS_ENTROPY_NV_SEED)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200215 TEST_ASSERT( mbedtls_entropy_write_seed_file( &ctx, path )
216 == MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
217 TEST_ASSERT( mbedtls_entropy_update_seed_file( &ctx, path )
218 == MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200219#else
220 ((void) path);
221#endif
222
Paul Bakkerbd51b262014-07-10 15:26:12 +0200223exit:
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200224 mbedtls_entropy_free( &ctx );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200225}
226/* END_CASE */
227
Hanno Beckerd4a872e2017-09-07 08:09:33 +0100228/* BEGIN_CASE depends_on:ENTROPY_HAVE_STRONG */
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200229void entropy_threshold( int threshold, int chunk_size, int result )
230{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200231 mbedtls_entropy_context ctx;
232 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE] = { 0 };
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200233 int ret;
234
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200235 mbedtls_entropy_init( &ctx );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200236
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200237 TEST_ASSERT( mbedtls_entropy_add_source( &ctx, entropy_dummy_source,
Manuel Pégourié-Gonnard7580ba42015-06-19 10:26:32 +0200238 &chunk_size, threshold,
239 MBEDTLS_ENTROPY_SOURCE_WEAK ) == 0 );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200240
241 entropy_dummy_calls = 0;
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200242 ret = mbedtls_entropy_func( &ctx, buf, sizeof( buf ) );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200243
244 if( result >= 0 )
245 {
246 TEST_ASSERT( ret == 0 );
Paul Bakkerffbfb4c2016-06-01 15:36:18 +0100247#if defined(MBEDTLS_ENTROPY_NV_SEED)
248 // Two times as much calls due to the NV seed update
249 result *= 2;
250#endif
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200251 TEST_ASSERT( entropy_dummy_calls == (size_t) result );
252 }
253 else
254 {
255 TEST_ASSERT( ret == result );
256 }
257
Paul Bakkerbd51b262014-07-10 15:26:12 +0200258exit:
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200259 mbedtls_entropy_free( &ctx );
Manuel Pégourié-Gonnardc7c56b22014-05-30 11:42:01 +0200260}
261/* END_CASE */
262
Paul Bakkerffbfb4c2016-06-01 15:36:18 +0100263/* BEGIN_CASE depends_on:MBEDTLS_ENTROPY_NV_SEED:MBEDTLS_FS_IO */
Azim Khanf1aaec92017-05-30 14:23:15 +0100264void nv_seed_file_create( )
Paul Bakkerffbfb4c2016-06-01 15:36:18 +0100265{
266 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE];
267
268 memset( buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE );
269
270 TEST_ASSERT( write_nv_seed( buf, MBEDTLS_ENTROPY_BLOCK_SIZE ) == 0 );
271}
272/* END_CASE */
273
Paul Bakkerb598c292016-06-01 16:57:11 +0100274/* BEGIN_CASE depends_on:MBEDTLS_ENTROPY_NV_SEED:MBEDTLS_FS_IO:MBEDTLS_PLATFORM_NV_SEED_ALT */
Azim Khanf1aaec92017-05-30 14:23:15 +0100275void entropy_nv_seed_std_io( )
Paul Bakkerffbfb4c2016-06-01 15:36:18 +0100276{
277 unsigned char io_seed[MBEDTLS_ENTROPY_BLOCK_SIZE];
278 unsigned char check_seed[MBEDTLS_ENTROPY_BLOCK_SIZE];
279
280 memset( io_seed, 1, MBEDTLS_ENTROPY_BLOCK_SIZE );
281 memset( check_seed, 0, MBEDTLS_ENTROPY_BLOCK_SIZE );
282
283 mbedtls_platform_set_nv_seed( mbedtls_platform_std_nv_seed_read,
284 mbedtls_platform_std_nv_seed_write );
285
286 /* Check if platform NV read and write manipulate the same data */
287 TEST_ASSERT( write_nv_seed( io_seed, MBEDTLS_ENTROPY_BLOCK_SIZE ) == 0 );
288 TEST_ASSERT( mbedtls_nv_seed_read( check_seed, MBEDTLS_ENTROPY_BLOCK_SIZE ) ==
289 MBEDTLS_ENTROPY_BLOCK_SIZE );
290
291 TEST_ASSERT( memcmp( io_seed, check_seed, MBEDTLS_ENTROPY_BLOCK_SIZE ) == 0 );
292
293 memset( check_seed, 0, MBEDTLS_ENTROPY_BLOCK_SIZE );
294
295 /* Check if platform NV write and raw read manipulate the same data */
296 TEST_ASSERT( mbedtls_nv_seed_write( io_seed, MBEDTLS_ENTROPY_BLOCK_SIZE ) ==
297 MBEDTLS_ENTROPY_BLOCK_SIZE );
298 TEST_ASSERT( read_nv_seed( check_seed, MBEDTLS_ENTROPY_BLOCK_SIZE ) == 0 );
299
300 TEST_ASSERT( memcmp( io_seed, check_seed, MBEDTLS_ENTROPY_BLOCK_SIZE ) == 0 );
301}
302/* END_CASE */
303
Paul Bakkerc5687622016-06-07 11:06:09 +0100304/* BEGIN_CASE depends_on:MBEDTLS_ENTROPY_NV_SEED:MBEDTLS_PLATFORM_NV_SEED_ALT:MBEDTLS_ENTROPY_SHA512_ACCUMULATOR */
Azim Khanf1aaec92017-05-30 14:23:15 +0100305void entropy_nv_seed( uint8_t * read_seed, uint32_t read_seed_len )
Paul Bakkerffbfb4c2016-06-01 15:36:18 +0100306{
307 mbedtls_sha512_context accumulator;
308 mbedtls_entropy_context ctx;
309
310 unsigned char header[2];
311 unsigned char entropy[MBEDTLS_ENTROPY_BLOCK_SIZE];
312 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE];
313 unsigned char empty[MBEDTLS_ENTROPY_BLOCK_SIZE];
314 unsigned char read_seed[MBEDTLS_ENTROPY_BLOCK_SIZE];
315 unsigned char check_seed[MBEDTLS_ENTROPY_BLOCK_SIZE];
316 unsigned char check_entropy[MBEDTLS_ENTROPY_BLOCK_SIZE];
317
318 memset( entropy, 0, MBEDTLS_ENTROPY_BLOCK_SIZE );
319 memset( buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE );
320 memset( buffer_seed, 0, MBEDTLS_ENTROPY_BLOCK_SIZE );
321 memset( empty, 0, MBEDTLS_ENTROPY_BLOCK_SIZE );
322 memset( check_seed, 2, MBEDTLS_ENTROPY_BLOCK_SIZE );
323 memset( check_entropy, 3, MBEDTLS_ENTROPY_BLOCK_SIZE );
324
325 // Set the initial NV seed to read
Paul Bakkerffbfb4c2016-06-01 15:36:18 +0100326 memcpy( buffer_seed, read_seed, MBEDTLS_ENTROPY_BLOCK_SIZE );
327
328 // Make sure we read/write NV seed from our buffers
329 mbedtls_platform_set_nv_seed( buffer_nv_seed_read, buffer_nv_seed_write );
330
331 mbedtls_entropy_init( &ctx );
332 entropy_clear_sources( &ctx );
333
334 TEST_ASSERT( mbedtls_entropy_add_source( &ctx, mbedtls_nv_seed_poll, NULL,
335 MBEDTLS_ENTROPY_BLOCK_SIZE,
336 MBEDTLS_ENTROPY_SOURCE_STRONG ) == 0 );
337
338 // Do an entropy run
339 TEST_ASSERT( mbedtls_entropy_func( &ctx, entropy, sizeof( entropy ) ) == 0 );
340
341 // Determine what should have happened with manual entropy internal logic
342 // Only use the SHA-512 version to check
343
344 // Init accumulator
345 header[1] = MBEDTLS_ENTROPY_BLOCK_SIZE;
346 mbedtls_sha512_starts( &accumulator, 0 );
347
348 // First run for updating write_seed
349 header[0] = 0;
350 mbedtls_sha512_update( &accumulator, header, 2 );
351 mbedtls_sha512_update( &accumulator, read_seed, MBEDTLS_ENTROPY_BLOCK_SIZE );
352 mbedtls_sha512_finish( &accumulator, buf );
353
354 memset( &accumulator, 0, sizeof( mbedtls_sha512_context ) );
355 mbedtls_sha512_starts( &accumulator, 0 );
356 mbedtls_sha512_update( &accumulator, buf, MBEDTLS_ENTROPY_BLOCK_SIZE );
357
358 mbedtls_sha512( buf, MBEDTLS_ENTROPY_BLOCK_SIZE, check_seed, 0 );
359
360 // Second run for actual entropy (triggers mbedtls_entropy_update_nv_seed)
361 header[0] = MBEDTLS_ENTROPY_SOURCE_MANUAL;
362 mbedtls_sha512_update( &accumulator, header, 2 );
363 mbedtls_sha512_update( &accumulator, empty, MBEDTLS_ENTROPY_BLOCK_SIZE );
364
365 header[0] = 0;
366 mbedtls_sha512_update( &accumulator, header, 2 );
367 mbedtls_sha512_update( &accumulator, check_seed, MBEDTLS_ENTROPY_BLOCK_SIZE );
368 mbedtls_sha512_finish( &accumulator, buf );
369
370 mbedtls_sha512( buf, MBEDTLS_ENTROPY_BLOCK_SIZE, check_entropy, 0 );
371
372 // Check result of both NV file and entropy received with the manual calculations
373 TEST_ASSERT( memcmp( check_seed, buffer_seed, MBEDTLS_ENTROPY_BLOCK_SIZE ) == 0 );
374 TEST_ASSERT( memcmp( check_entropy, entropy, MBEDTLS_ENTROPY_BLOCK_SIZE ) == 0 );
375
376 mbedtls_entropy_free( &ctx );
377}
378/* END_CASE */
379
Hanno Beckerd4a872e2017-09-07 08:09:33 +0100380/* BEGIN_CASE depends_on:ENTROPY_HAVE_STRONG:MBEDTLS_SELF_TEST */
Simon Butcherb7f45c52016-09-15 18:42:26 +0100381void entropy_selftest( int result )
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200382{
Andres AG93012e82016-09-09 09:10:28 +0100383 TEST_ASSERT( mbedtls_entropy_self_test( 1 ) == result );
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200384}
385/* END_CASE */