2019-09-16 13:50:38 +00:00
|
|
|
#include "tommath_private.h"
|
2006-03-08 13:16:18 +00:00
|
|
|
#ifdef BN_MP_INIT_SET_C
|
2020-05-26 15:36:47 +00:00
|
|
|
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
|
|
|
|
/* SPDX-License-Identifier: Unlicense */
|
2006-03-08 13:16:18 +00:00
|
|
|
|
|
|
|
/* initialize and set a digit */
|
2020-05-26 15:36:47 +00:00
|
|
|
mp_err mp_init_set(mp_int *a, mp_digit b)
|
2006-03-08 13:16:18 +00:00
|
|
|
{
|
2020-05-26 15:36:47 +00:00
|
|
|
mp_err err;
|
2019-09-16 13:50:38 +00:00
|
|
|
if ((err = mp_init(a)) != MP_OKAY) {
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
mp_set(a, b);
|
|
|
|
return err;
|
2006-03-08 13:16:18 +00:00
|
|
|
}
|
|
|
|
#endif
|