|
noexcept |
Performs an addition of two arbitrary-precision integers given in the Little-Endian byte order and of the same size and writes the result into a separate output buffer.
[out] | pResult | A pointer to the destination buffer to accept the sum. |
[in] | pX | A pointer to the first addend. |
[in] | pY | A pointer to the second addend. |
cb | A byte size of the integers pointed to by pX and pY as well as the capacity of the output buffer pResult and a number of bytes written into it. |
The addition is carried out modulo bcb
, where b = 2CHAR_BIT
is a number of values that a byte can represent.
All of the integers are specified with vectors in the Little-Endian byte order. That is, if n = cb - 1
, and the first and the second integers are respectively specified with vectors \(V_X = \{x_0,\dots, x_n\}\) and \(V_Y = \{y_0,\dots, y_n\}\), where \(x_0\) and \(y_0\) are the first bytes of the vectors, then the respective integers are defined as \(X=\sum_{i=0}^{n}x_i\cdot b^i\) and \(Y=\sum_{i=0}^{n}y_i\cdot b^i\). The result of the addition is also written in the Little-Endian byte order.
To add up numbers given in the Big-Endian byte order use memadd_BE_copy.
None of the buffers may overlap. To perform an addition in place use memadd_LE_inplace or memadd_LE.