@@ -3146,7 +3146,7 @@ static void psa_aead_abort( aead_operation_t *operation )
3146
3146
mbedtls_ccm_free ( & operation -> ctx .ccm );
3147
3147
break ;
3148
3148
#endif /* MBEDTLS_CCM_C */
3149
- #if defined(MBEDTLS_CCM_C )
3149
+ #if defined(MBEDTLS_GCM_C )
3150
3150
case PSA_ALG_GCM :
3151
3151
mbedtls_gcm_free ( & operation -> ctx .gcm );
3152
3152
break ;
@@ -3259,6 +3259,7 @@ psa_status_t psa_aead_encrypt( psa_key_slot_t key,
3259
3259
}
3260
3260
tag = ciphertext + plaintext_length ;
3261
3261
3262
+ #if defined(MBEDTLS_GCM_C )
3262
3263
if ( operation .core_alg == PSA_ALG_GCM )
3263
3264
{
3264
3265
status = mbedtls_to_psa_error (
@@ -3270,7 +3271,10 @@ psa_status_t psa_aead_encrypt( psa_key_slot_t key,
3270
3271
plaintext , ciphertext ,
3271
3272
operation .tag_length , tag ) );
3272
3273
}
3273
- else if ( operation .core_alg == PSA_ALG_CCM )
3274
+ else
3275
+ #endif /* MBEDTLS_GCM_C */
3276
+ #if defined(MBEDTLS_CCM_C )
3277
+ if ( operation .core_alg == PSA_ALG_CCM )
3274
3278
{
3275
3279
status = mbedtls_to_psa_error (
3276
3280
mbedtls_ccm_encrypt_and_tag ( & operation .ctx .ccm ,
@@ -3282,6 +3286,7 @@ psa_status_t psa_aead_encrypt( psa_key_slot_t key,
3282
3286
tag , operation .tag_length ) );
3283
3287
}
3284
3288
else
3289
+ #endif /* MBEDTLS_CCM_C */
3285
3290
{
3286
3291
return ( PSA_ERROR_NOT_SUPPORTED );
3287
3292
}
@@ -3339,6 +3344,7 @@ psa_status_t psa_aead_decrypt( psa_key_slot_t key,
3339
3344
if ( status != PSA_SUCCESS )
3340
3345
return ( status );
3341
3346
3347
+ #if defined(MBEDTLS_GCM_C )
3342
3348
if ( operation .core_alg == PSA_ALG_GCM )
3343
3349
{
3344
3350
status = psa_aead_unpadded_locate_tag ( operation .tag_length ,
@@ -3356,7 +3362,10 @@ psa_status_t psa_aead_decrypt( psa_key_slot_t key,
3356
3362
tag , operation .tag_length ,
3357
3363
ciphertext , plaintext ) );
3358
3364
}
3359
- else if ( operation .core_alg == PSA_ALG_CCM )
3365
+ else
3366
+ #endif /* MBEDTLS_GCM_C */
3367
+ #if defined(MBEDTLS_CCM_C )
3368
+ if ( operation .core_alg == PSA_ALG_CCM )
3360
3369
{
3361
3370
status = psa_aead_unpadded_locate_tag ( operation .tag_length ,
3362
3371
ciphertext , ciphertext_length ,
@@ -3374,6 +3383,7 @@ psa_status_t psa_aead_decrypt( psa_key_slot_t key,
3374
3383
tag , operation .tag_length ) );
3375
3384
}
3376
3385
else
3386
+ #endif /* MBEDTLS_CCM_C */
3377
3387
{
3378
3388
return ( PSA_ERROR_NOT_SUPPORTED );
3379
3389
}
0 commit comments