1 #include "tommath_private.h"
3 /* LibTomMath, multiple-precision integer library -- Tom St Denis */
4 /* SPDX-License-Identifier: Unlicense */
7 mp_err
mp_copy(const mp_int
*a
, mp_int
*b
)
11 /* if dst == src do nothing */
17 if ((err
= mp_grow(b
, a
->used
)) != MP_OKAY
) {
21 /* copy everything over and zero high digits */
22 s_mp_copy_digs(b
->dp
, a
->dp
, a
->used
);
23 s_mp_zero_digs(b
->dp
+ a
->used
, b
->used
- a
->used
);