chsvlib
chsv helper source code

◆ memandnot_inplace()

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

Computes bitwise NOT of an arbitrary-precision integer, then computes bitwise AND 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 AND. On output, the buffer receives the final result.
[in]pSrc2A pointer to the second integer 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 memandnot_LE or memandnot_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 memandnot_copy (faster), memandnot_LE or memandnot_BE.

The memandnot_LE and memandnot_BE functions allow variable-sized and possibly overlapping buffers.

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