From ba864848e7dd6f5807092faa17e9a4de27d0e66e Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Tue, 1 Nov 2022 16:40:40 +0000 Subject: [PATCH 1/3] Remove duplicate function prototype Signed-off-by: Dave Rodgman --- library/psa_crypto_cipher.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/library/psa_crypto_cipher.h b/library/psa_crypto_cipher.h index fae98473c..e5fe23bb3 100644 --- a/library/psa_crypto_cipher.h +++ b/library/psa_crypto_cipher.h @@ -24,22 +24,6 @@ #include #include -/** Get Mbed TLS cipher information given the cipher algorithm PSA identifier - * as well as the PSA type and size of the key to be used with the cipher - * algorithm. - * - * \param alg PSA cipher algorithm identifier - * \param key_type PSA key type - * \param key_bits Size of the key in bits - * \param[out] cipher_id Mbed TLS cipher algorithm identifier - * - * \return The Mbed TLS cipher information of the cipher algorithm. - * \c NULL if the PSA cipher algorithm is not supported. - */ -const mbedtls_cipher_info_t *mbedtls_cipher_info_from_psa( - psa_algorithm_t alg, psa_key_type_t key_type, size_t key_bits, - mbedtls_cipher_id_t *cipher_id ); - /** * \brief Set the key for a multipart symmetric encryption operation. * From 1630447eed7e2023222db1efdb92acd5062d6112 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Wed, 2 Nov 2022 09:25:38 +0000 Subject: [PATCH 2/3] Move declaration of mbedtls_cipher_info_from_psa into psa_crypto_cipher.h Signed-off-by: Dave Rodgman --- library/psa_crypto_aead.c | 1 + library/psa_crypto_cipher.h | 16 ++++++++++++++++ library/psa_crypto_core.h | 16 ---------------- library/psa_crypto_mac.c | 1 + 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/library/psa_crypto_aead.c b/library/psa_crypto_aead.c index 48969b3a3..730ef9555 100644 --- a/library/psa_crypto_aead.c +++ b/library/psa_crypto_aead.c @@ -24,6 +24,7 @@ #include "psa_crypto_aead.h" #include "psa_crypto_core.h" +#include "psa_crypto_cipher.h" #include #include "mbedtls/platform.h" diff --git a/library/psa_crypto_cipher.h b/library/psa_crypto_cipher.h index e5fe23bb3..fae98473c 100644 --- a/library/psa_crypto_cipher.h +++ b/library/psa_crypto_cipher.h @@ -24,6 +24,22 @@ #include #include +/** Get Mbed TLS cipher information given the cipher algorithm PSA identifier + * as well as the PSA type and size of the key to be used with the cipher + * algorithm. + * + * \param alg PSA cipher algorithm identifier + * \param key_type PSA key type + * \param key_bits Size of the key in bits + * \param[out] cipher_id Mbed TLS cipher algorithm identifier + * + * \return The Mbed TLS cipher information of the cipher algorithm. + * \c NULL if the PSA cipher algorithm is not supported. + */ +const mbedtls_cipher_info_t *mbedtls_cipher_info_from_psa( + psa_algorithm_t alg, psa_key_type_t key_type, size_t key_bits, + mbedtls_cipher_id_t *cipher_id ); + /** * \brief Set the key for a multipart symmetric encryption operation. * diff --git a/library/psa_crypto_core.h b/library/psa_crypto_core.h index 8c91b04d0..98638481c 100644 --- a/library/psa_crypto_core.h +++ b/library/psa_crypto_core.h @@ -246,22 +246,6 @@ psa_status_t psa_copy_key_material_into_slot( psa_key_slot_t *slot, */ psa_status_t mbedtls_to_psa_error( int ret ); -/** Get Mbed TLS cipher information given the cipher algorithm PSA identifier - * as well as the PSA type and size of the key to be used with the cipher - * algorithm. - * - * \param alg PSA cipher algorithm identifier - * \param key_type PSA key type - * \param key_bits Size of the key in bits - * \param[out] cipher_id Mbed TLS cipher algorithm identifier - * - * \return The Mbed TLS cipher information of the cipher algorithm. - * \c NULL if the PSA cipher algorithm is not supported. - */ -const mbedtls_cipher_info_t *mbedtls_cipher_info_from_psa( - psa_algorithm_t alg, psa_key_type_t key_type, size_t key_bits, - mbedtls_cipher_id_t *cipher_id ); - /** Import a key in binary format. * * \note The signature of this function is that of a PSA driver diff --git a/library/psa_crypto_mac.c b/library/psa_crypto_mac.c index dcf065a67..d771e23e1 100644 --- a/library/psa_crypto_mac.c +++ b/library/psa_crypto_mac.c @@ -24,6 +24,7 @@ #include #include "psa_crypto_core.h" +#include "psa_crypto_cipher.h" #include "psa_crypto_mac.h" #include From 0877dc8f558f4a199d714b86c2ccfd63f085ed2d Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Wed, 2 Nov 2022 09:29:35 +0000 Subject: [PATCH 3/3] Improve documentation for psa_crypto_cipher.h Signed-off-by: Dave Rodgman --- library/psa_crypto_cipher.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/psa_crypto_cipher.h b/library/psa_crypto_cipher.h index fae98473c..3bd5360cd 100644 --- a/library/psa_crypto_cipher.h +++ b/library/psa_crypto_cipher.h @@ -1,5 +1,5 @@ /* - * PSA cipher driver entry points + * PSA cipher driver entry points and associated auxiliary functions */ /* * Copyright The Mbed TLS Contributors