diff --git a/include/psa/crypto_values.h b/include/psa/crypto_values.h index 7d16523a9..524cde1a0 100644 --- a/include/psa/crypto_values.h +++ b/include/psa/crypto_values.h @@ -941,7 +941,7 @@ /** Macro to build a MAC minimum-MAC-length wildcard algorithm. * - * A mininimum-MAC-length MAC wildcard algorithm permits all MAC algorithms + * A minimum-MAC-length MAC wildcard algorithm permits all MAC algorithms * sharing the same base algorithm, and where the (potentially truncated) MAC * length of the specific algorithm is equal to or larger then the wildcard * algorithm's minimum MAC length. @@ -1192,7 +1192,7 @@ /** Macro to build an AEAD minimum-tag-length wildcard algorithm. * - * A mininimum-tag-length AEAD wildcard algorithm permits all AEAD algorithms + * A minimum-tag-length AEAD wildcard algorithm permits all AEAD algorithms * sharing the same base algorithm, and where the tag length of the specific * algorithm is equal to or larger then the minimum tag length specified by the * wildcard algorithm. diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 40a0db373..c23d124f3 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -714,7 +714,7 @@ static psa_algorithm_t psa_key_policy_algorithm_intersection( size_t alg2_len = PSA_MAC_TRUNCATED_LENGTH( alg2 ); size_t max_len = alg1_len > alg2_len ? alg1_len : alg2_len; - /* If both are wildcards, return most restricitve wildcard */ + /* If both are wildcards, return most restrictive wildcard */ if( ( ( alg1 & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG ) != 0 ) && ( ( alg2 & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG ) != 0 ) ) { diff --git a/tests/suites/test_suite_psa_crypto_metadata.function b/tests/suites/test_suite_psa_crypto_metadata.function index 9379c5ed2..01ce47f2c 100644 --- a/tests/suites/test_suite_psa_crypto_metadata.function +++ b/tests/suites/test_suite_psa_crypto_metadata.function @@ -272,9 +272,9 @@ void mac_algorithm( int alg_arg, int classification_flags, mac_algorithm_core( policy_alg, classification_flags | ALG_IS_WILDCARD, key_type, key_bits, n ); TEST_EQUAL( PSA_ALG_FULL_LENGTH_MAC( policy_alg ), alg ); - /* Check that calling PSA_ALG_TRUNCATED_MAC twice gives the length - * of the outer truncation (even if the outer length is smaller than - * the inner length). */ + /* Check that calling PSA_ALG_AT_LEAST_THIS_LENGTH_MAC twice gives the + * length of the outer truncation (even if the outer length is smaller + * than the inner length). */ TEST_EQUAL( PSA_ALG_AT_LEAST_THIS_LENGTH_MAC( policy_alg, 1 ), PSA_ALG_AT_LEAST_THIS_LENGTH_MAC( alg, 1 ) ); TEST_EQUAL( PSA_ALG_AT_LEAST_THIS_LENGTH_MAC( policy_alg, length - 1 ), @@ -347,7 +347,7 @@ void aead_algorithm( int alg_arg, int classification_flags, aead_algorithm_core( truncated_alg, classification_flags, n ); TEST_EQUAL( PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG( truncated_alg ), alg ); - /* Check that calling PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG twice gives + /* Check that calling PSA_ALG_AEAD_WITH_SHORTENED_TAG twice gives * the length of the outer truncation (even if the outer length is * smaller than the inner length). */ TEST_EQUAL( PSA_ALG_AEAD_WITH_SHORTENED_TAG( truncated_alg, 1 ), @@ -365,8 +365,8 @@ void aead_algorithm( int alg_arg, int classification_flags, aead_algorithm_core( policy_alg, classification_flags | ALG_IS_WILDCARD, n ); TEST_EQUAL( PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG( policy_alg ), alg ); - /* Check that calling PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG twice gives - * the length of the outer truncation (even if the outer length is + /* Check that calling PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG twice + * gives the length of the outer truncation (even if the outer length is * smaller than the inner length). */ TEST_EQUAL( PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG( policy_alg, 1 ), PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG( alg, 1 ) );