diff --git a/library/psa_crypto.c b/library/psa_crypto.c index e45b5d70af..aef18ac418 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -3711,11 +3711,7 @@ exit: static psa_status_t psa_validate_tag_length( psa_aead_operation_t *operation, psa_algorithm_t alg ) { - uint8_t tag_len = 0; - if( psa_driver_get_tag_len( operation, &tag_len ) != PSA_SUCCESS ) - { - return( PSA_ERROR_INVALID_ARGUMENT ); - } + const uint8_t tag_len = PSA_ALG_AEAD_GET_TAG_LENGTH( alg ); switch( PSA_ALG_AEAD_WITH_SHORTENED_TAG( alg, 0 ) ) { diff --git a/library/psa_crypto_driver_wrappers.h b/library/psa_crypto_driver_wrappers.h index 12c649da37..ee23b6f3fe 100644 --- a/library/psa_crypto_driver_wrappers.h +++ b/library/psa_crypto_driver_wrappers.h @@ -226,10 +226,6 @@ psa_status_t psa_driver_wrapper_aead_decrypt( const uint8_t *ciphertext, size_t ciphertext_length, uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length ); -psa_status_t psa_driver_get_tag_len( - psa_aead_operation_t *operation, - uint8_t *tag_len ); - psa_status_t psa_driver_wrapper_aead_encrypt_setup( psa_aead_operation_t *operation, const psa_key_attributes_t *attributes, diff --git a/scripts/data_files/driver_templates/psa_crypto_driver_wrappers.c.jinja b/scripts/data_files/driver_templates/psa_crypto_driver_wrappers.c.jinja index a5ae6a29e4..8ef2e6d874 100644 --- a/scripts/data_files/driver_templates/psa_crypto_driver_wrappers.c.jinja +++ b/scripts/data_files/driver_templates/psa_crypto_driver_wrappers.c.jinja @@ -1616,22 +1616,6 @@ psa_status_t psa_driver_wrapper_aead_decrypt( } } -psa_status_t psa_driver_get_tag_len( psa_aead_operation_t *operation, - uint8_t *tag_len ) -{ - if( operation == NULL || tag_len == NULL ) - return( PSA_ERROR_INVALID_ARGUMENT ); - -#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT) -#if defined(PSA_CRYPTO_DRIVER_TEST) - *tag_len = operation->ctx.transparent_test_driver_ctx.tag_length; - return ( PSA_SUCCESS ); -#endif -#endif - *tag_len = operation->ctx.mbedtls_ctx.tag_length; - return ( PSA_SUCCESS ); -} - psa_status_t psa_driver_wrapper_aead_encrypt_setup( psa_aead_operation_t *operation, const psa_key_attributes_t *attributes,