Whitespace fixes
Changed indentation to match Mbed TLS style. Wrapped some lines to 80 columns.
This commit is contained in:
parent
20399393a5
commit
a40d77477d
1 changed files with 29 additions and 26 deletions
|
@ -1517,14 +1517,15 @@ psa_status_t psa_aead_encrypt( psa_key_slot_t key,
|
||||||
mbedtls_gcm_context gcm;
|
mbedtls_gcm_context gcm;
|
||||||
mbedtls_gcm_init( &gcm );
|
mbedtls_gcm_init( &gcm );
|
||||||
ret = mbedtls_gcm_setkey( &gcm, cipher_id,
|
ret = mbedtls_gcm_setkey( &gcm, cipher_id,
|
||||||
( const unsigned char * )slot->data.raw.data, key_bits );
|
( const unsigned char * )slot->data.raw.data,
|
||||||
|
key_bits );
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
{
|
{
|
||||||
mbedtls_gcm_free( &gcm );
|
mbedtls_gcm_free( &gcm );
|
||||||
return( mbedtls_to_psa_error( ret ) );
|
return( mbedtls_to_psa_error( ret ) );
|
||||||
}
|
}
|
||||||
ret = mbedtls_gcm_crypt_and_tag( &gcm, MBEDTLS_GCM_ENCRYPT,
|
ret = mbedtls_gcm_crypt_and_tag( &gcm, MBEDTLS_GCM_ENCRYPT,
|
||||||
plaintext_length, nonce ,
|
plaintext_length, nonce,
|
||||||
nonce_length, additional_data,
|
nonce_length, additional_data,
|
||||||
additional_data_length, plaintext,
|
additional_data_length, plaintext,
|
||||||
ciphertext, sizeof( tag ), tag );
|
ciphertext, sizeof( tag ), tag );
|
||||||
|
@ -1552,9 +1553,10 @@ psa_status_t psa_aead_encrypt( psa_key_slot_t key,
|
||||||
return( mbedtls_to_psa_error( ret ) );
|
return( mbedtls_to_psa_error( ret ) );
|
||||||
}
|
}
|
||||||
ret = mbedtls_ccm_encrypt_and_tag( &ccm, plaintext_length,
|
ret = mbedtls_ccm_encrypt_and_tag( &ccm, plaintext_length,
|
||||||
nonce , nonce_length, additional_data,
|
nonce, nonce_length, additional_data,
|
||||||
additional_data_length,
|
additional_data_length,
|
||||||
plaintext, ciphertext, tag, sizeof( tag ) );
|
plaintext, ciphertext,
|
||||||
|
tag, sizeof( tag ) );
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
{
|
{
|
||||||
mbedtls_ccm_free( &ccm );
|
mbedtls_ccm_free( &ccm );
|
||||||
|
@ -1629,9 +1631,10 @@ psa_status_t psa_aead_decrypt( psa_key_slot_t key,
|
||||||
return( mbedtls_to_psa_error( ret ) );
|
return( mbedtls_to_psa_error( ret ) );
|
||||||
}
|
}
|
||||||
ret = mbedtls_gcm_crypt_and_tag( &gcm, MBEDTLS_GCM_DECRYPT,
|
ret = mbedtls_gcm_crypt_and_tag( &gcm, MBEDTLS_GCM_DECRYPT,
|
||||||
ciphertext_length, nonce , nonce_length,
|
ciphertext_length, nonce, nonce_length,
|
||||||
additional_data, additional_data_length,
|
additional_data, additional_data_length,
|
||||||
ciphertext, plaintext, sizeof( tag ), tag );
|
ciphertext, plaintext,
|
||||||
|
sizeof( tag ), tag );
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
{
|
{
|
||||||
mbedtls_gcm_free( &gcm );
|
mbedtls_gcm_free( &gcm );
|
||||||
|
@ -1657,8 +1660,8 @@ psa_status_t psa_aead_decrypt( psa_key_slot_t key,
|
||||||
return( mbedtls_to_psa_error( ret ) );
|
return( mbedtls_to_psa_error( ret ) );
|
||||||
}
|
}
|
||||||
ret = mbedtls_ccm_auth_decrypt( &ccm, ciphertext_length,
|
ret = mbedtls_ccm_auth_decrypt( &ccm, ciphertext_length,
|
||||||
nonce , nonce_length, additional_data,
|
nonce, nonce_length, additional_data,
|
||||||
additional_data_length, ciphertext ,
|
additional_data_length, ciphertext,
|
||||||
plaintext, tag, sizeof( tag ) );
|
plaintext, tag, sizeof( tag ) );
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue