From 1b29ce896f9748ee3032cdfd1eca345a7909d558 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Thu, 6 Mar 2014 15:46:01 -0800 Subject: [PATCH 01/15] include compiler defines and other minor refinements --- demos/demo_crypt_constants.c | 60 ++++++ demos/demo_crypt_sizes.c | 55 ++++++ makefile | 11 ++ src/misc/crypt/crypt_constants.c | 121 ++++++++++++ src/misc/crypt/crypt_inits.c | 44 +++++ src/misc/crypt/crypt_sizes.c | 305 +++++++++++++++++++++++++++++++ 6 files changed, 596 insertions(+) create mode 100644 demos/demo_crypt_constants.c create mode 100644 demos/demo_crypt_sizes.c create mode 100755 src/misc/crypt/crypt_constants.c create mode 100755 src/misc/crypt/crypt_inits.c create mode 100755 src/misc/crypt/crypt_sizes.c diff --git a/demos/demo_crypt_constants.c b/demos/demo_crypt_constants.c new file mode 100644 index 0000000..5ca6a87 --- /dev/null +++ b/demos/demo_crypt_constants.c @@ -0,0 +1,60 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * 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" + +/** + @file demo_crypt_constants.c + + Demo how to get various constants to dynamic languages + like Python + + Larry Bugbee, February 2013 +*/ + + +// in lieu of a header file +int crypt_get_constant(const char* namein, int *valueout); +int crypt_list_all_constants(char *names_list, + unsigned long *names_list_size); + + +int main(void) { + int rc; + + printf("\n"); + + // given a specific constant name, get and print its value + char name[] = "CTR_COUNTER_BIG_ENDIAN"; + int value; + + rc = crypt_get_constant(name, &value); + printf(" %s is %d \n", name, value); + printf("\n"); + + // get and print the length of the names (and values) list + char *names_list; + unsigned long names_list_len; + + rc = crypt_list_all_constants(NULL, &names_list_len); + printf(" need to allocate %lu bytes \n", names_list_len); + printf("\n"); + + // get and print the names (and values) list + names_list = malloc(names_list_len); + rc = crypt_list_all_constants(names_list, &names_list_len); + printf(" supported constants: \n%s \n", names_list); + printf("\n"); +} + + +/* $Source: $ */ +/* $Revision: $ */ +/* $Date: $ */ diff --git a/demos/demo_crypt_sizes.c b/demos/demo_crypt_sizes.c new file mode 100644 index 0000000..f2154e2 --- /dev/null +++ b/demos/demo_crypt_sizes.c @@ -0,0 +1,55 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * 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" + +/** + @file demo_crypt_sizes.c + + Demo how to get various sizes to dynamic languages + like Python - Larry Bugbee, February 2013 +*/ + + +// in lieu of a header file +int crypt_get_size(const char* namein, int *sizeout); +int crypt_list_all_sizes(char *names_list, + unsigned long *names_list_size); + + +int main(void) { + int rc; + printf("\n"); + + // given a specific size name, get and print its size + char name[] = "ecc_key_struct_size"; + int size; + rc = crypt_get_size(name, &size); + printf(" %s is %d \n", name, size); + printf("\n"); + + // get and print the length of the names (and sizes) list + char *sizes_list; + unsigned long sizes_list_len; + rc = crypt_list_all_sizes(NULL, &sizes_list_len); + printf(" need to allocate %lu bytes \n", sizes_list_len); + printf("\n"); + + // get and print the names (and sizes) list + sizes_list = malloc(sizes_list_len); + rc = crypt_list_all_sizes(sizes_list, &sizes_list_len); + printf(" supported sizes: %s \n", sizes_list); + printf("\n"); +} + + +/* $Source: $ */ +/* $Revision: $ */ +/* $Date: $ */ diff --git a/makefile b/makefile index 7a055f2..2ff2d82 100644 --- a/makefile +++ b/makefile @@ -81,6 +81,8 @@ TV=tv_gen MULTI=multi TIMING=timing TEST=test +SIZES=sizes +CONSTANTS=constants #LIBPATH-The directory for libtomcrypt to be installed to. #INCPATH-The directory to install the header files for libtomcrypt. @@ -255,6 +257,8 @@ TVS=demos/tv_gen.o MULTIS=demos/multi.o TIMINGS=demos/timing.o TESTS=demos/test.o +CRYPTSIZES=demos/demo_crypt_sizes.o +CRYPTCONSTANTS=demos/demo_crypt_constants.o #Files left over from making the crypt.pdf. LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out *.lof @@ -312,6 +316,12 @@ timing: library testprof/$(LIBTEST) $(TIMINGS) test: library testprof/$(LIBTEST) $(TESTS) $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST) +sizes: library $(CRYPTSIZES) + $(CC) $(LDFLAGS) $(CRYPTSIZES) $(LIBNAME) $(EXTRALIBS) -o $(SIZES) + +constants: library $(CRYPTCONSTANTS) + $(CC) $(LDFLAGS) $(CRYPTCONSTANTS) $(LIBNAME) $(EXTRALIBS) -o $(CONSTANTS) + #This rule installs the library and the header files. This must be run #as root in order to have a high enough permission to write to the correct #directories and to set the owner and group to root. @@ -360,6 +370,7 @@ clean: rm -rf `find . -type d -name "*.libs" | xargs` rm -f crypt.aux crypt.dvi crypt.idx crypt.ilg crypt.ind crypt.log crypt.toc rm -f $(TV) $(SMALL) $(CRYPT) $(HASH) $(MULTI) $(TIMING) $(TEST) + rm -f $(SIZES) $(CONSTANTS) rm -rf doc/doxygen rm -f `find . -type f -name "*.pdf" | grep -FL crypt.pdf | xargs` rm -f *.txt diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c new file mode 100755 index 0000000..79b1942 --- /dev/null +++ b/src/misc/crypt/crypt_constants.c @@ -0,0 +1,121 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * 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" + +/** + @file crypt_constants.c + + Make various constants available to dynamic languages + like Python - Larry Bugbee, February 2013 + + LB - Dec 2013 - revised to include compiler define options +*/ + +typedef struct { + const char *name; + const long value; +} crypt_constant; + +crypt_constant _crypt_constants[] = { +#ifdef LTC_CTR_MODE + {"CTR_COUNTER_LITTLE_ENDIAN", CTR_COUNTER_LITTLE_ENDIAN}, + {"CTR_COUNTER_BIG_ENDIAN", CTR_COUNTER_BIG_ENDIAN}, + {"LTC_CTR_RFC3686", LTC_CTR_RFC3686}, +#endif + + {"PK_PUBLIC", PK_PUBLIC}, + {"PK_PRIVATE", PK_PRIVATE}, +#ifdef LTC_MRSA + {"MIN_RSA_SIZE", MIN_RSA_SIZE}, + {"MAX_RSA_SIZE", MAX_RSA_SIZE}, +#endif + +#ifdef LTC_PKCS_1 + {"LTC_PKCS_1_OAEP", LTC_PKCS_1_OAEP}, + {"LTC_PKCS_1_PSS", LTC_PKCS_1_PSS}, + {"LTC_PKCS_1_V1_5", LTC_PKCS_1_V1_5}, +#endif +}; + + +/* crypt_get_constant() + * sizeout will be the size (bytes) of the named struct or union + * return -1 if named item not found + */ +int crypt_get_constant(const char* namein, int *valueout) { + int i; + int _crypt_constants_len = sizeof(_crypt_constants) / sizeof(crypt_constant); + for (i=0; i<_crypt_constants_len; i++) { + if (strcmp(_crypt_constants[i].name, namein) == 0) { + *valueout = _crypt_constants[i].value; + return 0; + } + } + return 1; +} + +/* crypt_list_all_constants() + * if names_list is NULL, names_list_size will be the minimum + * size needed to receive the complete names_list + * if names_list is NOT NULL, names_list must be the addr with + * sufficient memory allocated into which the names_list + * is to be written. Also, the value in names_list_size + * sets the upper bound of the number of characters to be + * written. + * a -1 return value signifies insufficient space made available + */ +int crypt_list_all_constants(char *names_list, + unsigned long *names_list_size) { + int i; + unsigned long total_len = 0; + char number[10]; + int number_len; + int count = sizeof(_crypt_constants) / sizeof(crypt_constant); + + /* calculate amount of memory required for the list */ + for (i=0; i *names_list_size) { + return -1; + } + /* build the names list */ + char *ptr = names_list; + for (i=0; i *names_list_size) { + return -1; + } + /* build the names list */ + char *ptr = names_list; + for (i=0; i Date: Thu, 6 Mar 2014 21:25:31 -0800 Subject: [PATCH 02/15] added a Python demo --- demos/demo_dynamic.py | 237 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 demos/demo_dynamic.py diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py new file mode 100644 index 0000000..a22e240 --- /dev/null +++ b/demos/demo_dynamic.py @@ -0,0 +1,237 @@ + + +""" + demo_dynamic.py v1 + + This program demonstrates Python's use of the dynamic + language support additions to LTC, namely access to LTC + constants, struct and union sizes, and the binding of a + math package to LTC. Also provided are simple code + fragments to illustrate how one might write a Python + wrapper for LTC and how an app might call the wrapper. + This or a similar model should work for Ruby and other + dynamic languages. + + This instance uses Python's ctypes and requires a single + .dylib linking together LTC and one or more math libraries. + Building a single .dylib is needed because LTC wants a + fairly tight relationship between itself and the mathlib. + (ctypes can load multiple .dylibs, but it does not support + this level of coupling between those independent libraries.) + + My .dylib was created on OSX with the following steps: + + 1- compile LTC to a .a static lib: + CFLAGS="-DLTM_DESC -DUSE_LTM -DTFM_DESC -DUSE_TFM \ + -I/usr/local/include" make + + 2- link LTC, LTM and TFM into a single .dylib: + ar2dylib_with_and tomcrypt tommath tfm + where ar2dylib_with_and is a shell script that combines + the .a with .dylibs for LTM and TFM + + Reminder: you don't need to bind in a math library unless + you are going to use LTC functions that depend + on a mathlib. For example, public key crypto + needs a mathlib; hashing and symmetric encryption + does not. + + Larry Bugbee + March 2014 + +""" + + +from ctypes import * +from ctypes.util import find_library + + +#--------------------------------------------------------------- +# load the .dylib + +libname = 'tomcrypt' +libpath = find_library(libname) + +print +print(' demo_dynamic.py') +print +print(' path to library %s: %s' % (libname, libpath)) + +LTC = cdll.LoadLibrary(libpath) +print(' loaded: %s' % LTC) +print + + + +#--------------------------------------------------------------- +# get list of all supported constants followed by a list of all +# supported sizes. One alternative: these lists may be parsed +# and used as needed. + +if 1: + print ' all supported constants and their values:' + + # get size to allocate for constants output list + str_len = c_int(0) + ret = LTC.crypt_list_all_constants(None, byref(str_len)) + print ' need to allocate %d bytes \n' % str_len.value + + # allocate that size and get (name, size) pairs, each pair + # separated by a newline char. + names_sizes = c_buffer(str_len.value) + ret = LTC.crypt_list_all_constants(names_sizes, byref(str_len)) + print names_sizes.value + print + + +if 1: + print ' all supported sizes:' + + # get size to allocate for sizes output list + str_len = c_int(0) + ret = LTC.crypt_list_all_sizes(None, byref(str_len)) + print ' need to allocate %d bytes \n' % str_len.value + + # allocate that size and get (name, size) pairs, each pair + # separated by a newline char. + names_sizes = c_buffer(str_len.value) + ret = LTC.crypt_list_all_sizes(names_sizes, byref(str_len)) + print names_sizes.value + print + + +#--------------------------------------------------------------- +# get individually named constants and sizes + +# print selected constants +if 1: + print '\n selected constants:' + + names = [ + 'PK_PUBLIC', + 'MAX_RSA_SIZE', + 'CTR_COUNTER_BIG_ENDIAN', + ] + for name in names: + const_value = c_int(0) + rc = LTC.crypt_get_constant(name, byref(const_value)) + value = const_value.value + print ' %-25s %d' % (name, value) + +# print selected sizes +if 1: + print '\n selected sizes:' + + names = [ + 'rijndael_key_struct_size', + 'rsa_key_struct_size', + 'symmetric_CTR_struct_size', + 'twofish_key_struct_size', + 'ecc_point_struct_size', + 'gcm_state_struct_size', + 'sha512_state_struct_size', + ] + for name in names: + size_value = c_int(0) + rc = LTC.crypt_get_size(name, byref(size_value)) + value = size_value.value + print ' %-25s %d' % (name, value) + + +#--------------------------------------------------------------- +# init the selected math package, change to another mathlib, +# and change back to the first mathlib + +if 1: + print '\n init the selected math package, change, and change again' + + # show ltm_desc + ptr = c_int.in_dll(LTC, 'ltm_desc') + print ' ltm_desc: ', hex(ptr.value) + # show tfm_desc + ptr = c_int.in_dll(LTC, 'tfm_desc') + print ' tfm_desc: ', hex(ptr.value) + # let's see the initial value of ltc_mp + ptr = c_int.in_dll(LTC, 'ltc_mp') + print ' initial ptr:', hex(ptr.value) + + # init LTM and show ltc_mp + LTC.init_LTM() + ptr = c_int.in_dll(LTC, 'ltc_mp') + print ' ptr to LTM: ', hex(ptr.value) + + # init TFM and show ltc_mp + LTC.init_TFM() + ptr = c_int.in_dll(LTC, 'ltc_mp') + print ' ptr to TFM: ', hex(ptr.value) + + # now change back to LTM + LTC.init_LTM() + ptr = c_int.in_dll(LTC, 'ltc_mp') + print ' ptr to LTM: ', hex(ptr.value) + + + +#--------------------------------------------------------------- +#--------------------------------------------------------------- +# ctypes getting a list of this build's supported algorithms +# and compiler switches + +def get_named_string(lib, name): + return c_char_p.in_dll(lib, name).value + +if 0: + print '\n%s' % ('-'*60) + print 'This is a string compiled into LTC showing compile ' + print 'options and algorithms supported by this build \n' + print get_named_string(LTC, 'crypt_build_settings') + print + + + +#--------------------------------------------------------------- +#--------------------------------------------------------------- +# here is an example of how a wrapper can make Python access +# more Pythonic + +# - - - - - - - - - - - - - +# a wrapper fragment... + +def _get_size(name): + size = c_int(0) + rc = LTC.crypt_get_size(name, byref(size)) + return size.value + +sha256_state_struct_size = _get_size('sha256_state_struct_size') +sha512_state_struct_size = _get_size('sha512_state_struct_size') + +class SHA256(object): + def __init__(self): + self.state = c_buffer(sha256_state_struct_size) + LTC.sha256_init(byref(self.state)) + def update(self, data): + LTC.sha256_process(byref(self.state), data, len(data)) + def digest(self): + md = c_buffer(32) + LTC.sha256_done(byref(self.state), byref(md)) + return md.raw + +# - - - - - - - - - - - - - +# an app fragment... + +# from wrapper import * # uncomment in real life + +data = 'hello world' + +sha256 = SHA256() +sha256.update(data) +md = sha256.digest() + +template = '\n\n the SHA256 digest for "%s" is %s \n' +print template % (data, md.encode('hex')) + + + +#--------------------------------------------------------------- +#--------------------------------------------------------------- +#--------------------------------------------------------------- From 3f9144c9a7e043421e0b90306a4681d49f11365a Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Sat, 8 Mar 2014 12:16:07 -0800 Subject: [PATCH 03/15] added signatures to header file --- demos/demo_crypt_constants.c | 7 +------ demos/demo_crypt_sizes.c | 7 +------ src/headers/tomcrypt_misc.h | 9 +++++++++ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/demos/demo_crypt_constants.c b/demos/demo_crypt_constants.c index 5ca6a87..d15d0e9 100644 --- a/demos/demo_crypt_constants.c +++ b/demos/demo_crypt_constants.c @@ -9,6 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" +#include "tomcrypt_misc.h" /** @file demo_crypt_constants.c @@ -20,12 +21,6 @@ */ -// in lieu of a header file -int crypt_get_constant(const char* namein, int *valueout); -int crypt_list_all_constants(char *names_list, - unsigned long *names_list_size); - - int main(void) { int rc; diff --git a/demos/demo_crypt_sizes.c b/demos/demo_crypt_sizes.c index f2154e2..30f3b89 100644 --- a/demos/demo_crypt_sizes.c +++ b/demos/demo_crypt_sizes.c @@ -9,6 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" +#include "tomcrypt_misc.h" /** @file demo_crypt_sizes.c @@ -18,12 +19,6 @@ */ -// in lieu of a header file -int crypt_get_size(const char* namein, int *sizeout); -int crypt_list_all_sizes(char *names_list, - unsigned long *names_list_size); - - int main(void) { int rc; printf("\n"); diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index e1e4457..ece5d92 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -49,6 +49,15 @@ extern const char *crypt_build_settings; /* ---- HMM ---- */ int crypt_fsa(void *mp, ...); +/* ---- Dynamic language support ---- */ +int crypt_get_constant(const char* namein, int *valueout); +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); + /* $Source$ */ /* $Revision$ */ /* $Date$ */ From a543e0caa6126566724dad87a0f31bd238d64eff Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Sat, 8 Mar 2014 12:16:58 -0800 Subject: [PATCH 04/15] changed to keep it simple --- demos/demo_dynamic.py | 59 ++++++++++--------------------------------- 1 file changed, 13 insertions(+), 46 deletions(-) diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index a22e240..be538c0 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -13,28 +13,29 @@ dynamic languages. This instance uses Python's ctypes and requires a single - .dylib linking together LTC and one or more math libraries. - Building a single .dylib is needed because LTC wants a - fairly tight relationship between itself and the mathlib. - (ctypes can load multiple .dylibs, but it does not support - this level of coupling between those independent libraries.) + .dylib linking together LTC and a math library. Building + a single .dylib is needed because LTC wants a fairly tight + relationship between itself and the mathlib. (ctypes can + load multiple .dylibs, but it does not support this level + of tight coupling between otherwise independent libraries.) My .dylib was created on OSX with the following steps: 1- compile LTC to a .a static lib: - CFLAGS="-DLTM_DESC -DUSE_LTM -DTFM_DESC -DUSE_TFM \ - -I/usr/local/include" make + CFLAGS="-DLTM_DESC -DUSE_LTM" make - 2- link LTC, LTM and TFM into a single .dylib: - ar2dylib_with_and tomcrypt tommath tfm - where ar2dylib_with_and is a shell script that combines - the .a with .dylibs for LTM and TFM + 2- link LTC and LTM into a single .dylib: + ar2dylib_with tomcrypt tommath + where ar2dylib_with is a shell script that combines + the LTC .a with the LTM .dylib Reminder: you don't need to bind in a math library unless you are going to use LTC functions that depend on a mathlib. For example, public key crypto needs a mathlib; hashing and symmetric encryption - does not. + do not. + + This code was written for Python 2.7. Larry Bugbee March 2014 @@ -138,40 +139,6 @@ if 1: print ' %-25s %d' % (name, value) -#--------------------------------------------------------------- -# init the selected math package, change to another mathlib, -# and change back to the first mathlib - -if 1: - print '\n init the selected math package, change, and change again' - - # show ltm_desc - ptr = c_int.in_dll(LTC, 'ltm_desc') - print ' ltm_desc: ', hex(ptr.value) - # show tfm_desc - ptr = c_int.in_dll(LTC, 'tfm_desc') - print ' tfm_desc: ', hex(ptr.value) - # let's see the initial value of ltc_mp - ptr = c_int.in_dll(LTC, 'ltc_mp') - print ' initial ptr:', hex(ptr.value) - - # init LTM and show ltc_mp - LTC.init_LTM() - ptr = c_int.in_dll(LTC, 'ltc_mp') - print ' ptr to LTM: ', hex(ptr.value) - - # init TFM and show ltc_mp - LTC.init_TFM() - ptr = c_int.in_dll(LTC, 'ltc_mp') - print ' ptr to TFM: ', hex(ptr.value) - - # now change back to LTM - LTC.init_LTM() - ptr = c_int.in_dll(LTC, 'ltc_mp') - print ' ptr to LTM: ', hex(ptr.value) - - - #--------------------------------------------------------------- #--------------------------------------------------------------- # ctypes getting a list of this build's supported algorithms From ef1fe79ca597d3f64412c95eca8792901781ae37 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Tue, 11 Mar 2014 22:25:27 -0700 Subject: [PATCH 05/15] added missing signatures --- src/headers/tomcrypt_misc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index ece5d92..73b0c5f 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -58,6 +58,10 @@ int crypt_get_size(const char* namein, int *sizeout); int crypt_list_all_sizes(char *names_list, unsigned long *names_list_size); +void init_LTM(void); +void init_TFM(void); + + /* $Source$ */ /* $Revision$ */ /* $Date$ */ From f07234fd93227f80aedb921120716543a5ac8c6f Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Wed, 12 Mar 2014 01:48:26 -0700 Subject: [PATCH 06/15] removed redundant include --- demos/demo_crypt_constants.c | 1 - demos/demo_crypt_sizes.c | 1 - 2 files changed, 2 deletions(-) diff --git a/demos/demo_crypt_constants.c b/demos/demo_crypt_constants.c index d15d0e9..410c132 100644 --- a/demos/demo_crypt_constants.c +++ b/demos/demo_crypt_constants.c @@ -9,7 +9,6 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" -#include "tomcrypt_misc.h" /** @file demo_crypt_constants.c diff --git a/demos/demo_crypt_sizes.c b/demos/demo_crypt_sizes.c index 30f3b89..ea566d9 100644 --- a/demos/demo_crypt_sizes.c +++ b/demos/demo_crypt_sizes.c @@ -9,7 +9,6 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" -#include "tomcrypt_misc.h" /** @file demo_crypt_sizes.c From 46b6e36ea66635c821907c25ed49278a72373d69 Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Thu, 13 Mar 2014 21:07:25 -0700 Subject: [PATCH 07/15] to know if LTC compiled big/little endian, 32/64-bit word --- demos/demo_dynamic.py | 2 ++ src/misc/crypt/crypt_constants.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index be538c0..275a6e8 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -109,6 +109,8 @@ if 1: print '\n selected constants:' names = [ + 'ENDIAN_LITTLE', + 'ENDIAN_64BITWORD', 'PK_PUBLIC', 'MAX_RSA_SIZE', 'CTR_COUNTER_BIG_ENDIAN', diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 79b1942..bc74578 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -25,6 +25,30 @@ typedef struct { } crypt_constant; crypt_constant _crypt_constants[] = { +#ifdef ENDIAN_LITTLE + {"ENDIAN_LITTLE", 1}, // true +#else + {"ENDIAN_LITTLE", 0}, // false +#endif + +#ifdef ENDIAN_BIG + {"ENDIAN_BIG", 1}, // true +#else + {"ENDIAN_BIG", 0}, // false +#endif + +#ifdef ENDIAN_32BITWORD + {"ENDIAN_32BITWORD", 1}, // true +#else + {"ENDIAN_32BITWORD", 0}, // false +#endif + +#ifdef ENDIAN_64BITWORD + {"ENDIAN_64BITWORD", 1}, // true +#else + {"ENDIAN_64BITWORD", 0}, // false +#endif + #ifdef LTC_CTR_MODE {"CTR_COUNTER_LITTLE_ENDIAN", CTR_COUNTER_LITTLE_ENDIAN}, {"CTR_COUNTER_BIG_ENDIAN", CTR_COUNTER_BIG_ENDIAN}, From a6b68849827b4517b3bebfeae593271559d6c51f Mon Sep 17 00:00:00 2001 From: Larry Bugbee Date: Sun, 16 Mar 2014 00:14:43 -0700 Subject: [PATCH 08/15] minor editorial changes --- src/misc/crypt/crypt_constants.c | 46 +++++++++++++++++--------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index bc74578..486a312 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -17,6 +17,7 @@ like Python - Larry Bugbee, February 2013 LB - Dec 2013 - revised to include compiler define options + LB - Mar 2014 - added endianness and word size */ typedef struct { @@ -25,6 +26,26 @@ typedef struct { } crypt_constant; crypt_constant _crypt_constants[] = { + {"PK_PUBLIC", PK_PUBLIC}, + {"PK_PRIVATE", PK_PRIVATE}, + +#ifdef LTC_CTR_MODE + {"CTR_COUNTER_LITTLE_ENDIAN", CTR_COUNTER_LITTLE_ENDIAN}, + {"CTR_COUNTER_BIG_ENDIAN", CTR_COUNTER_BIG_ENDIAN}, + {"LTC_CTR_RFC3686", LTC_CTR_RFC3686}, +#endif + +#ifdef LTC_MRSA + {"MIN_RSA_SIZE", MIN_RSA_SIZE}, + {"MAX_RSA_SIZE", MAX_RSA_SIZE}, +#endif + +#ifdef LTC_PKCS_1 + {"LTC_PKCS_1_OAEP", LTC_PKCS_1_OAEP}, + {"LTC_PKCS_1_PSS", LTC_PKCS_1_PSS}, + {"LTC_PKCS_1_V1_5", LTC_PKCS_1_V1_5}, +#endif + #ifdef ENDIAN_LITTLE {"ENDIAN_LITTLE", 1}, // true #else @@ -48,30 +69,11 @@ crypt_constant _crypt_constants[] = { #else {"ENDIAN_64BITWORD", 0}, // false #endif - -#ifdef LTC_CTR_MODE - {"CTR_COUNTER_LITTLE_ENDIAN", CTR_COUNTER_LITTLE_ENDIAN}, - {"CTR_COUNTER_BIG_ENDIAN", CTR_COUNTER_BIG_ENDIAN}, - {"LTC_CTR_RFC3686", LTC_CTR_RFC3686}, -#endif - - {"PK_PUBLIC", PK_PUBLIC}, - {"PK_PRIVATE", PK_PRIVATE}, -#ifdef LTC_MRSA - {"MIN_RSA_SIZE", MIN_RSA_SIZE}, - {"MAX_RSA_SIZE", MAX_RSA_SIZE}, -#endif - -#ifdef LTC_PKCS_1 - {"LTC_PKCS_1_OAEP", LTC_PKCS_1_OAEP}, - {"LTC_PKCS_1_PSS", LTC_PKCS_1_PSS}, - {"LTC_PKCS_1_V1_5", LTC_PKCS_1_V1_5}, -#endif }; /* crypt_get_constant() - * sizeout will be the size (bytes) of the named struct or union + * valueout will be the value of the named constant * return -1 if named item not found */ int crypt_get_constant(const char* namein, int *valueout) { @@ -88,8 +90,8 @@ int crypt_get_constant(const char* namein, int *valueout) { /* crypt_list_all_constants() * if names_list is NULL, names_list_size will be the minimum - * size needed to receive the complete names_list - * if names_list is NOT NULL, names_list must be the addr with + * number of bytes needed to receive the complete names_list + * if names_list is NOT NULL, names_list must be the addr of * sufficient memory allocated into which the names_list * is to be written. Also, the value in names_list_size * sets the upper bound of the number of characters to be From e628fb9203caff080d5a9a8de048a1de5b7f485f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 13:58:48 +0200 Subject: [PATCH 09/15] clean up/trim trailing spaces --- demos/demo_crypt_constants.c | 48 +++++++++++++------------- demos/demo_crypt_sizes.c | 20 +++++------ src/headers/tomcrypt_misc.h | 6 ++-- src/misc/crypt/crypt_constants.c | 58 ++++++++++++++++---------------- src/misc/crypt/crypt_sizes.c | 40 +++++++++++----------- 5 files changed, 83 insertions(+), 89 deletions(-) diff --git a/demos/demo_crypt_constants.c b/demos/demo_crypt_constants.c index 410c132..9c41cf7 100644 --- a/demos/demo_crypt_constants.c +++ b/demos/demo_crypt_constants.c @@ -12,43 +12,43 @@ /** @file demo_crypt_constants.c - - Demo how to get various constants to dynamic languages + + Demo how to get various constants to dynamic languages like Python - + Larry Bugbee, February 2013 */ int main(void) { - int rc; - - printf("\n"); - // given a specific constant name, get and print its value char name[] = "CTR_COUNTER_BIG_ENDIAN"; int value; - - rc = crypt_get_constant(name, &value); - printf(" %s is %d \n", name, value); - printf("\n"); - + + if (crypt_get_constant(name, &value) != 0) + exit(EXIT_FAILURE); + printf("\n %s is %d \n\n", name, value); + // get and print the length of the names (and values) list char *names_list; unsigned long names_list_len; - - rc = crypt_list_all_constants(NULL, &names_list_len); - printf(" need to allocate %lu bytes \n", names_list_len); - printf("\n"); - + + if (crypt_list_all_constants(NULL, &names_list_len) != 0) + exit(EXIT_FAILURE); + printf(" need to allocate %lu bytes \n\n", names_list_len); + // get and print the names (and values) list - names_list = malloc(names_list_len); - rc = crypt_list_all_constants(names_list, &names_list_len); - printf(" supported constants: \n%s \n", names_list); - printf("\n"); + if ((names_list = malloc(names_list_len)) == NULL) + exit(EXIT_FAILURE); + if (crypt_list_all_constants(names_list, &names_list_len) != 0) + exit(EXIT_FAILURE); + printf(" supported constants:\n\n%s\n\n", names_list); + free(names_list); + + return 0; } -/* $Source: $ */ -/* $Revision: $ */ -/* $Date: $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/demos/demo_crypt_sizes.c b/demos/demo_crypt_sizes.c index ea566d9..dcd8bb0 100644 --- a/demos/demo_crypt_sizes.c +++ b/demos/demo_crypt_sizes.c @@ -12,35 +12,31 @@ /** @file demo_crypt_sizes.c - - Demo how to get various sizes to dynamic languages + + Demo how to get various sizes to dynamic languages like Python - Larry Bugbee, February 2013 */ int main(void) { int rc; - printf("\n"); - + // given a specific size name, get and print its size char name[] = "ecc_key_struct_size"; int size; rc = crypt_get_size(name, &size); - printf(" %s is %d \n", name, size); - printf("\n"); - + printf("\n size of '%s' is %d \n\n", name, size); + // get and print the length of the names (and sizes) list char *sizes_list; unsigned long sizes_list_len; rc = crypt_list_all_sizes(NULL, &sizes_list_len); - printf(" need to allocate %lu bytes \n", sizes_list_len); - printf("\n"); - + printf(" need to allocate %lu bytes \n\n", sizes_list_len); + // get and print the names (and sizes) list sizes_list = malloc(sizes_list_len); rc = crypt_list_all_sizes(sizes_list, &sizes_list_len); - printf(" supported sizes: %s \n", sizes_list); - printf("\n"); + printf(" supported sizes:\n\n%s\n\n", sizes_list); } diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 73b0c5f..18d8b6d 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -51,12 +51,10 @@ int crypt_fsa(void *mp, ...); /* ---- Dynamic language support ---- */ int crypt_get_constant(const char* namein, int *valueout); -int crypt_list_all_constants(char *names_list, - unsigned long *names_list_size); +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); +int crypt_list_all_sizes(char *names_list, unsigned long *names_list_size); void init_LTM(void); void init_TFM(void); diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 486a312..eda3b75 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -12,10 +12,10 @@ /** @file crypt_constants.c - - Make various constants available to dynamic languages + + Make various constants available to dynamic languages like Python - Larry Bugbee, February 2013 - + LB - Dec 2013 - revised to include compiler define options LB - Mar 2014 - added endianness and word size */ @@ -39,7 +39,7 @@ crypt_constant _crypt_constants[] = { {"MIN_RSA_SIZE", MIN_RSA_SIZE}, {"MAX_RSA_SIZE", MAX_RSA_SIZE}, #endif - + #ifdef LTC_PKCS_1 {"LTC_PKCS_1_OAEP", LTC_PKCS_1_OAEP}, {"LTC_PKCS_1_PSS", LTC_PKCS_1_PSS}, @@ -47,27 +47,27 @@ crypt_constant _crypt_constants[] = { #endif #ifdef ENDIAN_LITTLE - {"ENDIAN_LITTLE", 1}, // true + {"ENDIAN_LITTLE", 1}, #else - {"ENDIAN_LITTLE", 0}, // false + {"ENDIAN_LITTLE", 0}, #endif #ifdef ENDIAN_BIG - {"ENDIAN_BIG", 1}, // true + {"ENDIAN_BIG", 1}, #else - {"ENDIAN_BIG", 0}, // false + {"ENDIAN_BIG", 0}, #endif #ifdef ENDIAN_32BITWORD - {"ENDIAN_32BITWORD", 1}, // true + {"ENDIAN_32BITWORD", 1}, #else - {"ENDIAN_32BITWORD", 0}, // false + {"ENDIAN_32BITWORD", 0}, #endif #ifdef ENDIAN_64BITWORD - {"ENDIAN_64BITWORD", 1}, // true + {"ENDIAN_64BITWORD", 1}, #else - {"ENDIAN_64BITWORD", 0}, // false + {"ENDIAN_64BITWORD", 0}, #endif }; @@ -89,32 +89,31 @@ int crypt_get_constant(const char* namein, int *valueout) { } /* crypt_list_all_constants() - * if names_list is NULL, names_list_size will be the minimum + * if names_list is NULL, names_list_size will be the minimum * number of bytes needed to receive the complete names_list - * if names_list is NOT NULL, names_list must be the addr of - * sufficient memory allocated into which the names_list - * is to be written. Also, the value in names_list_size - * sets the upper bound of the number of characters to be + * if names_list is NOT NULL, names_list must be the addr of + * sufficient memory allocated into which the names_list + * is to be written. Also, the value in names_list_size + * sets the upper bound of the number of characters to be * written. * a -1 return value signifies insufficient space made available */ -int crypt_list_all_constants(char *names_list, - unsigned long *names_list_size) { +int crypt_list_all_constants(char *names_list, unsigned long *names_list_size) { int i; unsigned long total_len = 0; char number[10]; int number_len; - int count = sizeof(_crypt_constants) / sizeof(crypt_constant); - + int count = sizeof(_crypt_constants) / sizeof(_crypt_constants[0]); + /* calculate amount of memory required for the list */ for (i=0; i Date: Tue, 15 Jul 2014 14:09:50 +0200 Subject: [PATCH 10/15] use snprintf() instead of sprintf() --- src/misc/crypt/crypt_constants.c | 13 ++++++++----- src/misc/crypt/crypt_sizes.c | 11 +++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index eda3b75..065a832 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -78,7 +78,7 @@ crypt_constant _crypt_constants[] = { */ int crypt_get_constant(const char* namein, int *valueout) { int i; - int _crypt_constants_len = sizeof(_crypt_constants) / sizeof(crypt_constant); + int _crypt_constants_len = sizeof(_crypt_constants) / sizeof(_crypt_constants[0]); for (i=0; i<_crypt_constants_len; i++) { if (strcmp(_crypt_constants[i].name, namein) == 0) { *valueout = _crypt_constants[i].value; @@ -101,7 +101,7 @@ int crypt_get_constant(const char* namein, int *valueout) { int crypt_list_all_constants(char *names_list, unsigned long *names_list_size) { int i; unsigned long total_len = 0; - char number[10]; + char number[32]; int number_len; int count = sizeof(_crypt_constants) / sizeof(_crypt_constants[0]); @@ -109,8 +109,11 @@ int crypt_list_all_constants(char *names_list, unsigned long *names_list_size) { for (i=0; i= sizeof(number))) + return -1; + total_len += number_len + 1; /* this last +1 is for newlines (and ending NULL) */ } @@ -128,7 +131,7 @@ int crypt_list_all_constants(char *names_list, unsigned long *names_list_size) { strcpy(ptr, ","); ptr += 1; - number_len = sprintf(number,"%lu",_crypt_constants[i].value); + number_len = snprintf(number, sizeof(number), "%ld", _crypt_constants[i].value); strcpy(ptr, number); ptr += number_len; strcpy(ptr, "\n"); diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index 5149437..ceaf0fa 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -236,7 +236,7 @@ crypt_size _crypt_sizes[] = { */ int crypt_get_size(const char* namein, int *sizeout) { int i; - int count = sizeof(_crypt_sizes) / sizeof(crypt_size); + int count = sizeof(_crypt_sizes) / sizeof(_crypt_sizes[0]); for (i=0; i= sizeof(number))) + return -1; total_len += strlen(number) + 1; /* this last +1 is for newlines (and ending NULL) */ } @@ -286,7 +289,7 @@ int crypt_list_all_sizes(char *names_list, unsigned long *names_list_size) { strcpy(ptr, ","); ptr += 1; - number_len = sprintf(number,"%lu",_crypt_sizes[i].size); + number_len = snprintf(number, sizeof(number), "%ld", _crypt_sizes[i].size); strcpy(ptr, number); ptr += number_len; strcpy(ptr, "\n"); From fc7eeac2189e34b0ca48a80b5872cb13b1c6303f Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 15:27:31 +0200 Subject: [PATCH 11/15] update/rework constants and sizes --- src/misc/crypt/crypt_constants.c | 107 ++++++++++++++++++++--- src/misc/crypt/crypt_sizes.c | 141 ++++++++++++++++--------------- 2 files changed, 166 insertions(+), 82 deletions(-) diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 065a832..adb6836 100755 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -25,25 +25,100 @@ typedef struct { const long value; } crypt_constant; -crypt_constant _crypt_constants[] = { - {"PK_PUBLIC", PK_PUBLIC}, - {"PK_PRIVATE", PK_PRIVATE}, +#define _C_STRINGIFY(s) { #s, s } -#ifdef LTC_CTR_MODE - {"CTR_COUNTER_LITTLE_ENDIAN", CTR_COUNTER_LITTLE_ENDIAN}, - {"CTR_COUNTER_BIG_ENDIAN", CTR_COUNTER_BIG_ENDIAN}, - {"LTC_CTR_RFC3686", LTC_CTR_RFC3686}, +static const crypt_constant _crypt_constants[] = { + _C_STRINGIFY(PK_PUBLIC), + _C_STRINGIFY(PK_PRIVATE), + + _C_STRINGIFY(PKA_RSA), + _C_STRINGIFY(PKA_DSA), + +#ifdef LTC_PKCS_1 + {"LTC_PKCS_1", 1}, + /* Block types */ + _C_STRINGIFY(LTC_PKCS_1_EMSA), + _C_STRINGIFY(LTC_PKCS_1_EME), + + /* Padding types */ + _C_STRINGIFY(LTC_PKCS_1_V1_5), + _C_STRINGIFY(LTC_PKCS_1_OAEP), + _C_STRINGIFY(LTC_PKCS_1_PSS), +#else + {"LTC_PKCS_1", 0}, #endif #ifdef LTC_MRSA - {"MIN_RSA_SIZE", MIN_RSA_SIZE}, - {"MAX_RSA_SIZE", MAX_RSA_SIZE}, + {"LTC_MRSA", 1}, + _C_STRINGIFY(MIN_RSA_SIZE), + _C_STRINGIFY(MAX_RSA_SIZE), +#else + {"LTC_MRSA", 0}, #endif -#ifdef LTC_PKCS_1 - {"LTC_PKCS_1_OAEP", LTC_PKCS_1_OAEP}, - {"LTC_PKCS_1_PSS", LTC_PKCS_1_PSS}, - {"LTC_PKCS_1_V1_5", LTC_PKCS_1_V1_5}, +#ifdef MKAT + {"MKAT", 1}, + _C_STRINGIFY(MIN_KAT_SIZE), + _C_STRINGIFY(MAX_KAT_SIZE), +#else + {"MKAT", 0}, +#endif + +#ifdef LTC_MECC + {"LTC_MECC", 1}, + _C_STRINGIFY(ECC_BUF_SIZE), + _C_STRINGIFY(ECC_MAXSIZE), +#else + {"LTC_MECC", 0}, +#endif + +#ifdef LTC_MDSA + {"LTC_MDSA", 1}, + _C_STRINGIFY(LTC_MDSA_DELTA), + _C_STRINGIFY(LTC_MDSA_MAX_GROUP), +#else + {"LTC_MDSA", 0}, +#endif + +#ifdef LTC_CTR_MODE + {"LTC_CTR_MODE", 1}, + _C_STRINGIFY(CTR_COUNTER_LITTLE_ENDIAN), + _C_STRINGIFY(CTR_COUNTER_BIG_ENDIAN), + _C_STRINGIFY(LTC_CTR_RFC3686), +#else + {"LTC_CTR_MODE", 0}, +#endif + + _C_STRINGIFY(MAXBLOCKSIZE), + _C_STRINGIFY(TAB_SIZE), + _C_STRINGIFY(ARGTYPE), + +#ifdef LTM_DESC + {"LTM_DESC", 1}, +#else + {"LTM_DESC", 0}, +#endif +#ifdef TFM_DESC + {"TFM_DESC", 1}, +#else + {"TFM_DESC", 0}, +#endif +#ifdef GMP_DESC + {"GMP_DESC", 1}, +#else + {"GMP_DESC", 0}, +#endif + +#ifdef LTC_FAST + {"LTC_FAST", 1}, +#else + {"LTC_FAST", 0}, +#endif + +#ifdef LTC_NO_FILE + {"LTC_NO_FILE", 1}, +#else + {"LTC_NO_FILE", 0}, #endif #ifdef ENDIAN_LITTLE @@ -69,6 +144,12 @@ crypt_constant _crypt_constants[] = { #else {"ENDIAN_64BITWORD", 0}, #endif + +#ifdef ENDIAN_NEUTRAL + {"ENDIAN_NEUTRAL", 1}, +#else + {"ENDIAN_NEUTRAL", 0}, +#endif }; diff --git a/src/misc/crypt/crypt_sizes.c b/src/misc/crypt/crypt_sizes.c index ceaf0fa..d7b1cb8 100755 --- a/src/misc/crypt/crypt_sizes.c +++ b/src/misc/crypt/crypt_sizes.c @@ -25,165 +25,168 @@ typedef struct { const long size; } crypt_size; -crypt_size _crypt_sizes[] = { +#define _SZ_STRINGIFY_S(s) { #s, sizeof(struct s) } +#define _SZ_STRINGIFY_T(s) { #s, sizeof(s) } + +static const crypt_size _crypt_sizes[] = { // hash state sizes - {"hash_descriptor_struct_size", sizeof(struct ltc_hash_descriptor)}, - {"hash_state_union_size", sizeof(hash_state)}, + _SZ_STRINGIFY_S(ltc_hash_descriptor), + _SZ_STRINGIFY_T(hash_state), #ifdef LTC_SHA256 - {"sha256_state_struct_size", sizeof(struct sha256_state)}, + _SZ_STRINGIFY_S(sha256_state), #endif #ifdef LTC_SHA512 - {"sha512_state_struct_size", sizeof(struct sha512_state)}, + _SZ_STRINGIFY_S(sha512_state), #endif #ifdef LTC_WHIRLPOOL - {"whirlpool_state_struct_size", sizeof(struct whirlpool_state)}, + _SZ_STRINGIFY_S(whirlpool_state), #endif #ifdef LTC_MD2 - {"md2_state_struct_size", sizeof(struct md2_state)}, + _SZ_STRINGIFY_S(md2_state), #endif #ifdef LTC_MD4 - {"md4_state_struct_size", sizeof(struct md4_state)}, + _SZ_STRINGIFY_S(md4_state), #endif #ifdef LTC_MD5 - {"md5_state_struct_size", sizeof(struct md5_state)}, + _SZ_STRINGIFY_S(md5_state), #endif #ifdef LTC_RIPEMD128 - {"rmd128_state_struct_size", sizeof(struct rmd128_state)}, + _SZ_STRINGIFY_S(rmd128_state), #endif #ifdef LTC_RIPEMD160 - {"rmd160_state_struct_size", sizeof(struct rmd160_state)}, + _SZ_STRINGIFY_S(rmd160_state), #endif #ifdef LTC_RIPEMD256 - {"rmd256_state_struct_size", sizeof(struct rmd256_state)}, + _SZ_STRINGIFY_S(rmd256_state), #endif #ifdef LTC_RIPEMD320 - {"rmd320_state_struct_size", sizeof(struct rmd320_state)}, + _SZ_STRINGIFY_S(rmd320_state), #endif #ifdef LTC_SHA1 - {"sha1_state_struct_size", sizeof(struct sha1_state)}, + _SZ_STRINGIFY_S(sha1_state), #endif #ifdef LTC_TIGER - {"tiger_state_struct_size", sizeof(struct tiger_state)}, + _SZ_STRINGIFY_S(tiger_state), #endif #ifdef LTC_CHC_HASH - {"chc_state_struct_size", sizeof(struct chc_state)}, + _SZ_STRINGIFY_S(chc_state), #endif // block cipher key sizes - {"cipher_descriptor_struct_size", sizeof(struct ltc_cipher_descriptor)}, - {"symmetric_key_union_size", sizeof(symmetric_key)}, + _SZ_STRINGIFY_S(ltc_cipher_descriptor), + _SZ_STRINGIFY_T(symmetric_key), #ifdef LTC_ANUBIS - {"anubis_key_struct_size", sizeof(struct anubis_key)}, + _SZ_STRINGIFY_S(anubis_key), #endif #ifdef LTC_CAMELLIA - {"camellia_key_struct_size", sizeof(struct camellia_key)}, + _SZ_STRINGIFY_S(camellia_key), #endif #ifdef LTC_BLOWFISH - {"blowfish_key_struct_size", sizeof(struct blowfish_key)}, + _SZ_STRINGIFY_S(blowfish_key), #endif #ifdef LTC_CAST5 - {"cast5_key_struct_size", sizeof(struct cast5_key)}, + _SZ_STRINGIFY_S(cast5_key), #endif #ifdef LTC_DES - {"des_key_struct_size", sizeof(struct des_key)}, - {"des3_key_struct_size", sizeof(struct des3_key)}, + _SZ_STRINGIFY_S(des_key), + _SZ_STRINGIFY_S(des3_key), #endif #ifdef LTC_KASUMI - {"kasumi_key_struct_size", sizeof(struct kasumi_key)}, + _SZ_STRINGIFY_S(kasumi_key), #endif #ifdef LTC_KHAZAD - {"khazad_key_struct_size", sizeof(struct khazad_key)}, + _SZ_STRINGIFY_S(khazad_key), #endif #ifdef LTC_KSEED - {"kseed_key_struct_size", sizeof(struct kseed_key)}, + _SZ_STRINGIFY_S(kseed_key), #endif #ifdef LTC_MULTI2 -// {"multi2_key_struct_size", sizeof(struct multi2_key)}, + _SZ_STRINGIFY_S(multi2_key), #endif #ifdef LTC_NOEKEON - {"noekeon_key_struct_size", sizeof(struct noekeon_key)}, + _SZ_STRINGIFY_S(noekeon_key), #endif #ifdef LTC_RC2 - {"rc2_key_struct_size", sizeof(struct rc2_key)}, + _SZ_STRINGIFY_S(rc2_key), #endif #ifdef LTC_RC5 - {"rc5_key_struct_size", sizeof(struct rc5_key)}, + _SZ_STRINGIFY_S(rc5_key), #endif #ifdef LTC_RC6 - {"rc6_key_struct_size", sizeof(struct rc6_key)}, + _SZ_STRINGIFY_S(rc6_key), #endif #ifdef LTC_SKIPJACK - {"skipjack_key_struct_size", sizeof(struct skipjack_key)}, + _SZ_STRINGIFY_S(skipjack_key), #endif #ifdef LTC_XTEA - {"xtea_key_struct_size", sizeof(struct xtea_key)}, + _SZ_STRINGIFY_S(xtea_key), #endif #ifdef LTC_RIJNDAEL - {"rijndael_key_struct_size", sizeof(struct rijndael_key)}, + _SZ_STRINGIFY_S(rijndael_key), #endif #ifdef LTC_SAFER - {"safer_key_struct_size", sizeof(struct safer_key)}, + _SZ_STRINGIFY_S(safer_key), #endif #ifdef LTC_SAFERP - {"saferp_key_struct_size", sizeof(struct saferp_key)}, + _SZ_STRINGIFY_S(saferp_key), #endif #ifdef LTC_TWOFISH - {"twofish_key_struct_size", sizeof(struct twofish_key)}, + _SZ_STRINGIFY_S(twofish_key), #endif // mode sizes #ifdef LTC_CBC_MODE - {"symmetric_CBC_struct_size", sizeof(symmetric_CBC)}, + _SZ_STRINGIFY_T(symmetric_CBC), #endif #ifdef LTC_CFB_MODE - {"symmetric_CFB_struct_size", sizeof(symmetric_CFB)}, + _SZ_STRINGIFY_T(symmetric_CFB), #endif #ifdef LTC_CTR_MODE - {"symmetric_CTR_struct_size", sizeof(symmetric_CTR)}, + _SZ_STRINGIFY_T(symmetric_CTR), #endif #ifdef LTC_ECB_MODE - {"symmetric_ECB_struct_size", sizeof(symmetric_ECB)}, + _SZ_STRINGIFY_T(symmetric_ECB), #endif #ifdef LTC_F8_MODE - {"symmetric_F8_struct_size", sizeof(symmetric_F8)}, + _SZ_STRINGIFY_T(symmetric_F8), #endif #ifdef LTC_LRW_MODE - {"symmetric_LRW_struct_size", sizeof(symmetric_LRW)}, + _SZ_STRINGIFY_T(symmetric_LRW), #endif #ifdef LTC_OFB_MODE - {"symmetric_OFB_struct_size", sizeof(symmetric_OFB)}, + _SZ_STRINGIFY_T(symmetric_OFB), #endif // MAC sizes -- no states for ccm, lrw #ifdef LTC_F9_MODE - {"f9_state_struct_size", sizeof(f9_state)}, + _SZ_STRINGIFY_T(f9_state), #endif #ifdef LTC_HMAC - {"hmac_state_struct_size", sizeof(hmac_state)}, + _SZ_STRINGIFY_T(hmac_state), #endif #ifdef LTC_OMAC - {"omac_state_struct_size", sizeof(omac_state)}, + _SZ_STRINGIFY_T(omac_state), #endif #ifdef LTC_PELICAN - {"pelican_state_struct_size", sizeof(pelican_state)}, + _SZ_STRINGIFY_T(pelican_state), #endif #ifdef LTC_PMAC - {"pmac_state_struct_size", sizeof(pmac_state)}, + _SZ_STRINGIFY_T(pmac_state), #endif #ifdef LTC_XCBC - {"xcbc_state_struct_size", sizeof(xcbc_state)}, + _SZ_STRINGIFY_T(xcbc_state), #endif #ifdef LTC_OCB_MODE - {"ocb_state_struct_size", sizeof(ocb_state)}, + _SZ_STRINGIFY_T(ocb_state), #endif #ifdef LTC_OCB3_MODE - {"ocb3_state_struct_size", sizeof(ocb3_state)}, + _SZ_STRINGIFY_T(ocb3_state), #endif #ifdef LTC_GCM_MODE - {"gcm_state_struct_size", sizeof(gcm_state)}, + _SZ_STRINGIFY_T(gcm_state), #endif #ifdef LTC_EAX_MODE - {"eax_state_struct_size", sizeof(eax_state)}, + _SZ_STRINGIFY_T(eax_state), #endif #ifdef LTC_CCM_MODE // not defined @@ -194,37 +197,37 @@ crypt_size _crypt_sizes[] = { // asymmetric keys #ifdef LTC_MRSA - {"rsa_key_struct_size", sizeof(rsa_key)}, + _SZ_STRINGIFY_T(rsa_key), #endif #ifdef LTC_MDSA - {"dsa_key_struct_size", sizeof(dsa_key)}, + _SZ_STRINGIFY_T(dsa_key), #endif -#ifdef MDH - {"dh_key_struct_size", sizeof(dh_key)}, +#ifdef LTC_MDH + _SZ_STRINGIFY_T(dh_key), #endif #ifdef LTC_MECC - {"ecc_set_struct_size", sizeof(ltc_ecc_set_type)}, - {"ecc_key_struct_size", sizeof(ecc_key)}, - {"ecc_point_struct_size", sizeof(ecc_point)}, + _SZ_STRINGIFY_T(ltc_ecc_set_type), + _SZ_STRINGIFY_T(ecc_key), + _SZ_STRINGIFY_T(ecc_point), #endif #ifdef MKAT -// {"katja_key_struct_size", sizeof(katja_key)}, + _SZ_STRINGIFY_T(katja_key), #endif // prng state sizes - {"prng_descriptor_struct_size", sizeof(struct ltc_prng_descriptor)}, - {"prng_state_union_size", sizeof(prng_state)}, + _SZ_STRINGIFY_S(ltc_prng_descriptor), + _SZ_STRINGIFY_T(prng_state), #ifdef LTC_FORTUNA - {"fortuna_prng_struct_size", sizeof(struct fortuna_prng)}, + _SZ_STRINGIFY_S(fortuna_prng), #endif #ifdef LTC_RC4 - {"rc4_prng_struct_size", sizeof(struct rc4_prng)}, + _SZ_STRINGIFY_S(rc4_prng), #endif #ifdef LTC_SOBER128 - {"sober128_prng_struct_size", sizeof(struct sober128_prng)}, + _SZ_STRINGIFY_S(sober128_prng), #endif #ifdef LTC_YARROW - {"yarrow_prng_struct_size", sizeof(struct yarrow_prng)}, + _SZ_STRINGIFY_S(yarrow_prng), #endif // sprng has no state as it uses other potentially available sources // like /dev/random. See Developers Guide for more info. From 746fd583c9c0ea29720681076585e476e1ceda0c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 15:28:29 +0200 Subject: [PATCH 12/15] update demos according to changed naming --- demos/demo_crypt_sizes.c | 2 +- demos/demo_dynamic.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) mode change 100644 => 100755 demos/demo_dynamic.py diff --git a/demos/demo_crypt_sizes.c b/demos/demo_crypt_sizes.c index dcd8bb0..ea1cef1 100644 --- a/demos/demo_crypt_sizes.c +++ b/demos/demo_crypt_sizes.c @@ -22,7 +22,7 @@ int main(void) { int rc; // given a specific size name, get and print its size - char name[] = "ecc_key_struct_size"; + char name[] = "ecc_key"; int size; rc = crypt_get_size(name, &size); printf("\n size of '%s' is %d \n\n", name, size); diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py old mode 100644 new mode 100755 index 275a6e8..81f6f8b --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -126,13 +126,13 @@ if 1: print '\n selected sizes:' names = [ - 'rijndael_key_struct_size', - 'rsa_key_struct_size', - 'symmetric_CTR_struct_size', - 'twofish_key_struct_size', - 'ecc_point_struct_size', - 'gcm_state_struct_size', - 'sha512_state_struct_size', + 'rijndael_key', + 'rsa_key', + 'symmetric_CTR', + 'twofish_key', + 'ecc_point', + 'gcm_state', + 'sha512_state', ] for name in names: size_value = c_int(0) @@ -171,8 +171,8 @@ def _get_size(name): rc = LTC.crypt_get_size(name, byref(size)) return size.value -sha256_state_struct_size = _get_size('sha256_state_struct_size') -sha512_state_struct_size = _get_size('sha512_state_struct_size') +sha256_state_struct_size = _get_size('sha256_state') +sha512_state_struct_size = _get_size('sha512_state') class SHA256(object): def __init__(self): From 542ba9995c3fdffc89b6cd4a90d25f3f9abf9ece Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 15:38:18 +0200 Subject: [PATCH 13/15] 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$ */ From 5fa34ad1714718bf2f8f478e8c9107b998149dd5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 15:45:33 +0200 Subject: [PATCH 14/15] update makefiles --- makefile | 34 ++++++++++++++++++---------------- makefile.icc | 34 ++++++++++++++++++---------------- makefile.mingw | 34 ++++++++++++++++++---------------- makefile.msvc | 34 ++++++++++++++++++---------------- makefile.shared | 34 ++++++++++++++++++---------------- makefile.unix | 34 ++++++++++++++++++---------------- 6 files changed, 108 insertions(+), 96 deletions(-) diff --git a/makefile b/makefile index 2ff2d82..dea1ea2 100644 --- a/makefile +++ b/makefile @@ -159,24 +159,26 @@ src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ -src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ -src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ -src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ -src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ -src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ -src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ +src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ +src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ diff --git a/makefile.icc b/makefile.icc index f18d1d5..6d5a4d2 100644 --- a/makefile.icc +++ b/makefile.icc @@ -142,24 +142,26 @@ src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ -src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ -src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ -src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ -src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ -src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ -src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ +src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ +src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ diff --git a/makefile.mingw b/makefile.mingw index bae91a5..888fac2 100644 --- a/makefile.mingw +++ b/makefile.mingw @@ -89,24 +89,26 @@ src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ -src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ -src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ -src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ -src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ -src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ -src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ +src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ +src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ diff --git a/makefile.msvc b/makefile.msvc index 13e25eb..afb1ad6 100644 --- a/makefile.msvc +++ b/makefile.msvc @@ -47,24 +47,26 @@ src/mac/xcbc/xcbc_test.obj src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.o src/math/multi.obj src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj \ src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj src/misc/burn_stack.obj \ src/misc/crypt/crypt_argchk.obj src/misc/crypt/crypt.obj src/misc/crypt/crypt_cipher_descriptor.obj \ -src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_find_cipher_any.obj \ -src/misc/crypt/crypt_find_cipher.obj src/misc/crypt/crypt_find_cipher_id.obj \ -src/misc/crypt/crypt_find_hash_any.obj src/misc/crypt/crypt_find_hash.obj \ -src/misc/crypt/crypt_find_hash_id.obj src/misc/crypt/crypt_find_hash_oid.obj \ -src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj src/misc/crypt/crypt_hash_descriptor.obj \ -src/misc/crypt/crypt_hash_is_valid.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ +src/misc/crypt/crypt_cipher_is_valid.obj src/misc/crypt/crypt_constants.obj \ +src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher.obj \ +src/misc/crypt/crypt_find_cipher_id.obj src/misc/crypt/crypt_find_hash_any.obj \ +src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_id.obj \ +src/misc/crypt/crypt_find_hash_oid.obj src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj \ +src/misc/crypt/crypt_hash_descriptor.obj src/misc/crypt/crypt_hash_is_valid.obj \ +src/misc/crypt/crypt_inits.obj src/misc/crypt/crypt_ltc_mp_descriptor.obj \ src/misc/crypt/crypt_prng_descriptor.obj src/misc/crypt/crypt_prng_is_valid.obj \ src/misc/crypt/crypt_register_cipher.obj src/misc/crypt/crypt_register_hash.obj \ -src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_unregister_cipher.obj \ -src/misc/crypt/crypt_unregister_hash.obj src/misc/crypt/crypt_unregister_prng.obj \ -src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj src/misc/hkdf/hkdf_test.obj src/misc/pkcs5/pkcs_5_1.obj \ -src/misc/pkcs5/pkcs_5_2.obj src/misc/pkcs5/pkcs_5_test.obj src/misc/pk_get_oid.obj src/misc/zeromem.obj \ -src/modes/cbc/cbc_decrypt.obj src/modes/cbc/cbc_done.obj src/modes/cbc/cbc_encrypt.obj \ -src/modes/cbc/cbc_getiv.obj src/modes/cbc/cbc_setiv.obj src/modes/cbc/cbc_start.obj \ -src/modes/cfb/cfb_decrypt.obj src/modes/cfb/cfb_done.obj src/modes/cfb/cfb_encrypt.obj \ -src/modes/cfb/cfb_getiv.obj src/modes/cfb/cfb_setiv.obj src/modes/cfb/cfb_start.obj \ -src/modes/ctr/ctr_decrypt.obj src/modes/ctr/ctr_done.obj src/modes/ctr/ctr_encrypt.obj \ -src/modes/ctr/ctr_getiv.obj src/modes/ctr/ctr_setiv.obj src/modes/ctr/ctr_start.obj src/modes/ctr/ctr_test.obj \ +src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \ +src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \ +src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \ +src/misc/hkdf/hkdf_test.obj src/misc/pkcs5/pkcs_5_1.obj src/misc/pkcs5/pkcs_5_2.obj \ +src/misc/pkcs5/pkcs_5_test.obj src/misc/pk_get_oid.obj src/misc/zeromem.obj src/modes/cbc/cbc_decrypt.obj \ +src/modes/cbc/cbc_done.obj src/modes/cbc/cbc_encrypt.obj src/modes/cbc/cbc_getiv.obj \ +src/modes/cbc/cbc_setiv.obj src/modes/cbc/cbc_start.obj src/modes/cfb/cfb_decrypt.obj \ +src/modes/cfb/cfb_done.obj src/modes/cfb/cfb_encrypt.obj src/modes/cfb/cfb_getiv.obj \ +src/modes/cfb/cfb_setiv.obj src/modes/cfb/cfb_start.obj src/modes/ctr/ctr_decrypt.obj \ +src/modes/ctr/ctr_done.obj src/modes/ctr/ctr_encrypt.obj src/modes/ctr/ctr_getiv.obj \ +src/modes/ctr/ctr_setiv.obj src/modes/ctr/ctr_start.obj src/modes/ctr/ctr_test.obj \ src/modes/ecb/ecb_decrypt.obj src/modes/ecb/ecb_done.obj src/modes/ecb/ecb_encrypt.obj \ src/modes/ecb/ecb_start.obj src/modes/f8/f8_decrypt.obj src/modes/f8/f8_done.obj src/modes/f8/f8_encrypt.obj \ src/modes/f8/f8_getiv.obj src/modes/f8/f8_setiv.obj src/modes/f8/f8_start.obj src/modes/f8/f8_test_mode.obj \ diff --git a/makefile.shared b/makefile.shared index d658e08..3aa78b4 100644 --- a/makefile.shared +++ b/makefile.shared @@ -141,24 +141,26 @@ src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ -src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ -src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ -src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ -src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ -src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ -src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ +src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ +src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ diff --git a/makefile.unix b/makefile.unix index eb2f38c..9e2a645 100644 --- a/makefile.unix +++ b/makefile.unix @@ -83,24 +83,26 @@ src/mac/xcbc/xcbc_test.o src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src src/math/multi.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o \ src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \ src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt.o src/misc/crypt/crypt_cipher_descriptor.o \ -src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher_any.o \ -src/misc/crypt/crypt_find_cipher.o src/misc/crypt/crypt_find_cipher_id.o \ -src/misc/crypt/crypt_find_hash_any.o src/misc/crypt/crypt_find_hash.o \ -src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \ -src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \ -src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ +src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_constants.o \ +src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher.o \ +src/misc/crypt/crypt_find_cipher_id.o src/misc/crypt/crypt_find_hash_any.o \ +src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_id.o \ +src/misc/crypt/crypt_find_hash_oid.o src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o \ +src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \ +src/misc/crypt/crypt_inits.o src/misc/crypt/crypt_ltc_mp_descriptor.o \ src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \ src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \ -src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \ -src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \ -src/misc/error_to_string.o src/misc/hkdf/hkdf.o src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o \ -src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o \ -src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \ -src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \ -src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \ -src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \ -src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ -src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ +src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \ +src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \ +src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \ +src/misc/hkdf/hkdf_test.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o \ +src/misc/pkcs5/pkcs_5_test.o src/misc/pk_get_oid.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \ +src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \ +src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \ +src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \ +src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \ +src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \ +src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \ src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \ src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \ src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \ From 7189998ba1282a003d79b3ab89adc3177ad642c6 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 15 Jul 2014 15:45:39 +0200 Subject: [PATCH 15/15] update gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 8f8f6d1..fe67ca5 100644 --- a/.gitignore +++ b/.gitignore @@ -14,10 +14,14 @@ tv.txt *_tv.txt # *nix/windows test executables +constants +constants.exe encrypt encrypt.exe hashsum hashsum.exe +sizes +sizes.exe small small.exe test