Internalise functions flagged as internal

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
Thomas Daubney 2024-07-25 10:39:47 +01:00
parent 2f1bebd551
commit 3e0273f41a
10 changed files with 5 additions and 80 deletions

View File

@ -125,22 +125,6 @@ int mbedtls_md5_update(mbedtls_md5_context *ctx,
int mbedtls_md5_finish(mbedtls_md5_context *ctx, int mbedtls_md5_finish(mbedtls_md5_context *ctx,
unsigned char output[16]); unsigned char output[16]);
/**
* \brief MD5 process data block (internal use only)
*
* \param ctx MD5 context
* \param data buffer holding one block of data
*
* \return 0 if successful
*
* \warning MD5 is considered a weak message digest and its use
* constitutes a security risk. We recommend considering
* stronger message digests instead.
*
*/
int mbedtls_internal_md5_process(mbedtls_md5_context *ctx,
const unsigned char data[64]);
/** /**
* \brief Output = MD5( input buffer ) * \brief Output = MD5( input buffer )
* *

View File

@ -86,17 +86,6 @@ int mbedtls_ripemd160_update(mbedtls_ripemd160_context *ctx,
int mbedtls_ripemd160_finish(mbedtls_ripemd160_context *ctx, int mbedtls_ripemd160_finish(mbedtls_ripemd160_context *ctx,
unsigned char output[20]); unsigned char output[20]);
/**
* \brief RIPEMD-160 process data block (internal use only)
*
* \param ctx RIPEMD-160 context
* \param data buffer holding one block of data
*
* \return 0 if successful
*/
int mbedtls_internal_ripemd160_process(mbedtls_ripemd160_context *ctx,
const unsigned char data[64]);
/** /**
* \brief Output = RIPEMD-160( input buffer ) * \brief Output = RIPEMD-160( input buffer )
* *

View File

@ -142,24 +142,6 @@ int mbedtls_sha1_update(mbedtls_sha1_context *ctx,
int mbedtls_sha1_finish(mbedtls_sha1_context *ctx, int mbedtls_sha1_finish(mbedtls_sha1_context *ctx,
unsigned char output[20]); unsigned char output[20]);
/**
* \brief SHA-1 process data block (internal use only).
*
* \warning SHA-1 is considered a weak message digest and its use
* constitutes a security risk. We recommend considering
* stronger message digests instead.
*
* \param ctx The SHA-1 context to use. This must be initialized.
* \param data The data block being processed. This must be a
* readable buffer of length \c 64 Bytes.
*
* \return \c 0 on success.
* \return A negative error code on failure.
*
*/
int mbedtls_internal_sha1_process(mbedtls_sha1_context *ctx,
const unsigned char data[64]);
/** /**
* \brief This function calculates the SHA-1 checksum of a buffer. * \brief This function calculates the SHA-1 checksum of a buffer.
* *

View File

@ -119,21 +119,6 @@ int mbedtls_sha256_update(mbedtls_sha256_context *ctx,
int mbedtls_sha256_finish(mbedtls_sha256_context *ctx, int mbedtls_sha256_finish(mbedtls_sha256_context *ctx,
unsigned char *output); unsigned char *output);
/**
* \brief This function processes a single data block within
* the ongoing SHA-256 computation. This function is for
* internal use only.
*
* \param ctx The SHA-256 context. This must be initialized.
* \param data The buffer holding one block of data. This must
* be a readable buffer of length \c 64 Bytes.
*
* \return \c 0 on success.
* \return A negative error code on failure.
*/
int mbedtls_internal_sha256_process(mbedtls_sha256_context *ctx,
const unsigned char data[64]);
/** /**
* \brief This function calculates the SHA-224 or SHA-256 * \brief This function calculates the SHA-224 or SHA-256
* checksum of a buffer. * checksum of a buffer.

View File

@ -120,21 +120,6 @@ int mbedtls_sha512_update(mbedtls_sha512_context *ctx,
int mbedtls_sha512_finish(mbedtls_sha512_context *ctx, int mbedtls_sha512_finish(mbedtls_sha512_context *ctx,
unsigned char *output); unsigned char *output);
/**
* \brief This function processes a single data block within
* the ongoing SHA-512 computation.
* This function is for internal use only.
*
* \param ctx The SHA-512 context. This must be initialized.
* \param data The buffer holding one block of data. This
* must be a readable buffer of length \c 128 Bytes.
*
* \return \c 0 on success.
* \return A negative error code on failure.
*/
int mbedtls_internal_sha512_process(mbedtls_sha512_context *ctx,
const unsigned char data[128]);
/** /**
* \brief This function calculates the SHA-512 or SHA-384 * \brief This function calculates the SHA-512 or SHA-384
* checksum of a buffer. * checksum of a buffer.

View File

@ -58,7 +58,7 @@ int mbedtls_md5_starts(mbedtls_md5_context *ctx)
return 0; return 0;
} }
int mbedtls_internal_md5_process(mbedtls_md5_context *ctx, static int mbedtls_internal_md5_process(mbedtls_md5_context *ctx,
const unsigned char data[64]) const unsigned char data[64])
{ {
struct { struct {

View File

@ -62,7 +62,7 @@ int mbedtls_ripemd160_starts(mbedtls_ripemd160_context *ctx)
/* /*
* Process one block * Process one block
*/ */
int mbedtls_internal_ripemd160_process(mbedtls_ripemd160_context *ctx, static int mbedtls_internal_ripemd160_process(mbedtls_ripemd160_context *ctx,
const unsigned char data[64]) const unsigned char data[64])
{ {
struct { struct {

View File

@ -59,7 +59,7 @@ int mbedtls_sha1_starts(mbedtls_sha1_context *ctx)
return 0; return 0;
} }
int mbedtls_internal_sha1_process(mbedtls_sha1_context *ctx, static int mbedtls_internal_sha1_process(mbedtls_sha1_context *ctx,
const unsigned char data[64]) const unsigned char data[64])
{ {
struct { struct {

View File

@ -617,7 +617,7 @@ static size_t mbedtls_internal_sha256_process_many(mbedtls_sha256_context *ctx,
} }
} }
int mbedtls_internal_sha256_process(mbedtls_sha256_context *ctx, static int mbedtls_internal_sha256_process(mbedtls_sha256_context *ctx,
const unsigned char data[SHA256_BLOCK_SIZE]) const unsigned char data[SHA256_BLOCK_SIZE])
{ {
if (mbedtls_a64_crypto_sha256_has_support()) { if (mbedtls_a64_crypto_sha256_has_support()) {

View File

@ -737,7 +737,7 @@ static size_t mbedtls_internal_sha512_process_many(mbedtls_sha512_context *ctx,
} }
} }
int mbedtls_internal_sha512_process(mbedtls_sha512_context *ctx, static int mbedtls_internal_sha512_process(mbedtls_sha512_context *ctx,
const unsigned char data[SHA512_BLOCK_SIZE]) const unsigned char data[SHA512_BLOCK_SIZE])
{ {
if (mbedtls_a64_crypto_sha512_has_support()) { if (mbedtls_a64_crypto_sha512_has_support()) {