Lines Matching refs:TEST_ASSERT

31         TEST_ASSERT( info != NULL );
32 TEST_ASSERT( mbedtls_md_setup( &ctx, info, 0 ) == 0 );
33 TEST_ASSERT( mbedtls_md_process( &ctx, buf ) == 0 );
51 TEST_ASSERT( mbedtls_md_get_size( NULL ) == 0 );
52 TEST_ASSERT( mbedtls_md_get_type( NULL ) == MBEDTLS_MD_NONE );
53 TEST_ASSERT( mbedtls_md_get_name( NULL ) == NULL );
55 TEST_ASSERT( mbedtls_md_info_from_string( NULL ) == NULL );
57 TEST_ASSERT( mbedtls_md_setup( &ctx, NULL, 0 ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
58 TEST_ASSERT( mbedtls_md_setup( NULL, info, 0 ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
60 TEST_ASSERT( mbedtls_md_starts( NULL ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
61 TEST_ASSERT( mbedtls_md_starts( &ctx ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
63 TEST_ASSERT( mbedtls_md_update( NULL, buf, 1 ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
64 TEST_ASSERT( mbedtls_md_update( &ctx, buf, 1 ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
66 TEST_ASSERT( mbedtls_md_finish( NULL, buf ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
67 TEST_ASSERT( mbedtls_md_finish( &ctx, buf ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
69 TEST_ASSERT( mbedtls_md( NULL, buf, 1, buf ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
72 TEST_ASSERT( mbedtls_md_file( NULL, "", buf ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
75 TEST_ASSERT( mbedtls_md_hmac_starts( NULL, buf, 1 )
77 TEST_ASSERT( mbedtls_md_hmac_starts( &ctx, buf, 1 )
80 TEST_ASSERT( mbedtls_md_hmac_update( NULL, buf, 1 )
82 TEST_ASSERT( mbedtls_md_hmac_update( &ctx, buf, 1 )
85 TEST_ASSERT( mbedtls_md_hmac_finish( NULL, buf )
87 TEST_ASSERT( mbedtls_md_hmac_finish( &ctx, buf )
90 TEST_ASSERT( mbedtls_md_hmac_reset( NULL ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
91 TEST_ASSERT( mbedtls_md_hmac_reset( &ctx ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
93 TEST_ASSERT( mbedtls_md_hmac( NULL, buf, 1, buf, 1, buf )
96 TEST_ASSERT( mbedtls_md_process( NULL, buf ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
97 TEST_ASSERT( mbedtls_md_process( &ctx, buf ) == MBEDTLS_ERR_MD_BAD_INPUT_DATA );
100 TEST_ASSERT( mbedtls_md_info_from_type( MBEDTLS_MD_NONE ) == NULL );
101 TEST_ASSERT( mbedtls_md_info_from_string( "no such md" ) == NULL );
113 TEST_ASSERT( md_info != NULL );
114 TEST_ASSERT( md_info == mbedtls_md_info_from_string( md_name ) );
116 TEST_ASSERT( mbedtls_md_get_type( md_info ) == (mbedtls_md_type_t) md_type );
117 TEST_ASSERT( mbedtls_md_get_size( md_info ) == (unsigned char) md_size );
118 TEST_ASSERT( strcmp( mbedtls_md_get_name( md_info ), md_name ) == 0 );
124 TEST_ASSERT( found == 1 );
145 TEST_ASSERT( md_info != NULL );
147 TEST_ASSERT ( 0 == mbedtls_md( md_info, src_str, strlen( (char *) src_str ), output ) );
150 TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
171 TEST_ASSERT( md_info != NULL );
174 TEST_ASSERT ( 0 == mbedtls_md( md_info, src_str, src_len, output ) );
178 TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
209 TEST_ASSERT( md_info != NULL );
210 TEST_ASSERT ( 0 == mbedtls_md_setup( &ctx, md_info, 0 ) );
211 TEST_ASSERT ( 0 == mbedtls_md_setup( &ctx_copy, md_info, 0 ) );
213 TEST_ASSERT ( 0 == mbedtls_md_starts( &ctx ) );
214 TEST_ASSERT ( ctx.md_ctx != NULL );
215 TEST_ASSERT ( 0 == mbedtls_md_update( &ctx, src_str, halfway ) );
216 TEST_ASSERT ( 0 == mbedtls_md_clone( &ctx_copy, &ctx ) );
218 TEST_ASSERT ( 0 == mbedtls_md_update( &ctx, src_str + halfway, len - halfway ) );
219 TEST_ASSERT ( 0 == mbedtls_md_finish( &ctx, output ) );
221 TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
227 TEST_ASSERT ( 0 == mbedtls_md_update( &ctx_copy, src_str + halfway, len - halfway ) );
228 TEST_ASSERT ( 0 == mbedtls_md_finish( &ctx_copy, output ) );
230 TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
260 TEST_ASSERT( md_info != NULL );
261 TEST_ASSERT ( 0 == mbedtls_md_setup( &ctx, md_info, 0 ) );
262 TEST_ASSERT ( 0 == mbedtls_md_setup( &ctx_copy, md_info, 0 ) );
267 TEST_ASSERT ( 0 == mbedtls_md_starts( &ctx ) );
268 TEST_ASSERT ( ctx.md_ctx != NULL );
269 TEST_ASSERT ( 0 == mbedtls_md_update( &ctx, src_str, halfway ) );
270 TEST_ASSERT ( 0 == mbedtls_md_clone( &ctx_copy, &ctx ) );
272 TEST_ASSERT ( 0 == mbedtls_md_update( &ctx, src_str + halfway, src_len - halfway) );
273 TEST_ASSERT ( 0 == mbedtls_md_finish( &ctx, output ) );
275 TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
281 TEST_ASSERT ( 0 == mbedtls_md_update( &ctx_copy, src_str + halfway, src_len - halfway ) );
282 TEST_ASSERT ( 0 == mbedtls_md_finish( &ctx_copy, output ) );
284 TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
312 TEST_ASSERT( md_info != NULL );
317 TEST_ASSERT ( mbedtls_md_hmac( md_info, key_str, key_len, src_str, src_len, output ) == 0 );
320 TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
347 TEST_ASSERT( md_info != NULL );
348 TEST_ASSERT ( 0 == mbedtls_md_setup( &ctx, md_info, 1 ) );
354 TEST_ASSERT ( 0 == mbedtls_md_hmac_starts( &ctx, key_str, key_len ) );
355 TEST_ASSERT ( ctx.md_ctx != NULL );
356 TEST_ASSERT ( 0 == mbedtls_md_hmac_update( &ctx, src_str, halfway ) );
357 TEST_ASSERT ( 0 == mbedtls_md_hmac_update( &ctx, src_str + halfway, src_len - halfway ) );
358 TEST_ASSERT ( 0 == mbedtls_md_hmac_finish( &ctx, output ) );
361 TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
367 TEST_ASSERT ( 0 == mbedtls_md_hmac_reset( &ctx ) );
368 TEST_ASSERT ( 0 == mbedtls_md_hmac_update( &ctx, src_str, halfway ) );
369 TEST_ASSERT ( 0 == mbedtls_md_hmac_update( &ctx, src_str + halfway, src_len - halfway ) );
370 TEST_ASSERT ( 0 == mbedtls_md_hmac_finish( &ctx, output ) );
373 TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
394 TEST_ASSERT( md_info != NULL );
396 TEST_ASSERT( mbedtls_md_file( md_info, filename, output ) == 0 );
399 TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );