• Home
  • Raw
  • Download

Lines Matching refs:alg

145                         psa_algorithm_t alg,
153 psa_set_key_algorithm( &attributes, alg );
157 *status = psa_mac_sign_setup( operation, key, alg );
164 TEST_EQUAL( psa_mac_sign_setup( operation, key, alg ), *status );
178 psa_algorithm_t alg,
186 psa_set_key_algorithm( &attributes, alg );
190 *status = psa_cipher_encrypt_setup( operation, key, alg );
197 TEST_EQUAL( psa_cipher_encrypt_setup( operation, key, alg ),
332 psa_algorithm_t alg = alg_arg;
364 psa_set_key_algorithm( &attributes, alg );
373 tag_length = PSA_AEAD_TAG_LENGTH( key_type, key_bits, alg );
378 output_size = PSA_AEAD_UPDATE_OUTPUT_SIZE( key_type, alg,
385 output_size = PSA_AEAD_UPDATE_OUTPUT_SIZE( key_type, alg,
397 final_output_size = PSA_AEAD_FINISH_OUTPUT_SIZE( key_type, alg );
402 final_output_size = PSA_AEAD_VERIFY_OUTPUT_SIZE( key_type, alg );
409 status = psa_aead_encrypt_setup( &operation, key, alg );
411 status = psa_aead_decrypt_setup( &operation, key, alg );
419 MBEDTLS_TEST_PSA_SKIP_IF_ALT_GCM_NOT_12BYTES_NONCE( alg, nonce->len );
479 part_data_size = PSA_AEAD_UPDATE_OUTPUT_SIZE( key_type, alg,
559 PSA_AEAD_ENCRYPT_OUTPUT_SIZE( key_type, alg,
567 PSA_AEAD_DECRYPT_OUTPUT_SIZE( key_type, alg,
621 psa_algorithm_t alg = alg_arg;
630 psa_set_key_algorithm( &attributes, alg );
643 TEST_EQUAL( psa_get_key_algorithm( &got_attributes ), alg );
811 psa_algorithm_t alg = alg_arg;
831 psa_set_key_algorithm( &attributes, alg );
920 psa_algorithm_t alg = alg_arg;
933 psa_set_key_algorithm( &attributes, alg );
982 psa_algorithm_t alg = alg_arg;
983 psa_key_usage_t usage = mbedtls_test_psa_usage_to_exercise( type, alg );
990 psa_set_key_algorithm( &attributes, alg );
1002 if( ! mbedtls_test_psa_exercise_key( key, usage, alg ) )
1032 psa_algorithm_t alg = alg_arg;
1041 psa_set_key_algorithm( &attributes, alg );
1547 psa_algorithm_t alg = alg_arg;
1553 psa_set_key_algorithm( &attributes, alg );
1563 TEST_EQUAL( psa_get_key_algorithm( &got_attributes ), alg );
1566 if( ! mbedtls_test_psa_exercise_key( key, usage, alg ) )
1804 psa_algorithm_t alg = alg_arg;
1811 status = psa_hash_setup( &operation, alg );
1820 TEST_EQUAL( psa_hash_setup( &operation, alg ), status );
1837 psa_algorithm_t alg = alg_arg;
1848 status = psa_hash_compute( alg, input->x, input->len,
1864 psa_algorithm_t alg = alg_arg;
1870 status = psa_hash_compare( alg, input->x, input->len,
1883 psa_algorithm_t alg = alg_arg;
1891 PSA_ASSERT( psa_hash_compute( alg, input->x, input->len,
1892 output, PSA_HASH_LENGTH( alg ),
1894 TEST_EQUAL( output_length, PSA_HASH_LENGTH( alg ) );
1899 PSA_ASSERT( psa_hash_compute( alg, input->x, input->len,
1902 TEST_EQUAL( output_length, PSA_HASH_LENGTH( alg ) );
1907 PSA_ASSERT( psa_hash_compare( alg, input->x, input->len,
1911 TEST_EQUAL( psa_hash_compare( alg, input->x, input->len,
1916 TEST_EQUAL( psa_hash_compare( alg, input->x, input->len,
1925 TEST_EQUAL( psa_hash_compare( alg, input->x, input->len,
1939 psa_algorithm_t alg = PSA_ALG_SHA_256;
1953 PSA_ASSERT( psa_hash_setup( &operation, alg ) );
1955 TEST_EQUAL( psa_hash_setup( &operation, alg ),
1967 PSA_ASSERT( psa_hash_setup( &operation, alg ) );
1977 PSA_ASSERT( psa_hash_setup( &operation, alg ) );
1991 PSA_ASSERT( psa_hash_setup( &operation, alg ) );
2000 PSA_ASSERT( psa_hash_setup( &operation, alg ) );
2018 PSA_ASSERT( psa_hash_setup( &operation, alg ) );
2027 PSA_ASSERT( psa_hash_setup( &operation, alg ) );
2043 psa_algorithm_t alg = PSA_ALG_SHA_256;
2050 size_t expected_size = PSA_HASH_LENGTH( alg );
2056 PSA_ASSERT( psa_hash_setup( &operation, alg ) );
2065 PSA_ASSERT( psa_hash_setup( &operation, alg ) );
2070 PSA_ASSERT( psa_hash_setup( &operation, alg ) );
2082 psa_algorithm_t alg = PSA_ALG_SHA_256;
2084 size_t expected_size = PSA_HASH_LENGTH( alg );
2091 PSA_ASSERT( psa_hash_setup( &operation, alg ) );
2104 psa_algorithm_t alg = PSA_ALG_SHA_256;
2114 PSA_ASSERT( psa_hash_setup( &op_source, alg ) );
2116 PSA_ASSERT( psa_hash_setup( &op_setup, alg ) );
2117 PSA_ASSERT( psa_hash_setup( &op_finished, alg ) );
2120 PSA_ASSERT( psa_hash_setup( &op_aborted, alg ) );
2149 psa_algorithm_t alg = PSA_ALG_SHA_256;
2160 PSA_ASSERT( psa_hash_setup( &op_setup, alg ) );
2161 PSA_ASSERT( psa_hash_setup( &op_finished, alg ) );
2164 PSA_ASSERT( psa_hash_setup( &op_aborted, alg ) );
2227 psa_algorithm_t alg = alg_arg;
2237 if( ! exercise_mac_setup( key_type, key->x, key->len, alg,
2263 psa_algorithm_t alg = PSA_ALG_HMAC(PSA_ALG_SHA_256);
2280 psa_set_key_algorithm( &attributes, alg );
2304 PSA_ASSERT( psa_mac_sign_setup( &operation, key, alg ) );
2306 TEST_EQUAL( psa_mac_sign_setup( &operation, key, alg ),
2313 PSA_ASSERT( psa_mac_sign_setup( &operation, key, alg ) );
2323 PSA_ASSERT( psa_mac_verify_setup( &operation, key, alg ) );
2332 PSA_ASSERT( psa_mac_sign_setup( &operation, key, alg ) );
2344 PSA_ASSERT( psa_mac_verify_setup( &operation, key, alg ) );
2354 PSA_ASSERT( psa_mac_sign_setup( &operation, key, alg ) );
2365 PSA_ASSERT( psa_mac_verify_setup( &operation, key, alg ) );
2392 psa_algorithm_t alg = alg_arg;
2397 PSA_MAC_LENGTH( key_type, PSA_BYTES_TO_BITS( key_data->len ), alg );
2414 psa_set_key_algorithm( &attributes, alg );
2431 TEST_EQUAL( psa_mac_compute( key, alg,
2445 PSA_ASSERT( psa_mac_sign_setup( &operation, key, alg ) );
2480 psa_algorithm_t alg = alg_arg;
2490 psa_set_key_algorithm( &attributes, alg );
2497 PSA_ASSERT( psa_mac_verify( key, alg, input->x, input->len,
2501 PSA_ASSERT( psa_mac_verify_setup( &operation, key, alg ) );
2509 TEST_EQUAL( psa_mac_verify( key, alg,
2516 PSA_ASSERT( psa_mac_verify_setup( &operation, key, alg ) );
2527 TEST_EQUAL( psa_mac_verify( key, alg,
2533 PSA_ASSERT( psa_mac_verify_setup( &operation, key, alg ) );
2547 TEST_EQUAL( psa_mac_verify( key, alg,
2552 PSA_ASSERT( psa_mac_verify_setup( &operation, key, alg ) );
2617 psa_algorithm_t alg = alg_arg;
2627 if( ! exercise_cipher_setup( key_type, key->x, key->len, alg,
2654 psa_algorithm_t alg = PSA_ALG_CBC_PKCS7;
2669 psa_set_key_algorithm( &attributes, alg );
2675 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
2677 TEST_EQUAL( psa_cipher_encrypt_setup( &operation, key, alg ),
2684 PSA_ASSERT( psa_cipher_decrypt_setup( &operation, key, alg ) );
2686 TEST_EQUAL( psa_cipher_decrypt_setup( &operation, key, alg ),
2700 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
2714 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
2730 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
2742 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
2760 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
2772 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
2791 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
2803 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
2831 psa_algorithm_t alg = alg_arg;
2843 psa_set_key_algorithm( &attributes, alg );
2846 output_buffer_size = PSA_CIPHER_ENCRYPT_OUTPUT_SIZE( key_type, alg,
2854 status = psa_cipher_encrypt( key, alg, input->x, input->len, output,
2867 void cipher_encrypt_validate_iv_length( int alg, int key_type, data_t* key_data,
2877 output_buffer_size = PSA_CIPHER_ENCRYPT_OUTPUT_SIZE( key_type, alg, input->len );
2883 psa_set_key_algorithm( &attributes, alg );
2888 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
2909 psa_algorithm_t alg = alg_arg;
2921 psa_set_key_algorithm( &attributes, alg );
2924 output_buffer_size = PSA_CIPHER_ENCRYPT_OUTPUT_SIZE( key_type, alg, input->len );
2930 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
2933 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
2938 PSA_ASSERT( psa_cipher_encrypt( key, alg, input->x, input->len, output,
2941 PSA_CIPHER_ENCRYPT_OUTPUT_SIZE( key_type, alg, input->len ) );
2958 psa_algorithm_t alg = alg_arg;
2967 psa_set_key_algorithm( &attributes, alg );
2973 TEST_EQUAL( PSA_CIPHER_ENCRYPT_OUTPUT_SIZE( key_type, alg, 16 ),
2975 TEST_EQUAL( PSA_CIPHER_UPDATE_OUTPUT_SIZE( key_type, alg, 16 ), 0 );
2981 /* Should fail due to invalid alg type (to support invalid key type).
2983 status = psa_cipher_encrypt_setup( &operation, key, alg );
3002 psa_algorithm_t alg = alg_arg;
3003 size_t iv_size = PSA_CIPHER_IV_LENGTH ( key_type, alg );
3017 psa_set_key_algorithm( &attributes, alg );
3020 output1_buffer_size = PSA_CIPHER_ENCRYPT_OUTPUT_SIZE( key_type, alg, input->len );
3021 output2_buffer_size = PSA_CIPHER_UPDATE_OUTPUT_SIZE( key_type, alg, input->len ) +
3022 PSA_CIPHER_FINISH_OUTPUT_SIZE( key_type, alg );
3031 PSA_ASSERT( psa_cipher_encrypt( key, alg, input->x, input->len, output1,
3034 PSA_CIPHER_ENCRYPT_OUTPUT_SIZE( key_type, alg, input->len ) );
3038 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
3046 PSA_CIPHER_UPDATE_OUTPUT_SIZE( key_type, alg, input->len ) );
3056 PSA_CIPHER_FINISH_OUTPUT_SIZE( key_type, alg ) );
3085 psa_algorithm_t alg = alg_arg;
3101 psa_set_key_algorithm( &attributes, alg );
3107 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
3114 output_buffer_size = PSA_CIPHER_UPDATE_OUTPUT_SIZE( key_type, alg, input->len ) +
3115 PSA_CIPHER_FINISH_OUTPUT_SIZE( key_type, alg );
3124 PSA_CIPHER_UPDATE_OUTPUT_SIZE( key_type, alg, first_part_size ) );
3141 alg,
3154 PSA_CIPHER_FINISH_OUTPUT_SIZE( key_type, alg ) );
3187 psa_algorithm_t alg = alg_arg;
3203 psa_set_key_algorithm( &attributes, alg );
3209 PSA_ASSERT( psa_cipher_decrypt_setup( &operation, key, alg ) );
3216 output_buffer_size = PSA_CIPHER_UPDATE_OUTPUT_SIZE( key_type, alg, input->len ) +
3217 PSA_CIPHER_FINISH_OUTPUT_SIZE( key_type, alg );
3227 PSA_CIPHER_UPDATE_OUTPUT_SIZE( key_type, alg, first_part_size ) );
3244 alg,
3257 PSA_CIPHER_FINISH_OUTPUT_SIZE( key_type, alg ) );
3290 psa_algorithm_t alg = alg_arg;
3304 psa_set_key_algorithm( &attributes, alg );
3320 output_buffer_size = PSA_CIPHER_DECRYPT_OUTPUT_SIZE( key_type, alg, input_buffer_size );
3323 status = psa_cipher_decrypt( key, alg, input, input_buffer_size, output,
3345 psa_algorithm_t alg = alg_arg;
3356 psa_set_key_algorithm( &attributes, alg );
3368 output_buffer_size = PSA_CIPHER_DECRYPT_OUTPUT_SIZE( key_type, alg, input_buffer_size );
3374 PSA_ASSERT( psa_cipher_decrypt( key, alg, input, input_buffer_size, output,
3377 PSA_CIPHER_DECRYPT_OUTPUT_SIZE( key_type, alg, input_buffer_size ) );
3399 psa_algorithm_t alg = alg_arg;
3411 psa_set_key_algorithm( &attributes, alg );
3416 output1_size = PSA_CIPHER_ENCRYPT_OUTPUT_SIZE( key_type, alg, input->len );
3419 PSA_ASSERT( psa_cipher_encrypt( key, alg, input->x, input->len,
3423 PSA_CIPHER_ENCRYPT_OUTPUT_SIZE( key_type, alg, input->len ) );
3430 PSA_ASSERT( psa_cipher_decrypt( key, alg, output1, output1_length,
3434 PSA_CIPHER_DECRYPT_OUTPUT_SIZE( key_type, alg, output1_length ) );
3457 psa_algorithm_t alg = alg_arg;
3476 psa_set_key_algorithm( &attributes, alg );
3482 PSA_ASSERT( psa_cipher_encrypt_setup( &operation1, key, alg ) );
3483 PSA_ASSERT( psa_cipher_decrypt_setup( &operation2, key, alg ) );
3485 if( alg != PSA_ALG_ECB_NO_PADDING )
3492 output1_buffer_size = PSA_CIPHER_ENCRYPT_OUTPUT_SIZE( key_type, alg, input->len );
3503 PSA_CIPHER_UPDATE_OUTPUT_SIZE( key_type, alg, first_part_size ) );
3515 alg,
3526 PSA_CIPHER_FINISH_OUTPUT_SIZE( key_type, alg ) );
3535 PSA_CIPHER_DECRYPT_OUTPUT_SIZE( key_type, alg, output1_length ) );
3550 PSA_CIPHER_UPDATE_OUTPUT_SIZE( key_type, alg, first_part_size ) );
3562 alg,
3573 PSA_CIPHER_FINISH_OUTPUT_SIZE( key_type, alg ) );
3602 psa_algorithm_t alg = alg_arg;
3616 psa_set_key_algorithm( &attributes, alg );
3625 alg );
3632 PSA_AEAD_ENCRYPT_OUTPUT_SIZE( key_type, alg, input_data->len ) );
3638 status = psa_aead_encrypt( key, alg,
3652 MBEDTLS_TEST_PSA_SKIP_IF_ALT_GCM_NOT_12BYTES_NONCE( alg, nonce->len );
3664 PSA_AEAD_DECRYPT_OUTPUT_SIZE( key_type, alg, output_length ) );
3669 TEST_EQUAL( psa_aead_decrypt( key, alg,
3700 psa_algorithm_t alg = alg_arg;
3711 psa_set_key_algorithm( &attributes, alg );
3720 alg );
3724 PSA_AEAD_ENCRYPT_OUTPUT_SIZE( key_type, alg, input_data->len ) );
3729 status = psa_aead_encrypt( key, alg,
3742 MBEDTLS_TEST_PSA_SKIP_IF_ALT_GCM_NOT_12BYTES_NONCE( alg, nonce->len );
3767 psa_algorithm_t alg = alg_arg;
3779 psa_set_key_algorithm( &attributes, alg );
3788 alg );
3795 PSA_AEAD_DECRYPT_OUTPUT_SIZE( key_type, alg, input_data->len ) );
3801 status = psa_aead_decrypt( key, alg,
3815 MBEDTLS_TEST_PSA_SKIP_IF_ALT_GCM_NOT_12BYTES_NONCE( alg, nonce->len );
4025 psa_algorithm_t alg = alg_arg;
4044 psa_set_key_algorithm( & attributes, alg );
4052 output_size = PSA_AEAD_UPDATE_OUTPUT_SIZE( key_type, alg, input_data->len );
4056 ciphertext_size = PSA_AEAD_FINISH_OUTPUT_SIZE( key_type, alg );
4062 status = psa_aead_encrypt_setup( &operation, key, alg );
4070 MBEDTLS_TEST_PSA_SKIP_IF_ALT_GCM_NOT_12BYTES_NONCE( alg, nonce_length );
4085 alg ) );
4127 psa_algorithm_t alg = alg_arg;
4146 psa_set_key_algorithm( &attributes, alg );
4154 output_size = PSA_AEAD_UPDATE_OUTPUT_SIZE( key_type, alg, input_data->len );
4158 ciphertext_size = PSA_AEAD_FINISH_OUTPUT_SIZE( key_type, alg );
4164 status = psa_aead_encrypt_setup( &operation, key, alg );
4172 MBEDTLS_TEST_PSA_SKIP_IF_ALT_GCM_NOT_12BYTES_NONCE( alg, nonce_length_arg );
4243 psa_algorithm_t alg = alg_arg;
4259 psa_set_key_algorithm( &attributes, alg );
4269 ciphertext_size = PSA_AEAD_FINISH_OUTPUT_SIZE( key_type, alg );
4273 status = psa_aead_encrypt_setup( &operation, key, alg );
4281 MBEDTLS_TEST_PSA_SKIP_IF_ALT_GCM_NOT_12BYTES_NONCE( alg, nonce->len );
4329 psa_algorithm_t alg = alg_arg;
4346 psa_set_key_algorithm( &attributes, alg );
4354 ciphertext_size = PSA_AEAD_UPDATE_OUTPUT_SIZE( key_type, alg, input_data->len );
4362 status = psa_aead_encrypt_setup( &operation, key, alg );
4370 MBEDTLS_TEST_PSA_SKIP_IF_ALT_GCM_NOT_12BYTES_NONCE( alg, nonce->len );
4416 psa_algorithm_t alg = alg_arg;
4433 psa_set_key_algorithm( &attributes, alg );
4441 plaintext_size = PSA_AEAD_UPDATE_OUTPUT_SIZE( key_type, alg,
4446 verify_plaintext_size = PSA_AEAD_VERIFY_OUTPUT_SIZE( key_type, alg );
4450 status = psa_aead_decrypt_setup( &operation, key, alg );
4458 MBEDTLS_TEST_PSA_SKIP_IF_ALT_GCM_NOT_12BYTES_NONCE( alg, nonce->len );
4515 psa_algorithm_t alg = alg_arg;
4525 psa_set_key_algorithm( &attributes, alg );
4531 status = psa_aead_encrypt_setup( &operation, key, alg );
4537 status = psa_aead_decrypt_setup( &operation, key, alg );
4557 psa_algorithm_t alg = alg_arg;
4577 psa_set_key_algorithm( & attributes, alg );
4586 tag_length = PSA_AEAD_TAG_LENGTH( key_type, key_bits, alg );
4590 output_size = PSA_AEAD_UPDATE_OUTPUT_SIZE( key_type, alg, input_data->len );
4594 finish_output_size = PSA_AEAD_FINISH_OUTPUT_SIZE( key_type, alg );
4663 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4665 TEST_EQUAL( psa_aead_encrypt_setup( &operation, key, alg ),
4672 PSA_ASSERT( psa_aead_decrypt_setup( &operation, key, alg ) );
4674 TEST_EQUAL( psa_aead_decrypt_setup( &operation, key, alg ),
4681 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4683 TEST_EQUAL( psa_aead_decrypt_setup( &operation, key, alg ),
4690 PSA_ASSERT( psa_aead_decrypt_setup( &operation, key, alg ) );
4692 TEST_EQUAL( psa_aead_encrypt_setup( &operation, key, alg ),
4699 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4709 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4720 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4733 PSA_ASSERT( psa_aead_decrypt_setup( &operation, key, alg ) );
4746 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4757 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4773 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4786 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4799 PSA_ASSERT( psa_aead_decrypt_setup( &operation, key, alg ) );
4810 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4825 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4840 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4857 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4876 PSA_ASSERT( psa_aead_decrypt_setup( &operation, key, alg ) );
4895 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4911 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4932 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4947 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4965 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
4980 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
5003 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
5019 PSA_ASSERT( psa_aead_decrypt_setup( &operation, key, alg ) );
5034 PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
5064 psa_algorithm_t alg = alg_arg;
5065 size_t actual_size = PSA_SIGN_OUTPUT_SIZE( type, bits, alg );
5081 psa_algorithm_t alg = alg_arg;
5091 psa_set_key_algorithm( &attributes, alg );
5102 key_bits, alg );
5108 PSA_ASSERT( psa_sign_hash( key, alg,
5136 psa_algorithm_t alg = alg_arg;
5149 psa_set_key_algorithm( &attributes, alg );
5155 actual_status = psa_sign_hash( key, alg,
5180 psa_algorithm_t alg = alg_arg;
5190 psa_set_key_algorithm( &attributes, alg );
5201 key_bits, alg );
5207 PSA_ASSERT( psa_sign_hash( key, alg,
5216 PSA_ASSERT( psa_verify_hash( key, alg,
5226 TEST_EQUAL( psa_verify_hash( key, alg,
5252 psa_algorithm_t alg = alg_arg;
5260 psa_set_key_algorithm( &attributes, alg );
5266 PSA_ASSERT( psa_verify_hash( key, alg,
5285 psa_algorithm_t alg = alg_arg;
5293 psa_set_key_algorithm( &attributes, alg );
5299 actual_status = psa_verify_hash( key, alg,
5320 psa_algorithm_t alg = alg_arg;
5330 psa_set_key_algorithm( &attributes, alg );
5338 signature_size = PSA_SIGN_OUTPUT_SIZE( key_type, key_bits, alg );
5343 PSA_ASSERT( psa_sign_message( key, alg,
5371 psa_algorithm_t alg = alg_arg;
5384 psa_set_key_algorithm( &attributes, alg );
5390 actual_status = psa_sign_message( key, alg,
5417 psa_algorithm_t alg = alg_arg;
5428 psa_set_key_algorithm( &attributes, alg );
5436 signature_size = PSA_SIGN_OUTPUT_SIZE( key_type, key_bits, alg );
5441 PSA_ASSERT( psa_sign_message( key, alg,
5448 PSA_ASSERT( psa_verify_message( key, alg,
5458 TEST_EQUAL( psa_verify_message( key, alg,
5482 psa_algorithm_t alg = alg_arg;
5490 psa_set_key_algorithm( &attributes, alg );
5496 PSA_ASSERT( psa_verify_message( key, alg,
5517 psa_algorithm_t alg = alg_arg;
5525 psa_set_key_algorithm( &attributes, alg );
5531 actual_status = psa_verify_message( key, alg,
5555 psa_algorithm_t alg = alg_arg;
5569 psa_set_key_algorithm( &attributes, alg );
5578 output_size = PSA_ASYMMETRIC_ENCRYPT_OUTPUT_SIZE( key_type, key_bits, alg );
5583 actual_status = psa_asymmetric_encrypt( key, alg,
5598 actual_status = psa_asymmetric_encrypt( key, alg,
5629 psa_algorithm_t alg = alg_arg;
5642 psa_set_key_algorithm( &attributes, alg );
5652 output_size = PSA_ASYMMETRIC_ENCRYPT_OUTPUT_SIZE( key_type, key_bits, alg );
5658 PSA_ASYMMETRIC_DECRYPT_OUTPUT_SIZE( key_type, key_bits, alg ) );
5665 PSA_ASSERT( psa_asymmetric_encrypt( key, alg,
5674 PSA_ASSERT( psa_asymmetric_decrypt( key, alg,
5706 psa_algorithm_t alg = alg_arg;
5716 psa_set_key_algorithm( &attributes, alg );
5726 output_size = PSA_ASYMMETRIC_DECRYPT_OUTPUT_SIZE( key_type, key_bits, alg );
5730 PSA_ASSERT( psa_asymmetric_decrypt( key, alg,
5746 PSA_ASSERT( psa_asymmetric_decrypt( key, alg,
5775 psa_algorithm_t alg = alg_arg;
5788 psa_set_key_algorithm( &attributes, alg );
5794 actual_status = psa_asymmetric_decrypt( key, alg,
5809 actual_status = psa_asymmetric_decrypt( key, alg,
5858 psa_algorithm_t alg = alg_arg;
5864 TEST_EQUAL( psa_key_derivation_setup( &operation, alg ),
5877 psa_algorithm_t alg = alg_arg;
5884 PSA_ASSERT( psa_key_derivation_setup( &operation, alg ) );
5905 psa_algorithm_t alg = alg_arg;
5926 psa_set_key_algorithm( &attributes, alg );
5928 PSA_ASSERT( psa_key_derivation_setup( &operation, alg ) );
5998 psa_algorithm_t alg = alg_arg;
6016 psa_set_key_algorithm( &attributes, alg );
6024 if( !mbedtls_test_psa_setup_key_derivation_wrap( &operation, key, alg,
6031 TEST_EQUAL( psa_key_derivation_setup( &operation, alg ),
6084 psa_algorithm_t alg = alg_arg;
6115 psa_set_key_algorithm( &attributes, alg );
6119 PSA_ASSERT( psa_key_derivation_setup( &operation, alg ) );
6133 if ( PSA_ALG_IS_TLS12_PSK_TO_MS( alg ) )
6207 psa_algorithm_t alg = alg_arg;
6218 psa_set_key_algorithm( &attributes, alg );
6224 if( !mbedtls_test_psa_setup_key_derivation_wrap( &operation, key, alg,
6274 psa_algorithm_t alg = alg_arg;
6287 psa_set_key_algorithm( &attributes, alg );
6293 if ( mbedtls_test_psa_setup_key_derivation_wrap( &operation, base_key, alg,
6339 psa_algorithm_t alg = alg_arg;
6355 psa_set_key_algorithm( &base_attributes, alg );
6361 if( !mbedtls_test_psa_setup_key_derivation_wrap( &operation, base_key, alg,
6373 if( !mbedtls_test_psa_setup_key_derivation_wrap( &operation, base_key, alg,
6421 psa_algorithm_t alg = alg_arg;
6432 psa_set_key_algorithm( &base_attributes, alg );
6437 if( !mbedtls_test_psa_setup_key_derivation_wrap( &operation, base_key, alg,
6471 psa_algorithm_t alg = alg_arg;
6492 status = psa_key_derivation_setup( &operation, alg );
6520 psa_algorithm_t alg = alg_arg;
6531 psa_set_key_algorithm( &attributes, alg );
6540 PSA_ASSERT( psa_raw_key_agreement( alg, our_key,
6565 psa_algorithm_t alg = alg_arg;
6575 psa_set_key_algorithm( &attributes, alg );
6581 PSA_ASSERT( psa_key_derivation_setup( &operation, alg ) );
6586 if( PSA_ALG_IS_HKDF( PSA_ALG_KEY_AGREEMENT_GET_KDF( alg ) ) )
6625 psa_algorithm_t alg = alg_arg;
6637 psa_set_key_algorithm( &attributes, alg );
6643 PSA_ASSERT( psa_key_derivation_setup( &operation, alg ) );
6648 if( PSA_ALG_IS_HKDF( PSA_ALG_KEY_AGREEMENT_GET_KDF( alg ) ) )
6737 psa_algorithm_t alg = alg_arg;
6745 psa_set_key_algorithm( &attributes, alg );
6764 if( ! mbedtls_test_psa_exercise_key( key, usage, alg ) )
6788 psa_algorithm_t alg = PSA_ALG_RSA_PKCS1V15_SIGN_RAW;
6813 psa_set_key_algorithm( &attributes, alg );
6836 if( ! mbedtls_test_psa_exercise_key( key, usage, alg ) )
6900 psa_algorithm_t alg = alg_arg;
6918 psa_set_key_algorithm( &attributes, alg );
7000 TEST_EQUAL( psa_get_key_algorithm( &attributes ), alg );
7013 if( ! mbedtls_test_psa_exercise_key( key, usage_flags, alg ) )