Skip to content

Commit 3cc7546

Browse files
committed
undef Macros after usage & rename duplicate symbols
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent ac2c11a commit 3cc7546

52 files changed

Lines changed: 372 additions & 63 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/ciphers/aes/aes.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,5 +726,11 @@ int ECB_KS(int *keysize)
726726
return CRYPT_OK;
727727
}
728728

729-
#endif
729+
#undef SETUP
730+
#undef ECB_ENC
731+
#undef ECB_DEC
732+
#undef ECB_DONE
733+
#undef ECB_TEST
734+
#undef ECB_KS
730735

736+
#endif

src/ciphers/anubis.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ const struct ltc_cipher_descriptor anubis_desc = {
2626

2727
#define MAX_N 10
2828

29+
30+
#define T0 anubis_T0
31+
#define T1 anubis_T1
32+
#define T2 anubis_T2
33+
#define T3 anubis_T3
34+
#define T4 anubis_T4
35+
#define T5 anubis_T5
36+
#define rc anubis_rc
2937
/*
3038
* Though Anubis is endianness-neutral, the encryption tables are listed
3139
* in BIG-ENDIAN format, which is adopted throughout this implementation
@@ -1546,5 +1554,14 @@ int anubis_keysize(int *keysize)
15461554
return CRYPT_OK;
15471555
}
15481556

1557+
#undef MAX_N
1558+
#undef T0
1559+
#undef T1
1560+
#undef T2
1561+
#undef T3
1562+
#undef T4
1563+
#undef T5
1564+
#undef rc
1565+
15491566
#endif
15501567

src/ciphers/blowfish.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,5 +654,7 @@ int blowfish_keysize(int *keysize)
654654
return CRYPT_OK;
655655
}
656656

657+
#undef F
658+
657659
#endif
658660

src/ciphers/camellia.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,4 +717,6 @@ int camellia_keysize(int *keysize)
717717
return CRYPT_OK;
718718
}
719719

720+
#undef loc
721+
720722
#endif

src/ciphers/cast5.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ int cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_
491491
}
492492
#endif
493493

494+
#define FI cast5_FI
494495
LTC_INLINE static ulong32 FI(ulong32 R, ulong32 Km, ulong32 Kr)
495496
{
496497
ulong32 I;
@@ -702,4 +703,7 @@ int cast5_keysize(int *keysize)
702703
return CRYPT_OK;
703704
}
704705

706+
#undef GB
707+
#undef FI
708+
705709
#endif

src/ciphers/des.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,5 +2238,8 @@ int des3_keysize(int *keysize)
22382238
return CRYPT_OK;
22392239
}
22402240

2241+
#undef EN0
2242+
#undef DE1
2243+
22412244
#endif
22422245

src/ciphers/idea.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static ushort16 s_add_inv(ushort16 x)
6666
return LOW16(0 - x);
6767
}
6868

69+
#define s_setup_key s_idea_setup_key
6970
static int s_setup_key(const unsigned char *key, symmetric_key *skey)
7071
{
7172
int i, j;
@@ -247,4 +248,11 @@ int idea_test(void)
247248
#endif
248249
}
249250

251+
#undef LOW16
252+
#undef HIGH16
253+
#undef MUL
254+
#undef STORE16
255+
#undef LOAD16
256+
#undef s_setup_key
257+
250258
#endif

src/ciphers/kasumi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const struct ltc_cipher_descriptor kasumi_desc = {
2828
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
2929
};
3030

31+
#define FI kasumi_FI
3132
static u16 FI( u16 in, u16 subkey )
3233
{
3334
u16 nine, seven;
@@ -304,4 +305,7 @@ int kasumi_test(void)
304305
#endif
305306
}
306307

308+
#undef ROL16
309+
#undef FI
310+
307311
#endif

src/ciphers/khazad.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,4 +837,6 @@ int khazad_keysize(int *keysize)
837837
return CRYPT_INVALID_KEYSIZE;
838838
}
839839

840+
#undef R
841+
840842
#endif

src/ciphers/kseed.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,7 @@ int kseed_keysize(int *keysize)
363363
return CRYPT_OK;
364364
}
365365

366+
#undef G
367+
#undef F
368+
366369
#endif

0 commit comments

Comments
 (0)