12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #include <tommath.h>
- #ifdef BN_MP_INIT_C
- int mp_init (mp_int * a)
- {
- int i;
-
- a->dp = OPT_CAST(mp_digit) XMALLOC (sizeof (mp_digit) * MP_PREC);
- if (a->dp == NULL) {
- return MP_MEM;
- }
-
- for (i = 0; i < MP_PREC; i++) {
- a->dp[i] = 0;
- }
-
- a->used = 0;
- a->alloc = MP_PREC;
- a->sign = MP_ZPOS;
- return MP_OKAY;
- }
- #endif
|