• Home
  • Raw
  • Download

Lines Matching refs:alg

819                                             psa_algorithm_t alg )  in psa_key_policy_permits()  argument
822 if( alg == 0 ) in psa_key_policy_permits()
826 if( PSA_ALG_IS_WILDCARD( alg ) ) in psa_key_policy_permits()
829 if( psa_key_algorithm_permits( key_type, policy->alg, alg ) || in psa_key_policy_permits()
830 psa_key_algorithm_permits( key_type, policy->alg2, alg ) ) in psa_key_policy_permits()
860 psa_key_policy_algorithm_intersection( key_type, policy->alg, in psa_restrict_key_policy()
861 constraint->alg ); in psa_restrict_key_policy()
865 if( intersection_alg == 0 && policy->alg != 0 && constraint->alg != 0 ) in psa_restrict_key_policy()
870 policy->alg = intersection_alg; in psa_restrict_key_policy()
892 psa_algorithm_t alg ) in psa_get_and_lock_key_slot_with_policy() argument
916 if( alg != 0 ) in psa_get_and_lock_key_slot_with_policy()
920 alg ); in psa_get_and_lock_key_slot_with_policy()
951 psa_algorithm_t alg ) in psa_get_and_lock_transparent_key_slot_with_policy() argument
954 usage, alg ); in psa_get_and_lock_transparent_key_slot_with_policy()
2117 psa_algorithm_t alg ) in psa_hash_setup() argument
2128 if( !PSA_ALG_IS_HASH( alg ) ) in psa_hash_setup()
2138 status = psa_driver_wrapper_hash_setup( operation, alg ); in psa_hash_setup()
2219 psa_status_t psa_hash_compute( psa_algorithm_t alg, in psa_hash_compute() argument
2225 if( !PSA_ALG_IS_HASH( alg ) ) in psa_hash_compute()
2228 return( psa_driver_wrapper_hash_compute( alg, input, input_length, in psa_hash_compute()
2232 psa_status_t psa_hash_compare( psa_algorithm_t alg, in psa_hash_compare() argument
2239 if( !PSA_ALG_IS_HASH( alg ) ) in psa_hash_compare()
2243 alg, input, input_length, in psa_hash_compare()
2298 psa_algorithm_t alg, in psa_mac_finalize_alg_and_key_validation() argument
2306 if( ! PSA_ALG_IS_MAC( alg ) ) in psa_mac_finalize_alg_and_key_validation()
2310 status = psa_mac_key_can_do( alg, key_type ); in psa_mac_finalize_alg_and_key_validation()
2315 *mac_size = PSA_MAC_LENGTH( key_type, key_bits, alg ); in psa_mac_finalize_alg_and_key_validation()
2327 PSA_ALG_FULL_LENGTH_MAC( alg ) ) ) in psa_mac_finalize_alg_and_key_validation()
2339 psa_algorithm_t alg, in psa_mac_setup() argument
2358 alg ); in psa_mac_setup()
2363 status = psa_mac_finalize_alg_and_key_validation( alg, &attributes, in psa_mac_setup()
2376 alg ); in psa_mac_setup()
2384 alg ); in psa_mac_setup()
2398 psa_algorithm_t alg ) in psa_mac_sign_setup() argument
2400 return( psa_mac_setup( operation, key, alg, 1 ) ); in psa_mac_sign_setup()
2405 psa_algorithm_t alg ) in psa_mac_verify_setup() argument
2407 return( psa_mac_setup( operation, key, alg, 0 ) ); in psa_mac_verify_setup()
2525 psa_algorithm_t alg, in psa_mac_compute_internal() argument
2543 alg ); in psa_mac_compute_internal()
2549 status = psa_mac_finalize_alg_and_key_validation( alg, &attributes, in psa_mac_compute_internal()
2563 alg, in psa_mac_compute_internal()
2588 psa_algorithm_t alg, in psa_mac_compute() argument
2595 return( psa_mac_compute_internal( key, alg, in psa_mac_compute()
2601 psa_algorithm_t alg, in psa_mac_verify() argument
2611 status = psa_mac_compute_internal( key, alg, in psa_mac_verify()
2640 psa_algorithm_t alg ) in psa_sign_verify_check_alg() argument
2644 if( ! PSA_ALG_IS_SIGN_MESSAGE( alg ) ) in psa_sign_verify_check_alg()
2647 if ( PSA_ALG_IS_SIGN_HASH( alg ) ) in psa_sign_verify_check_alg()
2649 if( ! PSA_ALG_IS_HASH( PSA_ALG_SIGN_GET_HASH( alg ) ) ) in psa_sign_verify_check_alg()
2655 if( ! PSA_ALG_IS_SIGN_HASH( alg ) ) in psa_sign_verify_check_alg()
2664 psa_algorithm_t alg, in psa_sign_internal() argument
2678 status = psa_sign_verify_check_alg( input_is_message, alg ); in psa_sign_internal()
2693 alg ); in psa_sign_internal()
2710 alg, input, input_length, in psa_sign_internal()
2718 alg, input, input_length, in psa_sign_internal()
2743 psa_algorithm_t alg, in psa_verify_internal() argument
2753 status = psa_sign_verify_check_alg( input_is_message, alg ); in psa_verify_internal()
2761 alg ); in psa_verify_internal()
2774 alg, input, input_length, in psa_verify_internal()
2781 alg, input, input_length, in psa_verify_internal()
2795 psa_algorithm_t alg, in psa_sign_message_builtin() argument
2804 if ( PSA_ALG_IS_SIGN_HASH( alg ) ) in psa_sign_message_builtin()
2810 PSA_ALG_SIGN_GET_HASH( alg ), in psa_sign_message_builtin()
2819 alg, hash, hash_length, in psa_sign_message_builtin()
2827 psa_algorithm_t alg, in psa_sign_message() argument
2835 key, 1, alg, input, input_length, in psa_sign_message()
2843 psa_algorithm_t alg, in psa_verify_message_builtin() argument
2851 if ( PSA_ALG_IS_SIGN_HASH( alg ) ) in psa_verify_message_builtin()
2857 PSA_ALG_SIGN_GET_HASH( alg ), in psa_verify_message_builtin()
2866 alg, hash, hash_length, in psa_verify_message_builtin()
2874 psa_algorithm_t alg, in psa_verify_message() argument
2881 key, 1, alg, input, input_length, in psa_verify_message()
2888 psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, in psa_sign_hash_builtin() argument
2893 if( PSA_ALG_IS_RSA_PKCS1V15_SIGN( alg ) || in psa_sign_hash_builtin()
2894 PSA_ALG_IS_RSA_PSS( alg) ) in psa_sign_hash_builtin()
2901 alg, hash, hash_length, in psa_sign_hash_builtin()
2913 if( PSA_ALG_IS_ECDSA( alg ) ) in psa_sign_hash_builtin()
2920 alg, hash, hash_length, in psa_sign_hash_builtin()
2943 psa_algorithm_t alg, in psa_sign_hash() argument
2951 key, 0, alg, hash, hash_length, in psa_sign_hash()
2958 psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, in psa_verify_hash_builtin() argument
2963 if( PSA_ALG_IS_RSA_PKCS1V15_SIGN( alg ) || in psa_verify_hash_builtin()
2964 PSA_ALG_IS_RSA_PSS( alg) ) in psa_verify_hash_builtin()
2971 alg, hash, hash_length, in psa_verify_hash_builtin()
2983 if( PSA_ALG_IS_ECDSA( alg ) ) in psa_verify_hash_builtin()
2990 alg, hash, hash_length, in psa_verify_hash_builtin()
3012 psa_algorithm_t alg, in psa_verify_hash() argument
3019 key, 0, alg, hash, hash_length, in psa_verify_hash()
3024 static int psa_rsa_oaep_set_padding_mode( psa_algorithm_t alg, in psa_rsa_oaep_set_padding_mode() argument
3027 psa_algorithm_t hash_alg = PSA_ALG_RSA_OAEP_GET_HASH( alg ); in psa_rsa_oaep_set_padding_mode()
3036 psa_algorithm_t alg, in psa_asymmetric_encrypt() argument
3057 if( ! PSA_ALG_IS_RSA_OAEP( alg ) && salt_length != 0 ) in psa_asymmetric_encrypt()
3061 key, &slot, PSA_KEY_USAGE_ENCRYPT, alg ); in psa_asymmetric_encrypt()
3090 if( alg == PSA_ALG_RSA_PKCS1V15_CRYPT ) in psa_asymmetric_encrypt()
3105 if( PSA_ALG_IS_RSA_OAEP( alg ) ) in psa_asymmetric_encrypt()
3109 psa_rsa_oaep_set_padding_mode( alg, rsa ) ); in psa_asymmetric_encrypt()
3152 psa_algorithm_t alg, in psa_asymmetric_decrypt() argument
3173 if( ! PSA_ALG_IS_RSA_OAEP( alg ) && salt_length != 0 ) in psa_asymmetric_decrypt()
3177 key, &slot, PSA_KEY_USAGE_DECRYPT, alg ); in psa_asymmetric_decrypt()
3206 if( alg == PSA_ALG_RSA_PKCS1V15_CRYPT ) in psa_asymmetric_decrypt()
3222 if( PSA_ALG_IS_RSA_OAEP( alg ) ) in psa_asymmetric_decrypt()
3226 psa_rsa_oaep_set_padding_mode( alg, rsa ) ); in psa_asymmetric_decrypt()
3275 psa_algorithm_t alg, in psa_cipher_setup() argument
3293 if( ! PSA_ALG_IS_CIPHER( alg ) ) in psa_cipher_setup()
3299 status = psa_get_and_lock_key_slot_with_policy( key, &slot, usage, alg ); in psa_cipher_setup()
3308 if( alg == PSA_ALG_ECB_NO_PADDING ) in psa_cipher_setup()
3312 operation->default_iv_length = PSA_CIPHER_IV_LENGTH( slot->attr.type, alg ); in psa_cipher_setup()
3322 alg ); in psa_cipher_setup()
3328 alg ); in psa_cipher_setup()
3341 psa_algorithm_t alg ) in psa_cipher_encrypt_setup() argument
3343 return( psa_cipher_setup( operation, key, alg, MBEDTLS_ENCRYPT ) ); in psa_cipher_encrypt_setup()
3348 psa_algorithm_t alg ) in psa_cipher_decrypt_setup() argument
3350 return( psa_cipher_setup( operation, key, alg, MBEDTLS_DECRYPT ) ); in psa_cipher_decrypt_setup()
3537 psa_algorithm_t alg, in psa_cipher_encrypt() argument
3551 if( ! PSA_ALG_IS_CIPHER( alg ) ) in psa_cipher_encrypt()
3559 alg ); in psa_cipher_encrypt()
3565 default_iv_length = PSA_CIPHER_IV_LENGTH( slot->attr.type, alg ); in psa_cipher_encrypt()
3587 alg, local_iv, default_iv_length, input, input_length, in psa_cipher_encrypt()
3609 psa_algorithm_t alg, in psa_cipher_decrypt() argument
3621 if( ! PSA_ALG_IS_CIPHER( alg ) ) in psa_cipher_decrypt()
3629 alg ); in psa_cipher_decrypt()
3635 …if( alg == PSA_ALG_CCM_STAR_NO_TAG && input_length < PSA_BLOCK_CIPHER_BLOCK_LENGTH( slot->attr.typ… in psa_cipher_decrypt()
3640 else if ( input_length < PSA_CIPHER_IV_LENGTH( slot->attr.type, alg ) ) in psa_cipher_decrypt()
3648 alg, input, input_length, in psa_cipher_decrypt()
3668 static psa_algorithm_t psa_aead_get_base_algorithm( psa_algorithm_t alg ) in psa_aead_get_base_algorithm() argument
3670 return PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG( alg ); in psa_aead_get_base_algorithm()
3674 static psa_status_t psa_aead_check_nonce_length( psa_algorithm_t alg, in psa_aead_check_nonce_length() argument
3677 psa_algorithm_t base_alg = psa_aead_get_base_algorithm( alg ); in psa_aead_check_nonce_length()
3715 psa_algorithm_t alg, in psa_aead_encrypt() argument
3731 if( !PSA_ALG_IS_AEAD( alg ) || PSA_ALG_IS_WILDCARD( alg ) ) in psa_aead_encrypt()
3735 key, &slot, PSA_KEY_USAGE_ENCRYPT, alg ); in psa_aead_encrypt()
3743 status = psa_aead_check_nonce_length( alg, nonce_length ); in psa_aead_encrypt()
3749 alg, in psa_aead_encrypt()
3765 psa_algorithm_t alg, in psa_aead_decrypt() argument
3781 if( !PSA_ALG_IS_AEAD( alg ) || PSA_ALG_IS_WILDCARD( alg ) ) in psa_aead_decrypt()
3785 key, &slot, PSA_KEY_USAGE_DECRYPT, alg ); in psa_aead_decrypt()
3793 status = psa_aead_check_nonce_length( alg, nonce_length ); in psa_aead_decrypt()
3799 alg, in psa_aead_decrypt()
3818 psa_algorithm_t alg ) in psa_aead_setup() argument
3826 if( !PSA_ALG_IS_AEAD( alg ) || PSA_ALG_IS_WILDCARD( alg ) ) in psa_aead_setup()
3851 alg ); in psa_aead_setup()
3862 alg ); in psa_aead_setup()
3868 alg ); in psa_aead_setup()
3880 operation->alg = psa_aead_get_base_algorithm( alg ); in psa_aead_setup()
3892 psa_algorithm_t alg ) in psa_aead_encrypt_setup() argument
3894 return( psa_aead_setup( operation, 1, key, alg ) ); in psa_aead_encrypt_setup()
3900 psa_algorithm_t alg ) in psa_aead_decrypt_setup() argument
3902 return( psa_aead_setup( operation, 0, key, alg ) ); in psa_aead_decrypt_setup()
3939 operation->alg ); in psa_aead_generate_nonce()
3984 status = psa_aead_check_nonce_length( operation->alg, nonce_length ); in psa_aead_set_nonce()
4023 switch(operation->alg) in psa_aead_set_lengths()
4104 else if( operation->alg == PSA_ALG_CCM ) in psa_aead_update_ad()
4168 else if( operation->alg == PSA_ALG_CCM ) in psa_aead_update()
4348 if ( PSA_ALG_IS_KEY_AGREEMENT( operation->alg ) ) in psa_key_derivation_get_kdf_alg()
4349 return( PSA_ALG_KEY_AGREEMENT_GET_KDF( operation->alg ) ); in psa_key_derivation_get_kdf_alg()
4351 return( operation->alg ); in psa_key_derivation_get_kdf_alg()
4418 if( operation->alg == 0 ) in psa_key_derivation_get_capacity()
4431 if( operation->alg == 0 ) in psa_key_derivation_set_capacity()
4519 psa_algorithm_t alg ) in psa_key_derivation_tls12_prf_generate_next_block() argument
4521 psa_algorithm_t hash_alg = PSA_ALG_HKDF_GET_HASH( alg ); in psa_key_derivation_tls12_prf_generate_next_block()
4629 psa_algorithm_t alg, in psa_key_derivation_tls12_prf_read() argument
4633 psa_algorithm_t hash_alg = PSA_ALG_TLS12_PRF_GET_HASH( alg ); in psa_key_derivation_tls12_prf_read()
4655 alg ); in psa_key_derivation_tls12_prf_read()
4687 if( operation->alg == 0 ) in psa_key_derivation_output_bytes()
4746 psa_algorithm_t alg = operation->alg; in psa_key_derivation_output_bytes() local
4748 operation->alg = alg; in psa_key_derivation_output_bytes()
4835 if( operation->alg == PSA_ALG_NONE ) in psa_key_derivation_output_key()
4920 psa_algorithm_t alg ) in psa_key_derivation_setup() argument
4924 if( operation->alg != 0 ) in psa_key_derivation_setup()
4927 if( PSA_ALG_IS_RAW_KEY_AGREEMENT( alg ) ) in psa_key_derivation_setup()
4929 else if( PSA_ALG_IS_KEY_AGREEMENT( alg ) ) in psa_key_derivation_setup()
4932 psa_algorithm_t kdf_alg = PSA_ALG_KEY_AGREEMENT_GET_KDF( alg ); in psa_key_derivation_setup()
4938 else if( PSA_ALG_IS_KEY_DERIVATION( alg ) ) in psa_key_derivation_setup()
4941 status = psa_key_derivation_setup_kdf( operation, alg ); in psa_key_derivation_setup()
4950 operation->alg = alg; in psa_key_derivation_setup()
5272 key, &slot, PSA_KEY_USAGE_DERIVE, operation->alg ); in psa_key_derivation_input_key()
5357 static psa_status_t psa_key_agreement_raw_internal( psa_algorithm_t alg, in psa_key_agreement_raw_internal() argument
5367 switch( alg ) in psa_key_agreement_raw_internal()
5413 psa_algorithm_t ka_alg = PSA_ALG_KEY_AGREEMENT_GET_BASE( operation->alg ); in psa_key_agreement_internal()
5448 if( ! PSA_ALG_IS_KEY_AGREEMENT( operation->alg ) ) in psa_key_derivation_key_agreement()
5451 private_key, &slot, PSA_KEY_USAGE_DERIVE, operation->alg ); in psa_key_derivation_key_agreement()
5472 psa_status_t psa_raw_key_agreement( psa_algorithm_t alg, in psa_raw_key_agreement() argument
5484 if( ! PSA_ALG_IS_KEY_AGREEMENT( alg ) ) in psa_raw_key_agreement()
5490 private_key, &slot, PSA_KEY_USAGE_DERIVE, alg ); in psa_raw_key_agreement()
5494 status = psa_key_agreement_raw_internal( alg, slot, in psa_raw_key_agreement()