Переглянути джерело

Merge pull request #444 from libtom/pr/fix-unused-macros

Remove unused macros
karel-m 7 роки тому
батько
коміт
4d6f973b2d

+ 0 - 8
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

+ 0 - 4
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),

+ 4 - 0
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] = {

+ 0 - 2
src/mac/hmac/hmac_test.c

@@ -15,8 +15,6 @@
 
 #ifdef LTC_HMAC
 
-#define LTC_HMAC_BLOCKSIZE hash_descriptor[hash].blocksize
-
 /*
     TEST CASES SOURCE:
 

+ 0 - 3
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;

+ 0 - 2
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,