Lines Matching refs:alg1
820 psa_algorithm_t alg1, in psa_key_policy_algorithm_intersection() argument
824 if (alg1 == alg2) { in psa_key_policy_algorithm_intersection()
825 return alg1; in psa_key_policy_algorithm_intersection()
829 if (PSA_ALG_IS_SIGN_HASH(alg1) && in psa_key_policy_algorithm_intersection()
831 (alg1 & ~PSA_ALG_HASH_MASK) == (alg2 & ~PSA_ALG_HASH_MASK)) { in psa_key_policy_algorithm_intersection()
832 if (PSA_ALG_SIGN_GET_HASH(alg1) == PSA_ALG_ANY_HASH) { in psa_key_policy_algorithm_intersection()
836 return alg1; in psa_key_policy_algorithm_intersection()
842 if (PSA_ALG_IS_AEAD(alg1) && PSA_ALG_IS_AEAD(alg2) && in psa_key_policy_algorithm_intersection()
843 (PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg1, 0) == in psa_key_policy_algorithm_intersection()
845 size_t alg1_len = PSA_ALG_AEAD_GET_TAG_LENGTH(alg1); in psa_key_policy_algorithm_intersection()
850 if (((alg1 & PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG) != 0) && in psa_key_policy_algorithm_intersection()
853 alg1, restricted_len); in psa_key_policy_algorithm_intersection()
856 if (((alg1 & PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG) != 0) && in psa_key_policy_algorithm_intersection()
862 return alg1; in psa_key_policy_algorithm_intersection()
868 if (PSA_ALG_IS_MAC(alg1) && PSA_ALG_IS_MAC(alg2) && in psa_key_policy_algorithm_intersection()
869 (PSA_ALG_FULL_LENGTH_MAC(alg1) == in psa_key_policy_algorithm_intersection()
873 if (PSA_SUCCESS != psa_mac_key_can_do(alg1, key_type)) { in psa_key_policy_algorithm_intersection()
885 size_t alg1_len = PSA_MAC_LENGTH(key_type, 0, alg1); in psa_key_policy_algorithm_intersection()
890 if (((alg1 & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG) != 0) && in psa_key_policy_algorithm_intersection()
892 return PSA_ALG_AT_LEAST_THIS_LENGTH_MAC(alg1, restricted_len); in psa_key_policy_algorithm_intersection()
898 if ((alg1 & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG) != 0) { in psa_key_policy_algorithm_intersection()
902 return (alg2_len <= alg1_len) ? alg1 : 0; in psa_key_policy_algorithm_intersection()
910 return PSA_ALG_TRUNCATED_MAC(alg1, alg1_len); in psa_key_policy_algorithm_intersection()