mbedtls_ct_memcpy_offset() function
Copy data from a secret position with constant flow. This function copies \p len bytes from \p src_base + \p offset_secret to \p dst, with a code flow and memory access pattern that does not depend on \p offset_secret, but only on \p offset_min, \p offset_max and \p len. Functionally equivalent to `memcpy(dst, src + offset_secret, len)`.
Arguments
dest
The destination buffer. This must point to a writable buffer of at least \p len bytes.
src
The base of the source buffer. This must point to a readable buffer of at least \p offset_max + \p len bytes. Shouldn't overlap with \p dest.
offset
The offset in the source buffer from which to copy. This must be no less than \p offset_min and no greater than \p offset_max.
offset_min
The minimal value of \p offset.
offset_max
The maximal value of \p offset.
len
The number of bytes to copy.
Notes
This function reads from \p dest, but the value that is read does not influence the result and this function's behavior is well-defined regardless of the contents of the buffers. This may result in false positives from static or dynamic analyzers, especially if \p dest is not initialized.