mbedtls_ct_memcpy_if_eq() function
Conditional memcpy without branches. 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.
Syntax
void mbedtls_ct_memcpy_if_eq(unsigned char *dest,
const unsigned char *src,
size_t len,
size_t c1,
size_t c2);
Arguments
dest
The pointer to conditionally copy to.
src
The pointer to copy from. Shouldn't overlap with \p dest.
len
The number of bytes to copy.
c1
The first value to analyze in the condition.
c2
The second value to analyze in the condition.