summaryrefslogtreecommitdiff
path: root/libtomcrypt/src/math/multi.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtomcrypt/src/math/multi.c')
-rw-r--r--libtomcrypt/src/math/multi.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/libtomcrypt/src/math/multi.c b/libtomcrypt/src/math/multi.c
index 593f353..da5bb60 100644
--- a/libtomcrypt/src/math/multi.c
+++ b/libtomcrypt/src/math/multi.c
@@ -5,12 +5,10 @@
*
* The library is free for all purposes without any express
* guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
-#ifdef MPI
+#ifdef LTC_MPI
#include <stdarg.h>
int ltc_init_multi(void **a, ...)
@@ -32,13 +30,14 @@ int ltc_init_multi(void **a, ...)
cur = va_arg(clean_list, void**);
}
va_end(clean_list);
+ va_end(args);
return CRYPT_MEM;
}
++np;
cur = va_arg(args, void**);
}
va_end(args);
- return CRYPT_OK;
+ return CRYPT_OK;
}
void ltc_deinit_multi(void *a, ...)
@@ -54,8 +53,25 @@ void ltc_deinit_multi(void *a, ...)
va_end(args);
}
+void ltc_cleanup_multi(void **a, ...)
+{
+ void **cur = a;
+ va_list args;
+
+ va_start(args, a);
+ while (cur != NULL) {
+ if (*cur != NULL) {
+ mp_clear(*cur);
+ *cur = NULL;
+ }
+ cur = va_arg(args, void**);
+ }
+ va_end(args);
+ return;
+}
+
#endif
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
+/* ref: $Format:%D$ */
+/* git commit: $Format:%H$ */
+/* commit time: $Format:%ai$ */