mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-24 22:25:11 +00:00
Use a public macro for AEAD tag length variations
Avoid depending on the encoding of algorithms inside psa_crypto.c.
This commit is contained in:
parent
7fa99d90dd
commit
57fbdb1939
|
@ -1225,7 +1225,7 @@ static const mbedtls_cipher_info_t *mbedtls_cipher_info_from_psa(
|
||||||
mbedtls_cipher_id_t cipher_id_tmp;
|
mbedtls_cipher_id_t cipher_id_tmp;
|
||||||
|
|
||||||
if( PSA_ALG_IS_AEAD( alg ) )
|
if( PSA_ALG_IS_AEAD( alg ) )
|
||||||
alg &= ~PSA_ALG_AEAD_TAG_LENGTH_MASK;
|
alg = PSA_ALG_AEAD_WITH_TAG_LENGTH( alg, 0 );
|
||||||
|
|
||||||
if( PSA_ALG_IS_CIPHER( alg ) || PSA_ALG_IS_AEAD( alg ) )
|
if( PSA_ALG_IS_CIPHER( alg ) || PSA_ALG_IS_AEAD( alg ) )
|
||||||
{
|
{
|
||||||
|
@ -1249,10 +1249,10 @@ static const mbedtls_cipher_info_t *mbedtls_cipher_info_from_psa(
|
||||||
case PSA_ALG_CBC_PKCS7:
|
case PSA_ALG_CBC_PKCS7:
|
||||||
mode = MBEDTLS_MODE_CBC;
|
mode = MBEDTLS_MODE_CBC;
|
||||||
break;
|
break;
|
||||||
case PSA_ALG_CCM & ~PSA_ALG_AEAD_TAG_LENGTH_MASK:
|
case PSA_ALG_AEAD_WITH_TAG_LENGTH( PSA_ALG_CCM, 0 ):
|
||||||
mode = MBEDTLS_MODE_CCM;
|
mode = MBEDTLS_MODE_CCM;
|
||||||
break;
|
break;
|
||||||
case PSA_ALG_GCM & ~PSA_ALG_AEAD_TAG_LENGTH_MASK:
|
case PSA_ALG_AEAD_WITH_TAG_LENGTH( PSA_ALG_GCM, 0 ):
|
||||||
mode = MBEDTLS_MODE_GCM;
|
mode = MBEDTLS_MODE_GCM;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue