From 12ca50307f0335416fd445688a3ea58495f4fad9 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 11 Feb 2021 11:02:00 -0700 Subject: [PATCH] Change some conditionals of PSA to use BUILTIN Change a few conditionals in the psa library to be based on the MBEDTLS_PSA_BUILTIN_KEY_TYPE_DES instead of the WANT macros. Future additions of HW acceleration will need to be mindful of these definitions if any of this code is needed in those instances. Signed-off-by: David Brown --- library/psa_crypto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 9b3305f55..d7a14d3a4 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -3875,7 +3875,7 @@ static psa_status_t psa_cipher_setup( psa_cipher_operation_t *operation, if( ret != 0 ) goto exit; -#if defined(PSA_WANT_KEY_TYPE_DES) +#if defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_DES) if( slot->attr.type == PSA_KEY_TYPE_DES && key_bits == 128 ) { /* Two-key Triple-DES is 3-key Triple-DES with K1=K3 */ @@ -5095,7 +5095,7 @@ static psa_status_t psa_generate_derived_key_internal( status = psa_key_derivation_output_bytes( operation, data, bytes ); if( status != PSA_SUCCESS ) goto exit; -#if defined(PSA_WANT_KEY_TYPE_DES) +#if defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_DES) if( slot->attr.type == PSA_KEY_TYPE_DES ) psa_des_set_key_parity( data, bytes ); #endif /* PSA_WANT_KEY_TYPE_DES */ @@ -6029,7 +6029,7 @@ psa_status_t psa_generate_key_internal( if( status != PSA_SUCCESS ) return( status ); -#if defined(PSA_WANT_KEY_TYPE_DES) +#if defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_DES) if( type == PSA_KEY_TYPE_DES ) psa_des_set_key_parity( key_buffer, key_buffer_size ); #endif /* MBEDTLS_DES_C */