to know if LTC compiled big/little endian, 32/64-bit word

This commit is contained in:
Larry Bugbee 2014-03-13 21:07:25 -07:00 committed by Steffen Jaeckel
parent f07234fd93
commit 46b6e36ea6
2 changed files with 26 additions and 0 deletions

View File

@ -109,6 +109,8 @@ if 1:
print '\n selected constants:'
names = [
'ENDIAN_LITTLE',
'ENDIAN_64BITWORD',
'PK_PUBLIC',
'MAX_RSA_SIZE',
'CTR_COUNTER_BIG_ENDIAN',

View File

@ -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},