chsvlib
chsv helper source code

◆ memxor_copy()

void Chusov::Memory::memxor_copy ( void *restrict  pDest,
const void *restrict  pSrc1,
const void *restrict  pSrc2,
std::size_t  cbSrc 
)
noexcept

Computes bitwise XOR of two arbitrary precision integers and copies the resulting integer into a separate output buffer.

Parameters
[out]pDestThe destination buffer of the capacity of at least cbSrc bytes.
[in]pSrc1A pointer to the first integer of cbSrc bytes.
[in]pSrc2A pointer to the second integer of cbSrc bytes.
cbSrcA byte size of the input operands and a capacity of the output buffer pDest.

For the operation it is irrelevant whether bytes of the integers are specified in the Little-Endian or Big-Endian order.

The buffers pSrc1, pSrc2 and pDest must not overlap. To write the result into the same buffer as one of the operands, use memxor_inplace.

The memxor_LE and memxor_BE functions allow variable-sized and possibly overlapping buffers.

See also
memxor_inplace;
memxor_LE;
memxor_BE;
memand_LE, memand_BE;
memor_LE, memor_BE;
memandnot_LE, memandnot_BE;
memornot_LE, memornot_BE;
memxornot_LE, memxornot_BE;
memnot_LE, memnot_BE.