Lines Matching refs:alg
119 psa_algorithm_t alg ) in exercise_mac_key() argument
127 if( alg & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG ) in exercise_mac_key()
129 alg = PSA_ALG_TRUNCATED_MAC( alg, PSA_MAC_TRUNCATED_LENGTH( alg ) ); in exercise_mac_key()
134 PSA_ASSERT( psa_mac_sign_setup( &operation, key, alg ) ); in exercise_mac_key()
148 PSA_ASSERT( psa_mac_verify_setup( &operation, key, alg ) ); in exercise_mac_key()
164 psa_algorithm_t alg ) in exercise_cipher_key() argument
177 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) ); in exercise_cipher_key()
204 maybe_invalid_padding = ! PSA_ALG_IS_STREAM_CIPHER( alg ); in exercise_cipher_key()
207 PSA_ASSERT( psa_cipher_decrypt_setup( &operation, key, alg ) ); in exercise_cipher_key()
237 psa_algorithm_t alg ) in exercise_aead_key() argument
247 if( alg & PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG ) in exercise_aead_key()
249 alg = PSA_ALG_AEAD_WITH_SHORTENED_TAG( alg, PSA_ALG_AEAD_GET_TAG_LENGTH( alg ) ); in exercise_aead_key()
253 if( PSA_ALG_AEAD_WITH_SHORTENED_TAG( alg, 0 ) == in exercise_aead_key()
260 if( PSA_ALG_AEAD_WITH_SHORTENED_TAG( alg, 0 ) == in exercise_aead_key()
268 PSA_ASSERT( psa_aead_encrypt( key, alg, in exercise_aead_key()
282 TEST_EQUAL( psa_aead_decrypt( key, alg, in exercise_aead_key()
299 psa_algorithm_t alg ) in exercise_signature_key() argument
307 psa_algorithm_t hash_alg = PSA_ALG_SIGN_GET_HASH( alg ); in exercise_signature_key()
310 if( PSA_ALG_IS_SIGN_HASH( alg ) && hash_alg == PSA_ALG_ANY_HASH ) in exercise_signature_key()
314 alg ^= PSA_ALG_ANY_HASH ^ hash_alg; in exercise_signature_key()
328 PSA_ASSERT( psa_sign_hash( key, alg, in exercise_signature_key()
340 TEST_EQUAL( psa_verify_hash( key, alg, in exercise_signature_key()
356 PSA_ASSERT( psa_sign_message( key, alg, in exercise_signature_key()
368 TEST_EQUAL( psa_verify_message( key, alg, in exercise_signature_key()
383 psa_algorithm_t alg ) in exercise_asymmetric_encryption_key() argument
392 PSA_ASSERT( psa_asymmetric_encrypt( key, alg, in exercise_asymmetric_encryption_key()
402 psa_asymmetric_decrypt( key, alg, in exercise_asymmetric_encryption_key()
422 psa_algorithm_t alg, in mbedtls_test_psa_setup_key_derivation_wrap() argument
427 PSA_ASSERT( psa_key_derivation_setup( operation, alg ) ); in mbedtls_test_psa_setup_key_derivation_wrap()
428 if( PSA_ALG_IS_HKDF( alg ) ) in mbedtls_test_psa_setup_key_derivation_wrap()
441 else if( PSA_ALG_IS_TLS12_PRF( alg ) || in mbedtls_test_psa_setup_key_derivation_wrap()
442 PSA_ALG_IS_TLS12_PSK_TO_MS( alg ) ) in mbedtls_test_psa_setup_key_derivation_wrap()
471 psa_algorithm_t alg ) in exercise_key_derivation_key() argument
483 if( !mbedtls_test_psa_setup_key_derivation_wrap( &operation, key, alg, in exercise_key_derivation_key()
544 psa_algorithm_t alg, in mbedtls_test_psa_raw_key_agreement_with_self() argument
570 status = psa_raw_key_agreement( alg, key, in mbedtls_test_psa_raw_key_agreement_with_self()
595 psa_algorithm_t alg ) in exercise_raw_key_agreement_key() argument
603 PSA_ASSERT( mbedtls_test_psa_raw_key_agreement_with_self( alg, key ) ); in exercise_raw_key_agreement_key()
613 psa_algorithm_t alg ) in exercise_key_agreement_key() argument
623 PSA_ASSERT( psa_key_derivation_setup( &operation, alg ) ); in exercise_key_agreement_key()
889 psa_algorithm_t alg ) in mbedtls_test_psa_exercise_key() argument
896 if( alg == 0 ) in mbedtls_test_psa_exercise_key()
898 else if( PSA_ALG_IS_MAC( alg ) ) in mbedtls_test_psa_exercise_key()
899 ok = exercise_mac_key( key, usage, alg ); in mbedtls_test_psa_exercise_key()
900 else if( PSA_ALG_IS_CIPHER( alg ) ) in mbedtls_test_psa_exercise_key()
901 ok = exercise_cipher_key( key, usage, alg ); in mbedtls_test_psa_exercise_key()
902 else if( PSA_ALG_IS_AEAD( alg ) ) in mbedtls_test_psa_exercise_key()
903 ok = exercise_aead_key( key, usage, alg ); in mbedtls_test_psa_exercise_key()
904 else if( PSA_ALG_IS_SIGN( alg ) ) in mbedtls_test_psa_exercise_key()
905 ok = exercise_signature_key( key, usage, alg ); in mbedtls_test_psa_exercise_key()
906 else if( PSA_ALG_IS_ASYMMETRIC_ENCRYPTION( alg ) ) in mbedtls_test_psa_exercise_key()
907 ok = exercise_asymmetric_encryption_key( key, usage, alg ); in mbedtls_test_psa_exercise_key()
908 else if( PSA_ALG_IS_KEY_DERIVATION( alg ) ) in mbedtls_test_psa_exercise_key()
909 ok = exercise_key_derivation_key( key, usage, alg ); in mbedtls_test_psa_exercise_key()
910 else if( PSA_ALG_IS_RAW_KEY_AGREEMENT( alg ) ) in mbedtls_test_psa_exercise_key()
911 ok = exercise_raw_key_agreement_key( key, usage, alg ); in mbedtls_test_psa_exercise_key()
912 else if( PSA_ALG_IS_KEY_AGREEMENT( alg ) ) in mbedtls_test_psa_exercise_key()
913 ok = exercise_key_agreement_key( key, usage, alg ); in mbedtls_test_psa_exercise_key()
925 psa_algorithm_t alg ) in mbedtls_test_psa_usage_to_exercise() argument
927 if( PSA_ALG_IS_MAC( alg ) || PSA_ALG_IS_SIGN( alg ) ) in mbedtls_test_psa_usage_to_exercise()
929 if( PSA_ALG_IS_SIGN_HASH( alg ) ) in mbedtls_test_psa_usage_to_exercise()
931 if( PSA_ALG_SIGN_GET_HASH( alg ) ) in mbedtls_test_psa_usage_to_exercise()
937 else if( PSA_ALG_IS_SIGN_MESSAGE( alg) ) in mbedtls_test_psa_usage_to_exercise()
946 else if( PSA_ALG_IS_CIPHER( alg ) || PSA_ALG_IS_AEAD( alg ) || in mbedtls_test_psa_usage_to_exercise()
947 PSA_ALG_IS_ASYMMETRIC_ENCRYPTION( alg ) ) in mbedtls_test_psa_usage_to_exercise()
953 else if( PSA_ALG_IS_KEY_DERIVATION( alg ) || in mbedtls_test_psa_usage_to_exercise()
954 PSA_ALG_IS_KEY_AGREEMENT( alg ) ) in mbedtls_test_psa_usage_to_exercise()