Replace function with macro that already exists
I wrote a function to determine the base algorithm given a variant, however this is already implemented by PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
parent
7220cae93c
commit
e4030f2cd1
1 changed files with 1 additions and 14 deletions
|
@ -3398,20 +3398,7 @@ psa_status_t psa_aead_decrypt( mbedtls_svc_key_id_t key,
|
||||||
/* Helper function to get the base algorithm from its variants. */
|
/* Helper function to get the base algorithm from its variants. */
|
||||||
static psa_algorithm_t psa_aead_get_base_algorithm(psa_algorithm_t alg)
|
static psa_algorithm_t psa_aead_get_base_algorithm(psa_algorithm_t alg)
|
||||||
{
|
{
|
||||||
switch( PSA_ALG_AEAD_WITH_SHORTENED_TAG( alg, 0 ) )
|
return PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG( alg );
|
||||||
{
|
|
||||||
case PSA_ALG_AEAD_WITH_SHORTENED_TAG( PSA_ALG_CCM, 0 ):
|
|
||||||
return( PSA_ALG_CCM );
|
|
||||||
|
|
||||||
case PSA_ALG_AEAD_WITH_SHORTENED_TAG( PSA_ALG_GCM, 0 ):
|
|
||||||
return( PSA_ALG_GCM );
|
|
||||||
|
|
||||||
case PSA_ALG_AEAD_WITH_SHORTENED_TAG( PSA_ALG_CHACHA20_POLY1305, 0 ):
|
|
||||||
return( PSA_ALG_CHACHA20_POLY1305 );
|
|
||||||
|
|
||||||
default:
|
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the key for a multipart authenticated encryption operation. */
|
/* Set the key for a multipart authenticated encryption operation. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue