From 542ba9995c3fdffc89b6cd4a90d25f3f9abf9ece Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 15:38:18 +0200 Subject: [PATCH] update math inititializers make math initializer functions dependant on the xxx_DESC macro instead of the USE_xxx macro, which is only relevant when building tests etc. --- src/headers/tomcrypt_misc.h | 9 +++++++++ src/misc/crypt/crypt_inits.c | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 18d8b6d..503447c 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -56,8 +56,17 @@ int crypt_list_all_constants(char *names_list, unsigned long *names_list_size); int crypt_get_size(const char* namein, int *sizeout); int crypt_list_all_sizes(char *names_list, unsigned long *names_list_size); +#ifdef LTM_DESC void init_LTM(void); +#endif +#ifdef TFM_DESC void init_TFM(void); +#endif +/* *** use of GMP is untested *** +#ifdef GMP_DESC +void init_GMP(void); +#endif +*/ /* $Source$ */ diff --git a/src/misc/crypt/crypt_inits.c b/src/misc/crypt/crypt_inits.c index 5428cc3..cc92f52 100755 --- a/src/misc/crypt/crypt_inits.c +++ b/src/misc/crypt/crypt_inits.c @@ -12,33 +12,33 @@ /** @file crypt_inits.c - - Provide math library functions for dynamic languages + + Provide math library functions for dynamic languages like Python - Larry Bugbee, February 2013 */ -#ifdef USE_LTM +#ifdef LTM_DESC void init_LTM(void) { ltc_mp = ltm_desc; } #endif -#ifdef USE_TFM +#ifdef TFM_DESC void init_TFM(void) { ltc_mp = tfm_desc; } #endif /* *** use of GMP is untested *** - #ifdef USE_GMP - void init_GMP(void) { - ltc_mp = gmp_desc; - } - #endif +#ifdef GMP_DESC +void init_GMP(void) { + ltc_mp = gmp_desc; +} +#endif */ -/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_inits.c,v $ */ -/* $Revision: $ */ -/* $Date: $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */