Lines Matching refs:TEST_ASSERT

73     TEST_ASSERT( mbedtls_pk_setup( &pk, mbedtls_pk_info_from_type( type ) ) == 0 );
74 TEST_ASSERT( pk_genkey( &pk ) == 0 );
76 TEST_ASSERT( (int) mbedtls_pk_get_type( &pk ) == type );
77 TEST_ASSERT( mbedtls_pk_can_do( &pk, type ) );
78 TEST_ASSERT( mbedtls_pk_get_bitlen( &pk ) == (unsigned) size );
79 TEST_ASSERT( mbedtls_pk_get_len( &pk ) == (unsigned) len );
80 TEST_ASSERT( strcmp( mbedtls_pk_get_name( &pk), name ) == 0 );
96 TEST_ASSERT( mbedtls_pk_parse_public_keyfile( &pub, pub_file ) == 0 );
97 TEST_ASSERT( mbedtls_pk_parse_keyfile( &prv, prv_file, NULL ) == 0 );
99 TEST_ASSERT( mbedtls_pk_check_pair( &pub, &prv ) == ret );
104 TEST_ASSERT( mbedtls_pk_setup_rsa_alt( &alt, mbedtls_pk_rsa( prv ),
106 TEST_ASSERT( mbedtls_pk_check_pair( &pub, &alt ) == ret );
134 TEST_ASSERT( mbedtls_pk_setup( &pk, mbedtls_pk_info_from_type( MBEDTLS_PK_RSA ) ) == 0 );
138 TEST_ASSERT( mbedtls_mpi_read_string( &rsa->N, radix_N, input_N ) == 0 );
139 TEST_ASSERT( mbedtls_mpi_read_string( &rsa->E, radix_E, input_E ) == 0 );
145TEST_ASSERT( mbedtls_md( mbedtls_md_info_from_type( digest ), message_str, msg_len, hash_result ) …
147 TEST_ASSERT( mbedtls_pk_verify( &pk, digest, hash_result, 0,
178 TEST_ASSERT( mbedtls_pk_setup( &pk, mbedtls_pk_info_from_type( MBEDTLS_PK_RSA ) ) == 0 );
182 TEST_ASSERT( mbedtls_mpi_read_string( &rsa->N, radix_N, input_N ) == 0 );
183 TEST_ASSERT( mbedtls_mpi_read_string( &rsa->E, radix_E, input_E ) == 0 );
190 TEST_ASSERT( mbedtls_md( mbedtls_md_info_from_type( digest ),
212 TEST_ASSERT( mbedtls_pk_verify_ext( pk_type, options, &pk,
236 TEST_ASSERT( mbedtls_pk_setup( &pk, mbedtls_pk_info_from_type( type ) ) == 0 );
238 TEST_ASSERT( mbedtls_pk_can_do( &pk, MBEDTLS_PK_ECDSA ) );
241 TEST_ASSERT( mbedtls_ecp_group_load( &eckey->grp, id ) == 0 );
242 TEST_ASSERT( mbedtls_ecp_point_read_binary( &eckey->grp, &eckey->Q,
245 TEST_ASSERT( mbedtls_pk_verify( &pk, MBEDTLS_MD_NONE,
265 TEST_ASSERT( mbedtls_pk_setup( &pk, mbedtls_pk_info_from_type( type ) ) == 0 );
266 TEST_ASSERT( pk_genkey( &pk ) == 0 );
268 TEST_ASSERT( mbedtls_pk_sign( &pk, MBEDTLS_MD_SHA256, hash, sizeof hash,
271 TEST_ASSERT( mbedtls_pk_verify( &pk, MBEDTLS_MD_SHA256,
302 TEST_ASSERT( mbedtls_pk_setup( &pk, mbedtls_pk_info_from_type( MBEDTLS_PK_RSA ) ) == 0 );
306 TEST_ASSERT( mbedtls_mpi_read_string( &rsa->N, radix_N, input_N ) == 0 );
307 TEST_ASSERT( mbedtls_mpi_read_string( &rsa->E, radix_E, input_E ) == 0 );
309 TEST_ASSERT( mbedtls_pk_encrypt( &pk, message, msg_len,
312 TEST_ASSERT( olen == res_len );
313 TEST_ASSERT( memcmp( output, result, olen ) == 0 );
348 TEST_ASSERT( mbedtls_pk_setup( &pk, mbedtls_pk_info_from_type( MBEDTLS_PK_RSA ) ) == 0 );
353 TEST_ASSERT( mbedtls_mpi_read_string( &rsa->N, radix_N, input_N ) == 0 );
354 TEST_ASSERT( mbedtls_mpi_read_string( &rsa->E, radix_E, input_E ) == 0 );
357 TEST_ASSERT( mbedtls_mpi_read_string( &rsa->P, radix_P, input_P ) == 0 );
358 TEST_ASSERT( mbedtls_mpi_read_string( &rsa->Q, radix_Q, input_Q ) == 0 );
359 TEST_ASSERT( mbedtls_mpi_sub_int( &P1, &rsa->P, 1 ) == 0 );
360 TEST_ASSERT( mbedtls_mpi_sub_int( &Q1, &rsa->Q, 1 ) == 0 );
361 TEST_ASSERT( mbedtls_mpi_mul_mpi( &H, &P1, &Q1 ) == 0 );
362 TEST_ASSERT( mbedtls_mpi_gcd( &G, &rsa->E, &H ) == 0 );
363 TEST_ASSERT( mbedtls_mpi_inv_mod( &rsa->D , &rsa->E, &H ) == 0 );
364 TEST_ASSERT( mbedtls_mpi_mod_mpi( &rsa->DP, &rsa->D, &P1 ) == 0 );
365 TEST_ASSERT( mbedtls_mpi_mod_mpi( &rsa->DQ, &rsa->D, &Q1 ) == 0 );
366 TEST_ASSERT( mbedtls_mpi_inv_mod( &rsa->QP, &rsa->Q, &rsa->P ) == 0 );
371 TEST_ASSERT( mbedtls_pk_decrypt( &pk, cipher, cipher_len,
376 TEST_ASSERT( olen == clear_len );
377 TEST_ASSERT( memcmp( output, clear, olen ) == 0 );
402 TEST_ASSERT( mbedtls_pk_setup( &pk, mbedtls_pk_info_from_type( type ) ) == 0 );
404 TEST_ASSERT( mbedtls_pk_encrypt( &pk, input, sizeof( input ),
408 TEST_ASSERT( mbedtls_pk_decrypt( &pk, input, sizeof( input ),
443 TEST_ASSERT( mbedtls_pk_setup( &rsa,
445 TEST_ASSERT( pk_genkey( &rsa ) == 0 );
448 TEST_ASSERT( mbedtls_rsa_copy( &raw, mbedtls_pk_rsa( rsa ) ) == 0 );
451 TEST_ASSERT( mbedtls_pk_setup_rsa_alt( &alt, (void *) &raw,
455 TEST_ASSERT( mbedtls_pk_can_do( &alt, MBEDTLS_PK_RSA ) );
456 TEST_ASSERT( mbedtls_pk_get_bitlen( &alt ) == RSA_KEY_SIZE );
457 TEST_ASSERT( mbedtls_pk_get_len( &alt ) == RSA_KEY_LEN );
458 TEST_ASSERT( mbedtls_pk_get_type( &alt ) == MBEDTLS_PK_RSA_ALT );
459 TEST_ASSERT( strcmp( mbedtls_pk_get_name( &alt ), "RSA-alt" ) == 0 );
462 TEST_ASSERT( mbedtls_pk_sign( &alt, MBEDTLS_MD_NONE, hash, sizeof hash,
464 TEST_ASSERT( sig_len == RSA_KEY_LEN );
465 TEST_ASSERT( mbedtls_pk_verify( &rsa, MBEDTLS_MD_NONE,
469 TEST_ASSERT( mbedtls_pk_encrypt( &rsa, msg, sizeof msg,
472 TEST_ASSERT( mbedtls_pk_decrypt( &alt, ciph, ciph_len,
475 TEST_ASSERT( test_len == sizeof msg );
476 TEST_ASSERT( memcmp( test, msg, test_len ) == 0 );
479 TEST_ASSERT( mbedtls_pk_encrypt( &alt, msg, sizeof msg,
482 TEST_ASSERT( mbedtls_pk_verify( &alt, MBEDTLS_MD_NONE,
484 TEST_ASSERT( mbedtls_pk_debug( &alt, dbg_items ) == ret );