1 #include "tommath_private.h"
3 /* LibTomMath, multiple-precision integer library -- Tom St Denis */
4 /* SPDX-License-Identifier: Unlicense */
8 mp_err
mp_init_multi(mp_int
*mp
, ...)
11 int n
= 0; /* Number of ok inits */
15 va_start(args
, mp
); /* init args to next argument from caller */
16 while (cur_arg
!= NULL
) {
17 err
= mp_init(cur_arg
);
19 /* Oops - error! Back-track and mp_clear what we already
20 succeeded in init-ing, then return error.
24 /* now start cleaning up */
26 va_start(clean_args
, mp
);
29 cur_arg
= va_arg(clean_args
, mp_int
*);
35 cur_arg
= va_arg(args
, mp_int
*);