mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-11 04:55:41 +00:00
Address review comments for documentation
This commit is contained in:
parent
1881ef53b7
commit
c4315e6d5e
|
@ -167,12 +167,11 @@ void mbedtls_platform_zeroize( void *buf, size_t len );
|
||||||
/**
|
/**
|
||||||
* \brief Secure memset
|
* \brief Secure memset
|
||||||
*
|
*
|
||||||
* This function is meant to provide a more secure way to do
|
* This is a constant-time version of memset(). If
|
||||||
* memset. It starts by initialising the given memory area
|
* MBEDTLS_ENTROPY_HARDWARE_ALT is defined, the buffer is
|
||||||
* from random tail location with random data. After tail is
|
* initialised with random data and the order is also
|
||||||
* initialised, the remaining head of the buffer is initialised
|
* randomised using the hardware RNG in order to further harden
|
||||||
* with random data. After initialisation, the original memset
|
* against side-channel attacks.
|
||||||
* is performed
|
|
||||||
*
|
*
|
||||||
* \param ptr Buffer to be set.
|
* \param ptr Buffer to be set.
|
||||||
* \param value Value to be used when setting the buffer.
|
* \param value Value to be used when setting the buffer.
|
||||||
|
@ -185,12 +184,11 @@ void *mbedtls_platform_memset( void *ptr, int value, size_t num );
|
||||||
/**
|
/**
|
||||||
* \brief Secure memcpy
|
* \brief Secure memcpy
|
||||||
*
|
*
|
||||||
* This function is meant to provide a more secure way to do
|
* This is a constant-time version of memcpy(). If
|
||||||
* memcpy. It starts by initialising the given memory area
|
* MBEDTLS_ENTROPY_HARDWARE_ALT is defined, the buffer is
|
||||||
* with random data. After initialisation, the original memcpy
|
* initialised with random data and the order is also
|
||||||
* is performed by starting first copying from random tail
|
* randomised using the hardware RNG in order to further harden
|
||||||
* location of the buffer. After tail has been copied, the
|
* against side-channel attacks.
|
||||||
* remaining head is copied as well.
|
|
||||||
*
|
*
|
||||||
* \param dst Destination buffer where the data is being copied to.
|
* \param dst Destination buffer where the data is being copied to.
|
||||||
* \param src Source buffer where the data is being copied from.
|
* \param src Source buffer where the data is being copied from.
|
||||||
|
@ -203,18 +201,17 @@ void *mbedtls_platform_memcpy( void *dst, const void *src, size_t num );
|
||||||
/**
|
/**
|
||||||
* \brief Secure memcmp
|
* \brief Secure memcmp
|
||||||
*
|
*
|
||||||
* This function is meant to provide a more secure way to do
|
* This is a constant-time version of memcmp(). If
|
||||||
* memcmp. It starts comparing from a random offset and goes
|
* MBEDTLS_ENTROPY_HARDWARE_ALT is defined, the order is also
|
||||||
* through the tail part of buffers first byte by byte. After
|
* randomised using the hardware RNG in order to further harden
|
||||||
* that it starts going through the head part of buffer. In the
|
* against side-channel attacks.
|
||||||
* end, the number of equal bytes is compared to the length of the
|
|
||||||
* buffers, thus making the function a fixed time memcmp.
|
|
||||||
*
|
*
|
||||||
* \param buf1 First buffer to compare.
|
* \param buf1 First buffer to compare.
|
||||||
* \param buf2 Second buffer to compare against.
|
* \param buf2 Second buffer to compare against.
|
||||||
* \param num The length of the buffers in bytes.
|
* \param num The length of the buffers in bytes.
|
||||||
*
|
*
|
||||||
* \return 0 if the buffers were equal.
|
* \return 0 if the buffers were equal or an unspecified non-zero value
|
||||||
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
int mbedtls_platform_memcmp( const void *buf1, const void *buf2, size_t num );
|
int mbedtls_platform_memcmp( const void *buf1, const void *buf2, size_t num );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue