From b2b64d36421a081f30c34db3140b3845874a78d0 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 14 Dec 2020 16:43:58 +0100 Subject: [PATCH] Rename psa_crypto_random.h to psa_crypto_random_impl.h Make it clear that this is an abstraction of the random generator abstraction, and not an abstraction of the PSA random generator. mbedtls_psa_get_random and MBEDTLS_PSA_RANDOM_STATE are public-facing definitions and will be moved in a subsequent commit. Signed-off-by: Gilles Peskine --- library/psa_crypto.c | 4 ++-- .../{psa_crypto_random.h => psa_crypto_random_impl.h} | 10 +++++----- tests/suites/test_suite_psa_crypto_init.function | 2 +- visualc/VS2010/mbedTLS.vcxproj | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) rename library/{psa_crypto_random.h => psa_crypto_random_impl.h} (96%) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 288e0717e..79b0633fa 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -40,7 +40,7 @@ * stored keys. */ #include "psa_crypto_storage.h" -#include "psa_crypto_random.h" +#include "psa_crypto_random_impl.h" #include #include @@ -6415,7 +6415,7 @@ psa_status_t psa_generate_random( uint8_t *output, /* Wrapper function allowing the classic API to use the PSA RNG. * In the non-external case, mbedtls_psa_get_random is defined - * as a constant function pointer in psa_crypto_random.h. + * as a constant function pointer in psa_crypto_random_impl.h. */ #if defined (MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) int mbedtls_psa_get_random( void *p_rng, diff --git a/library/psa_crypto_random.h b/library/psa_crypto_random_impl.h similarity index 96% rename from library/psa_crypto_random.h rename to library/psa_crypto_random_impl.h index 2482d6bc2..6b445c62f 100644 --- a/library/psa_crypto_random.h +++ b/library/psa_crypto_random_impl.h @@ -1,6 +1,6 @@ -/** \file psa_crypto_random.h +/** \file psa_crypto_random_impl.h * - * \brief PSA crypto random generator abstraction. + * \brief PSA crypto random generator implementation abstraction. */ /* * Copyright The Mbed TLS Contributors @@ -19,8 +19,8 @@ * limitations under the License. */ -#ifndef PSA_CRYPTO_RANDOM_H -#define PSA_CRYPTO_RANDOM_H +#ifndef PSA_CRYPTO_RANDOM_IMPL_H +#define PSA_CRYPTO_RANDOM_IMPL_H #if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) @@ -205,4 +205,4 @@ static inline int mbedtls_psa_drbg_seed( #endif /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */ -#endif /* PSA_CRYPTO_RANDOM_H */ +#endif /* PSA_CRYPTO_RANDOM_IMPL_H */ diff --git a/tests/suites/test_suite_psa_crypto_init.function b/tests/suites/test_suite_psa_crypto_init.function index 16e44c7af..e6097bb27 100644 --- a/tests/suites/test_suite_psa_crypto_init.function +++ b/tests/suites/test_suite_psa_crypto_init.function @@ -11,7 +11,7 @@ #define ENTROPY_MIN_NV_SEED_SIZE \ MAX(MBEDTLS_ENTROPY_MIN_PLATFORM, MBEDTLS_ENTROPY_BLOCK_SIZE) -#include "psa_crypto_random.h" +#include "psa_crypto_random_impl.h" #if defined(MBEDTLS_PSA_HMAC_DRBG_MD_TYPE) /* PSA crypto uses the HMAC_DRBG module. It reads from the entropy source twice: * once for the initial entropy and once for a nonce. The nonce length is diff --git a/visualc/VS2010/mbedTLS.vcxproj b/visualc/VS2010/mbedTLS.vcxproj index 98b8d66f6..ee6d28dc0 100644 --- a/visualc/VS2010/mbedTLS.vcxproj +++ b/visualc/VS2010/mbedTLS.vcxproj @@ -251,7 +251,7 @@ - +