chsvlib
chsv helper source code

◆ memxornot_copy()

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

Computes bitwise NOT of an arbitrary-precision integer, then computes bitwise XOR of the result with another arbitrary-precision integer and copies the final result into a separate destination buffer.

Parameters
[out]pDestA pointer to the destination buffer with the capacity of at least cbSrc bytes.
[in]pSrc1A pointer to the first integer whose bits are complemented and then combined with bits of pSrc2 using bitwise XOR. The size of the integer is cbSrc.
[in]pSrc2A pointer to the second integer which is combined with the complement of the integer pointed to by pSrc1. The size of the integer is also cbSrc.
cbSrcByte size of the data in pSrc1 and pSrc2 as well as the capacity of 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 memxornot_inplace.

The memxornot_LE and memxornot_BE functions allow variable-sized and possibly overlapping buffers.

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