chsvlib
chsv helper source code

◆ memxornot_inplace()

void Chusov::Memory::memxornot_inplace ( void *  pSrcDest,
const void *  pSrc2,
std::size_t  cbSrcDest 
)
noexcept

Computes bitwise NOT of an arbitrary-precision integer, then computes bitwise XOR of the result with another arbitrary-precision integer producing the final result written in place of the first integer.

Parameters
[in,out]pSrcDestA pointer to a buffer which on input contains the first arbitrary-precision integer, of size cbSrcDest bytes, which is bitwise complemented and then combined with pSrc2 using bitwise XOR. On output, the buffer receives the final result.
[in]pSrc2A pointer to the second integer which is combined with the complement of the input integer pointed to by pSrcDest. The size of the integer is also cbSrcDest. The parameter is allowed to point to the same buffer as pSrcDest. Other than that, the buffers may not overlap. To use overlapping buffers use memxornot_LE or memxornot_BE.
cbSrcDestA byte size of both of the operands as well as the capacity of the output buffer.

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

To preserve the values of both operands and copy the result of the operation into a third buffer, use memxornot_copy (faster), memxornot_LE or memxornot_BE.

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

See also
memxornot_copy;
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.