From 0bd244c0516645cc7206f0b47ca964fd224e91aa Mon Sep 17 00:00:00 2001 From: jsteube Date: Thu, 7 Feb 2019 16:59:10 +0100 Subject: [PATCH] Undef some macros to avoid collisions --- OpenCL/inc_cipher_camellia.cl | 9 +++++++++ OpenCL/inc_cipher_kuznyechik.cl | 4 ++++ OpenCL/inc_cipher_serpent.cl | 22 ++++++++++++++++++++++ OpenCL/inc_cipher_twofish.cl | 21 +++++++++++++++++++++ 4 files changed, 56 insertions(+) diff --git a/OpenCL/inc_cipher_camellia.cl b/OpenCL/inc_cipher_camellia.cl index 4ff09a913..152239441 100644 --- a/OpenCL/inc_cipher_camellia.cl +++ b/OpenCL/inc_cipher_camellia.cl @@ -363,3 +363,12 @@ DECLSPEC void camellia256_decrypt (const u32 *ks, const u32 *in, u32 *out) out[2] = tmp[0] ^ ks[2]; out[3] = tmp[1] ^ ks[3]; } + +#undef extract_byte + +#undef cam_rotate + +#undef c_sbox4 +#undef c_sbox3 +#undef c_sbox2 +#undef c_sbox1 diff --git a/OpenCL/inc_cipher_kuznyechik.cl b/OpenCL/inc_cipher_kuznyechik.cl index 7de25e101..7bbbd119f 100644 --- a/OpenCL/inc_cipher_kuznyechik.cl +++ b/OpenCL/inc_cipher_kuznyechik.cl @@ -297,3 +297,7 @@ DECLSPEC void kuznyechik_decrypt (const u32 *ks, const u32 *in, u32 *out) out[3] ^= ks[4 * i + 3]; } } + +#undef extract_byte +#undef k_lookup +#undef k_xor diff --git a/OpenCL/inc_cipher_serpent.cl b/OpenCL/inc_cipher_serpent.cl index a32cf65bc..9ebea4a64 100644 --- a/OpenCL/inc_cipher_serpent.cl +++ b/OpenCL/inc_cipher_serpent.cl @@ -726,3 +726,25 @@ DECLSPEC void serpent256_decrypt (const u32 *ks, const u32 *in, u32 *out) out[2] = c; out[3] = d; } + +#undef sb0 +#undef sb1 +#undef sb2 +#undef sb3 +#undef sb4 +#undef sb5 +#undef sb6 +#undef sb7 +#undef ib0 +#undef ib1 +#undef ib2 +#undef ib3 +#undef ib4 +#undef ib5 +#undef ib6 +#undef ib7 +#undef k_xor +#undef k_set +#undef k_get +#undef rot +#undef irot diff --git a/OpenCL/inc_cipher_twofish.cl b/OpenCL/inc_cipher_twofish.cl index ad4d1a6ba..86dc59423 100644 --- a/OpenCL/inc_cipher_twofish.cl +++ b/OpenCL/inc_cipher_twofish.cl @@ -575,3 +575,24 @@ DECLSPEC void twofish256_decrypt (const u32 *sk, const u32 *lk, const u32 *in, u out[2] = data[0] ^ lk[2]; out[3] = data[1] ^ lk[3]; } + +#undef extract_byte +#undef q +#undef mds +#undef q20 +#undef q21 +#undef q22 +#undef q23 +#undef q40 +#undef q41 +#undef q42 +#undef q43 +#undef G_MOD +#undef g1_fun128 +#undef g0_fun128 +#undef f_rnd128 +#undef i_rnd128 +#undef g1_fun256 +#undef g0_fun256 +#undef f_rnd256 +#undef i_rnd256