Merge pull request #5753 from tom-cosgrove-arm/fix-missing-prototypes-warnings-a64-sha256-sha512

Hide unnecessarily public functions in SHA-256 and SHA-512 A64 acceleration
This commit is contained in:
Gilles Peskine 2022-04-22 16:45:23 +02:00 committed by GitHub
commit 2f8c2a5fc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 1 deletions

View file

@ -357,6 +357,13 @@ static size_t mbedtls_internal_sha256_process_many_a64_crypto(
return( processed );
}
#if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT)
/*
* This function is for internal use only if we are building both C and A64
* versions, otherwise it is renamed to be the public mbedtls_internal_sha256_process()
*/
static
#endif
int mbedtls_internal_sha256_process_a64_crypto( mbedtls_sha256_context *ctx,
const unsigned char data[SHA256_BLOCK_SIZE] )
{
@ -402,6 +409,13 @@ int mbedtls_internal_sha256_process_a64_crypto( mbedtls_sha256_context *ctx,
(d) += local.temp1; (h) = local.temp1 + local.temp2; \
} while( 0 )
#if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT)
/*
* This function is for internal use only if we are building both C and A64
* versions, otherwise it is renamed to be the public mbedtls_internal_sha256_process()
*/
static
#endif
int mbedtls_internal_sha256_process_c( mbedtls_sha256_context *ctx,
const unsigned char data[SHA256_BLOCK_SIZE] )
{

View file

@ -527,6 +527,13 @@ static size_t mbedtls_internal_sha512_process_many_a64_crypto(
return( processed );
}
#if defined(MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT)
/*
* This function is for internal use only if we are building both C and A64
* versions, otherwise it is renamed to be the public mbedtls_internal_sha512_process()
*/
static
#endif
int mbedtls_internal_sha512_process_a64_crypto( mbedtls_sha512_context *ctx,
const unsigned char data[SHA512_BLOCK_SIZE] )
{
@ -545,6 +552,13 @@ int mbedtls_internal_sha512_process_a64_crypto( mbedtls_sha512_context *ctx,
#if !defined(MBEDTLS_SHA512_PROCESS_ALT) && !defined(MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY)
#if defined(MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT)
/*
* This function is for internal use only if we are building both C and A64
* versions, otherwise it is renamed to be the public mbedtls_internal_sha512_process()
*/
static
#endif
int mbedtls_internal_sha512_process_c( mbedtls_sha512_context *ctx,
const unsigned char data[SHA512_BLOCK_SIZE] )
{
@ -676,7 +690,7 @@ static size_t mbedtls_internal_sha512_process_many_c(
#if defined(MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT)
int mbedtls_a64_crypto_sha512_has_support( void )
static int mbedtls_a64_crypto_sha512_has_support( void )
{
static int done = 0;
static int supported = 0;