Mercurial > dropbear
diff libtomcrypt/src/math/multi.c @ 1471:6dba84798cd5
Update to libtomcrypt 1.18.1, merged with Dropbear changes
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 09 Feb 2018 21:44:05 +0800 |
parents | f849a5ca2efc |
children | e9dba7abd939 |
line wrap: on
line diff
--- a/libtomcrypt/src/math/multi.c Thu Feb 08 23:11:40 2018 +0800 +++ b/libtomcrypt/src/math/multi.c Fri Feb 09 21:44:05 2018 +0800 @@ -5,12 +5,10 @@ * * The library is free for all purposes without any express * guarantee it works. - * - * Tom St Denis, [email protected], http://libtom.org */ #include "tomcrypt.h" -#ifdef MPI +#ifdef LTC_MPI #include <stdarg.h> int ltc_init_multi(void **a, ...) @@ -32,13 +30,14 @@ 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 @@ 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$ */