From ef20f2e65670e8c121e3e2c72c17ab3103a65d96 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 4 Oct 2018 16:57:25 +0200 Subject: [PATCH] remove unused macros --- src/ciphers/anubis.c | 8 -------- src/ciphers/khazad.c | 4 ---- src/ciphers/twofish/twofish.c | 4 ++++ src/mac/hmac/hmac_test.c | 2 -- src/stream/sober128/sober128_stream.c | 3 --- tests/rsa_test.c | 2 -- 6 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/ciphers/anubis.c b/src/ciphers/anubis.c index 7bc359083..e0d7424e3 100644 --- a/src/ciphers/anubis.c +++ b/src/ciphers/anubis.c @@ -30,15 +30,7 @@ const struct ltc_cipher_descriptor anubis_desc = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; -#define MIN_N 4 #define MAX_N 10 -#define MIN_ROUNDS (8 + MIN_N) -#define MAX_ROUNDS (8 + MAX_N) -#define MIN_KEYSIZEB (4*MIN_N) -#define MAX_KEYSIZEB (4*MAX_N) -#define BLOCKSIZE 128 -#define BLOCKSIZEB (BLOCKSIZE/8) - /* * Though Anubis is endianness-neutral, the encryption tables are listed diff --git a/src/ciphers/khazad.c b/src/ciphers/khazad.c index aa751821a..175d513e1 100644 --- a/src/ciphers/khazad.c +++ b/src/ciphers/khazad.c @@ -30,10 +30,6 @@ const struct ltc_cipher_descriptor khazad_desc = { }; #define R 8 -#define KEYSIZE 128 -#define KEYSIZEB (KEYSIZE/8) -#define BLOCKSIZE 64 -#define BLOCKSIZEB (BLOCKSIZE/8) static const ulong64 T0[256] = { CONST64(0xbad3d268bbb96a01), CONST64(0x54fc4d19e59a66b1), CONST64(0x2f71bc93e26514cd), CONST64(0x749ccdb925871b51), diff --git a/src/ciphers/twofish/twofish.c b/src/ciphers/twofish/twofish.c index c3aa45912..c7965f697 100644 --- a/src/ciphers/twofish/twofish.c +++ b/src/ciphers/twofish/twofish.c @@ -37,8 +37,12 @@ const struct ltc_cipher_descriptor twofish_desc = }; /* the two polynomials */ +#ifndef LTC_TWOFISH_TABLES #define MDS_POLY 0x169 +#endif +#ifndef LTC_TWOFISH_ALL_TABLES #define RS_POLY 0x14D +#endif /* The 4x8 RS Linear Transform */ static const unsigned char RS[4][8] = { diff --git a/src/mac/hmac/hmac_test.c b/src/mac/hmac/hmac_test.c index 1dd4e495b..da131f3c7 100644 --- a/src/mac/hmac/hmac_test.c +++ b/src/mac/hmac/hmac_test.c @@ -15,8 +15,6 @@ #ifdef LTC_HMAC -#define LTC_HMAC_BLOCKSIZE hash_descriptor[hash].blocksize - /* TEST CASES SOURCE: diff --git a/src/stream/sober128/sober128_stream.c b/src/stream/sober128/sober128_stream.c index ecbe4d8d7..952d5622e 100644 --- a/src/stream/sober128/sober128_stream.c +++ b/src/stream/sober128/sober128_stream.c @@ -21,13 +21,10 @@ /* don't change these... */ #define N 17 -#define FOLD N /* how many iterations of folding to do */ #define INITKONST 0x6996c53a /* value of KONST to use during key loading */ #define KEYP 15 /* where to insert key words */ #define FOLDP 4 /* where to insert non-linear feedback */ -#define B(x,i) ((unsigned char)(((x) >> (8*i)) & 0xFF)) - static ulong32 BYTE2WORD(const unsigned char *b) { ulong32 t; diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 0e6529f38..ce2542bcf 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -10,8 +10,6 @@ #if defined(LTC_MRSA) -#define RSA_MSGSIZE 78 - /* These are test keys [see file test.key] that I use to test my import/export against */ static const unsigned char openssl_private_rsa[] = { 0x30, 0x82, 0x02, 0x5e, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xcf, 0x9a, 0xde, 0x64, 0x8a,