Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 1 | /* BEGIN_HEADER */ |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 2 | #include "mbedtls/ctr_drbg.h" |
Rich Evans | 00ab470 | 2015-02-06 13:43:58 +0000 | [diff] [blame] | 3 | |
Paul Bakker | 3ddfa66 | 2013-11-26 17:45:20 +0100 | [diff] [blame] | 4 | int test_offset_idx; |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5 | int mbedtls_entropy_func( void *data, unsigned char *buf, size_t len ) |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 6 | { |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 7 | const unsigned char *p = (unsigned char *) data; |
Paul Bakker | 3ddfa66 | 2013-11-26 17:45:20 +0100 | [diff] [blame] | 8 | memcpy( buf, p + test_offset_idx, len ); |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 9 | test_offset_idx += len; |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 10 | return( 0 ); |
| 11 | } |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 12 | /* END_HEADER */ |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 13 | |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 14 | /* BEGIN_DEPENDENCIES |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 15 | * depends_on:MBEDTLS_CTR_DRBG_C |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 16 | * END_DEPENDENCIES |
| 17 | */ |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 18 | |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 19 | /* BEGIN_CASE */ |
Paul Bakker | 185ccf7 | 2016-07-14 13:21:10 +0100 | [diff] [blame] | 20 | void ctr_drbg_special_behaviours( ) |
| 21 | { |
| 22 | mbedtls_ctr_drbg_context ctx; |
| 23 | unsigned char output[512]; |
| 24 | unsigned char additional[512]; |
| 25 | |
| 26 | mbedtls_ctr_drbg_init( &ctx ); |
| 27 | memset( output, 0, sizeof( output ) ); |
| 28 | memset( additional, 0, sizeof( additional ) ); |
| 29 | |
| 30 | TEST_ASSERT( mbedtls_ctr_drbg_random_with_add( &ctx, |
| 31 | output, MBEDTLS_CTR_DRBG_MAX_REQUEST + 1, |
| 32 | additional, 16 ) == |
| 33 | MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG ); |
| 34 | TEST_ASSERT( mbedtls_ctr_drbg_random_with_add( &ctx, |
| 35 | output, 16, |
| 36 | additional, MBEDTLS_CTR_DRBG_MAX_INPUT + 1 ) == |
| 37 | MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG ); |
| 38 | |
| 39 | TEST_ASSERT( mbedtls_ctr_drbg_reseed( &ctx, additional, |
| 40 | MBEDTLS_CTR_DRBG_MAX_SEED_INPUT + 1 ) == |
| 41 | MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG ); |
Andres Amaya Garcia | 6a54336 | 2017-01-17 23:04:22 +0000 | [diff] [blame^] | 42 | |
| 43 | mbedtls_ctr_drbg_set_entropy_len( &ctx, ~0 ); |
| 44 | TEST_ASSERT( mbedtls_ctr_drbg_reseed( &ctx, additional, |
| 45 | MBEDTLS_CTR_DRBG_MAX_SEED_INPUT ) == |
| 46 | MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG ); |
Paul Bakker | 185ccf7 | 2016-07-14 13:21:10 +0100 | [diff] [blame] | 47 | exit: |
| 48 | mbedtls_ctr_drbg_free( &ctx ); |
| 49 | } |
| 50 | /* END_CASE */ |
| 51 | |
| 52 | /* BEGIN_CASE */ |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 53 | void ctr_drbg_validate_pr( char *add_init_string, char *entropy_string, |
| 54 | char *add1_string, char *add2_string, |
| 55 | char *result_str ) |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 56 | { |
| 57 | unsigned char entropy[512]; |
| 58 | unsigned char add_init[512]; |
| 59 | unsigned char add1[512]; |
| 60 | unsigned char add2[512]; |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 61 | mbedtls_ctr_drbg_context ctx; |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 62 | unsigned char buf[512]; |
| 63 | unsigned char output_str[512]; |
| 64 | int add_init_len, add1_len, add2_len; |
| 65 | |
Manuel Pégourié-Gonnard | 8d128ef | 2015-04-28 22:38:08 +0200 | [diff] [blame] | 66 | mbedtls_ctr_drbg_init( &ctx ); |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 67 | memset( output_str, 0, 512 ); |
| 68 | |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 69 | unhexify( entropy, entropy_string ); |
| 70 | add_init_len = unhexify( add_init, add_init_string ); |
| 71 | add1_len = unhexify( add1, add1_string ); |
| 72 | add2_len = unhexify( add2, add2_string ); |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 73 | |
Paul Bakker | 3ddfa66 | 2013-11-26 17:45:20 +0100 | [diff] [blame] | 74 | test_offset_idx = 0; |
Manuel Pégourié-Gonnard | 8d128ef | 2015-04-28 22:38:08 +0200 | [diff] [blame] | 75 | TEST_ASSERT( mbedtls_ctr_drbg_seed_entropy_len( &ctx, mbedtls_entropy_func, entropy, add_init, add_init_len, 32 ) == 0 ); |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 76 | mbedtls_ctr_drbg_set_prediction_resistance( &ctx, MBEDTLS_CTR_DRBG_PR_ON ); |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 77 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 78 | TEST_ASSERT( mbedtls_ctr_drbg_random_with_add( &ctx, buf, 16, add1, add1_len ) == 0 ); |
| 79 | TEST_ASSERT( mbedtls_ctr_drbg_random_with_add( &ctx, buf, 16, add2, add2_len ) == 0 ); |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 80 | hexify( output_str, buf, 16 ); |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 81 | TEST_ASSERT( strcmp( (char *) output_str, result_str ) == 0 ); |
Paul Bakker | a317a98 | 2014-06-18 16:44:11 +0200 | [diff] [blame] | 82 | |
Paul Bakker | bd51b26 | 2014-07-10 15:26:12 +0200 | [diff] [blame] | 83 | exit: |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 84 | mbedtls_ctr_drbg_free( &ctx ); |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 85 | } |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 86 | /* END_CASE */ |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 87 | |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 88 | /* BEGIN_CASE */ |
| 89 | void ctr_drbg_validate_nopr( char *add_init_string, char *entropy_string, |
| 90 | char *add1_string, char *add_reseed_string, |
| 91 | char *add2_string, char *result_str ) |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 92 | { |
| 93 | unsigned char entropy[512]; |
| 94 | unsigned char add_init[512]; |
| 95 | unsigned char add1[512]; |
| 96 | unsigned char add_reseed[512]; |
| 97 | unsigned char add2[512]; |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 98 | mbedtls_ctr_drbg_context ctx; |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 99 | unsigned char buf[512]; |
| 100 | unsigned char output_str[512]; |
| 101 | int add_init_len, add1_len, add_reseed_len, add2_len; |
| 102 | |
Manuel Pégourié-Gonnard | 8d128ef | 2015-04-28 22:38:08 +0200 | [diff] [blame] | 103 | mbedtls_ctr_drbg_init( &ctx ); |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 104 | memset( output_str, 0, 512 ); |
| 105 | |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 106 | unhexify( entropy, entropy_string ); |
| 107 | add_init_len = unhexify( add_init, add_init_string ); |
| 108 | add1_len = unhexify( add1, add1_string ); |
| 109 | add_reseed_len = unhexify( add_reseed, add_reseed_string ); |
| 110 | add2_len = unhexify( add2, add2_string ); |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 111 | |
Paul Bakker | 3ddfa66 | 2013-11-26 17:45:20 +0100 | [diff] [blame] | 112 | test_offset_idx = 0; |
Manuel Pégourié-Gonnard | 8d128ef | 2015-04-28 22:38:08 +0200 | [diff] [blame] | 113 | TEST_ASSERT( mbedtls_ctr_drbg_seed_entropy_len( &ctx, mbedtls_entropy_func, entropy, add_init, add_init_len, 32 ) == 0 ); |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 114 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 115 | TEST_ASSERT( mbedtls_ctr_drbg_random_with_add( &ctx, buf, 16, add1, add1_len ) == 0 ); |
| 116 | TEST_ASSERT( mbedtls_ctr_drbg_reseed( &ctx, add_reseed, add_reseed_len ) == 0 ); |
| 117 | TEST_ASSERT( mbedtls_ctr_drbg_random_with_add( &ctx, buf, 16, add2, add2_len ) == 0 ); |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 118 | hexify( output_str, buf, 16 ); |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 119 | TEST_ASSERT( strcmp( (char *) output_str, result_str ) == 0 ); |
Paul Bakker | a317a98 | 2014-06-18 16:44:11 +0200 | [diff] [blame] | 120 | |
Paul Bakker | bd51b26 | 2014-07-10 15:26:12 +0200 | [diff] [blame] | 121 | exit: |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 122 | mbedtls_ctr_drbg_free( &ctx ); |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 123 | } |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 124 | /* END_CASE */ |
Manuel Pégourié-Gonnard | b3b205e | 2014-01-31 12:04:06 +0100 | [diff] [blame] | 125 | |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 126 | /* BEGIN_CASE */ |
| 127 | void ctr_drbg_entropy_usage( ) |
| 128 | { |
| 129 | unsigned char out[16]; |
| 130 | unsigned char add[16]; |
| 131 | unsigned char entropy[1024]; |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 132 | mbedtls_ctr_drbg_context ctx; |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 133 | size_t i, reps = 10; |
| 134 | int last_idx; |
| 135 | |
Manuel Pégourié-Gonnard | 8d128ef | 2015-04-28 22:38:08 +0200 | [diff] [blame] | 136 | mbedtls_ctr_drbg_init( &ctx ); |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 137 | test_offset_idx = 0; |
| 138 | memset( entropy, 0, sizeof( entropy ) ); |
| 139 | memset( out, 0, sizeof( out ) ); |
| 140 | memset( add, 0, sizeof( add ) ); |
| 141 | |
| 142 | /* Init must use entropy */ |
| 143 | last_idx = test_offset_idx; |
Manuel Pégourié-Gonnard | 8d128ef | 2015-04-28 22:38:08 +0200 | [diff] [blame] | 144 | TEST_ASSERT( mbedtls_ctr_drbg_seed( &ctx, mbedtls_entropy_func, entropy, NULL, 0 ) == 0 ); |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 145 | TEST_ASSERT( last_idx < test_offset_idx ); |
| 146 | |
| 147 | /* By default, PR is off and reseed_interval is large, |
| 148 | * so the next few calls should not use entropy */ |
| 149 | last_idx = test_offset_idx; |
| 150 | for( i = 0; i < reps; i++ ) |
| 151 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 152 | TEST_ASSERT( mbedtls_ctr_drbg_random( &ctx, out, sizeof( out ) - 4 ) == 0 ); |
| 153 | TEST_ASSERT( mbedtls_ctr_drbg_random_with_add( &ctx, out, sizeof( out ) - 4, |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 154 | add, sizeof( add ) ) == 0 ); |
| 155 | } |
| 156 | TEST_ASSERT( last_idx == test_offset_idx ); |
| 157 | |
| 158 | /* While at it, make sure we didn't write past the requested length */ |
| 159 | TEST_ASSERT( out[sizeof( out ) - 4] == 0 ); |
| 160 | TEST_ASSERT( out[sizeof( out ) - 3] == 0 ); |
| 161 | TEST_ASSERT( out[sizeof( out ) - 2] == 0 ); |
| 162 | TEST_ASSERT( out[sizeof( out ) - 1] == 0 ); |
| 163 | |
| 164 | /* Set reseed_interval to the number of calls done, |
| 165 | * so the next call should reseed */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 166 | mbedtls_ctr_drbg_set_reseed_interval( &ctx, 2 * reps ); |
| 167 | TEST_ASSERT( mbedtls_ctr_drbg_random( &ctx, out, sizeof( out ) ) == 0 ); |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 168 | TEST_ASSERT( last_idx < test_offset_idx ); |
| 169 | |
| 170 | /* The new few calls should not reseed */ |
| 171 | last_idx = test_offset_idx; |
| 172 | for( i = 0; i < reps / 2; i++ ) |
| 173 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 174 | TEST_ASSERT( mbedtls_ctr_drbg_random( &ctx, out, sizeof( out ) ) == 0 ); |
| 175 | TEST_ASSERT( mbedtls_ctr_drbg_random_with_add( &ctx, out, sizeof( out ) , |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 176 | add, sizeof( add ) ) == 0 ); |
| 177 | } |
| 178 | TEST_ASSERT( last_idx == test_offset_idx ); |
| 179 | |
Manuel Pégourié-Gonnard | f5f25b3 | 2014-11-27 14:04:56 +0100 | [diff] [blame] | 180 | /* Call update with too much data (sizeof entropy > MAX(_SEED)_INPUT) |
| 181 | * (just make sure it doesn't cause memory corruption) */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 182 | mbedtls_ctr_drbg_update( &ctx, entropy, sizeof( entropy ) ); |
Manuel Pégourié-Gonnard | f5f25b3 | 2014-11-27 14:04:56 +0100 | [diff] [blame] | 183 | |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 184 | /* Now enable PR, so the next few calls should all reseed */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 185 | mbedtls_ctr_drbg_set_prediction_resistance( &ctx, MBEDTLS_CTR_DRBG_PR_ON ); |
| 186 | TEST_ASSERT( mbedtls_ctr_drbg_random( &ctx, out, sizeof( out ) ) == 0 ); |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 187 | TEST_ASSERT( last_idx < test_offset_idx ); |
| 188 | |
| 189 | /* Finally, check setting entropy_len */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 190 | mbedtls_ctr_drbg_set_entropy_len( &ctx, 42 ); |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 191 | last_idx = test_offset_idx; |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 192 | TEST_ASSERT( mbedtls_ctr_drbg_random( &ctx, out, sizeof( out ) ) == 0 ); |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 193 | TEST_ASSERT( test_offset_idx - last_idx == 42 ); |
| 194 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 195 | mbedtls_ctr_drbg_set_entropy_len( &ctx, 13 ); |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 196 | last_idx = test_offset_idx; |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 197 | TEST_ASSERT( mbedtls_ctr_drbg_random( &ctx, out, sizeof( out ) ) == 0 ); |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 198 | TEST_ASSERT( test_offset_idx - last_idx == 13 ); |
Paul Bakker | a317a98 | 2014-06-18 16:44:11 +0200 | [diff] [blame] | 199 | |
Paul Bakker | bd51b26 | 2014-07-10 15:26:12 +0200 | [diff] [blame] | 200 | exit: |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 201 | mbedtls_ctr_drbg_free( &ctx ); |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 202 | } |
| 203 | /* END_CASE */ |
| 204 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 205 | /* BEGIN_CASE depends_on:MBEDTLS_FS_IO */ |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 206 | void ctr_drbg_seed_file( char *path, int ret ) |
| 207 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 208 | mbedtls_ctr_drbg_context ctx; |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 209 | |
Manuel Pégourié-Gonnard | 8d128ef | 2015-04-28 22:38:08 +0200 | [diff] [blame] | 210 | mbedtls_ctr_drbg_init( &ctx ); |
| 211 | |
| 212 | TEST_ASSERT( mbedtls_ctr_drbg_seed( &ctx, rnd_std_rand, NULL, NULL, 0 ) == 0 ); |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 213 | TEST_ASSERT( mbedtls_ctr_drbg_write_seed_file( &ctx, path ) == ret ); |
| 214 | TEST_ASSERT( mbedtls_ctr_drbg_update_seed_file( &ctx, path ) == ret ); |
Paul Bakker | a317a98 | 2014-06-18 16:44:11 +0200 | [diff] [blame] | 215 | |
Paul Bakker | bd51b26 | 2014-07-10 15:26:12 +0200 | [diff] [blame] | 216 | exit: |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 217 | mbedtls_ctr_drbg_free( &ctx ); |
Manuel Pégourié-Gonnard | 7575daa | 2014-01-31 12:16:54 +0100 | [diff] [blame] | 218 | } |
| 219 | /* END_CASE */ |
| 220 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 221 | /* BEGIN_CASE depends_on:MBEDTLS_SELF_TEST */ |
Manuel Pégourié-Gonnard | b3b205e | 2014-01-31 12:04:06 +0100 | [diff] [blame] | 222 | void ctr_drbg_selftest( ) |
| 223 | { |
Andres AG | 93012e8 | 2016-09-09 09:10:28 +0100 | [diff] [blame] | 224 | TEST_ASSERT( mbedtls_ctr_drbg_self_test( 1 ) == 0 ); |
Manuel Pégourié-Gonnard | b3b205e | 2014-01-31 12:04:06 +0100 | [diff] [blame] | 225 | } |
| 226 | /* END_CASE */ |