chsvlib
chsv helper source code

◆ memandnot_copy()

void Chusov::Memory::memandnot_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 AND 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 AND. 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 sizes 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 memandnot_inplace.

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

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