diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 194d986b2..86b84bf19 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -5841,8 +5841,8 @@ psa_status_t psa_key_agreement_raw_builtin( const psa_key_attributes_t *attribut /** Internal function for raw key agreement * Calls the driver wrapper which will hand off key agreement task - * to the driver's implementation if a driver is present. - * Fallback specified in the driver wrapper is built-in raw key agreement + * to the driver's implementation if a driver is present. + * Fallback specified in the driver wrapper is built-in raw key agreement * (psa_key_agreement_raw_builtin). */ static psa_status_t psa_key_agreement_raw_internal( psa_algorithm_t alg, @@ -5861,9 +5861,9 @@ static psa_status_t psa_key_agreement_raw_internal( psa_algorithm_t alg, }; return( psa_driver_wrapper_key_agreement( &attributes, private_key->key.data, - private_key->key.bytes, - alg, peer_key, peer_key_length, - shared_secret, shared_secret_size, + private_key->key.bytes, + alg, peer_key, peer_key_length, + shared_secret, shared_secret_size, shared_secret_length ) ); } diff --git a/library/psa_crypto_core.h b/library/psa_crypto_core.h index 5bfdfb39e..63d9b2916 100644 --- a/library/psa_crypto_core.h +++ b/library/psa_crypto_core.h @@ -548,7 +548,7 @@ psa_status_t psa_verify_hash_builtin( psa_status_t psa_validate_unstructured_key_bit_size( psa_key_type_t type, size_t bits ); -/** Perform a key agreement and return the raw shared secret, using +/** Perform a key agreement and return the raw shared secret, using built-in raw key agreement functions. * * \note The signature of this function is that of a PSA driver @@ -556,24 +556,24 @@ psa_status_t psa_validate_unstructured_key_bit_size( psa_key_type_t type, * entry point as defined in the PSA driver interface specification for * transparent drivers. * - * \param[in] attributes The attributes of the key to use for - * the operation. - * \param[in] key_buffer The buffer containing the private key - * context. - * \param[in] key_buffer_size Size of the \p key_buffer buffer in - * bytes. - * \param[in] alg A key agreement algorithm that is - * compatible with the type of the key. - * \param[in] peer_key The buffer containing the key context - * of the peer's public key. - * \param[in] peer_key_length Size of the \p peer_key buffer in - * bytes. - * \param[out] shared_secret The buffer to which the shared secret - * is to be written. - * \param[in] shared_secret_size Size of the \p shared_secret buffer in - * bytes. - * \param[out] shared_secret_length On success, the number of bytes that - * make up the returned shared secret. + * \param[in] attributes The attributes of the key to use for the + * operation. + * \param[in] key_buffer The buffer containing the private key + * context. + * \param[in] key_buffer_size Size of the \p key_buffer buffer in + * bytes. + * \param[in] alg A key agreement algorithm that is + * compatible with the type of the key. + * \param[in] peer_key The buffer containing the key context + * of the peer's public key. + * \param[in] peer_key_length Size of the \p peer_key buffer in + * bytes. + * \param[out] shared_secret The buffer to which the shared secret + * is to be written. + * \param[in] shared_secret_size Size of the \p shared_secret buffer in + * bytes. + * \param[out] shared_secret_length On success, the number of bytes that make + * up the returned shared secret. * \retval #PSA_SUCCESS * Success. Shared secret successfully calculated. * \retval #PSA_ERROR_INVALID_HANDLE @@ -594,7 +594,7 @@ psa_status_t psa_validate_unstructured_key_bit_size( psa_key_type_t type, * \retval #PSA_ERROR_STORAGE_FAILURE * \retval #PSA_ERROR_BAD_STATE */ -psa_status_t psa_key_agreement_raw_builtin( +psa_status_t psa_key_agreement_raw_builtin( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, @@ -604,5 +604,5 @@ psa_status_t psa_key_agreement_raw_builtin( uint8_t *shared_secret, size_t shared_secret_size, size_t *shared_secret_length ); - + #endif /* PSA_CRYPTO_CORE_H */ diff --git a/scripts/data_files/driver_templates/psa_crypto_driver_wrappers.c.jinja b/scripts/data_files/driver_templates/psa_crypto_driver_wrappers.c.jinja index 734b6b686..bef519701 100644 --- a/scripts/data_files/driver_templates/psa_crypto_driver_wrappers.c.jinja +++ b/scripts/data_files/driver_templates/psa_crypto_driver_wrappers.c.jinja @@ -2501,7 +2501,7 @@ psa_status_t psa_driver_wrapper_key_agreement( shared_secret_size, shared_secret_length ); return( status ); - + default: (void) attributes; (void) key_buffer; @@ -2512,7 +2512,7 @@ psa_status_t psa_driver_wrapper_key_agreement( (void) shared_secret_size; (void) shared_secret_length; return( PSA_ERROR_NOT_SUPPORTED ); - + } } diff --git a/tests/include/test/drivers/key_agreement.h b/tests/include/test/drivers/key_agreement.h index 57de81ab1..b04bc5985 100644 --- a/tests/include/test/drivers/key_agreement.h +++ b/tests/include/test/drivers/key_agreement.h @@ -68,4 +68,4 @@ psa_status_t mbedtls_test_opaque_key_agreement( size_t *shared_secret_length ); #endif /*PSA_CRYPTO_DRIVER_TEST */ -#endif /* PSA_CRYPTO_TEST_DRIVERS_KEY_AGREEMENT_H */ \ No newline at end of file +#endif /* PSA_CRYPTO_TEST_DRIVERS_KEY_AGREEMENT_H */ diff --git a/tests/src/drivers/test_driver_key_agreement.c b/tests/src/drivers/test_driver_key_agreement.c index 40681c315..884899ff2 100644 --- a/tests/src/drivers/test_driver_key_agreement.c +++ b/tests/src/drivers/test_driver_key_agreement.c @@ -58,7 +58,7 @@ psa_status_t mbedtls_test_transparent_key_agreement( return( PSA_SUCCESS ); } - return( psa_key_agreement_raw_builtin( + return( psa_key_agreement_raw_builtin( attributes, key_buffer, key_buffer_size, @@ -70,4 +70,4 @@ psa_status_t mbedtls_test_transparent_key_agreement( shared_secret_length ) ); } -#endif /* MBEDTLS_PSA_CRYPTO_DRIVERS && PSA_CRYPTO_DRIVER_TEST */ \ No newline at end of file +#endif /* MBEDTLS_PSA_CRYPTO_DRIVERS && PSA_CRYPTO_DRIVER_TEST */