Change function signature indentation
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
parent
e9eeea3290
commit
bb8bf6649e
2 changed files with 100 additions and 95 deletions
|
@ -337,13 +337,12 @@ exit:
|
||||||
|
|
||||||
/* Set the key and algorithm for a multipart authenticated encryption
|
/* Set the key and algorithm for a multipart authenticated encryption
|
||||||
* operation. */
|
* operation. */
|
||||||
psa_status_t mbedtls_psa_aead_encrypt_setup( mbedtls_psa_aead_operation_t
|
psa_status_t mbedtls_psa_aead_encrypt_setup(
|
||||||
*operation,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
const psa_key_attributes_t
|
const psa_key_attributes_t *attributes,
|
||||||
*attributes,
|
const uint8_t *key_buffer,
|
||||||
const uint8_t *key_buffer,
|
size_t key_buffer_size,
|
||||||
size_t key_buffer_size,
|
psa_algorithm_t alg )
|
||||||
psa_algorithm_t alg )
|
|
||||||
{
|
{
|
||||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||||
|
|
||||||
|
@ -358,13 +357,12 @@ psa_status_t mbedtls_psa_aead_encrypt_setup( mbedtls_psa_aead_operation_t
|
||||||
|
|
||||||
/* Set the key and algorithm for a multipart authenticated decryption
|
/* Set the key and algorithm for a multipart authenticated decryption
|
||||||
* operation. */
|
* operation. */
|
||||||
psa_status_t mbedtls_psa_aead_decrypt_setup( mbedtls_psa_aead_operation_t
|
psa_status_t mbedtls_psa_aead_decrypt_setup(
|
||||||
*operation,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
const psa_key_attributes_t
|
const psa_key_attributes_t *attributes,
|
||||||
*attributes,
|
const uint8_t *key_buffer,
|
||||||
const uint8_t *key_buffer,
|
size_t key_buffer_size,
|
||||||
size_t key_buffer_size,
|
psa_algorithm_t alg )
|
||||||
psa_algorithm_t alg )
|
|
||||||
{
|
{
|
||||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||||
|
|
||||||
|
@ -380,10 +378,10 @@ psa_status_t mbedtls_psa_aead_decrypt_setup( mbedtls_psa_aead_operation_t
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set a nonce for the multipart AEAD operation*/
|
/* Set a nonce for the multipart AEAD operation*/
|
||||||
psa_status_t mbedtls_psa_aead_set_nonce( mbedtls_psa_aead_operation_t
|
psa_status_t mbedtls_psa_aead_set_nonce(
|
||||||
*operation,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
const uint8_t *nonce,
|
const uint8_t *nonce,
|
||||||
size_t nonce_length )
|
size_t nonce_length )
|
||||||
{
|
{
|
||||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||||
|
|
||||||
|
@ -439,10 +437,10 @@ psa_status_t mbedtls_psa_aead_set_nonce( mbedtls_psa_aead_operation_t
|
||||||
return( status );
|
return( status );
|
||||||
}
|
}
|
||||||
/* Declare the lengths of the message and additional data for AEAD. */
|
/* Declare the lengths of the message and additional data for AEAD. */
|
||||||
psa_status_t mbedtls_psa_aead_set_lengths( mbedtls_psa_aead_operation_t
|
psa_status_t mbedtls_psa_aead_set_lengths(
|
||||||
*operation,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
size_t ad_length,
|
size_t ad_length,
|
||||||
size_t plaintext_length )
|
size_t plaintext_length )
|
||||||
{
|
{
|
||||||
|
|
||||||
#if defined(MBEDTLS_PSA_BUILTIN_ALG_GCM)
|
#if defined(MBEDTLS_PSA_BUILTIN_ALG_GCM)
|
||||||
|
@ -491,10 +489,10 @@ psa_status_t mbedtls_psa_aead_set_lengths( mbedtls_psa_aead_operation_t
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pass additional data to an active multipart AEAD operation. */
|
/* Pass additional data to an active multipart AEAD operation. */
|
||||||
psa_status_t mbedtls_psa_aead_update_ad( mbedtls_psa_aead_operation_t
|
psa_status_t mbedtls_psa_aead_update_ad(
|
||||||
*operation,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
const uint8_t *input,
|
const uint8_t *input,
|
||||||
size_t input_length )
|
size_t input_length )
|
||||||
{
|
{
|
||||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||||
|
|
||||||
|
@ -574,12 +572,13 @@ psa_status_t mbedtls_psa_aead_update_ad( mbedtls_psa_aead_operation_t
|
||||||
|
|
||||||
/* Encrypt or decrypt a message fragment in an active multipart AEAD
|
/* Encrypt or decrypt a message fragment in an active multipart AEAD
|
||||||
* operation.*/
|
* operation.*/
|
||||||
psa_status_t mbedtls_psa_aead_update( mbedtls_psa_aead_operation_t *operation,
|
psa_status_t mbedtls_psa_aead_update(
|
||||||
const uint8_t *input,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
size_t input_length,
|
const uint8_t *input,
|
||||||
uint8_t *output,
|
size_t input_length,
|
||||||
size_t output_size,
|
uint8_t *output,
|
||||||
size_t *output_length )
|
size_t output_size,
|
||||||
|
size_t *output_length )
|
||||||
{
|
{
|
||||||
size_t update_output_length;
|
size_t update_output_length;
|
||||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||||
|
@ -719,10 +718,10 @@ psa_status_t mbedtls_psa_aead_update( mbedtls_psa_aead_operation_t *operation,
|
||||||
|
|
||||||
/* Common checks for both mbedtls_psa_aead_finish() and
|
/* Common checks for both mbedtls_psa_aead_finish() and
|
||||||
mbedtls_psa_aead_verify() */
|
mbedtls_psa_aead_verify() */
|
||||||
static psa_status_t mbedtls_psa_aead_finish_checks( mbedtls_psa_aead_operation_t
|
static psa_status_t mbedtls_psa_aead_finish_checks(
|
||||||
*operation,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
size_t output_size,
|
size_t output_size,
|
||||||
size_t tag_size )
|
size_t tag_size )
|
||||||
{
|
{
|
||||||
size_t finish_output_size;
|
size_t finish_output_size;
|
||||||
|
|
||||||
|
@ -744,13 +743,14 @@ static psa_status_t mbedtls_psa_aead_finish_checks( mbedtls_psa_aead_operation_t
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Finish encrypting a message in a multipart AEAD operation. */
|
/* Finish encrypting a message in a multipart AEAD operation. */
|
||||||
psa_status_t mbedtls_psa_aead_finish( mbedtls_psa_aead_operation_t *operation,
|
psa_status_t mbedtls_psa_aead_finish(
|
||||||
uint8_t *ciphertext,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
size_t ciphertext_size,
|
uint8_t *ciphertext,
|
||||||
size_t *ciphertext_length,
|
size_t ciphertext_size,
|
||||||
uint8_t *tag,
|
size_t *ciphertext_length,
|
||||||
size_t tag_size,
|
uint8_t *tag,
|
||||||
size_t *tag_length )
|
size_t tag_size,
|
||||||
|
size_t *tag_length )
|
||||||
{
|
{
|
||||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||||
size_t finish_output_size = 0;
|
size_t finish_output_size = 0;
|
||||||
|
@ -808,12 +808,13 @@ psa_status_t mbedtls_psa_aead_finish( mbedtls_psa_aead_operation_t *operation,
|
||||||
|
|
||||||
/* Finish authenticating and decrypting a message in a multipart AEAD
|
/* Finish authenticating and decrypting a message in a multipart AEAD
|
||||||
* operation.*/
|
* operation.*/
|
||||||
psa_status_t mbedtls_psa_aead_verify( mbedtls_psa_aead_operation_t *operation,
|
psa_status_t mbedtls_psa_aead_verify(
|
||||||
uint8_t *plaintext,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
size_t plaintext_size,
|
uint8_t *plaintext,
|
||||||
size_t *plaintext_length,
|
size_t plaintext_size,
|
||||||
const uint8_t *tag,
|
size_t *plaintext_length,
|
||||||
size_t tag_length )
|
const uint8_t *tag,
|
||||||
|
size_t tag_length )
|
||||||
{
|
{
|
||||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||||
|
@ -911,7 +912,8 @@ psa_status_t mbedtls_psa_aead_verify( mbedtls_psa_aead_operation_t *operation,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Abort an AEAD operation */
|
/* Abort an AEAD operation */
|
||||||
psa_status_t mbedtls_psa_aead_abort( mbedtls_psa_aead_operation_t *operation )
|
psa_status_t mbedtls_psa_aead_abort(
|
||||||
|
mbedtls_psa_aead_operation_t *operation )
|
||||||
{
|
{
|
||||||
switch( operation->alg )
|
switch( operation->alg )
|
||||||
{
|
{
|
||||||
|
|
|
@ -185,13 +185,12 @@ psa_status_t mbedtls_psa_aead_decrypt(
|
||||||
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY
|
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY
|
||||||
* Failed to allocate memory for key material
|
* Failed to allocate memory for key material
|
||||||
*/
|
*/
|
||||||
psa_status_t mbedtls_psa_aead_encrypt_setup(mbedtls_psa_aead_operation_t
|
psa_status_t mbedtls_psa_aead_encrypt_setup(
|
||||||
*operation,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
const psa_key_attributes_t
|
const psa_key_attributes_t *attributes,
|
||||||
*attributes,
|
const uint8_t *key_buffer,
|
||||||
const uint8_t *key_buffer,
|
size_t key_buffer_size,
|
||||||
size_t key_buffer_size,
|
psa_algorithm_t alg );
|
||||||
psa_algorithm_t alg);
|
|
||||||
|
|
||||||
/** Set the key for a multipart authenticated decryption operation.
|
/** Set the key for a multipart authenticated decryption operation.
|
||||||
*
|
*
|
||||||
|
@ -230,13 +229,12 @@ psa_status_t mbedtls_psa_aead_encrypt_setup(mbedtls_psa_aead_operation_t
|
||||||
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY
|
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY
|
||||||
* Failed to allocate memory for key material
|
* Failed to allocate memory for key material
|
||||||
*/
|
*/
|
||||||
psa_status_t mbedtls_psa_aead_decrypt_setup(mbedtls_psa_aead_operation_t
|
psa_status_t mbedtls_psa_aead_decrypt_setup(
|
||||||
*operation,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
const psa_key_attributes_t
|
const psa_key_attributes_t *attributes,
|
||||||
*attributes,
|
const uint8_t *key_buffer,
|
||||||
const uint8_t *key_buffer,
|
size_t key_buffer_size,
|
||||||
size_t key_buffer_size,
|
psa_algorithm_t alg );
|
||||||
psa_algorithm_t alg);
|
|
||||||
|
|
||||||
/** Set the nonce for an authenticated encryption or decryption operation.
|
/** Set the nonce for an authenticated encryption or decryption operation.
|
||||||
*
|
*
|
||||||
|
@ -266,9 +264,10 @@ psa_status_t mbedtls_psa_aead_decrypt_setup(mbedtls_psa_aead_operation_t
|
||||||
* Algorithm previously set is not supported in this configuration of
|
* Algorithm previously set is not supported in this configuration of
|
||||||
* the library.
|
* the library.
|
||||||
*/
|
*/
|
||||||
psa_status_t mbedtls_psa_aead_set_nonce(mbedtls_psa_aead_operation_t *operation,
|
psa_status_t mbedtls_psa_aead_set_nonce(
|
||||||
const uint8_t *nonce,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
size_t nonce_length);
|
const uint8_t *nonce,
|
||||||
|
size_t nonce_length );
|
||||||
|
|
||||||
/** Declare the lengths of the message and additional data for AEAD.
|
/** Declare the lengths of the message and additional data for AEAD.
|
||||||
*
|
*
|
||||||
|
@ -307,10 +306,10 @@ psa_status_t mbedtls_psa_aead_set_nonce(mbedtls_psa_aead_operation_t *operation,
|
||||||
* Algorithm previously set is not supported in this configuration of
|
* Algorithm previously set is not supported in this configuration of
|
||||||
* the library.
|
* the library.
|
||||||
*/
|
*/
|
||||||
psa_status_t mbedtls_psa_aead_set_lengths(mbedtls_psa_aead_operation_t
|
psa_status_t mbedtls_psa_aead_set_lengths(
|
||||||
*operation,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
size_t ad_length,
|
size_t ad_length,
|
||||||
size_t plaintext_length);
|
size_t plaintext_length );
|
||||||
|
|
||||||
/** Pass additional data to an active AEAD operation.
|
/** Pass additional data to an active AEAD operation.
|
||||||
*
|
*
|
||||||
|
@ -361,9 +360,10 @@ psa_status_t mbedtls_psa_aead_set_lengths(mbedtls_psa_aead_operation_t
|
||||||
* Algorithm previously set is not supported in this configuration of
|
* Algorithm previously set is not supported in this configuration of
|
||||||
* the library.
|
* the library.
|
||||||
*/
|
*/
|
||||||
psa_status_t mbedtls_psa_aead_update_ad(mbedtls_psa_aead_operation_t *operation,
|
psa_status_t mbedtls_psa_aead_update_ad(
|
||||||
const uint8_t *input,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
size_t input_length);
|
const uint8_t *input,
|
||||||
|
size_t input_length );
|
||||||
|
|
||||||
/** Encrypt or decrypt a message fragment in an active AEAD operation.
|
/** Encrypt or decrypt a message fragment in an active AEAD operation.
|
||||||
*
|
*
|
||||||
|
@ -437,12 +437,13 @@ psa_status_t mbedtls_psa_aead_update_ad(mbedtls_psa_aead_operation_t *operation,
|
||||||
* (CCM only) Unable to allocate memory for the tag or the body
|
* (CCM only) Unable to allocate memory for the tag or the body
|
||||||
|
|
||||||
*/
|
*/
|
||||||
psa_status_t mbedtls_psa_aead_update(mbedtls_psa_aead_operation_t *operation,
|
psa_status_t mbedtls_psa_aead_update(
|
||||||
const uint8_t *input,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
size_t input_length,
|
const uint8_t *input,
|
||||||
uint8_t *output,
|
size_t input_length,
|
||||||
size_t output_size,
|
uint8_t *output,
|
||||||
size_t *output_length);
|
size_t output_size,
|
||||||
|
size_t *output_length );
|
||||||
|
|
||||||
/** Finish encrypting a message in an AEAD operation.
|
/** Finish encrypting a message in an AEAD operation.
|
||||||
*
|
*
|
||||||
|
@ -521,13 +522,14 @@ psa_status_t mbedtls_psa_aead_update(mbedtls_psa_aead_operation_t *operation,
|
||||||
* less than the plaintext length that was previously
|
* less than the plaintext length that was previously
|
||||||
* specified with mbedtls_psa_aead_set_lengths().
|
* specified with mbedtls_psa_aead_set_lengths().
|
||||||
*/
|
*/
|
||||||
psa_status_t mbedtls_psa_aead_finish(mbedtls_psa_aead_operation_t *operation,
|
psa_status_t mbedtls_psa_aead_finish(
|
||||||
uint8_t *ciphertext,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
size_t ciphertext_size,
|
uint8_t *ciphertext,
|
||||||
size_t *ciphertext_length,
|
size_t ciphertext_size,
|
||||||
uint8_t *tag,
|
size_t *ciphertext_length,
|
||||||
size_t tag_size,
|
uint8_t *tag,
|
||||||
size_t *tag_length);
|
size_t tag_size,
|
||||||
|
size_t *tag_length );
|
||||||
|
|
||||||
/** Finish authenticating and decrypting a message in an AEAD operation.
|
/** Finish authenticating and decrypting a message in an AEAD operation.
|
||||||
*
|
*
|
||||||
|
@ -605,12 +607,13 @@ psa_status_t mbedtls_psa_aead_finish(mbedtls_psa_aead_operation_t *operation,
|
||||||
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY
|
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY
|
||||||
* (CCM only) Failed to allocate temporary buffer
|
* (CCM only) Failed to allocate temporary buffer
|
||||||
*/
|
*/
|
||||||
psa_status_t mbedtls_psa_aead_verify(mbedtls_psa_aead_operation_t *operation,
|
psa_status_t mbedtls_psa_aead_verify(
|
||||||
uint8_t *plaintext,
|
mbedtls_psa_aead_operation_t *operation,
|
||||||
size_t plaintext_size,
|
uint8_t *plaintext,
|
||||||
size_t *plaintext_length,
|
size_t plaintext_size,
|
||||||
const uint8_t *tag,
|
size_t *plaintext_length,
|
||||||
size_t tag_length);
|
const uint8_t *tag,
|
||||||
|
size_t tag_length );
|
||||||
|
|
||||||
/** Abort an AEAD operation.
|
/** Abort an AEAD operation.
|
||||||
*
|
*
|
||||||
|
@ -636,7 +639,7 @@ psa_status_t mbedtls_psa_aead_verify(mbedtls_psa_aead_operation_t *operation,
|
||||||
* \retval #PSA_SUCCESS
|
* \retval #PSA_SUCCESS
|
||||||
* Success.
|
* Success.
|
||||||
*/
|
*/
|
||||||
psa_status_t mbedtls_psa_aead_abort(mbedtls_psa_aead_operation_t *operation);
|
psa_status_t mbedtls_psa_aead_abort(
|
||||||
|
mbedtls_psa_aead_operation_t *operation );
|
||||||
|
|
||||||
#endif /* PSA_CRYPTO_AEAD */
|
#endif /* PSA_CRYPTO_AEAD */
|
||||||
|
|
Loading…
Reference in a new issue