documented update
[gnutls.git] / lib / nettle / multi.c
blob788c8e9a0080829138321a101e56f2775bc7fcd6
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner.
6 * The library is free for all purposes without any express
7 * guarantee it works.
9 * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
11 #include <gmp.h>
12 #include <stdarg.h>
13 #include <ecc.h>
15 int mp_init_multi(mpz_t *a, ...)
17 mpz_t *cur = a;
18 int np = 0;
19 va_list args;
21 va_start(args, a);
22 while (cur != NULL) {
23 mpz_init(*cur);
24 ++np;
25 cur = va_arg(args, mpz_t*);
27 va_end(args);
28 return 0;
31 void mp_clear_multi(mpz_t *a, ...)
33 mpz_t *cur = a;
34 va_list args;
36 va_start(args, a);
37 while (cur != NULL) {
38 mpz_clear(*cur);
39 cur = va_arg(args, mpz_t*);
41 va_end(args);
44 /* $Source$ */
45 /* $Revision$ */
46 /* $Date$ */