mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-05-11 14:38:17 +02:00
Add mbedtls_platform_memmove() as a secured memcmp()
Signed-off-by: Piotr Nowicki <piotr.nowicki@arm.com>
This commit is contained in:
@@ -198,6 +198,22 @@ void *mbedtls_platform_memset( void *ptr, int value, size_t num );
|
||||
*/
|
||||
void *mbedtls_platform_memcpy( void *dst, const void *src, size_t num );
|
||||
|
||||
/**
|
||||
* \brief Secure memmove
|
||||
*
|
||||
* This is a constant-time version of memmove(). It is based on
|
||||
* the double use of the mbedtls_platform_memcpy() function secured
|
||||
* against side-channel attacks.
|
||||
*
|
||||
* \param dst Destination buffer where the data is being moved to.
|
||||
* \param src Source buffer where the data is being moved from.
|
||||
* \param num The length of the buffers in bytes.
|
||||
*
|
||||
* \return 0 if the operation was successful or -1 if memory allocation
|
||||
* failed.
|
||||
*/
|
||||
int mbedtls_platform_memmove( void *dst, const void *src, size_t num );
|
||||
|
||||
/**
|
||||
* \brief Secure memcmp
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user