clean-up test-build and extend tomcrypt_custom.h
added LTC_MINIMAL to be able do a build without nearly any functionality :) make sure timing resistant RSA & ECC are enabled if not said otherwise
This commit is contained in:
+4
-4
@@ -12,7 +12,7 @@
|
||||
|
||||
/**
|
||||
@file des.c
|
||||
LTC_DES code submitted by Dobes Vandermeer
|
||||
DES code submitted by Dobes Vandermeer
|
||||
*/
|
||||
|
||||
#ifdef LTC_DES
|
||||
@@ -1450,9 +1450,9 @@ static void _desfunc(ulong32 *block, const ulong32 *keys)
|
||||
for (cur_round = 0; cur_round < 8; cur_round++) {
|
||||
work = RORc(right, 4) ^ *keys++;
|
||||
leftt ^= SP7[work & 0x3fL]
|
||||
^ SP5[(work >> 8) & 0x3fL]
|
||||
^ SP3[(work >> 16) & 0x3fL]
|
||||
^ SP1[(work >> 24) & 0x3fL];
|
||||
^ SP5[(work >> 8) & 0x3fL]
|
||||
^ SP3[(work >> 16) & 0x3fL]
|
||||
^ SP1[(work >> 24) & 0x3fL];
|
||||
work = right ^ *keys++;
|
||||
leftt ^= SP8[ work & 0x3fL]
|
||||
^ SP6[(work >> 8) & 0x3fL]
|
||||
|
||||
@@ -125,6 +125,19 @@
|
||||
#define LTC_BASE64
|
||||
#endif
|
||||
|
||||
/* The minimal set of functionality to run the tests */
|
||||
#ifdef LTC_MINIMAL
|
||||
#define LTC_SHA256
|
||||
#define LTC_CTR_MODE
|
||||
#define LTC_RNG_MAKE_PRNG
|
||||
#define LTC_RNG_GET_BYTES
|
||||
#define LTC_YARROW
|
||||
#define LTC_DEVRANDOM
|
||||
#define LTC_TRY_URANDOM_FIRST
|
||||
|
||||
#undef LTC_NO_FILE
|
||||
#endif
|
||||
|
||||
/* Enable self-test test vector checking */
|
||||
#ifndef LTC_NO_TEST
|
||||
#define LTC_TEST
|
||||
@@ -252,6 +265,7 @@
|
||||
|
||||
#endif /* LTC_NO_HASHES */
|
||||
|
||||
|
||||
/* ---> MAC functions <--- */
|
||||
#ifndef LTC_NO_MACS
|
||||
|
||||
@@ -283,6 +297,7 @@
|
||||
|
||||
#endif /* LTC_NO_MACS */
|
||||
|
||||
|
||||
/* --> Pseudo Random Number Generators <--- */
|
||||
#ifndef LTC_NO_PRNGS
|
||||
|
||||
@@ -304,17 +319,14 @@
|
||||
|
||||
/* Fortuna PRNG */
|
||||
#define LTC_FORTUNA
|
||||
/* reseed every N calls to the read function */
|
||||
#define LTC_FORTUNA_WD 10
|
||||
/* number of pools (4..32) can save a bit of ram by lowering the count */
|
||||
#define LTC_FORTUNA_POOLS 32
|
||||
|
||||
/* Greg's LTC_SOBER128 PRNG ;-0 */
|
||||
#define LTC_SOBER128
|
||||
|
||||
/* the *nix style /dev/random device */
|
||||
#define LTC_DEVRANDOM
|
||||
/* try /dev/urandom before trying /dev/random */
|
||||
/* try /dev/urandom before trying /dev/random
|
||||
* are you sure you want to disable this? http://www.2uo.de/myths-about-urandom/ */
|
||||
#define LTC_TRY_URANDOM_FIRST
|
||||
/* rng_get_bytes() */
|
||||
#define LTC_RNG_GET_BYTES
|
||||
@@ -323,17 +335,27 @@
|
||||
|
||||
#endif /* LTC_NO_PRNGS */
|
||||
|
||||
#ifdef LTC_FORTUNA
|
||||
|
||||
#ifndef LTC_FORTUNA_WD
|
||||
/* reseed every N calls to the read function */
|
||||
#define LTC_FORTUNA_WD 10
|
||||
#endif
|
||||
|
||||
#ifndef LTC_FORTUNA_POOLS
|
||||
/* number of pools (4..32) can save a bit of ram by lowering the count */
|
||||
#define LTC_FORTUNA_POOLS 32
|
||||
#endif
|
||||
|
||||
#endif /* LTC_FORTUNA */
|
||||
|
||||
|
||||
/* ---> Public Key Crypto <--- */
|
||||
#ifndef LTC_NO_PK
|
||||
|
||||
/* Include RSA support */
|
||||
#define LTC_MRSA
|
||||
|
||||
#ifndef LTC_NO_RSA_BLINDING
|
||||
/* Enable RSA blinding when doing private key operations by default */
|
||||
#define LTC_RSA_BLINDING
|
||||
#endif /* LTC_NO_RSA_BLINDING */
|
||||
|
||||
/* Include Diffie-Hellman support */
|
||||
#ifndef GMP_DESC
|
||||
/* is_prime fails for GMP */
|
||||
@@ -373,13 +395,18 @@
|
||||
/* do we want fixed point ECC */
|
||||
/* #define LTC_MECC_FP */
|
||||
|
||||
#ifndef LTC_NO_ECC_TIMING_RESISTANT
|
||||
#endif /* LTC_NO_PK */
|
||||
|
||||
#if defined(LTC_MRSA) && !defined(LTC_NO_RSA_BLINDING)
|
||||
/* Enable RSA blinding when doing private key operations by default */
|
||||
#define LTC_RSA_BLINDING
|
||||
#endif /* LTC_NO_RSA_BLINDING */
|
||||
|
||||
#if defined(LTC_MECC) && !defined(LTC_NO_ECC_TIMING_RESISTANT)
|
||||
/* Enable ECC timing resistant version by default */
|
||||
#define LTC_ECC_TIMING_RESISTANT
|
||||
#endif
|
||||
|
||||
#endif /* LTC_NO_PK */
|
||||
|
||||
/* define these PK sizes out of LTC_NO_PK
|
||||
* to have them always defined
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user