mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 19:55:36 +01:00
Fix documentation and comments
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
parent
c0ae1cf45a
commit
dbe0f892b3
@ -25,7 +25,7 @@
|
||||
|
||||
/** Constant-time buffer comparison without branches.
|
||||
*
|
||||
* This is equivalent to the standard memncmp function, but is likely to be
|
||||
* This is equivalent to the standard memcmp function, but is likely to be
|
||||
* compiled to code using bitwise operation rather than a branch.
|
||||
*
|
||||
* This function can be used to write constant-time code by replacing branches
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following functiona are implemented without using comparison operators, as those
|
||||
* The following functions are implemented without using comparison operators, as those
|
||||
* might be translated to branches by some compilers on some platforms.
|
||||
*/
|
||||
|
||||
@ -240,7 +240,7 @@ unsigned mbedtls_ct_uint_if( unsigned condition,
|
||||
|
||||
#if defined(MBEDTLS_BIGNUM_C)
|
||||
|
||||
/** Select between two sign values witout branches.
|
||||
/** Select between two sign values without branches.
|
||||
*
|
||||
* This is functionally equivalent to `condition ? if1 : if0` but uses only bit
|
||||
* operations in order to avoid branches.
|
||||
@ -258,7 +258,7 @@ static int mbedtls_ct_cond_select_sign( unsigned char condition,
|
||||
int if1,
|
||||
int if0 )
|
||||
{
|
||||
/* In order to avoid questions about what we can reasonnably assume about
|
||||
/* In order to avoid questions about what we can reasonably assume about
|
||||
* the representations of signed integers, move everything to unsigned
|
||||
* by taking advantage of the fact that if1 and if0 are either +1 or -1. */
|
||||
unsigned uif1 = if1 + 1;
|
||||
|
@ -171,7 +171,7 @@ void mbedtls_ct_mpi_uint_cond_assign( size_t n,
|
||||
|
||||
/** Conditional memcpy without branches.
|
||||
*
|
||||
* This is equivalent to `if ( c1 == c2 ) memcpy(dst, src, len)`, but is likely
|
||||
* This is equivalent to `if ( c1 == c2 ) memcpy(dest, src, len)`, but is likely
|
||||
* to be compiled to code using bitwise operation rather than a branch.
|
||||
*
|
||||
* \param dest The pointer to conditionally copy to.
|
||||
|
Loading…
Reference in New Issue
Block a user