Redo of PR#5345. Fixed spelling and typographical errors found by CodeSpell.
Signed-off-by: Shaun Case <warmsocks@gmail.com> Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
parent
5479f5321a
commit
8b0ecbccf4
78 changed files with 151 additions and 151 deletions
|
@ -1089,7 +1089,7 @@ typedef unsigned char mbedtls_be128[16];
|
|||
*
|
||||
* This function multiplies a field element by x in the polynomial field
|
||||
* representation. It uses 64-bit word operations to gain speed but compensates
|
||||
* for machine endianess and hence works correctly on both big and little
|
||||
* for machine endianness and hence works correctly on both big and little
|
||||
* endian machines.
|
||||
*/
|
||||
static void mbedtls_gf128mul_x_ble( unsigned char r[16],
|
||||
|
@ -1189,7 +1189,7 @@ int mbedtls_aes_crypt_xts( mbedtls_aes_xts_context *ctx,
|
|||
unsigned char *prev_output = output - 16;
|
||||
|
||||
/* Copy ciphertext bytes from the previous block to our output for each
|
||||
* byte of cyphertext we won't steal. At the same time, copy the
|
||||
* byte of ciphertext we won't steal. At the same time, copy the
|
||||
* remainder of the input for this final round (since the loop bounds
|
||||
* are the same). */
|
||||
for( i = 0; i < leftover; i++ )
|
||||
|
|
|
@ -2278,7 +2278,7 @@ int mbedtls_mpi_gcd( mbedtls_mpi *G, const mbedtls_mpi *A, const mbedtls_mpi *B
|
|||
* TA-TB is even so the division by 2 has an integer result.
|
||||
* Invariant (I) is preserved since any odd divisor of both TA and TB
|
||||
* also divides |TA-TB|/2, and any odd divisor of both TA and |TA-TB|/2
|
||||
* also divides TB, and any odd divisior of both TB and |TA-TB|/2 also
|
||||
* also divides TB, and any odd divisor of both TB and |TA-TB|/2 also
|
||||
* divides TA.
|
||||
*/
|
||||
if( mbedtls_mpi_cmp_mpi( &TA, &TB ) >= 0 )
|
||||
|
|
|
@ -690,7 +690,7 @@ cleanup:
|
|||
/*
|
||||
* Conditionally swap X and Y, without leaking information
|
||||
* about whether the swap was made or not.
|
||||
* Here it is not ok to simply swap the pointers, which whould lead to
|
||||
* Here it is not ok to simply swap the pointers, which would lead to
|
||||
* different memory access patterns when X and Y are used afterwards.
|
||||
*/
|
||||
int mbedtls_mpi_safe_cond_swap( mbedtls_mpi *X,
|
||||
|
|
|
@ -449,7 +449,7 @@ cleanup:
|
|||
|
||||
/*
|
||||
* Read a ECJPAKEKeyKPPairList (7.4.2.3) and check proofs
|
||||
* Ouputs: verified peer public keys Xa, Xb
|
||||
* Outputs: verified peer public keys Xa, Xb
|
||||
*/
|
||||
static int ecjpake_kkpp_read( const mbedtls_md_info_t *md_info,
|
||||
const mbedtls_ecp_group *grp,
|
||||
|
|
|
@ -1267,7 +1267,7 @@ cleanup:
|
|||
* For curves in short Weierstrass form, we do all the internal operations in
|
||||
* Jacobian coordinates.
|
||||
*
|
||||
* For multiplication, we'll use a comb method with coutermeasueres against
|
||||
* For multiplication, we'll use a comb method with countermeasures against
|
||||
* SPA, hence timing attacks.
|
||||
*/
|
||||
|
||||
|
@ -2231,7 +2231,7 @@ static unsigned char ecp_pick_window_size( const mbedtls_ecp_group *grp,
|
|||
* This function is mainly responsible for administrative work:
|
||||
* - managing the restart context if enabled
|
||||
* - managing the table of precomputed points (passed between the below two
|
||||
* functions): allocation, computation, ownership tranfer, freeing.
|
||||
* functions): allocation, computation, ownership transfer, freeing.
|
||||
*
|
||||
* It delegates the actual arithmetic work to:
|
||||
* ecp_precompute_comb() and ecp_mul_comb_with_precomp()
|
||||
|
@ -2365,7 +2365,7 @@ cleanup:
|
|||
/*
|
||||
* For Montgomery curves, we do all the internal arithmetic in projective
|
||||
* coordinates. Import/export of points uses only the x coordinates, which is
|
||||
* internaly represented as X / Z.
|
||||
* internally represented as X / Z.
|
||||
*
|
||||
* For scalar multiplication, we'll use a Montgomery ladder.
|
||||
*/
|
||||
|
@ -2519,7 +2519,7 @@ static int ecp_mul_mxz( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
|||
MPI_ECP_LSET( &R->Z, 0 );
|
||||
mbedtls_mpi_free( &R->Y );
|
||||
|
||||
/* RP.X might be sligtly larger than P, so reduce it */
|
||||
/* RP.X might be slightly larger than P, so reduce it */
|
||||
MOD_ADD( &RP.X );
|
||||
|
||||
/* Randomize coordinates of the starting point */
|
||||
|
|
|
@ -561,8 +561,8 @@ static void *buffer_alloc_calloc_mutexed( size_t n, size_t size )
|
|||
|
||||
static void buffer_alloc_free_mutexed( void *ptr )
|
||||
{
|
||||
/* We have to good option here, but corrupting the heap seems
|
||||
* worse than loosing memory. */
|
||||
/* We have no good option here, but corrupting the heap seems
|
||||
* worse than losing memory. */
|
||||
if( mbedtls_mutex_lock( &heap.mutex ) )
|
||||
return;
|
||||
buffer_alloc_free( ptr );
|
||||
|
|
|
@ -475,7 +475,7 @@ static int pk_use_ecparams( const mbedtls_asn1_buf *params, mbedtls_ecp_group *g
|
|||
}
|
||||
|
||||
/*
|
||||
* grp may already be initilialized; if so, make sure IDs match
|
||||
* grp may already be initialized; if so, make sure IDs match
|
||||
*/
|
||||
if( grp->id != MBEDTLS_ECP_DP_NONE && grp->id != grp_id )
|
||||
return( MBEDTLS_ERR_PK_KEY_INVALID_FORMAT );
|
||||
|
@ -808,7 +808,7 @@ static int pk_parse_key_pkcs1_der( mbedtls_rsa_context *rsa,
|
|||
goto cleanup;
|
||||
|
||||
#else
|
||||
/* Verify existance of the CRT params */
|
||||
/* Verify existence of the CRT params */
|
||||
if( ( ret = asn1_get_nonzero_mpi( &p, end, &T ) ) != 0 ||
|
||||
( ret = asn1_get_nonzero_mpi( &p, end, &T ) ) != 0 ||
|
||||
( ret = asn1_get_nonzero_mpi( &p, end, &T ) ) != 0 )
|
||||
|
|
|
@ -913,7 +913,7 @@ static psa_status_t psa_get_and_lock_key_slot_with_policy(
|
|||
goto error;
|
||||
}
|
||||
|
||||
/* Enforce that the usage policy permits the requested algortihm. */
|
||||
/* Enforce that the usage policy permits the requested algorithm. */
|
||||
if( alg != 0 )
|
||||
{
|
||||
status = psa_key_policy_permits( &slot->attr.policy,
|
||||
|
|
|
@ -428,7 +428,7 @@ psa_status_t mbedtls_psa_aead_update(
|
|||
* preceding calls to mbedtls_psa_aead_update().
|
||||
* - \p tag contains the authentication tag.
|
||||
*
|
||||
* Whether or not this function returns successfuly, the PSA core subsequently
|
||||
* Whether or not this function returns successfully, the PSA core subsequently
|
||||
* calls mbedtls_psa_aead_abort() to deactivate the operation.
|
||||
*
|
||||
* \param[in,out] operation Active AEAD operation.
|
||||
|
|
|
@ -175,7 +175,7 @@ psa_status_t mbedtls_psa_hash_update(
|
|||
* This function calculates the hash of the message formed by concatenating
|
||||
* the inputs passed to preceding calls to mbedtls_psa_hash_update().
|
||||
*
|
||||
* When this function returns successfuly, the operation becomes inactive.
|
||||
* When this function returns successfully, the operation becomes inactive.
|
||||
* If this function returns an error status, the operation enters an error
|
||||
* state and must be aborted by calling mbedtls_psa_hash_abort().
|
||||
*
|
||||
|
|
|
@ -848,10 +848,10 @@ cleanup:
|
|||
* the more bits of the key can be recovered. See [3].
|
||||
*
|
||||
* Collecting n collisions with m bit long blinding value requires 2^(m-m/n)
|
||||
* observations on avarage.
|
||||
* observations on average.
|
||||
*
|
||||
* For example with 28 byte blinding to achieve 2 collisions the adversary has
|
||||
* to make 2^112 observations on avarage.
|
||||
* to make 2^112 observations on average.
|
||||
*
|
||||
* (With the currently (as of 2017 April) known best algorithms breaking 2048
|
||||
* bit RSA requires approximately as much time as trying out 2^112 random keys.
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
|
||||
/*
|
||||
* Cookies are formed of a 4-bytes timestamp (or serial number) and
|
||||
* an HMAC of timestemp and client ID.
|
||||
* an HMAC of timestamp and client ID.
|
||||
*/
|
||||
#define COOKIE_LEN ( 4 + COOKIE_HMAC_LEN )
|
||||
|
||||
|
|
|
@ -1234,7 +1234,7 @@ int mbedtls_ssl_decrypt_buf( mbedtls_ssl_context const *ssl,
|
|||
add_data, add_data_len );
|
||||
|
||||
/* Because of the check above, we know that there are
|
||||
* explicit_iv_len Bytes preceeding data, and taglen
|
||||
* explicit_iv_len Bytes preceding data, and taglen
|
||||
* bytes following data + data_len. This justifies
|
||||
* the debug message and the invocation of
|
||||
* mbedtls_cipher_auth_decrypt_ext() below. */
|
||||
|
@ -2404,7 +2404,7 @@ int mbedtls_ssl_start_handshake_msg( mbedtls_ssl_context *ssl, unsigned hs_type,
|
|||
unsigned char **buf, size_t *buf_len )
|
||||
{
|
||||
/*
|
||||
* Reserve 4 bytes for hanshake header. ( Section 4,RFC 8446 )
|
||||
* Reserve 4 bytes for handshake header. ( Section 4,RFC 8446 )
|
||||
* ...
|
||||
* HandshakeType msg_type;
|
||||
* uint24 length;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include <string.h>
|
||||
|
||||
/*
|
||||
* Initialze context
|
||||
* Initialize context
|
||||
*/
|
||||
void mbedtls_ssl_ticket_init( mbedtls_ssl_ticket_context *ctx )
|
||||
{
|
||||
|
|
|
@ -4017,7 +4017,7 @@ void mbedtls_ssl_free( mbedtls_ssl_context *ssl )
|
|||
}
|
||||
|
||||
/*
|
||||
* Initialze mbedtls_ssl_config
|
||||
* Initialize mbedtls_ssl_config
|
||||
*/
|
||||
void mbedtls_ssl_config_init( mbedtls_ssl_config *conf )
|
||||
{
|
||||
|
@ -6614,7 +6614,7 @@ void mbedtls_ssl_handshake_wrapup_free_hs_transform( mbedtls_ssl_context *ssl )
|
|||
ssl->handshake = NULL;
|
||||
|
||||
/*
|
||||
* Free the previous transform and swith in the current one
|
||||
* Free the previous transform and switch in the current one
|
||||
*/
|
||||
if( ssl->transform )
|
||||
{
|
||||
|
|
|
@ -2276,7 +2276,7 @@ start_processing:
|
|||
MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR );
|
||||
return( MBEDTLS_ERR_SSL_DECODE_ERROR );
|
||||
}
|
||||
} /* FALLTROUGH */
|
||||
} /* FALLTHROUGH */
|
||||
#endif /* MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED */
|
||||
|
||||
#if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \
|
||||
|
|
|
@ -1261,7 +1261,7 @@ read_record_header:
|
|||
* Handshake layer:
|
||||
* 0 . 0 handshake type
|
||||
* 1 . 3 handshake length
|
||||
* 4 . 5 DTLS only: message seqence number
|
||||
* 4 . 5 DTLS only: message sequence number
|
||||
* 6 . 8 DTLS only: fragment offset
|
||||
* 9 . 11 DTLS only: fragment length
|
||||
*/
|
||||
|
|
|
@ -1110,7 +1110,7 @@ int mbedtls_ssl_tls13_populate_transform( mbedtls_ssl_transform *transform,
|
|||
transform->tls_version = MBEDTLS_SSL_VERSION_TLS1_3;
|
||||
|
||||
/* We add the true record content type (1 Byte) to the plaintext and
|
||||
* then pad to the configured granularity. The mimimum length of the
|
||||
* then pad to the configured granularity. The minimum length of the
|
||||
* type-extended and padded plaintext is therefore the padding
|
||||
* granularity. */
|
||||
transform->minlen =
|
||||
|
@ -1425,7 +1425,7 @@ int mbedtls_ssl_tls13_generate_application_keys(
|
|||
hash_alg = mbedtls_psa_translate_md( handshake->ciphersuite_info->mac );
|
||||
hash_len = PSA_HASH_LENGTH( hash_alg );
|
||||
|
||||
/* Compute current handshake transcript. It's the caller's responsiblity
|
||||
/* Compute current handshake transcript. It's the caller's responsibility
|
||||
* to call this at the right time, that is, after the ServerFinished. */
|
||||
|
||||
ret = mbedtls_ssl_get_handshake_transcript( ssl, md_type,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue