2
#ifdef BN_MP_INIT_SIZE_C
3
/* LibTomMath, multiple-precision integer library -- Tom St Denis
5
* LibTomMath is a library that provides multiple-precision
6
* integer arithmetic as well as number theoretic functionality.
8
* The library was designed directly after the MPI library by
9
* Michael Fromberger but has been written from scratch with
10
* additional optimizations in place.
12
* The library is free for all purposes without any express
15
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
18
/* init an mp_init for a given size */
19
int mp_init_size (mp_int * a, int size)
23
/* pad size so there are always extra digits */
24
size += (MP_PREC * 2) - (size % MP_PREC);
27
a->dp = OPT_CAST(mp_digit) XMALLOC (sizeof (mp_digit) * size);
38
for (x = 0; x < size; x++) {
46
/* $Source: /cvs/libtom/libtommath/bn_mp_init_size.c,v $ */
47
/* $Revision: 1.4 $ */
48
/* $Date: 2006/12/28 01:25:13 $ */