From af3f39c01c14b7c5b4be39a9f33b2b537dade93f Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Mon, 22 Aug 2022 09:06:32 +0100 Subject: [PATCH] Fix typos Co-authored-by: Tom Cosgrove <81633263+tom-cosgrove-arm@users.noreply.github.com> Co-authored-by: Werner Lewis Signed-off-by: Janos Follath --- library/bignum_core.c | 6 +++--- library/bignum_core.h | 14 +++++++------- library/bignum_mod_raw.c | 6 +++--- library/bignum_mod_raw.h | 4 ++-- library/constant_time_internal.h | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/library/bignum_core.c b/library/bignum_core.c index 9d1e29c23..68c49dfc1 100644 --- a/library/bignum_core.c +++ b/library/bignum_core.c @@ -229,7 +229,7 @@ int mbedtls_mpi_core_write_le( const mbedtls_mpi_uint *A, { bytes_to_copy = output_length; - /* The output outputfer is smaller than the allocated size of A. + /* The output buffer is smaller than the allocated size of A. * However A may fit if its leading bytes are zero. */ for( size_t i = bytes_to_copy; i < stored_bytes; i++ ) { @@ -263,7 +263,7 @@ int mbedtls_mpi_core_write_be( const mbedtls_mpi_uint *X, if( stored_bytes < output_length ) { - /* There is enough space in the output outputfer. Write initial + /* There is enough space in the output buffer. Write initial * null bytes and record the position at which to start * writing the significant bytes. In this case, the execution * trace of this function does not depend on the value of the @@ -274,7 +274,7 @@ int mbedtls_mpi_core_write_be( const mbedtls_mpi_uint *X, } else { - /* The output outputfer is smaller than the allocated size of X. + /* The output buffer is smaller than the allocated size of X. * However X may fit if its leading bytes are zero. */ bytes_to_copy = output_length; p = output; diff --git a/library/bignum_core.h b/library/bignum_core.h index c75be260c..37f361726 100644 --- a/library/bignum_core.h +++ b/library/bignum_core.h @@ -1,9 +1,9 @@ /** * Core bignum functions * - * This interface only should be used by the legacy bignum module (bignum.h) + * This interface should only be used by the legacy bignum module (bignum.h) * and the modular bignum modules (bignum_mod.c, bignum_mod_raw.c). All other - * modules should use the high level modular bignum interface (bignum_mod.h) + * modules should use the high-level modular bignum interface (bignum_mod.h) * or the legacy bignum interface (bignum.h). * * Copyright The Mbed TLS Contributors @@ -49,7 +49,7 @@ size_t mbedtls_mpi_core_clz( const mbedtls_mpi_uint a ); * * \return The number of bits in \p A. */ -size_t mbedtls_mpi_core_bitlen( const mbedtls_mpi_uint *A, size_t a_limbs ); +size_t mbedtls_mpi_core_bitlen( const mbedtls_mpi_uint *A, size_t A_limbs ); /** Convert a big-endian byte array aligned to the size of mbedtls_mpi_uint * into the storage form used by mbedtls_mpi. @@ -60,7 +60,7 @@ size_t mbedtls_mpi_core_bitlen( const mbedtls_mpi_uint *A, size_t a_limbs ); void mbedtls_mpi_core_bigendian_to_host( mbedtls_mpi_uint *A, size_t limbs ); -/** Import X from unsigned binary data, little endian. +/** Import X from unsigned binary data, little-endian. * * The MPI needs to have enough limbs to store the full value (including any * most significant zero bytes in the input). @@ -79,7 +79,7 @@ int mbedtls_mpi_core_read_le( mbedtls_mpi_uint *X, const unsigned char *input, size_t input_length ); -/** Import X from unsigned binary data, big endian. +/** Import X from unsigned binary data, big-endian. * * The MPI needs to have enough limbs to store the full value (including any * most significant zero bytes in the input). @@ -101,7 +101,7 @@ int mbedtls_mpi_core_read_be( mbedtls_mpi_uint *X, const unsigned char *input, size_t input_length ); -/** Export A into unsigned binary data, little endian. +/** Export A into unsigned binary data, little-endian. * * \note If \p output is shorter than \p A the export is still successful if the * value held in \p A fits in the buffer (that is, if enough of the most @@ -121,7 +121,7 @@ int mbedtls_mpi_core_write_le( const mbedtls_mpi_uint *A, unsigned char *output, size_t output_length ); -/** Export A into unsigned binary data, big endian. +/** Export A into unsigned binary data, big-endian. * * \note If \p output is shorter than \p A the export is still successful if the * value held in \p A fits in the buffer (that is, if enough of the most diff --git a/library/bignum_mod_raw.c b/library/bignum_mod_raw.c index 88311dd7b..8c89b2cdf 100644 --- a/library/bignum_mod_raw.c +++ b/library/bignum_mod_raw.c @@ -44,7 +44,7 @@ int mbedtls_mpi_mod_raw_read( mbedtls_mpi_uint *X, const mbedtls_mpi_mod_modulus *m, const unsigned char *input, - size_t input_lentgth ) + size_t input_length ) { int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; @@ -52,11 +52,11 @@ int mbedtls_mpi_mod_raw_read( mbedtls_mpi_uint *X, { case MBEDTLS_MPI_MOD_EXT_REP_LE: ret = mbedtls_mpi_core_read_le( X, m->limbs, - input, input_lentgth ); + input, input_length ); break; case MBEDTLS_MPI_MOD_EXT_REP_BE: ret = mbedtls_mpi_core_read_be( X, m->limbs, - input, input_lentgth ); + input, input_length ); break; default: return( MBEDTLS_ERR_MPI_BAD_INPUT_DATA ); diff --git a/library/bignum_mod_raw.h b/library/bignum_mod_raw.h index 4b2a51f88..7b3a0c177 100644 --- a/library/bignum_mod_raw.h +++ b/library/bignum_mod_raw.h @@ -1,9 +1,9 @@ /** * Low-level modular bignum functions * - * This interface only should be used by the higher level modular bignum + * This interface should only be used by the higher-level modular bignum * module (bignum_mod.c) and the ECP module (ecp.c, ecp_curves.c). All other - * modules should use the high level modular bignum interface (bignum_mod.h) + * modules should use the high-level modular bignum interface (bignum_mod.h) * or the legacy bignum interface (bignum.h). * * Copyright The Mbed TLS Contributors diff --git a/library/constant_time_internal.h b/library/constant_time_internal.h index a8518b4de..fc24ae59a 100644 --- a/library/constant_time_internal.h +++ b/library/constant_time_internal.h @@ -137,7 +137,7 @@ unsigned mbedtls_ct_mpi_uint_lt( const mbedtls_mpi_uint x, * with the same allocated length as \p B. * \param B The right-hand MPI. This must point to an array of limbs * with the same allocated length as \p A. - * \param limbs The number of limbs in \p A and \p B. + * \param limbs The number of limbs in \p A and \p B. * * \return The result of the comparison: * \c 1 if \p A is less than \p B.