From 5ed0621dd4c2cd77f534a64dd9e38a3f37d1aac8 Mon Sep 17 00:00:00 2001 From: mohammad1603 Date: Wed, 6 Jun 2018 13:09:34 +0300 Subject: [PATCH] aligned with coding standards - line length --- library/psa_crypto.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 8207a9bc1..3ee3f9d8d 100755 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -1501,14 +1501,16 @@ psa_status_t psa_aead_encrypt( psa_key_slot_t key, return( status ); slot = &global_data.key_slots[key]; - cipher_info = mbedtls_cipher_info_from_psa( alg, key_type, key_bits, &cipher_id ); + cipher_info = mbedtls_cipher_info_from_psa( alg, key_type, + key_bits, &cipher_id ); if( cipher_info == NULL ) return( PSA_ERROR_NOT_SUPPORTED ); if( !( slot->policy.usage & PSA_KEY_USAGE_ENCRYPT ) ) return( PSA_ERROR_NOT_PERMITTED ); - if ( ( key_type & PSA_KEY_TYPE_CATEGORY_MASK ) != PSA_KEY_TYPE_CATEGORY_SYMMETRIC ) + if ( ( key_type & PSA_KEY_TYPE_CATEGORY_MASK ) != + PSA_KEY_TYPE_CATEGORY_SYMMETRIC ) return( PSA_ERROR_INVALID_ARGUMENT ); if( alg == PSA_ALG_GCM ) @@ -1642,15 +1644,18 @@ psa_status_t psa_aead_decrypt( psa_key_slot_t key, return( status ); slot = &global_data.key_slots[key]; - cipher_info = mbedtls_cipher_info_from_psa( alg, key_type, key_bits, &cipher_id ); + cipher_info = mbedtls_cipher_info_from_psa( alg, key_type, + key_bits, &cipher_id ); if( cipher_info == NULL ) return( PSA_ERROR_NOT_SUPPORTED ); if( !( slot->policy.usage & PSA_KEY_USAGE_DECRYPT ) ) return( PSA_ERROR_NOT_PERMITTED ); - if ( !( ( key_type & PSA_KEY_TYPE_CATEGORY_MASK ) == PSA_KEY_TYPE_CATEGORY_SYMMETRIC - && PSA_BLOCK_CIPHER_BLOCK_SIZE( key_type ) == cipher_info->block_size ) ) + if ( !( ( key_type & PSA_KEY_TYPE_CATEGORY_MASK ) == + PSA_KEY_TYPE_CATEGORY_SYMMETRIC + && PSA_BLOCK_CIPHER_BLOCK_SIZE( key_type ) == + cipher_info->block_size ) ) return( PSA_ERROR_INVALID_ARGUMENT ); if( alg == PSA_ALG_GCM ) @@ -1676,7 +1681,8 @@ psa_status_t psa_aead_decrypt( psa_key_slot_t key, ret = mbedtls_gcm_auth_decrypt( &gcm, ciphertext_length - tag_length, nonce, nonce_length, - additional_data, additional_data_length, + additional_data, + additional_data_length, tag, tag_length, ciphertext, plaintext ); mbedtls_gcm_free( &gcm );