diff --git a/OpenCL/inc_cipher_serpent.cl b/OpenCL/inc_cipher_serpent.cl index b4e21e2e0..98632fdef 100644 --- a/OpenCL/inc_cipher_serpent.cl +++ b/OpenCL/inc_cipher_serpent.cl @@ -383,29 +383,29 @@ /* the linear transformation and its inverse */ -#define rot(a,b,c,d) \ - a = hc_rotl32_S(a, 13); \ - c = hc_rotl32_S(c, 3); \ - d ^= c ^ (a << 3); \ - b ^= a ^ c; \ - d = hc_rotl32_S(d, 7); \ - b = hc_rotl32_S(b, 1); \ - a ^= b ^ d; \ - c ^= d ^ (b << 7); \ - a = hc_rotl32_S(a, 5); \ - c = hc_rotl32_S(c, 22) +#define rot(a,b,c,d) \ + a = hc_rotl32_S (a, 13); \ + c = hc_rotl32_S (c, 3); \ + d ^= c ^ (a << 3); \ + b ^= a ^ c; \ + d = hc_rotl32_S (d, 7); \ + b = hc_rotl32_S (b, 1); \ + a ^= b ^ d; \ + c ^= d ^ (b << 7); \ + a = hc_rotl32_S (a, 5); \ + c = hc_rotl32_S (c, 22) -#define irot(a,b,c,d) \ - c = hc_rotr32_S(c, 22); \ - a = hc_rotr32_S(a, 5); \ - c ^= d ^ (b << 7); \ - a ^= b ^ d; \ - d = hc_rotr32_S(d, 7); \ - b = hc_rotr32_S(b, 1); \ - d ^= c ^ (a << 3); \ - b ^= a ^ c; \ - c = hc_rotr32_S(c, 3); \ - a = hc_rotr32_S(a, 13) +#define irot(a,b,c,d) \ + c = hc_rotr32_S (c, 22); \ + a = hc_rotr32_S (a, 5); \ + c ^= d ^ (b << 7); \ + a ^= b ^ d; \ + d = hc_rotr32_S (d, 7); \ + b = hc_rotr32_S (b, 1); \ + d ^= c ^ (a << 3); \ + b ^= a ^ c; \ + c = hc_rotr32_S (c, 3); \ + a = hc_rotr32_S (a, 13) // 128 bit key diff --git a/OpenCL/inc_rp.cl b/OpenCL/inc_rp.cl index 56dc6f5de..9a50e1802 100644 --- a/OpenCL/inc_rp.cl +++ b/OpenCL/inc_rp.cl @@ -14,11 +14,11 @@ #endif #ifdef REAL_SHM -#define COPY_PW(x) \ - LOCAL_VK pw_t s_pws[64]; \ +#define COPY_PW(x) \ + LOCAL_VK pw_t s_pws[64]; \ s_pws[get_local_id (0)] = (x); #else -#define COPY_PW(x) \ +#define COPY_PW(x) \ pw_t pw = (x); #endif diff --git a/OpenCL/m00010_a3-optimized.cl b/OpenCL/m00010_a3-optimized.cl index a101428b1..85c6e5caa 100644 --- a/OpenCL/m00010_a3-optimized.cl +++ b/OpenCL/m00010_a3-optimized.cl @@ -17,7 +17,7 @@ #define MD5_STEP_REV(f,a,b,c,d,x,t,s) \ { \ a -= b; \ - a = hc_rotr32_S (a, s); \ + a = hc_rotr32_S (a, s); \ a -= f (b, c, d); \ a -= x; \ a -= t; \ @@ -26,7 +26,7 @@ #define MD5_STEP_REV1(f,a,b,c,d,x,t,s) \ { \ a -= b; \ - a = hc_rotr32_S (a, s); \ + a = hc_rotr32_S (a, s); \ a -= x; \ a -= t; \ } diff --git a/OpenCL/m00030_a3-optimized.cl b/OpenCL/m00030_a3-optimized.cl index 3c5a808f9..427040235 100644 --- a/OpenCL/m00030_a3-optimized.cl +++ b/OpenCL/m00030_a3-optimized.cl @@ -17,7 +17,7 @@ #define MD5_STEP_REV(f,a,b,c,d,x,t,s) \ { \ a -= b; \ - a = hc_rotr32_S (a, s); \ + a = hc_rotr32_S (a, s); \ a -= f (b, c, d); \ a -= x; \ a -= t; \ @@ -26,7 +26,7 @@ #define MD5_STEP_REV1(f,a,b,c,d,x,t,s) \ { \ a -= b; \ - a = hc_rotr32_S (a, s); \ + a = hc_rotr32_S (a, s); \ a -= x; \ a -= t; \ } diff --git a/OpenCL/m00400-optimized.cl b/OpenCL/m00400-optimized.cl index a66c7b02d..0ba302163 100644 --- a/OpenCL/m00400-optimized.cl +++ b/OpenCL/m00400-optimized.cl @@ -236,4 +236,4 @@ KERNEL_FQ void m00400_comp (KERN_ATTR_TMPS (phpass_tmp_t)) #ifdef KERNEL_STATIC #include COMPARE_M #endif -} \ No newline at end of file +} diff --git a/OpenCL/m00600_a0-optimized.cl b/OpenCL/m00600_a0-optimized.cl index 272fc6d97..0967e3cff 100644 --- a/OpenCL/m00600_a0-optimized.cl +++ b/OpenCL/m00600_a0-optimized.cl @@ -38,7 +38,7 @@ typedef struct blake2 d = hc_rotr64 (d ^ a, 16); \ c = c + d; \ b = hc_rotr64 (b ^ c, 63); \ - } while(0) + } while (0) #define BLAKE2B_ROUND(c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,ca,cb,cc,cd,ce,cf) \ do { \ @@ -50,7 +50,7 @@ typedef struct blake2 BLAKE2B_G ((ca),(cb),v[ 1],v[ 6],v[11],v[12]); \ BLAKE2B_G ((cc),(cd),v[ 2],v[ 7],v[ 8],v[13]); \ BLAKE2B_G ((ce),(cf),v[ 3],v[ 4],v[ 9],v[14]); \ -} while(0) +} while (0) DECLSPEC void blake2b_transform (u64x *h, u64x *t, u64x *f, u64x *m, u64x *v, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, const u32x out_len, const u8 isFinal) { @@ -195,7 +195,7 @@ KERNEL_FQ void m00600_m04 (KERN_ATTR_RULES_ESALT (blake2_t)) f[0] = tmp_f[0]; f[1] = tmp_f[1]; - blake2b_transform(h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); + blake2b_transform (h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); digest[0] = h[0]; digest[1] = h[1]; @@ -206,12 +206,12 @@ KERNEL_FQ void m00600_m04 (KERN_ATTR_RULES_ESALT (blake2_t)) digest[6] = h[6]; digest[7] = h[7]; - const u32x r0 = h32_from_64(digest[0]); - const u32x r1 = l32_from_64(digest[0]); - const u32x r2 = h32_from_64(digest[1]); - const u32x r3 = l32_from_64(digest[1]); + const u32x r0 = h32_from_64 (digest[0]); + const u32x r1 = l32_from_64 (digest[0]); + const u32x r2 = h32_from_64 (digest[1]); + const u32x r3 = l32_from_64 (digest[1]); - COMPARE_M_SIMD(r0, r1, r2, r3); + COMPARE_M_SIMD (r0, r1, r2, r3); } } @@ -314,7 +314,7 @@ KERNEL_FQ void m00600_s04 (KERN_ATTR_RULES_ESALT (blake2_t)) f[0] = tmp_f[0]; f[1] = tmp_f[1]; - blake2b_transform(h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); + blake2b_transform (h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); digest[0] = h[0]; digest[1] = h[1]; @@ -325,12 +325,12 @@ KERNEL_FQ void m00600_s04 (KERN_ATTR_RULES_ESALT (blake2_t)) digest[6] = h[6]; digest[7] = h[7]; - const u32x r0 = h32_from_64(digest[0]); - const u32x r1 = l32_from_64(digest[0]); - const u32x r2 = h32_from_64(digest[1]); - const u32x r3 = l32_from_64(digest[1]); + const u32x r0 = h32_from_64 (digest[0]); + const u32x r1 = l32_from_64 (digest[0]); + const u32x r2 = h32_from_64 (digest[1]); + const u32x r3 = l32_from_64 (digest[1]); - COMPARE_S_SIMD(r0, r1, r2, r3); + COMPARE_S_SIMD (r0, r1, r2, r3); } } diff --git a/OpenCL/m00600_a1-optimized.cl b/OpenCL/m00600_a1-optimized.cl index 8b51bfcf0..dea787469 100644 --- a/OpenCL/m00600_a1-optimized.cl +++ b/OpenCL/m00600_a1-optimized.cl @@ -36,7 +36,7 @@ typedef struct blake2 d = hc_rotr64 (d ^ a, 16); \ c = c + d; \ b = hc_rotr64 (b ^ c, 63); \ - } while(0) + } while (0) #define BLAKE2B_ROUND(c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,ca,cb,cc,cd,ce,cf) \ do { \ @@ -48,7 +48,7 @@ typedef struct blake2 BLAKE2B_G ((ca),(cb),v[ 1],v[ 6],v[11],v[12]); \ BLAKE2B_G ((cc),(cd),v[ 2],v[ 7],v[ 8],v[13]); \ BLAKE2B_G ((ce),(cf),v[ 3],v[ 4],v[ 9],v[14]); \ -} while(0) +} while (0) DECLSPEC void blake2b_transform (u64x *h, u64x *t, u64x *f, u64x *m, u64x *v, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, const u32x out_len, const u8 isFinal) { @@ -250,7 +250,7 @@ KERNEL_FQ void m00600_m04 (KERN_ATTR_ESALT (blake2_t)) f[0] = tmp_f[0]; f[1] = tmp_f[1]; - blake2b_transform(h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); + blake2b_transform (h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); digest[0] = h[0]; digest[1] = h[1]; @@ -261,12 +261,12 @@ KERNEL_FQ void m00600_m04 (KERN_ATTR_ESALT (blake2_t)) digest[6] = h[6]; digest[7] = h[7]; - const u32x r0 = h32_from_64(digest[0]); - const u32x r1 = l32_from_64(digest[0]); - const u32x r2 = h32_from_64(digest[1]); - const u32x r3 = l32_from_64(digest[1]); + const u32x r0 = h32_from_64 (digest[0]); + const u32x r1 = l32_from_64 (digest[0]); + const u32x r2 = h32_from_64 (digest[1]); + const u32x r3 = l32_from_64 (digest[1]); - COMPARE_M_SIMD(r0, r1, r2, r3); + COMPARE_M_SIMD (r0, r1, r2, r3); } } @@ -429,7 +429,7 @@ KERNEL_FQ void m00600_s04 (KERN_ATTR_ESALT (blake2_t)) f[0] = tmp_f[0]; f[1] = tmp_f[1]; - blake2b_transform(h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); + blake2b_transform (h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); digest[0] = h[0]; digest[1] = h[1]; @@ -440,12 +440,12 @@ KERNEL_FQ void m00600_s04 (KERN_ATTR_ESALT (blake2_t)) digest[6] = h[6]; digest[7] = h[7]; - const u32x r0 = h32_from_64(digest[0]); - const u32x r1 = l32_from_64(digest[0]); - const u32x r2 = h32_from_64(digest[1]); - const u32x r3 = l32_from_64(digest[1]); + const u32x r0 = h32_from_64 (digest[0]); + const u32x r1 = l32_from_64 (digest[0]); + const u32x r2 = h32_from_64 (digest[1]); + const u32x r3 = l32_from_64 (digest[1]); - COMPARE_S_SIMD(r0, r1, r2, r3); + COMPARE_S_SIMD (r0, r1, r2, r3); } } diff --git a/OpenCL/m00600_a3-optimized.cl b/OpenCL/m00600_a3-optimized.cl index 1ae51223f..2fa9e46b6 100644 --- a/OpenCL/m00600_a3-optimized.cl +++ b/OpenCL/m00600_a3-optimized.cl @@ -36,7 +36,7 @@ typedef struct blake2 d = hc_rotr64 (d ^ a, 16); \ c = c + d; \ b = hc_rotr64 (b ^ c, 63); \ - } while(0) + } while (0) #define BLAKE2B_ROUND(c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,ca,cb,cc,cd,ce,cf) \ do { \ @@ -48,7 +48,7 @@ typedef struct blake2 BLAKE2B_G ((ca),(cb),v[ 1],v[ 6],v[11],v[12]); \ BLAKE2B_G ((cc),(cd),v[ 2],v[ 7],v[ 8],v[13]); \ BLAKE2B_G ((ce),(cf),v[ 3],v[ 4],v[ 9],v[14]); \ -} while(0) +} while (0) DECLSPEC void blake2b_transform (u64x *h, u64x *t, u64x *f, u64x *m, u64x *v, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, const u32x out_len, const u8 isFinal) { @@ -198,7 +198,7 @@ KERNEL_FQ void m00600_m04 (KERN_ATTR_VECTOR_ESALT (blake2_t)) f[0] = tmp_f[0]; f[1] = tmp_f[1]; - blake2b_transform(h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); + blake2b_transform (h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); digest[0] = h[0]; digest[1] = h[1]; @@ -209,12 +209,12 @@ KERNEL_FQ void m00600_m04 (KERN_ATTR_VECTOR_ESALT (blake2_t)) digest[6] = h[6]; digest[7] = h[7]; - const u32x r0 = h32_from_64(digest[0]); - const u32x r1 = l32_from_64(digest[0]); - const u32x r2 = h32_from_64(digest[1]); - const u32x r3 = l32_from_64(digest[1]); + const u32x r0 = h32_from_64 (digest[0]); + const u32x r1 = l32_from_64 (digest[0]); + const u32x r2 = h32_from_64 (digest[1]); + const u32x r3 = l32_from_64 (digest[1]); - COMPARE_M_SIMD(r0, r1, r2, r3); + COMPARE_M_SIMD (r0, r1, r2, r3); } } @@ -302,7 +302,7 @@ KERNEL_FQ void m00600_m08 (KERN_ATTR_VECTOR_ESALT (blake2_t)) f[0] = tmp_f[0]; f[1] = tmp_f[1]; - blake2b_transform(h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); + blake2b_transform (h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); digest[0] = h[0]; digest[1] = h[1]; @@ -313,12 +313,12 @@ KERNEL_FQ void m00600_m08 (KERN_ATTR_VECTOR_ESALT (blake2_t)) digest[6] = h[6]; digest[7] = h[7]; - const u32x r0 = h32_from_64(digest[0]); - const u32x r1 = l32_from_64(digest[0]); - const u32x r2 = h32_from_64(digest[1]); - const u32x r3 = l32_from_64(digest[1]); + const u32x r0 = h32_from_64 (digest[0]); + const u32x r1 = l32_from_64 (digest[0]); + const u32x r2 = h32_from_64 (digest[1]); + const u32x r3 = l32_from_64 (digest[1]); - COMPARE_M_SIMD(r0, r1, r2, r3); + COMPARE_M_SIMD (r0, r1, r2, r3); } } @@ -406,7 +406,7 @@ KERNEL_FQ void m00600_m16 (KERN_ATTR_VECTOR_ESALT (blake2_t)) f[0] = tmp_f[0]; f[1] = tmp_f[1]; - blake2b_transform(h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); + blake2b_transform (h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); digest[0] = h[0]; digest[1] = h[1]; @@ -417,12 +417,12 @@ KERNEL_FQ void m00600_m16 (KERN_ATTR_VECTOR_ESALT (blake2_t)) digest[6] = h[6]; digest[7] = h[7]; - const u32x r0 = h32_from_64(digest[0]); - const u32x r1 = l32_from_64(digest[0]); - const u32x r2 = h32_from_64(digest[1]); - const u32x r3 = l32_from_64(digest[1]); + const u32x r0 = h32_from_64 (digest[0]); + const u32x r1 = l32_from_64 (digest[0]); + const u32x r2 = h32_from_64 (digest[1]); + const u32x r3 = l32_from_64 (digest[1]); - COMPARE_M_SIMD(r0, r1, r2, r3); + COMPARE_M_SIMD (r0, r1, r2, r3); } } @@ -522,7 +522,7 @@ KERNEL_FQ void m00600_s04 (KERN_ATTR_VECTOR_ESALT (blake2_t)) f[0] = tmp_f[0]; f[1] = tmp_f[1]; - blake2b_transform(h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); + blake2b_transform (h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); digest[0] = h[0]; digest[1] = h[1]; @@ -533,12 +533,12 @@ KERNEL_FQ void m00600_s04 (KERN_ATTR_VECTOR_ESALT (blake2_t)) digest[6] = h[6]; digest[7] = h[7]; - const u32x r0 = h32_from_64(digest[0]); - const u32x r1 = l32_from_64(digest[0]); - const u32x r2 = h32_from_64(digest[1]); - const u32x r3 = l32_from_64(digest[1]); + const u32x r0 = h32_from_64 (digest[0]); + const u32x r1 = l32_from_64 (digest[0]); + const u32x r2 = h32_from_64 (digest[1]); + const u32x r3 = l32_from_64 (digest[1]); - COMPARE_S_SIMD(r0, r1, r2, r3); + COMPARE_S_SIMD (r0, r1, r2, r3); } } @@ -638,7 +638,7 @@ KERNEL_FQ void m00600_s08 (KERN_ATTR_VECTOR_ESALT (blake2_t)) f[0] = tmp_f[0]; f[1] = tmp_f[1]; - blake2b_transform(h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); + blake2b_transform (h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); digest[0] = h[0]; digest[1] = h[1]; @@ -649,12 +649,12 @@ KERNEL_FQ void m00600_s08 (KERN_ATTR_VECTOR_ESALT (blake2_t)) digest[6] = h[6]; digest[7] = h[7]; - const u32x r0 = h32_from_64(digest[0]); - const u32x r1 = l32_from_64(digest[0]); - const u32x r2 = h32_from_64(digest[1]); - const u32x r3 = l32_from_64(digest[1]); + const u32x r0 = h32_from_64 (digest[0]); + const u32x r1 = l32_from_64 (digest[0]); + const u32x r2 = h32_from_64 (digest[1]); + const u32x r3 = l32_from_64 (digest[1]); - COMPARE_S_SIMD(r0, r1, r2, r3); + COMPARE_S_SIMD (r0, r1, r2, r3); } } @@ -754,7 +754,7 @@ KERNEL_FQ void m00600_s16 (KERN_ATTR_VECTOR_ESALT (blake2_t)) f[0] = tmp_f[0]; f[1] = tmp_f[1]; - blake2b_transform(h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); + blake2b_transform (h, t, f, m, v, w0, w1, w2, w3, out_len, BLAKE2B_FINAL); digest[0] = h[0]; digest[1] = h[1]; @@ -765,11 +765,11 @@ KERNEL_FQ void m00600_s16 (KERN_ATTR_VECTOR_ESALT (blake2_t)) digest[6] = h[6]; digest[7] = h[7]; - const u32x r0 = h32_from_64(digest[0]); - const u32x r1 = l32_from_64(digest[0]); - const u32x r2 = h32_from_64(digest[1]); - const u32x r3 = l32_from_64(digest[1]); + const u32x r0 = h32_from_64 (digest[0]); + const u32x r1 = l32_from_64 (digest[0]); + const u32x r2 = h32_from_64 (digest[1]); + const u32x r3 = l32_from_64 (digest[1]); - COMPARE_S_SIMD(r0, r1, r2, r3); + COMPARE_S_SIMD (r0, r1, r2, r3); } } diff --git a/OpenCL/m00900_a3-optimized.cl b/OpenCL/m00900_a3-optimized.cl index 11e21a483..e6d4fd6f0 100644 --- a/OpenCL/m00900_a3-optimized.cl +++ b/OpenCL/m00900_a3-optimized.cl @@ -16,7 +16,7 @@ #define MD4_STEP_REV(f,a,b,c,d,x,t,s) \ { \ - a = hc_rotr32_S (a, s); \ + a = hc_rotr32_S (a, s); \ a -= f (b, c, d); \ a -= x; \ a -= t; \ @@ -24,7 +24,7 @@ #define MD4_STEP_REV1(f,a,b,c,d,x,t,s) \ { \ - a = hc_rotr32_S (a, s); \ + a = hc_rotr32_S (a, s); \ a -= x; \ a -= t; \ } diff --git a/OpenCL/m01000_a3-optimized.cl b/OpenCL/m01000_a3-optimized.cl index 2953dca1e..69a83ea05 100644 --- a/OpenCL/m01000_a3-optimized.cl +++ b/OpenCL/m01000_a3-optimized.cl @@ -16,7 +16,7 @@ #define MD4_STEP_REV(f,a,b,c,d,x,t,s) \ { \ - a = hc_rotr32_S (a, s); \ + a = hc_rotr32_S (a, s); \ a -= f (b, c, d); \ a -= x; \ a -= t; \ @@ -24,7 +24,7 @@ #define MD4_STEP_REV1(f,a,b,c,d,x,t,s) \ { \ - a = hc_rotr32_S (a, s); \ + a = hc_rotr32_S (a, s); \ a -= x; \ a -= t; \ } diff --git a/OpenCL/m01500_a3-pure.cl b/OpenCL/m01500_a3-pure.cl index a751c55fe..7a38bac65 100644 --- a/OpenCL/m01500_a3-pure.cl +++ b/OpenCL/m01500_a3-pure.cl @@ -57,31 +57,31 @@ DECLSPEC void s1 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const u32 a5, const u32 a6, u32 *out1, u32 *out2, u32 *out3, u32 *out4) { - LUT(xAA55AA5500550055, a1, a4, a6, 0xC1) - LUT(xA55AA55AF0F5F0F5, a3, a6, xAA55AA5500550055, 0x9E) - LUT(x5F5F5F5FA5A5A5A5, a1, a3, a6, 0xD6) - LUT(xF5A0F5A0A55AA55A, a4, xAA55AA5500550055, x5F5F5F5FA5A5A5A5, 0x56) - LUT(x947A947AD1E7D1E7, a2, xA55AA55AF0F5F0F5, xF5A0F5A0A55AA55A, 0x6C) - LUT(x5FFF5FFFFFFAFFFA, a6, xAA55AA5500550055, x5F5F5F5FA5A5A5A5, 0x7B) - LUT(xB96CB96C69936993, a2, xF5A0F5A0A55AA55A, x5FFF5FFFFFFAFFFA, 0xD6) - LUT(x3, a5, x947A947AD1E7D1E7, xB96CB96C69936993, 0x6A) - LUT(x55EE55EE55EE55EE, a1, a2, a4, 0x7A) - LUT(x084C084CB77BB77B, a2, a6, xF5A0F5A0A55AA55A, 0xC9) - LUT(x9C329C32E295E295, x947A947AD1E7D1E7, x55EE55EE55EE55EE, x084C084CB77BB77B, 0x72) - LUT(xA51EA51E50E050E0, a3, a6, x55EE55EE55EE55EE, 0x29) - LUT(x4AD34AD3BE3CBE3C, a2, x947A947AD1E7D1E7, xA51EA51E50E050E0, 0x95) - LUT(x2, a5, x9C329C32E295E295, x4AD34AD3BE3CBE3C, 0xC6) - LUT(xD955D95595D195D1, a1, a2, x9C329C32E295E295, 0xD2) - LUT(x8058805811621162, x947A947AD1E7D1E7, x55EE55EE55EE55EE, x084C084CB77BB77B, 0x90) - LUT(x7D0F7D0FC4B3C4B3, xA51EA51E50E050E0, xD955D95595D195D1, x8058805811621162, 0x76) - LUT(x0805080500010001, a3, xAA55AA5500550055, xD955D95595D195D1, 0x80) - LUT(x4A964A96962D962D, xB96CB96C69936993, x4AD34AD3BE3CBE3C, x0805080500010001, 0xA6) - LUT(x4, a5, x7D0F7D0FC4B3C4B3, x4A964A96962D962D, 0xA6) - LUT(x148014807B087B08, a1, xAA55AA5500550055, x947A947AD1E7D1E7, 0x21) - LUT(x94D894D86B686B68, xA55AA55AF0F5F0F5, x8058805811621162, x148014807B087B08, 0x6A) - LUT(x5555555540044004, a1, a6, x084C084CB77BB77B, 0x70) - LUT(xAFB4AFB4BF5BBF5B, x5F5F5F5FA5A5A5A5, xA51EA51E50E050E0, x5555555540044004, 0x97) - LUT(x1, a5, x94D894D86B686B68, xAFB4AFB4BF5BBF5B, 0x6C) + LUT (xAA55AA5500550055, a1, a4, a6, 0xC1) + LUT (xA55AA55AF0F5F0F5, a3, a6, xAA55AA5500550055, 0x9E) + LUT (x5F5F5F5FA5A5A5A5, a1, a3, a6, 0xD6) + LUT (xF5A0F5A0A55AA55A, a4, xAA55AA5500550055, x5F5F5F5FA5A5A5A5, 0x56) + LUT (x947A947AD1E7D1E7, a2, xA55AA55AF0F5F0F5, xF5A0F5A0A55AA55A, 0x6C) + LUT (x5FFF5FFFFFFAFFFA, a6, xAA55AA5500550055, x5F5F5F5FA5A5A5A5, 0x7B) + LUT (xB96CB96C69936993, a2, xF5A0F5A0A55AA55A, x5FFF5FFFFFFAFFFA, 0xD6) + LUT (x3, a5, x947A947AD1E7D1E7, xB96CB96C69936993, 0x6A) + LUT (x55EE55EE55EE55EE, a1, a2, a4, 0x7A) + LUT (x084C084CB77BB77B, a2, a6, xF5A0F5A0A55AA55A, 0xC9) + LUT (x9C329C32E295E295, x947A947AD1E7D1E7, x55EE55EE55EE55EE, x084C084CB77BB77B, 0x72) + LUT (xA51EA51E50E050E0, a3, a6, x55EE55EE55EE55EE, 0x29) + LUT (x4AD34AD3BE3CBE3C, a2, x947A947AD1E7D1E7, xA51EA51E50E050E0, 0x95) + LUT (x2, a5, x9C329C32E295E295, x4AD34AD3BE3CBE3C, 0xC6) + LUT (xD955D95595D195D1, a1, a2, x9C329C32E295E295, 0xD2) + LUT (x8058805811621162, x947A947AD1E7D1E7, x55EE55EE55EE55EE, x084C084CB77BB77B, 0x90) + LUT (x7D0F7D0FC4B3C4B3, xA51EA51E50E050E0, xD955D95595D195D1, x8058805811621162, 0x76) + LUT (x0805080500010001, a3, xAA55AA5500550055, xD955D95595D195D1, 0x80) + LUT (x4A964A96962D962D, xB96CB96C69936993, x4AD34AD3BE3CBE3C, x0805080500010001, 0xA6) + LUT (x4, a5, x7D0F7D0FC4B3C4B3, x4A964A96962D962D, 0xA6) + LUT (x148014807B087B08, a1, xAA55AA5500550055, x947A947AD1E7D1E7, 0x21) + LUT (x94D894D86B686B68, xA55AA55AF0F5F0F5, x8058805811621162, x148014807B087B08, 0x6A) + LUT (x5555555540044004, a1, a6, x084C084CB77BB77B, 0x70) + LUT (xAFB4AFB4BF5BBF5B, x5F5F5F5FA5A5A5A5, xA51EA51E50E050E0, x5555555540044004, 0x97) + LUT (x1, a5, x94D894D86B686B68, xAFB4AFB4BF5BBF5B, 0x6C) *out1 ^= x1; *out2 ^= x2; @@ -91,30 +91,30 @@ DECLSPEC void s1 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const DECLSPEC void s2 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const u32 a5, const u32 a6, u32 *out1, u32 *out2, u32 *out3, u32 *out4) { - LUT(xEEEEEEEE99999999, a1, a2, a6, 0x97) - LUT(xFFFFEEEE66666666, a5, a6, xEEEEEEEE99999999, 0x67) - LUT(x5555FFFFFFFF0000, a1, a5, a6, 0x76) - LUT(x6666DDDD5555AAAA, a2, xFFFFEEEE66666666, x5555FFFFFFFF0000, 0x69) - LUT(x6969D3D35353ACAC, a3, xFFFFEEEE66666666, x6666DDDD5555AAAA, 0x6A) - LUT(xCFCF3030CFCF3030, a2, a3, a5, 0x65) - LUT(xE4E4EEEE9999F0F0, a3, xEEEEEEEE99999999, x5555FFFFFFFF0000, 0x8D) - LUT(xE5E5BABACDCDB0B0, a1, xCFCF3030CFCF3030, xE4E4EEEE9999F0F0, 0xCA) - LUT(x3, a4, x6969D3D35353ACAC, xE5E5BABACDCDB0B0, 0xC6) - LUT(x3333CCCC00000000, a2, a5, a6, 0x14) - LUT(xCCCCDDDDFFFF0F0F, a5, xE4E4EEEE9999F0F0, x3333CCCC00000000, 0xB5) - LUT(x00000101F0F0F0F0, a3, a6, xFFFFEEEE66666666, 0x1C) - LUT(x9A9A64646A6A9595, a1, xCFCF3030CFCF3030, x00000101F0F0F0F0, 0x96) - LUT(x2, a4, xCCCCDDDDFFFF0F0F, x9A9A64646A6A9595, 0x6A) - LUT(x3333BBBB3333FFFF, a1, a2, x6666DDDD5555AAAA, 0xDE) - LUT(x1414141441410000, a1, a3, xE4E4EEEE9999F0F0, 0x90) - LUT(x7F7FF3F3F5F53939, x6969D3D35353ACAC, x9A9A64646A6A9595, x3333BBBB3333FFFF, 0x79) - LUT(x9494E3E34B4B3939, a5, x1414141441410000, x7F7FF3F3F5F53939, 0x29) - LUT(x1, a4, x3333BBBB3333FFFF, x9494E3E34B4B3939, 0xA6) - LUT(xB1B1BBBBCCCCA5A5, a1, a1, xE4E4EEEE9999F0F0, 0x4A) - LUT(xFFFFECECEEEEDDDD, a2, x3333CCCC00000000, x9A9A64646A6A9595, 0xEF) - LUT(xB1B1A9A9DCDC8787, xE5E5BABACDCDB0B0, xB1B1BBBBCCCCA5A5, xFFFFECECEEEEDDDD, 0x8D) - LUT(xFFFFCCCCEEEE4444, a2, a5, xFFFFEEEE66666666, 0x2B) - LUT(x4, a4, xB1B1A9A9DCDC8787, xFFFFCCCCEEEE4444, 0x6C) + LUT (xEEEEEEEE99999999, a1, a2, a6, 0x97) + LUT (xFFFFEEEE66666666, a5, a6, xEEEEEEEE99999999, 0x67) + LUT (x5555FFFFFFFF0000, a1, a5, a6, 0x76) + LUT (x6666DDDD5555AAAA, a2, xFFFFEEEE66666666, x5555FFFFFFFF0000, 0x69) + LUT (x6969D3D35353ACAC, a3, xFFFFEEEE66666666, x6666DDDD5555AAAA, 0x6A) + LUT (xCFCF3030CFCF3030, a2, a3, a5, 0x65) + LUT (xE4E4EEEE9999F0F0, a3, xEEEEEEEE99999999, x5555FFFFFFFF0000, 0x8D) + LUT (xE5E5BABACDCDB0B0, a1, xCFCF3030CFCF3030, xE4E4EEEE9999F0F0, 0xCA) + LUT (x3, a4, x6969D3D35353ACAC, xE5E5BABACDCDB0B0, 0xC6) + LUT (x3333CCCC00000000, a2, a5, a6, 0x14) + LUT (xCCCCDDDDFFFF0F0F, a5, xE4E4EEEE9999F0F0, x3333CCCC00000000, 0xB5) + LUT (x00000101F0F0F0F0, a3, a6, xFFFFEEEE66666666, 0x1C) + LUT (x9A9A64646A6A9595, a1, xCFCF3030CFCF3030, x00000101F0F0F0F0, 0x96) + LUT (x2, a4, xCCCCDDDDFFFF0F0F, x9A9A64646A6A9595, 0x6A) + LUT (x3333BBBB3333FFFF, a1, a2, x6666DDDD5555AAAA, 0xDE) + LUT (x1414141441410000, a1, a3, xE4E4EEEE9999F0F0, 0x90) + LUT (x7F7FF3F3F5F53939, x6969D3D35353ACAC, x9A9A64646A6A9595, x3333BBBB3333FFFF, 0x79) + LUT (x9494E3E34B4B3939, a5, x1414141441410000, x7F7FF3F3F5F53939, 0x29) + LUT (x1, a4, x3333BBBB3333FFFF, x9494E3E34B4B3939, 0xA6) + LUT (xB1B1BBBBCCCCA5A5, a1, a1, xE4E4EEEE9999F0F0, 0x4A) + LUT (xFFFFECECEEEEDDDD, a2, x3333CCCC00000000, x9A9A64646A6A9595, 0xEF) + LUT (xB1B1A9A9DCDC8787, xE5E5BABACDCDB0B0, xB1B1BBBBCCCCA5A5, xFFFFECECEEEEDDDD, 0x8D) + LUT (xFFFFCCCCEEEE4444, a2, a5, xFFFFEEEE66666666, 0x2B) + LUT (x4, a4, xB1B1A9A9DCDC8787, xFFFFCCCCEEEE4444, 0x6C) *out1 ^= x1; *out2 ^= x2; @@ -124,31 +124,31 @@ DECLSPEC void s2 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const DECLSPEC void s3 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const u32 a5, const u32 a6, u32 *out1, u32 *out2, u32 *out3, u32 *out4) { - LUT(xA50FA50FA50FA50F, a1, a3, a4, 0xC9) - LUT(xF0F00F0FF0F0F0F0, a3, a5, a6, 0x4B) - LUT(xAF0FA0AAAF0FAF0F, a1, xA50FA50FA50FA50F, xF0F00F0FF0F0F0F0, 0x4D) - LUT(x5AA5A55A5AA55AA5, a1, a4, xF0F00F0FF0F0F0F0, 0x69) - LUT(xAA005FFFAA005FFF, a3, a5, xA50FA50FA50FA50F, 0xD6) - LUT(x5AA5A55A0F5AFAA5, a6, x5AA5A55A5AA55AA5, xAA005FFFAA005FFF, 0x9C) - LUT(x1, a2, xAF0FA0AAAF0FAF0F, x5AA5A55A0F5AFAA5, 0xA6) - LUT(xAA55AA5500AA00AA, a1, a4, a6, 0x49) - LUT(xFAFAA50FFAFAA50F, a1, a5, xA50FA50FA50FA50F, 0x9B) - LUT(x50AF0F5AFA50A5A5, a1, xAA55AA5500AA00AA, xFAFAA50FFAFAA50F, 0x66) - LUT(xAFAFAFAFFAFAFAFA, a1, a3, a6, 0x6F) - LUT(xAFAFFFFFFFFAFAFF, a4, x50AF0F5AFA50A5A5, xAFAFAFAFFAFAFAFA, 0xEB) - LUT(x4, a2, x50AF0F5AFA50A5A5, xAFAFFFFFFFFAFAFF, 0x6C) - LUT(x500F500F500F500F, a1, a3, a4, 0x98) - LUT(xF0505A0505A5050F, x5AA5A55A0F5AFAA5, xAA55AA5500AA00AA, xAFAFAFAFFAFAFAFA, 0x1D) - LUT(xF0505A05AA55AAFF, a6, x500F500F500F500F, xF0505A0505A5050F, 0x9A) - LUT(xFF005F55FF005F55, a1, a4, xAA005FFFAA005FFF, 0xB2) - LUT(xA55F5AF0A55F5AF0, a5, xA50FA50FA50FA50F, x5AA5A55A5AA55AA5, 0x3D) - LUT(x5A5F05A5A55F5AF0, a6, xFF005F55FF005F55, xA55F5AF0A55F5AF0, 0xA6) - LUT(x3, a2, xF0505A05AA55AAFF, x5A5F05A5A55F5AF0, 0xA6) - LUT(x0F0F0F0FA5A5A5A5, a1, a3, a6, 0xC6) - LUT(x5FFFFF5FFFA0FFA0, x5AA5A55A5AA55AA5, xAFAFAFAFFAFAFAFA, x0F0F0F0FA5A5A5A5, 0xDB) - LUT(xF5555AF500A05FFF, a5, xFAFAA50FFAFAA50F, xF0505A0505A5050F, 0xB9) - LUT(x05A5AAF55AFA55A5, xF0505A05AA55AAFF, x0F0F0F0FA5A5A5A5, xF5555AF500A05FFF, 0x9B) - LUT(x2, a2, x5FFFFF5FFFA0FFA0, x05A5AAF55AFA55A5, 0xA6) + LUT (xA50FA50FA50FA50F, a1, a3, a4, 0xC9) + LUT (xF0F00F0FF0F0F0F0, a3, a5, a6, 0x4B) + LUT (xAF0FA0AAAF0FAF0F, a1, xA50FA50FA50FA50F, xF0F00F0FF0F0F0F0, 0x4D) + LUT (x5AA5A55A5AA55AA5, a1, a4, xF0F00F0FF0F0F0F0, 0x69) + LUT (xAA005FFFAA005FFF, a3, a5, xA50FA50FA50FA50F, 0xD6) + LUT (x5AA5A55A0F5AFAA5, a6, x5AA5A55A5AA55AA5, xAA005FFFAA005FFF, 0x9C) + LUT (x1, a2, xAF0FA0AAAF0FAF0F, x5AA5A55A0F5AFAA5, 0xA6) + LUT (xAA55AA5500AA00AA, a1, a4, a6, 0x49) + LUT (xFAFAA50FFAFAA50F, a1, a5, xA50FA50FA50FA50F, 0x9B) + LUT (x50AF0F5AFA50A5A5, a1, xAA55AA5500AA00AA, xFAFAA50FFAFAA50F, 0x66) + LUT (xAFAFAFAFFAFAFAFA, a1, a3, a6, 0x6F) + LUT (xAFAFFFFFFFFAFAFF, a4, x50AF0F5AFA50A5A5, xAFAFAFAFFAFAFAFA, 0xEB) + LUT (x4, a2, x50AF0F5AFA50A5A5, xAFAFFFFFFFFAFAFF, 0x6C) + LUT (x500F500F500F500F, a1, a3, a4, 0x98) + LUT (xF0505A0505A5050F, x5AA5A55A0F5AFAA5, xAA55AA5500AA00AA, xAFAFAFAFFAFAFAFA, 0x1D) + LUT (xF0505A05AA55AAFF, a6, x500F500F500F500F, xF0505A0505A5050F, 0x9A) + LUT (xFF005F55FF005F55, a1, a4, xAA005FFFAA005FFF, 0xB2) + LUT (xA55F5AF0A55F5AF0, a5, xA50FA50FA50FA50F, x5AA5A55A5AA55AA5, 0x3D) + LUT (x5A5F05A5A55F5AF0, a6, xFF005F55FF005F55, xA55F5AF0A55F5AF0, 0xA6) + LUT (x3, a2, xF0505A05AA55AAFF, x5A5F05A5A55F5AF0, 0xA6) + LUT (x0F0F0F0FA5A5A5A5, a1, a3, a6, 0xC6) + LUT (x5FFFFF5FFFA0FFA0, x5AA5A55A5AA55AA5, xAFAFAFAFFAFAFAFA, x0F0F0F0FA5A5A5A5, 0xDB) + LUT (xF5555AF500A05FFF, a5, xFAFAA50FFAFAA50F, xF0505A0505A5050F, 0xB9) + LUT (x05A5AAF55AFA55A5, xF0505A05AA55AAFF, x0F0F0F0FA5A5A5A5, xF5555AF500A05FFF, 0x9B) + LUT (x2, a2, x5FFFFF5FFFA0FFA0, x05A5AAF55AFA55A5, 0xA6) *out1 ^= x1; *out2 ^= x2; @@ -158,24 +158,24 @@ DECLSPEC void s3 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const DECLSPEC void s4 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const u32 a5, const u32 a6, u32 *out1, u32 *out2, u32 *out3, u32 *out4) { - LUT(x55F055F055F055F0, a1, a3, a4, 0x72) - LUT(xA500F5F0A500F5F0, a3, a5, x55F055F055F055F0, 0xAD) - LUT(xF50AF50AF50AF50A, a1, a3, a4, 0x59) - LUT(xF5FA0FFFF5FA0FFF, a3, a5, xF50AF50AF50AF50A, 0xE7) - LUT(x61C8F93C61C8F93C, a2, xA500F5F0A500F5F0, xF5FA0FFFF5FA0FFF, 0xC6) - LUT(x9999666699996666, a1, a2, a5, 0x69) - LUT(x22C022C022C022C0, a2, a4, x55F055F055F055F0, 0x18) - LUT(xB35C94A6B35C94A6, xF5FA0FFFF5FA0FFF, x9999666699996666, x22C022C022C022C0, 0x63) - LUT(x4, a6, x61C8F93C61C8F93C, xB35C94A6B35C94A6, 0x6A) - LUT(x4848484848484848, a1, a2, a3, 0x12) - LUT(x55500AAA55500AAA, a1, a5, xF5FA0FFFF5FA0FFF, 0x28) - LUT(x3C90B3D63C90B3D6, x61C8F93C61C8F93C, x4848484848484848, x55500AAA55500AAA, 0x1E) - LUT(x8484333384843333, a1, x9999666699996666, x4848484848484848, 0x14) - LUT(x4452F1AC4452F1AC, xF50AF50AF50AF50A, xF5FA0FFFF5FA0FFF, xB35C94A6B35C94A6, 0x78) - LUT(x9586CA379586CA37, x55500AAA55500AAA, x8484333384843333, x4452F1AC4452F1AC, 0xD6) - LUT(x2, a6, x3C90B3D63C90B3D6, x9586CA379586CA37, 0x6A) - LUT(x1, a6, x3C90B3D63C90B3D6, x9586CA379586CA37, 0xA9) - LUT(x3, a6, x61C8F93C61C8F93C, xB35C94A6B35C94A6, 0x56) + LUT (x55F055F055F055F0, a1, a3, a4, 0x72) + LUT (xA500F5F0A500F5F0, a3, a5, x55F055F055F055F0, 0xAD) + LUT (xF50AF50AF50AF50A, a1, a3, a4, 0x59) + LUT (xF5FA0FFFF5FA0FFF, a3, a5, xF50AF50AF50AF50A, 0xE7) + LUT (x61C8F93C61C8F93C, a2, xA500F5F0A500F5F0, xF5FA0FFFF5FA0FFF, 0xC6) + LUT (x9999666699996666, a1, a2, a5, 0x69) + LUT (x22C022C022C022C0, a2, a4, x55F055F055F055F0, 0x18) + LUT (xB35C94A6B35C94A6, xF5FA0FFFF5FA0FFF, x9999666699996666, x22C022C022C022C0, 0x63) + LUT (x4, a6, x61C8F93C61C8F93C, xB35C94A6B35C94A6, 0x6A) + LUT (x4848484848484848, a1, a2, a3, 0x12) + LUT (x55500AAA55500AAA, a1, a5, xF5FA0FFFF5FA0FFF, 0x28) + LUT (x3C90B3D63C90B3D6, x61C8F93C61C8F93C, x4848484848484848, x55500AAA55500AAA, 0x1E) + LUT (x8484333384843333, a1, x9999666699996666, x4848484848484848, 0x14) + LUT (x4452F1AC4452F1AC, xF50AF50AF50AF50A, xF5FA0FFFF5FA0FFF, xB35C94A6B35C94A6, 0x78) + LUT (x9586CA379586CA37, x55500AAA55500AAA, x8484333384843333, x4452F1AC4452F1AC, 0xD6) + LUT (x2, a6, x3C90B3D63C90B3D6, x9586CA379586CA37, 0x6A) + LUT (x1, a6, x3C90B3D63C90B3D6, x9586CA379586CA37, 0xA9) + LUT (x3, a6, x61C8F93C61C8F93C, xB35C94A6B35C94A6, 0x56) *out1 ^= x1; *out2 ^= x2; @@ -185,31 +185,31 @@ DECLSPEC void s4 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const DECLSPEC void s5 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const u32 a5, const u32 a6, u32 *out1, u32 *out2, u32 *out3, u32 *out4) { - LUT(xA0A0A0A0FFFFFFFF, a1, a3, a6, 0xAB) - LUT(xFFFF00005555FFFF, a1, a5, a6, 0xB9) - LUT(xB3B320207777FFFF, a2, xA0A0A0A0FFFFFFFF, xFFFF00005555FFFF, 0xE8) - LUT(x50505A5A5A5A5050, a1, a3, xFFFF00005555FFFF, 0x34) - LUT(xA2A2FFFF2222FFFF, a1, a5, xB3B320207777FFFF, 0xCE) - LUT(x2E2E6969A4A46363, a2, x50505A5A5A5A5050, xA2A2FFFF2222FFFF, 0x29) - LUT(x3, a4, xB3B320207777FFFF, x2E2E6969A4A46363, 0xA6) - LUT(xA5A50A0AA5A50A0A, a1, a3, a5, 0x49) - LUT(x969639396969C6C6, a2, a6, xA5A50A0AA5A50A0A, 0x96) - LUT(x1B1B1B1B1B1B1B1B, a1, a2, a3, 0xCA) - LUT(xBFBFBFBFF6F6F9F9, a3, xA0A0A0A0FFFFFFFF, x969639396969C6C6, 0x7E) - LUT(x5B5BA4A4B8B81D1D, xFFFF00005555FFFF, x1B1B1B1B1B1B1B1B, xBFBFBFBFF6F6F9F9, 0x96) - LUT(x2, a4, x969639396969C6C6, x5B5BA4A4B8B81D1D, 0xCA) - LUT(x5555BBBBFFFF5555, a1, a2, xFFFF00005555FFFF, 0xE5) - LUT(x6D6D9C9C95956969, x50505A5A5A5A5050, xA2A2FFFF2222FFFF, x969639396969C6C6, 0x97) - LUT(x1A1A67676A6AB4B4, xA5A50A0AA5A50A0A, x5555BBBBFFFF5555, x6D6D9C9C95956969, 0x47) - LUT(xA0A0FFFFAAAA0000, a3, xFFFF00005555FFFF, xA5A50A0AA5A50A0A, 0x3B) - LUT(x36369C9CC1C1D6D6, x969639396969C6C6, x6D6D9C9C95956969, xA0A0FFFFAAAA0000, 0xD9) - LUT(x1, a4, x1A1A67676A6AB4B4, x36369C9CC1C1D6D6, 0xCA) - LUT(x5555F0F0F5F55555, a1, a3, xFFFF00005555FFFF, 0xB1) - LUT(x79790202DCDC0808, xA2A2FFFF2222FFFF, xA5A50A0AA5A50A0A, x969639396969C6C6, 0x47) - LUT(x6C6CF2F229295D5D, xBFBFBFBFF6F6F9F9, x5555F0F0F5F55555, x79790202DCDC0808, 0x6E) - LUT(xA3A3505010101A1A, a2, xA2A2FFFF2222FFFF, x36369C9CC1C1D6D6, 0x94) - LUT(x7676C7C74F4FC7C7, a1, x2E2E6969A4A46363, xA3A3505010101A1A, 0xD9) - LUT(x4, a4, x6C6CF2F229295D5D, x7676C7C74F4FC7C7, 0xC6) + LUT (xA0A0A0A0FFFFFFFF, a1, a3, a6, 0xAB) + LUT (xFFFF00005555FFFF, a1, a5, a6, 0xB9) + LUT (xB3B320207777FFFF, a2, xA0A0A0A0FFFFFFFF, xFFFF00005555FFFF, 0xE8) + LUT (x50505A5A5A5A5050, a1, a3, xFFFF00005555FFFF, 0x34) + LUT (xA2A2FFFF2222FFFF, a1, a5, xB3B320207777FFFF, 0xCE) + LUT (x2E2E6969A4A46363, a2, x50505A5A5A5A5050, xA2A2FFFF2222FFFF, 0x29) + LUT (x3, a4, xB3B320207777FFFF, x2E2E6969A4A46363, 0xA6) + LUT (xA5A50A0AA5A50A0A, a1, a3, a5, 0x49) + LUT (x969639396969C6C6, a2, a6, xA5A50A0AA5A50A0A, 0x96) + LUT (x1B1B1B1B1B1B1B1B, a1, a2, a3, 0xCA) + LUT (xBFBFBFBFF6F6F9F9, a3, xA0A0A0A0FFFFFFFF, x969639396969C6C6, 0x7E) + LUT (x5B5BA4A4B8B81D1D, xFFFF00005555FFFF, x1B1B1B1B1B1B1B1B, xBFBFBFBFF6F6F9F9, 0x96) + LUT (x2, a4, x969639396969C6C6, x5B5BA4A4B8B81D1D, 0xCA) + LUT (x5555BBBBFFFF5555, a1, a2, xFFFF00005555FFFF, 0xE5) + LUT (x6D6D9C9C95956969, x50505A5A5A5A5050, xA2A2FFFF2222FFFF, x969639396969C6C6, 0x97) + LUT (x1A1A67676A6AB4B4, xA5A50A0AA5A50A0A, x5555BBBBFFFF5555, x6D6D9C9C95956969, 0x47) + LUT (xA0A0FFFFAAAA0000, a3, xFFFF00005555FFFF, xA5A50A0AA5A50A0A, 0x3B) + LUT (x36369C9CC1C1D6D6, x969639396969C6C6, x6D6D9C9C95956969, xA0A0FFFFAAAA0000, 0xD9) + LUT (x1, a4, x1A1A67676A6AB4B4, x36369C9CC1C1D6D6, 0xCA) + LUT (x5555F0F0F5F55555, a1, a3, xFFFF00005555FFFF, 0xB1) + LUT (x79790202DCDC0808, xA2A2FFFF2222FFFF, xA5A50A0AA5A50A0A, x969639396969C6C6, 0x47) + LUT (x6C6CF2F229295D5D, xBFBFBFBFF6F6F9F9, x5555F0F0F5F55555, x79790202DCDC0808, 0x6E) + LUT (xA3A3505010101A1A, a2, xA2A2FFFF2222FFFF, x36369C9CC1C1D6D6, 0x94) + LUT (x7676C7C74F4FC7C7, a1, x2E2E6969A4A46363, xA3A3505010101A1A, 0xD9) + LUT (x4, a4, x6C6CF2F229295D5D, x7676C7C74F4FC7C7, 0xC6) *out1 ^= x1; *out2 ^= x2; @@ -219,30 +219,30 @@ DECLSPEC void s5 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const DECLSPEC void s6 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const u32 a5, const u32 a6, u32 *out1, u32 *out2, u32 *out3, u32 *out4) { - LUT(x5050F5F55050F5F5, a1, a3, a5, 0xB2) - LUT(x6363C6C66363C6C6, a1, a2, x5050F5F55050F5F5, 0x66) - LUT(xAAAA5555AAAA5555, a1, a1, a5, 0xA9) - LUT(x3A3A65653A3A6565, a3, x6363C6C66363C6C6, xAAAA5555AAAA5555, 0xA9) - LUT(x5963A3C65963A3C6, a4, x6363C6C66363C6C6, x3A3A65653A3A6565, 0xC6) - LUT(xE7E76565E7E76565, a5, x6363C6C66363C6C6, x3A3A65653A3A6565, 0xAD) - LUT(x455D45DF455D45DF, a1, a4, xE7E76565E7E76565, 0xE4) - LUT(x4, a6, x5963A3C65963A3C6, x455D45DF455D45DF, 0x6C) - LUT(x1101220211012202, a2, xAAAA5555AAAA5555, x5963A3C65963A3C6, 0x20) - LUT(xF00F0FF0F00F0FF0, a3, a4, a5, 0x69) - LUT(x16E94A9716E94A97, xE7E76565E7E76565, x1101220211012202, xF00F0FF0F00F0FF0, 0x9E) - LUT(x2992922929929229, a1, a2, xF00F0FF0F00F0FF0, 0x49) - LUT(xAFAF9823AFAF9823, a5, x5050F5F55050F5F5, x2992922929929229, 0x93) - LUT(x3, a6, x16E94A9716E94A97, xAFAF9823AFAF9823, 0x6C) - LUT(x4801810248018102, a4, x5963A3C65963A3C6, x1101220211012202, 0xA4) - LUT(x5EE8FFFD5EE8FFFD, a5, x16E94A9716E94A97, x4801810248018102, 0x76) - LUT(xF0FF00FFF0FF00FF, a3, a4, a5, 0xCD) - LUT(x942D9A67942D9A67, x3A3A65653A3A6565, x5EE8FFFD5EE8FFFD, xF0FF00FFF0FF00FF, 0x86) - LUT(x1, a6, x5EE8FFFD5EE8FFFD, x942D9A67942D9A67, 0xA6) - LUT(x6A40D4ED6F4DD4EE, a2, x4, xAFAF9823AFAF9823, 0x2D) - LUT(x6CA89C7869A49C79, x1101220211012202, x16E94A9716E94A97, x6A40D4ED6F4DD4EE, 0x26) - LUT(xD6DE73F9D6DE73F9, a3, x6363C6C66363C6C6, x455D45DF455D45DF, 0x6B) - LUT(x925E63E1965A63E1, x3A3A65653A3A6565, x6CA89C7869A49C79, xD6DE73F9D6DE73F9, 0xA2) - LUT(x2, a6, x6CA89C7869A49C79, x925E63E1965A63E1, 0xCA) + LUT (x5050F5F55050F5F5, a1, a3, a5, 0xB2) + LUT (x6363C6C66363C6C6, a1, a2, x5050F5F55050F5F5, 0x66) + LUT (xAAAA5555AAAA5555, a1, a1, a5, 0xA9) + LUT (x3A3A65653A3A6565, a3, x6363C6C66363C6C6, xAAAA5555AAAA5555, 0xA9) + LUT (x5963A3C65963A3C6, a4, x6363C6C66363C6C6, x3A3A65653A3A6565, 0xC6) + LUT (xE7E76565E7E76565, a5, x6363C6C66363C6C6, x3A3A65653A3A6565, 0xAD) + LUT (x455D45DF455D45DF, a1, a4, xE7E76565E7E76565, 0xE4) + LUT (x4, a6, x5963A3C65963A3C6, x455D45DF455D45DF, 0x6C) + LUT (x1101220211012202, a2, xAAAA5555AAAA5555, x5963A3C65963A3C6, 0x20) + LUT (xF00F0FF0F00F0FF0, a3, a4, a5, 0x69) + LUT (x16E94A9716E94A97, xE7E76565E7E76565, x1101220211012202, xF00F0FF0F00F0FF0, 0x9E) + LUT (x2992922929929229, a1, a2, xF00F0FF0F00F0FF0, 0x49) + LUT (xAFAF9823AFAF9823, a5, x5050F5F55050F5F5, x2992922929929229, 0x93) + LUT (x3, a6, x16E94A9716E94A97, xAFAF9823AFAF9823, 0x6C) + LUT (x4801810248018102, a4, x5963A3C65963A3C6, x1101220211012202, 0xA4) + LUT (x5EE8FFFD5EE8FFFD, a5, x16E94A9716E94A97, x4801810248018102, 0x76) + LUT (xF0FF00FFF0FF00FF, a3, a4, a5, 0xCD) + LUT (x942D9A67942D9A67, x3A3A65653A3A6565, x5EE8FFFD5EE8FFFD, xF0FF00FFF0FF00FF, 0x86) + LUT (x1, a6, x5EE8FFFD5EE8FFFD, x942D9A67942D9A67, 0xA6) + LUT (x6A40D4ED6F4DD4EE, a2, x4, xAFAF9823AFAF9823, 0x2D) + LUT (x6CA89C7869A49C79, x1101220211012202, x16E94A9716E94A97, x6A40D4ED6F4DD4EE, 0x26) + LUT (xD6DE73F9D6DE73F9, a3, x6363C6C66363C6C6, x455D45DF455D45DF, 0x6B) + LUT (x925E63E1965A63E1, x3A3A65653A3A6565, x6CA89C7869A49C79, xD6DE73F9D6DE73F9, 0xA2) + LUT (x2, a6, x6CA89C7869A49C79, x925E63E1965A63E1, 0xCA) *out1 ^= x1; *out2 ^= x2; @@ -252,30 +252,30 @@ DECLSPEC void s6 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const DECLSPEC void s7 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const u32 a5, const u32 a6, u32 *out1, u32 *out2, u32 *out3, u32 *out4) { - LUT(x88AA88AA88AA88AA, a1, a2, a4, 0x0B) - LUT(xAAAAFF00AAAAFF00, a1, a4, a5, 0x27) - LUT(xADAFF8A5ADAFF8A5, a3, x88AA88AA88AA88AA, xAAAAFF00AAAAFF00, 0x9E) - LUT(x0A0AF5F50A0AF5F5, a1, a3, a5, 0xA6) - LUT(x6B69C5DC6B69C5DC, a2, xADAFF8A5ADAFF8A5, x0A0AF5F50A0AF5F5, 0x6B) - LUT(x1C69B2DC1C69B2DC, a4, x88AA88AA88AA88AA, x6B69C5DC6B69C5DC, 0xA9) - LUT(x1, a6, xADAFF8A5ADAFF8A5, x1C69B2DC1C69B2DC, 0x6A) - LUT(x9C9C9C9C9C9C9C9C, a1, a2, a3, 0x63) - LUT(xE6E63BFDE6E63BFD, a2, xAAAAFF00AAAAFF00, x0A0AF5F50A0AF5F5, 0xE7) - LUT(x6385639E6385639E, a4, x9C9C9C9C9C9C9C9C, xE6E63BFDE6E63BFD, 0x93) - LUT(x5959C4CE5959C4CE, a2, x6B69C5DC6B69C5DC, xE6E63BFDE6E63BFD, 0x5D) - LUT(x5B53F53B5B53F53B, a4, x0A0AF5F50A0AF5F5, x5959C4CE5959C4CE, 0x6E) - LUT(x3, a6, x6385639E6385639E, x5B53F53B5B53F53B, 0xC6) - LUT(xFAF505FAFAF505FA, a3, a4, x0A0AF5F50A0AF5F5, 0x6D) - LUT(x6A65956A6A65956A, a3, x9C9C9C9C9C9C9C9C, xFAF505FAFAF505FA, 0xA6) - LUT(x8888CCCC8888CCCC, a1, a2, a5, 0x23) - LUT(x94E97A9494E97A94, x1C69B2DC1C69B2DC, x6A65956A6A65956A, x8888CCCC8888CCCC, 0x72) - LUT(x4, a6, x6A65956A6A65956A, x94E97A9494E97A94, 0xAC) - LUT(xA050A050A050A050, a1, a3, a4, 0x21) - LUT(xC1B87A2BC1B87A2B, xAAAAFF00AAAAFF00, x5B53F53B5B53F53B, x94E97A9494E97A94, 0xA4) - LUT(xE96016B7E96016B7, x8888CCCC8888CCCC, xA050A050A050A050, xC1B87A2BC1B87A2B, 0x96) - LUT(xE3CF1FD5E3CF1FD5, x88AA88AA88AA88AA, x6A65956A6A65956A, xE96016B7E96016B7, 0x3E) - LUT(x6776675B6776675B, xADAFF8A5ADAFF8A5, x94E97A9494E97A94, xE3CF1FD5E3CF1FD5, 0x6B) - LUT(x2, a6, xE96016B7E96016B7, x6776675B6776675B, 0xC6) + LUT (x88AA88AA88AA88AA, a1, a2, a4, 0x0B) + LUT (xAAAAFF00AAAAFF00, a1, a4, a5, 0x27) + LUT (xADAFF8A5ADAFF8A5, a3, x88AA88AA88AA88AA, xAAAAFF00AAAAFF00, 0x9E) + LUT (x0A0AF5F50A0AF5F5, a1, a3, a5, 0xA6) + LUT (x6B69C5DC6B69C5DC, a2, xADAFF8A5ADAFF8A5, x0A0AF5F50A0AF5F5, 0x6B) + LUT (x1C69B2DC1C69B2DC, a4, x88AA88AA88AA88AA, x6B69C5DC6B69C5DC, 0xA9) + LUT (x1, a6, xADAFF8A5ADAFF8A5, x1C69B2DC1C69B2DC, 0x6A) + LUT (x9C9C9C9C9C9C9C9C, a1, a2, a3, 0x63) + LUT (xE6E63BFDE6E63BFD, a2, xAAAAFF00AAAAFF00, x0A0AF5F50A0AF5F5, 0xE7) + LUT (x6385639E6385639E, a4, x9C9C9C9C9C9C9C9C, xE6E63BFDE6E63BFD, 0x93) + LUT (x5959C4CE5959C4CE, a2, x6B69C5DC6B69C5DC, xE6E63BFDE6E63BFD, 0x5D) + LUT (x5B53F53B5B53F53B, a4, x0A0AF5F50A0AF5F5, x5959C4CE5959C4CE, 0x6E) + LUT (x3, a6, x6385639E6385639E, x5B53F53B5B53F53B, 0xC6) + LUT (xFAF505FAFAF505FA, a3, a4, x0A0AF5F50A0AF5F5, 0x6D) + LUT (x6A65956A6A65956A, a3, x9C9C9C9C9C9C9C9C, xFAF505FAFAF505FA, 0xA6) + LUT (x8888CCCC8888CCCC, a1, a2, a5, 0x23) + LUT (x94E97A9494E97A94, x1C69B2DC1C69B2DC, x6A65956A6A65956A, x8888CCCC8888CCCC, 0x72) + LUT (x4, a6, x6A65956A6A65956A, x94E97A9494E97A94, 0xAC) + LUT (xA050A050A050A050, a1, a3, a4, 0x21) + LUT (xC1B87A2BC1B87A2B, xAAAAFF00AAAAFF00, x5B53F53B5B53F53B, x94E97A9494E97A94, 0xA4) + LUT (xE96016B7E96016B7, x8888CCCC8888CCCC, xA050A050A050A050, xC1B87A2BC1B87A2B, 0x96) + LUT (xE3CF1FD5E3CF1FD5, x88AA88AA88AA88AA, x6A65956A6A65956A, xE96016B7E96016B7, 0x3E) + LUT (x6776675B6776675B, xADAFF8A5ADAFF8A5, x94E97A9494E97A94, xE3CF1FD5E3CF1FD5, 0x6B) + LUT (x2, a6, xE96016B7E96016B7, x6776675B6776675B, 0xC6) *out1 ^= x1; *out2 ^= x2; @@ -285,29 +285,29 @@ DECLSPEC void s7 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const DECLSPEC void s8 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const u32 a5, const u32 a6, u32 *out1, u32 *out2, u32 *out3, u32 *out4) { - LUT(xEEEE3333EEEE3333, a1, a2, a5, 0x9D) - LUT(xBBBBBBBBBBBBBBBB, a1, a1, a2, 0x83) - LUT(xDDDDAAAADDDDAAAA, a1, a2, a5, 0x5B) - LUT(x29295A5A29295A5A, a3, xBBBBBBBBBBBBBBBB, xDDDDAAAADDDDAAAA, 0x85) - LUT(xC729695AC729695A, a4, xEEEE3333EEEE3333, x29295A5A29295A5A, 0xA6) - LUT(x3BF77B7B3BF77B7B, a2, a5, xC729695AC729695A, 0xF9) - LUT(x2900FF002900FF00, a4, a5, x29295A5A29295A5A, 0x0E) - LUT(x56B3803F56B3803F, xBBBBBBBBBBBBBBBB, x3BF77B7B3BF77B7B, x2900FF002900FF00, 0x61) - LUT(x4, a6, xC729695AC729695A, x56B3803F56B3803F, 0x6C) - LUT(xFBFBFBFBFBFBFBFB, a1, a2, a3, 0xDF) - LUT(x3012B7B73012B7B7, a2, a5, xC729695AC729695A, 0xD4) - LUT(x34E9B34C34E9B34C, a4, xFBFBFBFBFBFBFBFB, x3012B7B73012B7B7, 0x69) - LUT(xBFEAEBBEBFEAEBBE, a1, x29295A5A29295A5A, x34E9B34C34E9B34C, 0x6F) - LUT(xFFAEAFFEFFAEAFFE, a3, xBBBBBBBBBBBBBBBB, xBFEAEBBEBFEAEBBE, 0xB9) - LUT(x2, a6, x34E9B34C34E9B34C, xFFAEAFFEFFAEAFFE, 0xC6) - LUT(xCFDE88BBCFDE88BB, a2, xDDDDAAAADDDDAAAA, x34E9B34C34E9B34C, 0x5C) - LUT(x3055574530555745, a1, xC729695AC729695A, xCFDE88BBCFDE88BB, 0x71) - LUT(x99DDEEEE99DDEEEE, a4, xBBBBBBBBBBBBBBBB, xDDDDAAAADDDDAAAA, 0xB9) - LUT(x693CD926693CD926, x3BF77B7B3BF77B7B, x34E9B34C34E9B34C, x99DDEEEE99DDEEEE, 0x69) - LUT(x3, a6, x3055574530555745, x693CD926693CD926, 0x6A) - LUT(x9955EE559955EE55, a1, a4, x99DDEEEE99DDEEEE, 0xE2) - LUT(x9D48FA949D48FA94, x3BF77B7B3BF77B7B, xBFEAEBBEBFEAEBBE, x9955EE559955EE55, 0x9C) - LUT(x1, a6, xC729695AC729695A, x9D48FA949D48FA94, 0x39) + LUT (xEEEE3333EEEE3333, a1, a2, a5, 0x9D) + LUT (xBBBBBBBBBBBBBBBB, a1, a1, a2, 0x83) + LUT (xDDDDAAAADDDDAAAA, a1, a2, a5, 0x5B) + LUT (x29295A5A29295A5A, a3, xBBBBBBBBBBBBBBBB, xDDDDAAAADDDDAAAA, 0x85) + LUT (xC729695AC729695A, a4, xEEEE3333EEEE3333, x29295A5A29295A5A, 0xA6) + LUT (x3BF77B7B3BF77B7B, a2, a5, xC729695AC729695A, 0xF9) + LUT (x2900FF002900FF00, a4, a5, x29295A5A29295A5A, 0x0E) + LUT (x56B3803F56B3803F, xBBBBBBBBBBBBBBBB, x3BF77B7B3BF77B7B, x2900FF002900FF00, 0x61) + LUT (x4, a6, xC729695AC729695A, x56B3803F56B3803F, 0x6C) + LUT (xFBFBFBFBFBFBFBFB, a1, a2, a3, 0xDF) + LUT (x3012B7B73012B7B7, a2, a5, xC729695AC729695A, 0xD4) + LUT (x34E9B34C34E9B34C, a4, xFBFBFBFBFBFBFBFB, x3012B7B73012B7B7, 0x69) + LUT (xBFEAEBBEBFEAEBBE, a1, x29295A5A29295A5A, x34E9B34C34E9B34C, 0x6F) + LUT (xFFAEAFFEFFAEAFFE, a3, xBBBBBBBBBBBBBBBB, xBFEAEBBEBFEAEBBE, 0xB9) + LUT (x2, a6, x34E9B34C34E9B34C, xFFAEAFFEFFAEAFFE, 0xC6) + LUT (xCFDE88BBCFDE88BB, a2, xDDDDAAAADDDDAAAA, x34E9B34C34E9B34C, 0x5C) + LUT (x3055574530555745, a1, xC729695AC729695A, xCFDE88BBCFDE88BB, 0x71) + LUT (x99DDEEEE99DDEEEE, a4, xBBBBBBBBBBBBBBBB, xDDDDAAAADDDDAAAA, 0xB9) + LUT (x693CD926693CD926, x3BF77B7B3BF77B7B, x34E9B34C34E9B34C, x99DDEEEE99DDEEEE, 0x69) + LUT (x3, a6, x3055574530555745, x693CD926693CD926, 0x6A) + LUT (x9955EE559955EE55, a1, a4, x99DDEEEE99DDEEEE, 0xE2) + LUT (x9D48FA949D48FA94, x3BF77B7B3BF77B7B, xBFEAEBBEBFEAEBBE, x9955EE559955EE55, 0x9C) + LUT (x1, a6, xC729695AC729695A, x9D48FA949D48FA94, 0x39) *out1 ^= x1; *out2 ^= x2; @@ -1480,38 +1480,38 @@ DECLSPEC void s8 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const #define SWAP(a, b) { u32 tmp=*a;*a=*b;*b=tmp; } #define DATASWAP \ - SWAP(D00, D32); \ - SWAP(D01, D33); \ - SWAP(D02, D34); \ - SWAP(D03, D35); \ - SWAP(D04, D36); \ - SWAP(D05, D37); \ - SWAP(D06, D38); \ - SWAP(D07, D39); \ - SWAP(D08, D40); \ - SWAP(D09, D41); \ - SWAP(D10, D42); \ - SWAP(D11, D43); \ - SWAP(D12, D44); \ - SWAP(D13, D45); \ - SWAP(D14, D46); \ - SWAP(D15, D47); \ - SWAP(D16, D48); \ - SWAP(D17, D49); \ - SWAP(D18, D50); \ - SWAP(D19, D51); \ - SWAP(D20, D52); \ - SWAP(D21, D53); \ - SWAP(D22, D54); \ - SWAP(D23, D55); \ - SWAP(D24, D56); \ - SWAP(D25, D57); \ - SWAP(D26, D58); \ - SWAP(D27, D59); \ - SWAP(D28, D60); \ - SWAP(D29, D61); \ - SWAP(D30, D62); \ - SWAP(D31, D63); + SWAP (D00, D32); \ + SWAP (D01, D33); \ + SWAP (D02, D34); \ + SWAP (D03, D35); \ + SWAP (D04, D36); \ + SWAP (D05, D37); \ + SWAP (D06, D38); \ + SWAP (D07, D39); \ + SWAP (D08, D40); \ + SWAP (D09, D41); \ + SWAP (D10, D42); \ + SWAP (D11, D43); \ + SWAP (D12, D44); \ + SWAP (D13, D45); \ + SWAP (D14, D46); \ + SWAP (D15, D47); \ + SWAP (D16, D48); \ + SWAP (D17, D49); \ + SWAP (D18, D50); \ + SWAP (D19, D51); \ + SWAP (D20, D52); \ + SWAP (D21, D53); \ + SWAP (D22, D54); \ + SWAP (D23, D55); \ + SWAP (D24, D56); \ + SWAP (D25, D57); \ + SWAP (D26, D58); \ + SWAP (D27, D59); \ + SWAP (D28, D60); \ + SWAP (D29, D61); \ + SWAP (D30, D62); \ + SWAP (D31, D63); #define KEYSET00 { k00 = K08; k01 = K44; k02 = K29; k03 = K52; k04 = K42; k05 = K14; k06 = K28; k07 = K49; k08 = K01; k09 = K07; k10 = K16; k11 = K36; k12 = K02; k13 = K30; k14 = K22; k15 = K21; k16 = K38; k17 = K50; k18 = K51; k19 = K00; k20 = K31; k21 = K23; k22 = K15; k23 = K35; k24 = K19; k25 = K24; k26 = K34; k27 = K47; k28 = K32; k29 = K03; k30 = K41; k31 = K26; k32 = K04; k33 = K46; k34 = K20; k35 = K25; k36 = K53; k37 = K18; k38 = K33; k39 = K55; k40 = K13; k41 = K17; k42 = K39; k43 = K12; k44 = K11; k45 = K54; k46 = K48; k47 = K27; } #define KEYSET10 { k00 = K49; k01 = K28; k02 = K45; k03 = K36; k04 = K01; k05 = K30; k06 = K44; k07 = K08; k08 = K42; k09 = K23; k10 = K00; k11 = K52; k12 = K43; k13 = K14; k14 = K38; k15 = K37; k16 = K22; k17 = K09; k18 = K35; k19 = K16; k20 = K15; k21 = K07; k22 = K31; k23 = K51; k24 = K03; k25 = K40; k26 = K46; k27 = K04; k28 = K20; k29 = K19; k30 = K53; k31 = K10; k32 = K47; k33 = K34; k34 = K32; k35 = K13; k36 = K41; k37 = K06; k38 = K17; k39 = K12; k40 = K25; k41 = K33; k42 = K27; k43 = K55; k44 = K54; k45 = K11; k46 = K05; k47 = K39; } diff --git a/OpenCL/m03000_a3-pure.cl b/OpenCL/m03000_a3-pure.cl index 27b5c5630..1f5a6afa8 100644 --- a/OpenCL/m03000_a3-pure.cl +++ b/OpenCL/m03000_a3-pure.cl @@ -1478,39 +1478,39 @@ DECLSPEC void s8 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const #define SWAP(a, b) { u32 tmp=*a;*a=*b;*b=tmp; } -#define DATASWAP \ - SWAP(D00, D32); \ - SWAP(D01, D33); \ - SWAP(D02, D34); \ - SWAP(D03, D35); \ - SWAP(D04, D36); \ - SWAP(D05, D37); \ - SWAP(D06, D38); \ - SWAP(D07, D39); \ - SWAP(D08, D40); \ - SWAP(D09, D41); \ - SWAP(D10, D42); \ - SWAP(D11, D43); \ - SWAP(D12, D44); \ - SWAP(D13, D45); \ - SWAP(D14, D46); \ - SWAP(D15, D47); \ - SWAP(D16, D48); \ - SWAP(D17, D49); \ - SWAP(D18, D50); \ - SWAP(D19, D51); \ - SWAP(D20, D52); \ - SWAP(D21, D53); \ - SWAP(D22, D54); \ - SWAP(D23, D55); \ - SWAP(D24, D56); \ - SWAP(D25, D57); \ - SWAP(D26, D58); \ - SWAP(D27, D59); \ - SWAP(D28, D60); \ - SWAP(D29, D61); \ - SWAP(D30, D62); \ - SWAP(D31, D63); +#define DATASWAP \ + SWAP (D00, D32); \ + SWAP (D01, D33); \ + SWAP (D02, D34); \ + SWAP (D03, D35); \ + SWAP (D04, D36); \ + SWAP (D05, D37); \ + SWAP (D06, D38); \ + SWAP (D07, D39); \ + SWAP (D08, D40); \ + SWAP (D09, D41); \ + SWAP (D10, D42); \ + SWAP (D11, D43); \ + SWAP (D12, D44); \ + SWAP (D13, D45); \ + SWAP (D14, D46); \ + SWAP (D15, D47); \ + SWAP (D16, D48); \ + SWAP (D17, D49); \ + SWAP (D18, D50); \ + SWAP (D19, D51); \ + SWAP (D20, D52); \ + SWAP (D21, D53); \ + SWAP (D22, D54); \ + SWAP (D23, D55); \ + SWAP (D24, D56); \ + SWAP (D25, D57); \ + SWAP (D26, D58); \ + SWAP (D27, D59); \ + SWAP (D28, D60); \ + SWAP (D29, D61); \ + SWAP (D30, D62); \ + SWAP (D31, D63); #define KEYSET00 { k00 = K08; k01 = K44; k02 = K29; k03 = K52; k04 = K42; k05 = K14; k06 = K28; k07 = K49; k08 = K01; k09 = K07; k10 = K16; k11 = K36; k12 = K02; k13 = K30; k14 = K22; k15 = K21; k16 = K38; k17 = K50; k18 = K51; k19 = K00; k20 = K31; k21 = K23; k22 = K15; k23 = K35; k24 = K19; k25 = K24; k26 = K34; k27 = K47; k28 = K32; k29 = K03; k30 = K41; k31 = K26; k32 = K04; k33 = K46; k34 = K20; k35 = K25; k36 = K53; k37 = K18; k38 = K33; k39 = K55; k40 = K13; k41 = K17; k42 = K39; k43 = K12; k44 = K11; k45 = K54; k46 = K48; k47 = K27; } #define KEYSET10 { k00 = K49; k01 = K28; k02 = K45; k03 = K36; k04 = K01; k05 = K30; k06 = K44; k07 = K08; k08 = K42; k09 = K23; k10 = K00; k11 = K52; k12 = K43; k13 = K14; k14 = K38; k15 = K37; k16 = K22; k17 = K09; k18 = K35; k19 = K16; k20 = K15; k21 = K07; k22 = K31; k23 = K51; k24 = K03; k25 = K40; k26 = K46; k27 = K04; k28 = K20; k29 = K19; k30 = K53; k31 = K10; k32 = K47; k33 = K34; k34 = K32; k35 = K13; k36 = K41; k37 = K06; k38 = K17; k39 = K12; k40 = K25; k41 = K33; k42 = K27; k43 = K55; k44 = K54; k45 = K11; k46 = K05; k47 = K39; } diff --git a/OpenCL/m07700_a0-optimized.cl b/OpenCL/m07700_a0-optimized.cl index 5902ecca4..c509a4865 100644 --- a/OpenCL/m07700_a0-optimized.cl +++ b/OpenCL/m07700_a0-optimized.cl @@ -25,13 +25,13 @@ #define PUTCHAR(a,p,c) ((u8 *)(a))[(p)] = (u8) (c) #endif -#define SETSHIFTEDINT(a,n,v) \ -{ \ - const u32 s = ((n) & 3) * 8; \ - const u64 x = (u64) (v) << s; \ +#define SETSHIFTEDINT(a,n,v) \ +{ \ + const u32 s = ((n) & 3) * 8; \ + const u64 x = (u64) (v) << s; \ (a)[((n)/4)+0] &= ~(0xff << ((n & 3) * 8)); \ - (a)[((n)/4)+0] |= x; \ - (a)[((n)/4)+1] = x >> 32; \ + (a)[((n)/4)+0] |= x; \ + (a)[((n)/4)+1] = x >> 32; \ } CONSTANT_VK u32a sapb_trans_tbl[256] = diff --git a/OpenCL/m07700_a1-optimized.cl b/OpenCL/m07700_a1-optimized.cl index dec9f47d9..672662349 100644 --- a/OpenCL/m07700_a1-optimized.cl +++ b/OpenCL/m07700_a1-optimized.cl @@ -23,13 +23,13 @@ #define PUTCHAR(a,p,c) ((u8 *)(a))[(p)] = (u8) (c) #endif -#define SETSHIFTEDINT(a,n,v) \ -{ \ - const u32 s = ((n) & 3) * 8; \ - const u64 x = (u64) (v) << s; \ +#define SETSHIFTEDINT(a,n,v) \ +{ \ + const u32 s = ((n) & 3) * 8; \ + const u64 x = (u64) (v) << s; \ (a)[((n)/4)+0] &= ~(0xff << ((n & 3) * 8)); \ - (a)[((n)/4)+0] |= x; \ - (a)[((n)/4)+1] = x >> 32; \ + (a)[((n)/4)+0] |= x; \ + (a)[((n)/4)+1] = x >> 32; \ } CONSTANT_VK u32a sapb_trans_tbl[256] = diff --git a/OpenCL/m07701_a0-optimized.cl b/OpenCL/m07701_a0-optimized.cl index 3207e1f86..de26d7478 100644 --- a/OpenCL/m07701_a0-optimized.cl +++ b/OpenCL/m07701_a0-optimized.cl @@ -25,13 +25,13 @@ #define PUTCHAR(a,p,c) ((u8 *)(a))[(p)] = (u8) (c) #endif -#define SETSHIFTEDINT(a,n,v) \ -{ \ - const u32 s = ((n) & 3) * 8; \ - const u64 x = (u64) (v) << s; \ +#define SETSHIFTEDINT(a,n,v) \ +{ \ + const u32 s = ((n) & 3) * 8; \ + const u64 x = (u64) (v) << s; \ (a)[((n)/4)+0] &= ~(0xff << ((n & 3) * 8)); \ - (a)[((n)/4)+0] |= x; \ - (a)[((n)/4)+1] = x >> 32; \ + (a)[((n)/4)+0] |= x; \ + (a)[((n)/4)+1] = x >> 32; \ } CONSTANT_VK u32a sapb_trans_tbl[256] = diff --git a/OpenCL/m07701_a1-optimized.cl b/OpenCL/m07701_a1-optimized.cl index 32812f0ca..f10f8c782 100644 --- a/OpenCL/m07701_a1-optimized.cl +++ b/OpenCL/m07701_a1-optimized.cl @@ -23,13 +23,13 @@ #define PUTCHAR(a,p,c) ((u8 *)(a))[(p)] = (u8) (c) #endif -#define SETSHIFTEDINT(a,n,v) \ -{ \ - const u32 s = ((n) & 3) * 8; \ - const u64 x = (u64) (v) << s; \ +#define SETSHIFTEDINT(a,n,v) \ +{ \ + const u32 s = ((n) & 3) * 8; \ + const u64 x = (u64) (v) << s; \ (a)[((n)/4)+0] &= ~(0xff << ((n & 3) * 8)); \ - (a)[((n)/4)+0] |= x; \ - (a)[((n)/4)+1] = x >> 32; \ + (a)[((n)/4)+0] |= x; \ + (a)[((n)/4)+1] = x >> 32; \ } CONSTANT_VK u32a sapb_trans_tbl[256] = diff --git a/OpenCL/m14000_a3-pure.cl b/OpenCL/m14000_a3-pure.cl index 5f3abca84..50bf08343 100644 --- a/OpenCL/m14000_a3-pure.cl +++ b/OpenCL/m14000_a3-pure.cl @@ -1478,39 +1478,39 @@ DECLSPEC void s8 (const u32 a1, const u32 a2, const u32 a3, const u32 a4, const #define SWAP(a, b) { u32 tmp=*a;*a=*b;*b=tmp; } -#define DATASWAP \ - SWAP(D00, D32); \ - SWAP(D01, D33); \ - SWAP(D02, D34); \ - SWAP(D03, D35); \ - SWAP(D04, D36); \ - SWAP(D05, D37); \ - SWAP(D06, D38); \ - SWAP(D07, D39); \ - SWAP(D08, D40); \ - SWAP(D09, D41); \ - SWAP(D10, D42); \ - SWAP(D11, D43); \ - SWAP(D12, D44); \ - SWAP(D13, D45); \ - SWAP(D14, D46); \ - SWAP(D15, D47); \ - SWAP(D16, D48); \ - SWAP(D17, D49); \ - SWAP(D18, D50); \ - SWAP(D19, D51); \ - SWAP(D20, D52); \ - SWAP(D21, D53); \ - SWAP(D22, D54); \ - SWAP(D23, D55); \ - SWAP(D24, D56); \ - SWAP(D25, D57); \ - SWAP(D26, D58); \ - SWAP(D27, D59); \ - SWAP(D28, D60); \ - SWAP(D29, D61); \ - SWAP(D30, D62); \ - SWAP(D31, D63); +#define DATASWAP \ + SWAP (D00, D32); \ + SWAP (D01, D33); \ + SWAP (D02, D34); \ + SWAP (D03, D35); \ + SWAP (D04, D36); \ + SWAP (D05, D37); \ + SWAP (D06, D38); \ + SWAP (D07, D39); \ + SWAP (D08, D40); \ + SWAP (D09, D41); \ + SWAP (D10, D42); \ + SWAP (D11, D43); \ + SWAP (D12, D44); \ + SWAP (D13, D45); \ + SWAP (D14, D46); \ + SWAP (D15, D47); \ + SWAP (D16, D48); \ + SWAP (D17, D49); \ + SWAP (D18, D50); \ + SWAP (D19, D51); \ + SWAP (D20, D52); \ + SWAP (D21, D53); \ + SWAP (D22, D54); \ + SWAP (D23, D55); \ + SWAP (D24, D56); \ + SWAP (D25, D57); \ + SWAP (D26, D58); \ + SWAP (D27, D59); \ + SWAP (D28, D60); \ + SWAP (D29, D61); \ + SWAP (D30, D62); \ + SWAP (D31, D63); #define KEYSET00 { k00 = K08; k01 = K44; k02 = K29; k03 = K52; k04 = K42; k05 = K14; k06 = K28; k07 = K49; k08 = K01; k09 = K07; k10 = K16; k11 = K36; k12 = K02; k13 = K30; k14 = K22; k15 = K21; k16 = K38; k17 = K50; k18 = K51; k19 = K00; k20 = K31; k21 = K23; k22 = K15; k23 = K35; k24 = K19; k25 = K24; k26 = K34; k27 = K47; k28 = K32; k29 = K03; k30 = K41; k31 = K26; k32 = K04; k33 = K46; k34 = K20; k35 = K25; k36 = K53; k37 = K18; k38 = K33; k39 = K55; k40 = K13; k41 = K17; k42 = K39; k43 = K12; k44 = K11; k45 = K54; k46 = K48; k47 = K27; } #define KEYSET10 { k00 = K49; k01 = K28; k02 = K45; k03 = K36; k04 = K01; k05 = K30; k06 = K44; k07 = K08; k08 = K42; k09 = K23; k10 = K00; k11 = K52; k12 = K43; k13 = K14; k14 = K38; k15 = K37; k16 = K22; k17 = K09; k18 = K35; k19 = K16; k20 = K15; k21 = K07; k22 = K31; k23 = K51; k24 = K03; k25 = K40; k26 = K46; k27 = K04; k28 = K20; k29 = K19; k30 = K53; k31 = K10; k32 = K47; k33 = K34; k34 = K32; k35 = K13; k36 = K41; k37 = K06; k38 = K17; k39 = K12; k40 = K25; k41 = K33; k42 = K27; k43 = K55; k44 = K54; k45 = K11; k46 = K05; k47 = K39; } diff --git a/OpenCL/m15400_a0-optimized.cl b/OpenCL/m15400_a0-optimized.cl index c87d53ba2..9cd6f23db 100644 --- a/OpenCL/m15400_a0-optimized.cl +++ b/OpenCL/m15400_a0-optimized.cl @@ -29,16 +29,16 @@ typedef struct chacha20 #define CHACHA_CONST_02 0x79622d32 #define CHACHA_CONST_03 0x6b206574 -#define QR(a, b, c, d) \ - do { \ - x[a] = x[a] + x[b]; \ - x[d] = hc_rotl32(x[d] ^ x[a], 16); \ - x[c] = x[c] + x[d]; \ - x[b] = hc_rotl32(x[b] ^ x[c], 12); \ - x[a] = x[a] + x[b]; \ - x[d] = hc_rotl32(x[d] ^ x[a], 8); \ - x[c] = x[c] + x[d]; \ - x[b] = hc_rotl32(x[b] ^ x[c], 7); \ +#define QR(a, b, c, d) \ + do { \ + x[a] = x[a] + x[b]; \ + x[d] = hc_rotl32 (x[d] ^ x[a], 16); \ + x[c] = x[c] + x[ d]; \ + x[b] = hc_rotl32 (x[b] ^ x[c], 12); \ + x[a] = x[a] + x[ b]; \ + x[d] = hc_rotl32 (x[d] ^ x[a], 8); \ + x[c] = x[c] + x[ d]; \ + x[b] = hc_rotl32 (x[b] ^ x[c], 7); \ } while (0); DECLSPEC void chacha20_transform (const u32x *w0, const u32x *w1, const u32 *position, const u32 offset, const u32 *iv, const u32 *plain, u32x *digest) @@ -93,16 +93,16 @@ DECLSPEC void chacha20_transform (const u32x *w0, const u32x *w1, const u32 *pos for (u8 i = 0; i < 10; i++) { /* Column round */ - QR(0, 4, 8, 12); - QR(1, 5, 9, 13); - QR(2, 6, 10, 14); - QR(3, 7, 11, 15); + QR (0, 4, 8, 12); + QR (1, 5, 9, 13); + QR (2, 6, 10, 14); + QR (3, 7, 11, 15); /* Diagonal round */ - QR(0, 5, 10, 15); - QR(1, 6, 11, 12); - QR(2, 7, 8, 13); - QR(3, 4, 9, 14); + QR (0, 5, 10, 15); + QR (1, 6, 11, 12); + QR (2, 7, 8, 13); + QR (3, 4, 9, 14); } x[ 0] += ctx[ 0]; @@ -183,16 +183,16 @@ DECLSPEC void chacha20_transform (const u32x *w0, const u32x *w1, const u32 *pos for (u8 i = 0; i < 10; i++) { /* Column round */ - QR(16, 20, 24, 28); - QR(17, 21, 25, 29); - QR(18, 22, 26, 30); - QR(19, 23, 27, 31); + QR (16, 20, 24, 28); + QR (17, 21, 25, 29); + QR (18, 22, 26, 30); + QR (19, 23, 27, 31); /* Diagonal round */ - QR(16, 21, 26, 31); - QR(17, 22, 27, 28); - QR(18, 23, 24, 29); - QR(19, 20, 25, 30); + QR (16, 21, 26, 31); + QR (17, 22, 27, 28); + QR (18, 23, 24, 29); + QR (19, 20, 25, 30); } x[16] += ctx[ 0]; @@ -304,7 +304,7 @@ KERNEL_FQ void m15400_m04 (KERN_ATTR_RULES_ESALT (chacha20_t)) const u32x r2 = digest[2]; const u32x r3 = digest[3]; - COMPARE_M_SIMD(r0, r1, r2, r3); + COMPARE_M_SIMD (r0, r1, r2, r3); } } @@ -394,7 +394,7 @@ KERNEL_FQ void m15400_s04 (KERN_ATTR_RULES_ESALT (chacha20_t)) const u32x r2 = digest[2]; const u32x r3 = digest[3]; - COMPARE_S_SIMD(r0, r1, r2, r3); + COMPARE_S_SIMD (r0, r1, r2, r3); } } diff --git a/OpenCL/m15400_a1-optimized.cl b/OpenCL/m15400_a1-optimized.cl index 7b1ab79c9..0761867cd 100644 --- a/OpenCL/m15400_a1-optimized.cl +++ b/OpenCL/m15400_a1-optimized.cl @@ -27,16 +27,16 @@ typedef struct chacha20 #define CHACHA_CONST_02 0x79622d32 #define CHACHA_CONST_03 0x6b206574 -#define QR(a, b, c, d) \ - do { \ - x[a] = x[a] + x[b]; \ - x[d] = hc_rotl32(x[d] ^ x[a], 16); \ - x[c] = x[c] + x[d]; \ - x[b] = hc_rotl32(x[b] ^ x[c], 12); \ - x[a] = x[a] + x[b]; \ - x[d] = hc_rotl32(x[d] ^ x[a], 8); \ - x[c] = x[c] + x[d]; \ - x[b] = hc_rotl32(x[b] ^ x[c], 7); \ +#define QR(a, b, c, d) \ + do { \ + x[a] = x[a] + x[b]; \ + x[d] = hc_rotl32 (x[d] ^ x[a], 16); \ + x[c] = x[c] + x[ d]; \ + x[b] = hc_rotl32 (x[b] ^ x[c], 12); \ + x[a] = x[a] + x[ b]; \ + x[d] = hc_rotl32 (x[d] ^ x[a], 8); \ + x[c] = x[c] + x[ d]; \ + x[b] = hc_rotl32 (x[b] ^ x[c], 7); \ } while (0); DECLSPEC void chacha20_transform (const u32x *w0, const u32x *w1, const u32 *position, const u32 offset, const u32 *iv, const u32 *plain, u32x *digest) @@ -91,16 +91,16 @@ DECLSPEC void chacha20_transform (const u32x *w0, const u32x *w1, const u32 *pos for (u8 i = 0; i < 10; i++) { /* Column round */ - QR(0, 4, 8, 12); - QR(1, 5, 9, 13); - QR(2, 6, 10, 14); - QR(3, 7, 11, 15); + QR (0, 4, 8, 12); + QR (1, 5, 9, 13); + QR (2, 6, 10, 14); + QR (3, 7, 11, 15); /* Diagonal round */ - QR(0, 5, 10, 15); - QR(1, 6, 11, 12); - QR(2, 7, 8, 13); - QR(3, 4, 9, 14); + QR (0, 5, 10, 15); + QR (1, 6, 11, 12); + QR (2, 7, 8, 13); + QR (3, 4, 9, 14); } x[ 0] += ctx[ 0]; @@ -181,16 +181,16 @@ DECLSPEC void chacha20_transform (const u32x *w0, const u32x *w1, const u32 *pos for (u8 i = 0; i < 10; i++) { /* Column round */ - QR(16, 20, 24, 28); - QR(17, 21, 25, 29); - QR(18, 22, 26, 30); - QR(19, 23, 27, 31); + QR (16, 20, 24, 28); + QR (17, 21, 25, 29); + QR (18, 22, 26, 30); + QR (19, 23, 27, 31); /* Diagonal round */ - QR(16, 21, 26, 31); - QR(17, 22, 27, 28); - QR(18, 23, 24, 29); - QR(19, 20, 25, 30); + QR (16, 21, 26, 31); + QR (17, 22, 27, 28); + QR (18, 23, 24, 29); + QR (19, 20, 25, 30); } x[16] += ctx[ 0]; @@ -351,7 +351,7 @@ KERNEL_FQ void m15400_m04 (KERN_ATTR_ESALT (chacha20_t)) const u32x r2 = digest[2]; const u32x r3 = digest[3]; - COMPARE_M_SIMD(r0, r1, r2, r3); + COMPARE_M_SIMD (r0, r1, r2, r3); } } @@ -493,7 +493,7 @@ KERNEL_FQ void m15400_s04 (KERN_ATTR_ESALT (chacha20_t)) const u32x r2 = digest[2]; const u32x r3 = digest[3]; - COMPARE_S_SIMD(r0, r1, r2, r3); + COMPARE_S_SIMD (r0, r1, r2, r3); } } diff --git a/OpenCL/m15400_a3-optimized.cl b/OpenCL/m15400_a3-optimized.cl index 5923316f1..995c925e2 100644 --- a/OpenCL/m15400_a3-optimized.cl +++ b/OpenCL/m15400_a3-optimized.cl @@ -27,16 +27,16 @@ typedef struct chacha20 #define CHACHA_CONST_02 0x79622d32 #define CHACHA_CONST_03 0x6b206574 -#define QR(a, b, c, d) \ - do { \ - x[a] = x[a] + x[b]; \ - x[d] = hc_rotl32(x[d] ^ x[a], 16); \ - x[c] = x[c] + x[d]; \ - x[b] = hc_rotl32(x[b] ^ x[c], 12); \ - x[a] = x[a] + x[b]; \ - x[d] = hc_rotl32(x[d] ^ x[a], 8); \ - x[c] = x[c] + x[d]; \ - x[b] = hc_rotl32(x[b] ^ x[c], 7); \ +#define QR(a, b, c, d) \ + do { \ + x[a] = x[a] + x[b]; \ + x[d] = hc_rotl32 (x[d] ^ x[a], 16); \ + x[c] = x[c] + x[d]; \ + x[b] = hc_rotl32 (x[b] ^ x[c], 12); \ + x[a] = x[a] + x[b]; \ + x[d] = hc_rotl32 (x[d] ^ x[a], 8); \ + x[c] = x[c] + x[d]; \ + x[b] = hc_rotl32 (x[b] ^ x[c], 7); \ } while (0); DECLSPEC void chacha20_transform (const u32x *w0, const u32x *w1, const u32 *position, const u32 offset, const u32 *iv, const u32 *plain, u32x *digest) @@ -91,16 +91,16 @@ DECLSPEC void chacha20_transform (const u32x *w0, const u32x *w1, const u32 *pos for (u8 i = 0; i < 10; i++) { /* Column round */ - QR(0, 4, 8, 12); - QR(1, 5, 9, 13); - QR(2, 6, 10, 14); - QR(3, 7, 11, 15); + QR (0, 4, 8, 12); + QR (1, 5, 9, 13); + QR (2, 6, 10, 14); + QR (3, 7, 11, 15); /* Diagonal round */ - QR(0, 5, 10, 15); - QR(1, 6, 11, 12); - QR(2, 7, 8, 13); - QR(3, 4, 9, 14); + QR (0, 5, 10, 15); + QR (1, 6, 11, 12); + QR (2, 7, 8, 13); + QR (3, 4, 9, 14); } x[ 0] += ctx[ 0]; @@ -181,16 +181,16 @@ DECLSPEC void chacha20_transform (const u32x *w0, const u32x *w1, const u32 *pos for (u8 i = 0; i < 10; i++) { /* Column round */ - QR(16, 20, 24, 28); - QR(17, 21, 25, 29); - QR(18, 22, 26, 30); - QR(19, 23, 27, 31); + QR (16, 20, 24, 28); + QR (17, 21, 25, 29); + QR (18, 22, 26, 30); + QR (19, 23, 27, 31); /* Diagonal round */ - QR(16, 21, 26, 31); - QR(17, 22, 27, 28); - QR(18, 23, 24, 29); - QR(19, 20, 25, 30); + QR (16, 21, 26, 31); + QR (17, 22, 27, 28); + QR (18, 23, 24, 29); + QR (19, 20, 25, 30); } x[16] += ctx[ 0]; @@ -320,7 +320,7 @@ KERNEL_FQ void m15400_m16 (KERN_ATTR_VECTOR_ESALT (chacha20_t)) const u32x r2 = digest[2]; const u32x r3 = digest[3]; - COMPARE_M_SIMD(r0, r1, r2, r3); + COMPARE_M_SIMD (r0, r1, r2, r3); } } @@ -420,6 +420,6 @@ KERNEL_FQ void m15400_s16 (KERN_ATTR_VECTOR_ESALT (chacha20_t)) const u32x r2 = digest[2]; const u32x r3 = digest[3]; - COMPARE_S_SIMD(r0, r1, r2, r3); + COMPARE_S_SIMD (r0, r1, r2, r3); } } diff --git a/OpenCL/m15700-pure.cl b/OpenCL/m15700-pure.cl index 291b7b2d7..9a2ae1cf9 100644 --- a/OpenCL/m15700-pure.cl +++ b/OpenCL/m15700-pure.cl @@ -298,7 +298,7 @@ DECLSPEC void scrypt_smix (uint4 *X, uint4 *T, GLOBAL_AS uint4 *V0, GLOBAL_AS ui u32 j = keccakf_piln[s]; \ u32 k = keccakf_rotc[s]; \ bc0 = st[j]; \ - st[j] = hc_rotl64_S (t, k); \ + st[j] = hc_rotl64_S (t, k); \ t = bc0; \ } diff --git a/OpenCL/m16300-pure.cl b/OpenCL/m16300-pure.cl index beeba498d..7fe42bf51 100644 --- a/OpenCL/m16300-pure.cl +++ b/OpenCL/m16300-pure.cl @@ -68,7 +68,7 @@ CONSTANT_VK u64a keccakf_rndc[24] = u32 j = keccakf_piln[s]; \ u32 k = keccakf_rotc[s]; \ bc0 = st[j]; \ - st[j] = hc_rotl64_S (t, k); \ + st[j] = hc_rotl64_S (t, k); \ t = bc0; \ } diff --git a/OpenCL/m16400_a3-optimized.cl b/OpenCL/m16400_a3-optimized.cl index fa0e00c8b..58ef27f5c 100644 --- a/OpenCL/m16400_a3-optimized.cl +++ b/OpenCL/m16400_a3-optimized.cl @@ -17,7 +17,7 @@ #define MD5_STEP_REV(f,a,b,c,d,x,t,s) \ { \ a -= b; \ - a = hc_rotr32_S (a, s); \ + a = hc_rotr32_S (a, s); \ a -= f (b, c, d); \ a -= x; \ a -= t; \ @@ -26,7 +26,7 @@ #define MD5_STEP_REV1(f,a,b,c,d,x,t,s) \ { \ a -= b; \ - a = hc_rotr32_S (a, s); \ + a = hc_rotr32_S (a, s); \ a -= x; \ a -= t; \ } diff --git a/OpenCL/m17300_a0-optimized.cl b/OpenCL/m17300_a0-optimized.cl index a1c7bd237..058818ef2 100644 --- a/OpenCL/m17300_a0-optimized.cl +++ b/OpenCL/m17300_a0-optimized.cl @@ -108,7 +108,7 @@ KERNEL_FQ void m17300_m04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -338,7 +338,7 @@ KERNEL_FQ void m17300_s04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17300_a1-optimized.cl b/OpenCL/m17300_a1-optimized.cl index cc3c5ac5b..3ea82ef58 100644 --- a/OpenCL/m17300_a1-optimized.cl +++ b/OpenCL/m17300_a1-optimized.cl @@ -164,7 +164,7 @@ KERNEL_FQ void m17300_m04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -453,7 +453,7 @@ KERNEL_FQ void m17300_s04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17300_a3-optimized.cl b/OpenCL/m17300_a3-optimized.cl index cf78c55e6..3cdc01aa7 100644 --- a/OpenCL/m17300_a3-optimized.cl +++ b/OpenCL/m17300_a3-optimized.cl @@ -82,7 +82,7 @@ DECLSPEC void m17300m (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -280,7 +280,7 @@ DECLSPEC void m17300s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17400_a0-optimized.cl b/OpenCL/m17400_a0-optimized.cl index 8dbefbd72..8ba494a4f 100644 --- a/OpenCL/m17400_a0-optimized.cl +++ b/OpenCL/m17400_a0-optimized.cl @@ -108,7 +108,7 @@ KERNEL_FQ void m17400_m04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -338,7 +338,7 @@ KERNEL_FQ void m17400_s04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17400_a1-optimized.cl b/OpenCL/m17400_a1-optimized.cl index 96c99c25b..a358aaf65 100644 --- a/OpenCL/m17400_a1-optimized.cl +++ b/OpenCL/m17400_a1-optimized.cl @@ -164,7 +164,7 @@ KERNEL_FQ void m17400_m04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -453,7 +453,7 @@ KERNEL_FQ void m17400_s04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17400_a3-optimized.cl b/OpenCL/m17400_a3-optimized.cl index 1ce91475c..eaaa77a93 100644 --- a/OpenCL/m17400_a3-optimized.cl +++ b/OpenCL/m17400_a3-optimized.cl @@ -80,10 +80,9 @@ DECLSPEC void m17400m (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER u64x a43 = 0; u64x a44 = 0; - #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -281,7 +280,7 @@ DECLSPEC void m17400s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17500_a0-optimized.cl b/OpenCL/m17500_a0-optimized.cl index 10a029a81..e96bcd901 100644 --- a/OpenCL/m17500_a0-optimized.cl +++ b/OpenCL/m17500_a0-optimized.cl @@ -108,7 +108,7 @@ KERNEL_FQ void m17500_m04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -338,7 +338,7 @@ KERNEL_FQ void m17500_s04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17500_a1-optimized.cl b/OpenCL/m17500_a1-optimized.cl index 3a62ba394..bb4e8ef11 100644 --- a/OpenCL/m17500_a1-optimized.cl +++ b/OpenCL/m17500_a1-optimized.cl @@ -164,7 +164,7 @@ KERNEL_FQ void m17500_m04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -453,7 +453,7 @@ KERNEL_FQ void m17500_s04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17500_a3-optimized.cl b/OpenCL/m17500_a3-optimized.cl index 91705b5c4..dc3a9b1c8 100644 --- a/OpenCL/m17500_a3-optimized.cl +++ b/OpenCL/m17500_a3-optimized.cl @@ -82,7 +82,7 @@ DECLSPEC void m17500m (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -280,7 +280,7 @@ DECLSPEC void m17500s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17600_a0-optimized.cl b/OpenCL/m17600_a0-optimized.cl index 0b32f69b5..bc310c83f 100644 --- a/OpenCL/m17600_a0-optimized.cl +++ b/OpenCL/m17600_a0-optimized.cl @@ -108,7 +108,7 @@ KERNEL_FQ void m17600_m04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -338,7 +338,7 @@ KERNEL_FQ void m17600_s04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17600_a1-optimized.cl b/OpenCL/m17600_a1-optimized.cl index 5d5117736..dcbc26f80 100644 --- a/OpenCL/m17600_a1-optimized.cl +++ b/OpenCL/m17600_a1-optimized.cl @@ -164,7 +164,7 @@ KERNEL_FQ void m17600_m04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -453,7 +453,7 @@ KERNEL_FQ void m17600_s04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17600_a3-optimized.cl b/OpenCL/m17600_a3-optimized.cl index 7dde3b61a..33e1083ce 100644 --- a/OpenCL/m17600_a3-optimized.cl +++ b/OpenCL/m17600_a3-optimized.cl @@ -80,10 +80,9 @@ DECLSPEC void m17600m (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER u64x a43 = 0; u64x a44 = 0; - #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -281,7 +280,7 @@ DECLSPEC void m17600s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17700_a0-optimized.cl b/OpenCL/m17700_a0-optimized.cl index 00355e29a..055e69f96 100644 --- a/OpenCL/m17700_a0-optimized.cl +++ b/OpenCL/m17700_a0-optimized.cl @@ -108,7 +108,7 @@ KERNEL_FQ void m17700_m04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -338,7 +338,7 @@ KERNEL_FQ void m17700_s04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17700_a1-optimized.cl b/OpenCL/m17700_a1-optimized.cl index 88527e9b6..a1d4853e2 100644 --- a/OpenCL/m17700_a1-optimized.cl +++ b/OpenCL/m17700_a1-optimized.cl @@ -164,7 +164,7 @@ KERNEL_FQ void m17700_m04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -453,7 +453,7 @@ KERNEL_FQ void m17700_s04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17700_a3-optimized.cl b/OpenCL/m17700_a3-optimized.cl index 70a3f42d0..701f9e328 100644 --- a/OpenCL/m17700_a3-optimized.cl +++ b/OpenCL/m17700_a3-optimized.cl @@ -82,7 +82,7 @@ DECLSPEC void m17300m (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -280,7 +280,7 @@ DECLSPEC void m17300s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17800_a0-optimized.cl b/OpenCL/m17800_a0-optimized.cl index 193f9ce6e..f6323430e 100644 --- a/OpenCL/m17800_a0-optimized.cl +++ b/OpenCL/m17800_a0-optimized.cl @@ -108,7 +108,7 @@ KERNEL_FQ void m17800_m04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -338,7 +338,7 @@ KERNEL_FQ void m17800_s04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17800_a1-optimized.cl b/OpenCL/m17800_a1-optimized.cl index cc1e2ca52..b800ab71d 100644 --- a/OpenCL/m17800_a1-optimized.cl +++ b/OpenCL/m17800_a1-optimized.cl @@ -164,7 +164,7 @@ KERNEL_FQ void m17800_m04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -453,7 +453,7 @@ KERNEL_FQ void m17800_s04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17800_a3-optimized.cl b/OpenCL/m17800_a3-optimized.cl index 3de33b43a..3c0fd0130 100644 --- a/OpenCL/m17800_a3-optimized.cl +++ b/OpenCL/m17800_a3-optimized.cl @@ -82,7 +82,7 @@ DECLSPEC void m17400m (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -280,7 +280,7 @@ DECLSPEC void m17400s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17900_a0-optimized.cl b/OpenCL/m17900_a0-optimized.cl index 1e9e68e9d..9a442cf2d 100644 --- a/OpenCL/m17900_a0-optimized.cl +++ b/OpenCL/m17900_a0-optimized.cl @@ -108,7 +108,7 @@ KERNEL_FQ void m17900_m04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -338,7 +338,7 @@ KERNEL_FQ void m17900_s04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m17900_a1-optimized.cl b/OpenCL/m17900_a1-optimized.cl index e26e19987..69425e0e0 100644 --- a/OpenCL/m17900_a1-optimized.cl +++ b/OpenCL/m17900_a1-optimized.cl @@ -164,7 +164,7 @@ KERNEL_FQ void m17900_m04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -453,7 +453,7 @@ KERNEL_FQ void m17900_s04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m18000_a0-optimized.cl b/OpenCL/m18000_a0-optimized.cl index 6a2f4eeb4..181005280 100644 --- a/OpenCL/m18000_a0-optimized.cl +++ b/OpenCL/m18000_a0-optimized.cl @@ -108,7 +108,7 @@ KERNEL_FQ void m18000_m04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -338,7 +338,7 @@ KERNEL_FQ void m18000_s04 (KERN_ATTR_RULES ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m18000_a1-optimized.cl b/OpenCL/m18000_a1-optimized.cl index 36caf6052..bd63d834b 100644 --- a/OpenCL/m18000_a1-optimized.cl +++ b/OpenCL/m18000_a1-optimized.cl @@ -164,7 +164,7 @@ KERNEL_FQ void m18000_m04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -453,7 +453,7 @@ KERNEL_FQ void m18000_s04 (KERN_ATTR_BASIC ()) #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m18000_a3-optimized.cl b/OpenCL/m18000_a3-optimized.cl index 2dee6304a..a2dc1316a 100644 --- a/OpenCL/m18000_a3-optimized.cl +++ b/OpenCL/m18000_a3-optimized.cl @@ -82,7 +82,7 @@ DECLSPEC void m17600m (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll @@ -280,7 +280,7 @@ DECLSPEC void m17600s (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 pw_len, KER #define Rho_Pi(ad,r) \ bc0 = ad; \ - ad = hc_rotl64 (t, r); \ + ad = hc_rotl64 (t, r); \ t = bc0; \ #ifdef _unroll diff --git a/OpenCL/m18500_a0-pure.cl b/OpenCL/m18500_a0-pure.cl index 857d380ee..e65809bf1 100644 --- a/OpenCL/m18500_a0-pure.cl +++ b/OpenCL/m18500_a0-pure.cl @@ -116,22 +116,22 @@ KERNEL_FQ void m18500_mxx (KERN_ATTR_RULES ()) sha1_init (&ctx2); - ctx2.w0[0] = hc_swap32(uint_to_hex_lower8 ((e >> 0) & 255) << 0 - | uint_to_hex_lower8 ((e >> 8) & 255) << 16); - ctx2.w0[1] = hc_swap32(uint_to_hex_lower8 ((e >> 16) & 255) << 0 - | uint_to_hex_lower8 ((e >> 24) & 255) << 16); - ctx2.w0[2] = hc_swap32(uint_to_hex_lower8 ((f >> 0) & 255) << 0 - | uint_to_hex_lower8 ((f >> 8) & 255) << 16); - ctx2.w0[3] = hc_swap32(uint_to_hex_lower8 ((f >> 16) & 255) << 0 - | uint_to_hex_lower8 ((f >> 24) & 255) << 16); - ctx2.w1[0] = hc_swap32(uint_to_hex_lower8 ((g >> 0) & 255) << 0 - | uint_to_hex_lower8 ((g >> 8) & 255) << 16); - ctx2.w1[1] = hc_swap32(uint_to_hex_lower8 ((g >> 16) & 255) << 0 - | uint_to_hex_lower8 ((g >> 24) & 255) << 16); - ctx2.w1[2] = hc_swap32(uint_to_hex_lower8 ((h >> 0) & 255) << 0 - | uint_to_hex_lower8 ((h >> 8) & 255) << 16); - ctx2.w1[3] = hc_swap32(uint_to_hex_lower8 ((h >> 16) & 255) << 0 - | uint_to_hex_lower8 ((h >> 24) & 255) << 16); + ctx2.w0[0] = hc_swap32 (uint_to_hex_lower8 ((e >> 0) & 255) << 0 + | uint_to_hex_lower8 ((e >> 8) & 255) << 16); + ctx2.w0[1] = hc_swap32 (uint_to_hex_lower8 ((e >> 16) & 255) << 0 + | uint_to_hex_lower8 ((e >> 24) & 255) << 16); + ctx2.w0[2] = hc_swap32 (uint_to_hex_lower8 ((f >> 0) & 255) << 0 + | uint_to_hex_lower8 ((f >> 8) & 255) << 16); + ctx2.w0[3] = hc_swap32 (uint_to_hex_lower8 ((f >> 16) & 255) << 0 + | uint_to_hex_lower8 ((f >> 24) & 255) << 16); + ctx2.w1[0] = hc_swap32 (uint_to_hex_lower8 ((g >> 0) & 255) << 0 + | uint_to_hex_lower8 ((g >> 8) & 255) << 16); + ctx2.w1[1] = hc_swap32 (uint_to_hex_lower8 ((g >> 16) & 255) << 0 + | uint_to_hex_lower8 ((g >> 24) & 255) << 16); + ctx2.w1[2] = hc_swap32 (uint_to_hex_lower8 ((h >> 0) & 255) << 0 + | uint_to_hex_lower8 ((h >> 8) & 255) << 16); + ctx2.w1[3] = hc_swap32 (uint_to_hex_lower8 ((h >> 16) & 255) << 0 + | uint_to_hex_lower8 ((h >> 24) & 255) << 16); ctx2.len = 32; sha1_final (&ctx2); @@ -244,22 +244,22 @@ KERNEL_FQ void m18500_sxx (KERN_ATTR_RULES ()) sha1_init (&ctx2); - ctx2.w0[0] = hc_swap32(uint_to_hex_lower8 ((e >> 0) & 255) << 0 - | uint_to_hex_lower8 ((e >> 8) & 255) << 16); - ctx2.w0[1] = hc_swap32(uint_to_hex_lower8 ((e >> 16) & 255) << 0 - | uint_to_hex_lower8 ((e >> 24) & 255) << 16); - ctx2.w0[2] = hc_swap32(uint_to_hex_lower8 ((f >> 0) & 255) << 0 - | uint_to_hex_lower8 ((f >> 8) & 255) << 16); - ctx2.w0[3] = hc_swap32(uint_to_hex_lower8 ((f >> 16) & 255) << 0 - | uint_to_hex_lower8 ((f >> 24) & 255) << 16); - ctx2.w1[0] = hc_swap32(uint_to_hex_lower8 ((g >> 0) & 255) << 0 - | uint_to_hex_lower8 ((g >> 8) & 255) << 16); - ctx2.w1[1] = hc_swap32(uint_to_hex_lower8 ((g >> 16) & 255) << 0 - | uint_to_hex_lower8 ((g >> 24) & 255) << 16); - ctx2.w1[2] = hc_swap32(uint_to_hex_lower8 ((h >> 0) & 255) << 0 - | uint_to_hex_lower8 ((h >> 8) & 255) << 16); - ctx2.w1[3] = hc_swap32(uint_to_hex_lower8 ((h >> 16) & 255) << 0 - | uint_to_hex_lower8 ((h >> 24) & 255) << 16); + ctx2.w0[0] = hc_swap32 (uint_to_hex_lower8 ((e >> 0) & 255) << 0 + | uint_to_hex_lower8 ((e >> 8) & 255) << 16); + ctx2.w0[1] = hc_swap32 (uint_to_hex_lower8 ((e >> 16) & 255) << 0 + | uint_to_hex_lower8 ((e >> 24) & 255) << 16); + ctx2.w0[2] = hc_swap32 (uint_to_hex_lower8 ((f >> 0) & 255) << 0 + | uint_to_hex_lower8 ((f >> 8) & 255) << 16); + ctx2.w0[3] = hc_swap32 (uint_to_hex_lower8 ((f >> 16) & 255) << 0 + | uint_to_hex_lower8 ((f >> 24) & 255) << 16); + ctx2.w1[0] = hc_swap32 (uint_to_hex_lower8 ((g >> 0) & 255) << 0 + | uint_to_hex_lower8 ((g >> 8) & 255) << 16); + ctx2.w1[1] = hc_swap32 (uint_to_hex_lower8 ((g >> 16) & 255) << 0 + | uint_to_hex_lower8 ((g >> 24) & 255) << 16); + ctx2.w1[2] = hc_swap32 (uint_to_hex_lower8 ((h >> 0) & 255) << 0 + | uint_to_hex_lower8 ((h >> 8) & 255) << 16); + ctx2.w1[3] = hc_swap32 (uint_to_hex_lower8 ((h >> 16) & 255) << 0 + | uint_to_hex_lower8 ((h >> 24) & 255) << 16); ctx2.len = 32; sha1_final (&ctx2); diff --git a/OpenCL/m18500_a1-pure.cl b/OpenCL/m18500_a1-pure.cl index 4de2e20cb..f66a7f0bd 100644 --- a/OpenCL/m18500_a1-pure.cl +++ b/OpenCL/m18500_a1-pure.cl @@ -115,22 +115,22 @@ KERNEL_FQ void m18500_mxx (KERN_ATTR_RULES ()) sha1_init (&ctx2); - ctx2.w0[0] = hc_swap32(uint_to_hex_lower8 ((e >> 0) & 255) << 0 - | uint_to_hex_lower8 ((e >> 8) & 255) << 16); - ctx2.w0[1] = hc_swap32(uint_to_hex_lower8 ((e >> 16) & 255) << 0 - | uint_to_hex_lower8 ((e >> 24) & 255) << 16); - ctx2.w0[2] = hc_swap32(uint_to_hex_lower8 ((f >> 0) & 255) << 0 - | uint_to_hex_lower8 ((f >> 8) & 255) << 16); - ctx2.w0[3] = hc_swap32(uint_to_hex_lower8 ((f >> 16) & 255) << 0 - | uint_to_hex_lower8 ((f >> 24) & 255) << 16); - ctx2.w1[0] = hc_swap32(uint_to_hex_lower8 ((g >> 0) & 255) << 0 - | uint_to_hex_lower8 ((g >> 8) & 255) << 16); - ctx2.w1[1] = hc_swap32(uint_to_hex_lower8 ((g >> 16) & 255) << 0 - | uint_to_hex_lower8 ((g >> 24) & 255) << 16); - ctx2.w1[2] = hc_swap32(uint_to_hex_lower8 ((h >> 0) & 255) << 0 - | uint_to_hex_lower8 ((h >> 8) & 255) << 16); - ctx2.w1[3] = hc_swap32(uint_to_hex_lower8 ((h >> 16) & 255) << 0 - | uint_to_hex_lower8 ((h >> 24) & 255) << 16); + ctx2.w0[0] = hc_swap32 (uint_to_hex_lower8 ((e >> 0) & 255) << 0 + | uint_to_hex_lower8 ((e >> 8) & 255) << 16); + ctx2.w0[1] = hc_swap32 (uint_to_hex_lower8 ((e >> 16) & 255) << 0 + | uint_to_hex_lower8 ((e >> 24) & 255) << 16); + ctx2.w0[2] = hc_swap32 (uint_to_hex_lower8 ((f >> 0) & 255) << 0 + | uint_to_hex_lower8 ((f >> 8) & 255) << 16); + ctx2.w0[3] = hc_swap32 (uint_to_hex_lower8 ((f >> 16) & 255) << 0 + | uint_to_hex_lower8 ((f >> 24) & 255) << 16); + ctx2.w1[0] = hc_swap32 (uint_to_hex_lower8 ((g >> 0) & 255) << 0 + | uint_to_hex_lower8 ((g >> 8) & 255) << 16); + ctx2.w1[1] = hc_swap32 (uint_to_hex_lower8 ((g >> 16) & 255) << 0 + | uint_to_hex_lower8 ((g >> 24) & 255) << 16); + ctx2.w1[2] = hc_swap32 (uint_to_hex_lower8 ((h >> 0) & 255) << 0 + | uint_to_hex_lower8 ((h >> 8) & 255) << 16); + ctx2.w1[3] = hc_swap32 (uint_to_hex_lower8 ((h >> 16) & 255) << 0 + | uint_to_hex_lower8 ((h >> 24) & 255) << 16); ctx2.len = 32; sha1_final (&ctx2); @@ -242,22 +242,22 @@ KERNEL_FQ void m18500_sxx (KERN_ATTR_RULES ()) sha1_init (&ctx2); - ctx2.w0[0] = hc_swap32(uint_to_hex_lower8 ((e >> 0) & 255) << 0 - | uint_to_hex_lower8 ((e >> 8) & 255) << 16); - ctx2.w0[1] = hc_swap32(uint_to_hex_lower8 ((e >> 16) & 255) << 0 - | uint_to_hex_lower8 ((e >> 24) & 255) << 16); - ctx2.w0[2] = hc_swap32(uint_to_hex_lower8 ((f >> 0) & 255) << 0 - | uint_to_hex_lower8 ((f >> 8) & 255) << 16); - ctx2.w0[3] = hc_swap32(uint_to_hex_lower8 ((f >> 16) & 255) << 0 - | uint_to_hex_lower8 ((f >> 24) & 255) << 16); - ctx2.w1[0] = hc_swap32(uint_to_hex_lower8 ((g >> 0) & 255) << 0 - | uint_to_hex_lower8 ((g >> 8) & 255) << 16); - ctx2.w1[1] = hc_swap32(uint_to_hex_lower8 ((g >> 16) & 255) << 0 - | uint_to_hex_lower8 ((g >> 24) & 255) << 16); - ctx2.w1[2] = hc_swap32(uint_to_hex_lower8 ((h >> 0) & 255) << 0 - | uint_to_hex_lower8 ((h >> 8) & 255) << 16); - ctx2.w1[3] = hc_swap32(uint_to_hex_lower8 ((h >> 16) & 255) << 0 - | uint_to_hex_lower8 ((h >> 24) & 255) << 16); + ctx2.w0[0] = hc_swap32 (uint_to_hex_lower8 ((e >> 0) & 255) << 0 + | uint_to_hex_lower8 ((e >> 8) & 255) << 16); + ctx2.w0[1] = hc_swap32 (uint_to_hex_lower8 ((e >> 16) & 255) << 0 + | uint_to_hex_lower8 ((e >> 24) & 255) << 16); + ctx2.w0[2] = hc_swap32 (uint_to_hex_lower8 ((f >> 0) & 255) << 0 + | uint_to_hex_lower8 ((f >> 8) & 255) << 16); + ctx2.w0[3] = hc_swap32 (uint_to_hex_lower8 ((f >> 16) & 255) << 0 + | uint_to_hex_lower8 ((f >> 24) & 255) << 16); + ctx2.w1[0] = hc_swap32 (uint_to_hex_lower8 ((g >> 0) & 255) << 0 + | uint_to_hex_lower8 ((g >> 8) & 255) << 16); + ctx2.w1[1] = hc_swap32 (uint_to_hex_lower8 ((g >> 16) & 255) << 0 + | uint_to_hex_lower8 ((g >> 24) & 255) << 16); + ctx2.w1[2] = hc_swap32 (uint_to_hex_lower8 ((h >> 0) & 255) << 0 + | uint_to_hex_lower8 ((h >> 8) & 255) << 16); + ctx2.w1[3] = hc_swap32 (uint_to_hex_lower8 ((h >> 16) & 255) << 0 + | uint_to_hex_lower8 ((h >> 24) & 255) << 16); ctx2.len = 32; sha1_final (&ctx2); diff --git a/OpenCL/m18500_a3-pure.cl b/OpenCL/m18500_a3-pure.cl index 8eb1dac9d..5bd489870 100644 --- a/OpenCL/m18500_a3-pure.cl +++ b/OpenCL/m18500_a3-pure.cl @@ -125,22 +125,22 @@ KERNEL_FQ void m18500_mxx (KERN_ATTR_VECTOR ()) sha1_init (&ctx2); - ctx2.w0[0] = hc_swap32(uint_to_hex_lower8 ((e >> 0) & 255) << 0 - | uint_to_hex_lower8 ((e >> 8) & 255) << 16); - ctx2.w0[1] = hc_swap32(uint_to_hex_lower8 ((e >> 16) & 255) << 0 - | uint_to_hex_lower8 ((e >> 24) & 255) << 16); - ctx2.w0[2] = hc_swap32(uint_to_hex_lower8 ((f >> 0) & 255) << 0 - | uint_to_hex_lower8 ((f >> 8) & 255) << 16); - ctx2.w0[3] = hc_swap32(uint_to_hex_lower8 ((f >> 16) & 255) << 0 - | uint_to_hex_lower8 ((f >> 24) & 255) << 16); - ctx2.w1[0] = hc_swap32(uint_to_hex_lower8 ((g >> 0) & 255) << 0 - | uint_to_hex_lower8 ((g >> 8) & 255) << 16); - ctx2.w1[1] = hc_swap32(uint_to_hex_lower8 ((g >> 16) & 255) << 0 - | uint_to_hex_lower8 ((g >> 24) & 255) << 16); - ctx2.w1[2] = hc_swap32(uint_to_hex_lower8 ((h >> 0) & 255) << 0 - | uint_to_hex_lower8 ((h >> 8) & 255) << 16); - ctx2.w1[3] = hc_swap32(uint_to_hex_lower8 ((h >> 16) & 255) << 0 - | uint_to_hex_lower8 ((h >> 24) & 255) << 16); + ctx2.w0[0] = hc_swap32 (uint_to_hex_lower8 ((e >> 0) & 255) << 0 + | uint_to_hex_lower8 ((e >> 8) & 255) << 16); + ctx2.w0[1] = hc_swap32 (uint_to_hex_lower8 ((e >> 16) & 255) << 0 + | uint_to_hex_lower8 ((e >> 24) & 255) << 16); + ctx2.w0[2] = hc_swap32 (uint_to_hex_lower8 ((f >> 0) & 255) << 0 + | uint_to_hex_lower8 ((f >> 8) & 255) << 16); + ctx2.w0[3] = hc_swap32 (uint_to_hex_lower8 ((f >> 16) & 255) << 0 + | uint_to_hex_lower8 ((f >> 24) & 255) << 16); + ctx2.w1[0] = hc_swap32 (uint_to_hex_lower8 ((g >> 0) & 255) << 0 + | uint_to_hex_lower8 ((g >> 8) & 255) << 16); + ctx2.w1[1] = hc_swap32 (uint_to_hex_lower8 ((g >> 16) & 255) << 0 + | uint_to_hex_lower8 ((g >> 24) & 255) << 16); + ctx2.w1[2] = hc_swap32 (uint_to_hex_lower8 ((h >> 0) & 255) << 0 + | uint_to_hex_lower8 ((h >> 8) & 255) << 16); + ctx2.w1[3] = hc_swap32 (uint_to_hex_lower8 ((h >> 16) & 255) << 0 + | uint_to_hex_lower8 ((h >> 24) & 255) << 16); ctx2.len = 32; sha1_final (&ctx2); @@ -264,22 +264,22 @@ KERNEL_FQ void m18500_sxx (KERN_ATTR_VECTOR ()) sha1_init (&ctx2); - ctx2.w0[0] = hc_swap32(uint_to_hex_lower8 ((e >> 0) & 255) << 0 - | uint_to_hex_lower8 ((e >> 8) & 255) << 16); - ctx2.w0[1] = hc_swap32(uint_to_hex_lower8 ((e >> 16) & 255) << 0 - | uint_to_hex_lower8 ((e >> 24) & 255) << 16); - ctx2.w0[2] = hc_swap32(uint_to_hex_lower8 ((f >> 0) & 255) << 0 - | uint_to_hex_lower8 ((f >> 8) & 255) << 16); - ctx2.w0[3] = hc_swap32(uint_to_hex_lower8 ((f >> 16) & 255) << 0 - | uint_to_hex_lower8 ((f >> 24) & 255) << 16); - ctx2.w1[0] = hc_swap32(uint_to_hex_lower8 ((g >> 0) & 255) << 0 - | uint_to_hex_lower8 ((g >> 8) & 255) << 16); - ctx2.w1[1] = hc_swap32(uint_to_hex_lower8 ((g >> 16) & 255) << 0 - | uint_to_hex_lower8 ((g >> 24) & 255) << 16); - ctx2.w1[2] = hc_swap32(uint_to_hex_lower8 ((h >> 0) & 255) << 0 - | uint_to_hex_lower8 ((h >> 8) & 255) << 16); - ctx2.w1[3] = hc_swap32(uint_to_hex_lower8 ((h >> 16) & 255) << 0 - | uint_to_hex_lower8 ((h >> 24) & 255) << 16); + ctx2.w0[0] = hc_swap32 (uint_to_hex_lower8 ((e >> 0) & 255) << 0 + | uint_to_hex_lower8 ((e >> 8) & 255) << 16); + ctx2.w0[1] = hc_swap32 (uint_to_hex_lower8 ((e >> 16) & 255) << 0 + | uint_to_hex_lower8 ((e >> 24) & 255) << 16); + ctx2.w0[2] = hc_swap32 (uint_to_hex_lower8 ((f >> 0) & 255) << 0 + | uint_to_hex_lower8 ((f >> 8) & 255) << 16); + ctx2.w0[3] = hc_swap32 (uint_to_hex_lower8 ((f >> 16) & 255) << 0 + | uint_to_hex_lower8 ((f >> 24) & 255) << 16); + ctx2.w1[0] = hc_swap32 (uint_to_hex_lower8 ((g >> 0) & 255) << 0 + | uint_to_hex_lower8 ((g >> 8) & 255) << 16); + ctx2.w1[1] = hc_swap32 (uint_to_hex_lower8 ((g >> 16) & 255) << 0 + | uint_to_hex_lower8 ((g >> 24) & 255) << 16); + ctx2.w1[2] = hc_swap32 (uint_to_hex_lower8 ((h >> 0) & 255) << 0 + | uint_to_hex_lower8 ((h >> 8) & 255) << 16); + ctx2.w1[3] = hc_swap32 (uint_to_hex_lower8 ((h >> 16) & 255) << 0 + | uint_to_hex_lower8 ((h >> 24) & 255) << 16); ctx2.len = 32; sha1_final (&ctx2); diff --git a/OpenCL/m19600-pure.cl b/OpenCL/m19600-pure.cl index 1403a7c4d..39219af3f 100644 --- a/OpenCL/m19600-pure.cl +++ b/OpenCL/m19600-pure.cl @@ -513,7 +513,7 @@ KERNEL_FQ void m19600_comp (KERN_ATTR_TMPS_ESALT (krb5tgs_17_tmp_t, krb5tgs_17_t int last_block_size = edata2_len % 16; - if(last_block_size == 0) + if (last_block_size == 0) { last_block_size = 16; } @@ -991,9 +991,9 @@ KERNEL_FQ void m19600_comp (KERN_ATTR_TMPS_ESALT (krb5tgs_17_tmp_t, krb5tgs_17_t sha1_hmac_update_64 (&sha1_hmac_ctx, w0, w1, w2, w3, 16 + last_block_size); - sha1_hmac_final(&sha1_hmac_ctx); + sha1_hmac_final (&sha1_hmac_ctx); - if(sha1_hmac_ctx.opad.h[0] == esalt_bufs[digests_offset].checksum[0] + if (sha1_hmac_ctx.opad.h[0] == esalt_bufs[digests_offset].checksum[0] && sha1_hmac_ctx.opad.h[1] == esalt_bufs[digests_offset].checksum[1] && sha1_hmac_ctx.opad.h[2] == esalt_bufs[digests_offset].checksum[2]) { @@ -1005,4 +1005,4 @@ KERNEL_FQ void m19600_comp (KERN_ATTR_TMPS_ESALT (krb5tgs_17_tmp_t, krb5tgs_17_t } } } -} \ No newline at end of file +} diff --git a/OpenCL/m19700-pure.cl b/OpenCL/m19700-pure.cl index 4c7d9b466..eea054590 100644 --- a/OpenCL/m19700-pure.cl +++ b/OpenCL/m19700-pure.cl @@ -590,7 +590,7 @@ KERNEL_FQ void m19700_comp (KERN_ATTR_TMPS_ESALT (krb5tgs_18_tmp_t, krb5tgs_18_t int last_block_size = edata2_len % 16; - if(last_block_size == 0) + if (last_block_size == 0) { last_block_size = 16; } @@ -1055,9 +1055,9 @@ KERNEL_FQ void m19700_comp (KERN_ATTR_TMPS_ESALT (krb5tgs_18_tmp_t, krb5tgs_18_t sha1_hmac_update_64 (&sha1_hmac_ctx, w0, w1, w2, w3, 16 + last_block_size); - sha1_hmac_final(&sha1_hmac_ctx); + sha1_hmac_final (&sha1_hmac_ctx); - if(sha1_hmac_ctx.opad.h[0] == esalt_bufs[digests_offset].checksum[0] + if (sha1_hmac_ctx.opad.h[0] == esalt_bufs[digests_offset].checksum[0] && sha1_hmac_ctx.opad.h[1] == esalt_bufs[digests_offset].checksum[1] && sha1_hmac_ctx.opad.h[2] == esalt_bufs[digests_offset].checksum[2]) { @@ -1069,4 +1069,4 @@ KERNEL_FQ void m19700_comp (KERN_ATTR_TMPS_ESALT (krb5tgs_18_tmp_t, krb5tgs_18_t } } } -} \ No newline at end of file +} diff --git a/src/backend.c b/src/backend.c index 94f2df4ef..80fdbb387 100644 --- a/src/backend.c +++ b/src/backend.c @@ -5068,7 +5068,7 @@ int backend_ctx_init (hashcat_ctx_t *hashcat_ctx) hcfree (opencl_platforms_vendor); \ hcfree (opencl_platforms_vendor_id); \ hcfree (opencl_platforms_version); \ - } while(0) + } while (0) cl_platform_id *opencl_platforms = (cl_platform_id *) hccalloc (CL_PLATFORMS_MAX, sizeof (cl_platform_id)); cl_uint opencl_platforms_cnt = 0; diff --git a/src/ext_nvrtc.c b/src/ext_nvrtc.c index 634caac5d..91d68c0bd 100644 --- a/src/ext_nvrtc.c +++ b/src/ext_nvrtc.c @@ -24,4 +24,4 @@ int nvrtc_make_options_array_from_string (char *string, char **options) } while ((next = strtok_r ((char *) NULL, " ", &saveptr)) != NULL); return cnt; -} \ No newline at end of file +} diff --git a/src/filehandling.c b/src/filehandling.c index 598881077..b9fe2c6cc 100644 --- a/src/filehandling.c +++ b/src/filehandling.c @@ -255,15 +255,15 @@ int hc_fseek (HCFILE *fp, off_t offset, int whence) zlib_filefunc64_32_def *d = NULL; if (whence == SEEK_SET) { - r = ZSEEK64(*d, fp->ufp, offset, ZLIB_FILEFUNC_SEEK_SET); + r = ZSEEK64 (*d, fp->ufp, offset, ZLIB_FILEFUNC_SEEK_SET); } else if (whence == SEEK_CUR) { - r = ZSEEK64(*d, fp->ufp, offset, ZLIB_FILEFUNC_SEEK_CUR); + r = ZSEEK64 (*d, fp->ufp, offset, ZLIB_FILEFUNC_SEEK_CUR); } else if (whence == SEEK_END) { - r = ZSEEK64(*d, fp->ufp, offset, ZLIB_FILEFUNC_SEEK_END); + r = ZSEEK64 (*d, fp->ufp, offset, ZLIB_FILEFUNC_SEEK_END); } // or // r = unzSetOffset (fp->ufp, offset); diff --git a/src/hashcat.c b/src/hashcat.c index 4c916c988..bf1a7e1f2 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1265,7 +1265,7 @@ int hashcat_session_destroy (hashcat_ctx_t *hashcat_ctx) if (user_options->brain_client == true) { - WSACleanup(); + WSACleanup (); } #endif #endif diff --git a/src/hwmon.c b/src/hwmon.c index a709b3b72..a2de81bc9 100644 --- a/src/hwmon.c +++ b/src/hwmon.c @@ -456,7 +456,7 @@ static int nvml_init (hashcat_ctx_t *hashcat_ctx) #elif defined (__CYGWIN__) - nvml->lib = hc_dlopen("nvml.dll"); + nvml->lib = hc_dlopen ("nvml.dll"); if (!nvml->lib) { @@ -2252,7 +2252,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hcfree (hm_adapters_nvapi); \ hcfree (hm_adapters_nvml); \ hcfree (hm_adapters_sysfs); \ - } while(0) + } while (0) if (backend_ctx->need_nvml == true) { diff --git a/src/modules/module_11500.c b/src/modules/module_11500.c index 7129de04d..fcd3eb134 100644 --- a/src/modules/module_11500.c +++ b/src/modules/module_11500.c @@ -173,4 +173,4 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_tmp_size = MODULE_DEFAULT; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; -} \ No newline at end of file +} diff --git a/src/modules/module_13400.c b/src/modules/module_13400.c index 205e41121..7651c16f9 100644 --- a/src/modules/module_13400.c +++ b/src/modules/module_13400.c @@ -547,7 +547,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char *ptr_data = line_buf; - ptr_data += strlen(line_buf); + ptr_data += strlen (line_buf); *ptr_data = '*'; ptr_data++; @@ -594,7 +594,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE sprintf (ptr_data, "%u", contents_len); - ptr_data += strlen(ptr_contents_len); + ptr_data += strlen (ptr_contents_len); *ptr_data = '*'; ptr_data++; @@ -616,6 +616,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0; i < contents_hash_len; i++, ptr_data += 8) sprintf (ptr_data, "%08x", ptr_contents_hash[i]); } + if (keyfile_len) { *ptr_data = '*'; diff --git a/src/modules/module_15300.c b/src/modules/module_15300.c index 9f833e84b..92a548665 100644 --- a/src/modules/module_15300.c +++ b/src/modules/module_15300.c @@ -335,7 +335,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE SID[i] = SID_tmp[j]; } - hcfree(SID_tmp); + hcfree (SID_tmp); for (u32 i = 0; i < iv_len / 8; i++) { @@ -361,9 +361,9 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (contents_len == 208) { - memcpy (cipher_algorithm, "des3", strlen("des3")); + memcpy (cipher_algorithm, "des3", strlen ("des3")); - memcpy (hash_algorithm, "sha1", strlen("sha1")); + memcpy (hash_algorithm, "sha1", strlen ("sha1")); } const int line_len = snprintf (line_buf, line_size, "%s%u*%u*%s*%s*%s*%u*%s*%u*%s", diff --git a/src/modules/module_15900.c b/src/modules/module_15900.c index 984e66c85..066b279fe 100644 --- a/src/modules/module_15900.c +++ b/src/modules/module_15900.c @@ -301,7 +301,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // convert back SID - SID_tmp = (u8 *) hcmalloc ((SID_len + 1) * sizeof(u8)); + SID_tmp = (u8 *) hcmalloc ((SID_len + 1) * sizeof (u8)); for (u32 i = 0; i < (SID_len / 4) + 1; i++) { diff --git a/src/modules/module_17400.c b/src/modules/module_17400.c index bb769e386..ed4c8ae82 100644 --- a/src/modules/module_17400.c +++ b/src/modules/module_17400.c @@ -166,4 +166,4 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_tmp_size = MODULE_DEFAULT; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; -} \ No newline at end of file +} diff --git a/src/modules/module_17500.c b/src/modules/module_17500.c index b177872e6..213cf957a 100644 --- a/src/modules/module_17500.c +++ b/src/modules/module_17500.c @@ -172,4 +172,4 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_tmp_size = MODULE_DEFAULT; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; -} \ No newline at end of file +} diff --git a/src/modules/module_17600.c b/src/modules/module_17600.c index 478ccccf8..da307a6df 100644 --- a/src/modules/module_17600.c +++ b/src/modules/module_17600.c @@ -178,4 +178,4 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_tmp_size = MODULE_DEFAULT; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; -} \ No newline at end of file +} diff --git a/src/modules/module_17700.c b/src/modules/module_17700.c index 8d4003e0a..15f68cc61 100644 --- a/src/modules/module_17700.c +++ b/src/modules/module_17700.c @@ -175,4 +175,4 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_tmp_size = MODULE_DEFAULT; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; -} \ No newline at end of file +} diff --git a/src/modules/module_17800.c b/src/modules/module_17800.c index 704d37190..5600bfbf1 100644 --- a/src/modules/module_17800.c +++ b/src/modules/module_17800.c @@ -166,4 +166,4 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_tmp_size = MODULE_DEFAULT; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; -} \ No newline at end of file +} diff --git a/src/modules/module_17900.c b/src/modules/module_17900.c index d4947e418..e35b28954 100644 --- a/src/modules/module_17900.c +++ b/src/modules/module_17900.c @@ -172,4 +172,4 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_tmp_size = MODULE_DEFAULT; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; -} \ No newline at end of file +} diff --git a/src/modules/module_18000.c b/src/modules/module_18000.c index ad03e89af..de457b100 100644 --- a/src/modules/module_18000.c +++ b/src/modules/module_18000.c @@ -178,4 +178,4 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_tmp_size = MODULE_DEFAULT; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; -} \ No newline at end of file +} diff --git a/src/modules/module_18200.c b/src/modules/module_18200.c index 5d95589ed..3db491d68 100644 --- a/src/modules/module_18200.c +++ b/src/modules/module_18200.c @@ -134,7 +134,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE token.signatures_cnt = 1; token.signatures_buf[0] = SIGNATURE_KRB5ASREP; - token.len[0] = strlen(SIGNATURE_KRB5ASREP); + token.len[0] = strlen (SIGNATURE_KRB5ASREP); token.attr[0] = TOKEN_ATTR_FIXED_LENGTH | TOKEN_ATTR_VERIFY_SIGNATURE; diff --git a/src/modules/module_19600.c b/src/modules/module_19600.c index 5f686a5be..5f62a44f9 100644 --- a/src/modules/module_19600.c +++ b/src/modules/module_19600.c @@ -194,12 +194,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE user_pos = token.buf[1]; user_len = token.len[1]; - memcpy(krb5tgs->user, user_pos, user_len); + memcpy (krb5tgs->user, user_pos, user_len); domain_pos = token.buf[2]; domain_len = token.len[2]; - memcpy(krb5tgs->domain, domain_pos, domain_len); + memcpy (krb5tgs->domain, domain_pos, domain_len); checksum_pos = token.buf[3 + is_spn_provided]; @@ -211,12 +211,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 *account_info_ptr = (u8 *) krb5tgs->account_info; // domain must be uppercase - u8 domain[128]; - memcpy(domain, domain_pos, domain_len); - uppercase(domain, domain_len); - memcpy(account_info_ptr, domain, domain_len); - memcpy(account_info_ptr + domain_len, user_pos, user_len); + u8 domain[128]; + + memcpy (domain, domain_pos, domain_len); + uppercase (domain, domain_len); + + memcpy (account_info_ptr, domain, domain_len); + memcpy (account_info_ptr + domain_len, user_pos, user_len); krb5tgs->account_info_len = account_info_len; @@ -350,4 +352,4 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_tmp_size = module_tmp_size; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; -} \ No newline at end of file +} diff --git a/src/modules/module_19700.c b/src/modules/module_19700.c index f1602593d..a8b5f3720 100644 --- a/src/modules/module_19700.c +++ b/src/modules/module_19700.c @@ -194,12 +194,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE user_pos = token.buf[1]; user_len = token.len[1]; - memcpy(krb5tgs->user, user_pos, user_len); + memcpy (krb5tgs->user, user_pos, user_len); domain_pos = token.buf[2]; domain_len = token.len[2]; - memcpy(krb5tgs->domain, domain_pos, domain_len); + memcpy (krb5tgs->domain, domain_pos, domain_len); checksum_pos = token.buf[3 + is_spn_provided]; @@ -211,12 +211,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 *account_info_ptr = (u8 *) krb5tgs->account_info; // domain must be uppercase - u8 domain[128]; - memcpy(domain, domain_pos, domain_len); - uppercase(domain, domain_len); - memcpy(account_info_ptr, domain, domain_len); - memcpy(account_info_ptr + domain_len, user_pos, user_len); + u8 domain[128]; + + memcpy (domain, domain_pos, domain_len); + uppercase (domain, domain_len); + + memcpy (account_info_ptr, domain, domain_len); + memcpy (account_info_ptr + domain_len, user_pos, user_len); krb5tgs->account_info_len = account_info_len; @@ -350,4 +352,4 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_tmp_size = module_tmp_size; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; -} \ No newline at end of file +} diff --git a/src/modules/module_19800.c b/src/modules/module_19800.c index 3bca20227..e57a7d423 100644 --- a/src/modules/module_19800.c +++ b/src/modules/module_19800.c @@ -138,12 +138,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE user_pos = token.buf[1]; user_len = token.len[1]; - memcpy(krb5pa->user, user_pos, user_len); + memcpy (krb5pa->user, user_pos, user_len); domain_pos = token.buf[2]; domain_len = token.len[2]; - memcpy(krb5pa->domain, domain_pos, domain_len); + memcpy (krb5pa->domain, domain_pos, domain_len); data_pos = token.buf[3]; data_len = token.len[3]; @@ -153,12 +153,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 *account_info_ptr = (u8 *) krb5pa->account_info; // domain must be uppercase - u8 domain[128]; - memcpy(domain, domain_pos, domain_len); - uppercase(domain, domain_len); - memcpy(account_info_ptr, domain, domain_len); - memcpy(account_info_ptr + domain_len, user_pos, user_len); + u8 domain[128]; + + memcpy (domain, domain_pos, domain_len); + uppercase (domain, domain_len); + + memcpy (account_info_ptr, domain, domain_len); + memcpy (account_info_ptr + domain_len, user_pos, user_len); krb5pa->account_info_len = account_info_len; @@ -296,4 +298,4 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_tmp_size = module_tmp_size; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; -} \ No newline at end of file +} diff --git a/src/modules/module_19900.c b/src/modules/module_19900.c index 117887cb9..772f42197 100644 --- a/src/modules/module_19900.c +++ b/src/modules/module_19900.c @@ -138,12 +138,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE user_pos = token.buf[1]; user_len = token.len[1]; - memcpy(krb5pa->user, user_pos, user_len); + memcpy (krb5pa->user, user_pos, user_len); domain_pos = token.buf[2]; domain_len = token.len[2]; - memcpy(krb5pa->domain, domain_pos, domain_len); + memcpy (krb5pa->domain, domain_pos, domain_len); data_pos = token.buf[3]; data_len = token.len[3]; @@ -153,12 +153,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 *account_info_ptr = (u8 *) krb5pa->account_info; // domain must be uppercase - u8 domain[128]; - memcpy(domain, domain_pos, domain_len); - uppercase(domain, domain_len); - memcpy(account_info_ptr, domain, domain_len); - memcpy(account_info_ptr + domain_len, user_pos, user_len); + u8 domain[128]; + + memcpy (domain, domain_pos, domain_len); + uppercase (domain, domain_len); + + memcpy (account_info_ptr, domain, domain_len); + memcpy (account_info_ptr + domain_len, user_pos, user_len); krb5pa->account_info_len = account_info_len; @@ -296,4 +298,4 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_tmp_size = module_tmp_size; module_ctx->module_unstable_warning = MODULE_DEFAULT; module_ctx->module_warmup_disable = MODULE_DEFAULT; -} \ No newline at end of file +} diff --git a/src/terminal.c b/src/terminal.c index 411c5b36f..cb26e9d85 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -357,7 +357,7 @@ void SetConsoleWindowSize (const int x) static struct termios savemodes; static int havemodes = 0; -int tty_break() +int tty_break () { struct termios modmodes; @@ -373,7 +373,7 @@ int tty_break() return tcsetattr (fileno (stdin), TCSANOW, &modmodes); } -int tty_getchar() +int tty_getchar () { fd_set rfds; @@ -394,7 +394,7 @@ int tty_getchar() return getchar(); } -int tty_fix() +int tty_fix () { if (!havemodes) return 0; @@ -406,7 +406,7 @@ int tty_fix() static struct termios savemodes; static int havemodes = 0; -int tty_break() +int tty_break () { struct termios modmodes; @@ -422,7 +422,7 @@ int tty_break() return ioctl (fileno (stdin), TIOCSETAW, &modmodes); } -int tty_getchar() +int tty_getchar () { fd_set rfds; @@ -443,7 +443,7 @@ int tty_getchar() return getchar(); } -int tty_fix() +int tty_fix () { if (!havemodes) return 0; @@ -454,7 +454,7 @@ int tty_fix() #if defined (_WIN) static DWORD saveMode = 0; -int tty_break() +int tty_break () { HANDLE stdinHandle = GetStdHandle (STD_INPUT_HANDLE); @@ -464,7 +464,7 @@ int tty_break() return 0; } -int tty_getchar() +int tty_getchar () { HANDLE stdinHandle = GetStdHandle (STD_INPUT_HANDLE); @@ -504,7 +504,7 @@ int tty_getchar() return 0; } -int tty_fix() +int tty_fix () { HANDLE stdinHandle = GetStdHandle (STD_INPUT_HANDLE); @@ -1082,8 +1082,9 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx) if (device_num != 0) { - printf(","); + printf (","); } + printf (" { \"device_id\": %d,", device_id + 1); printf (" \"speed\": %" PRIu64 ",", (u64) (device_info->hashes_msec_dev * 1000)); @@ -1876,14 +1877,15 @@ void status_speed_json (hashcat_ctx_t *hashcat_ctx) if (device_num != 0) { - printf(","); + printf (","); } printf (" { \"device_id\": %d,", device_id + 1); printf (" \"speed\": %" PRIu64 " }", (u64) (device_info->hashes_msec_dev_benchmark * 1000)); device_num++; } - printf(" ] }"); + + printf (" ] }"); status_status_destroy (hashcat_ctx, hashcat_status); @@ -1995,7 +1997,7 @@ void status_progress_json (hashcat_ctx_t *hashcat_ctx) if (device_num != 0) { - printf(","); + printf (","); } printf (" { \"device_id\": %d,", device_id + 1); @@ -2004,7 +2006,7 @@ void status_progress_json (hashcat_ctx_t *hashcat_ctx) device_num++; } - printf(" ] }"); + printf (" ] }"); status_status_destroy (hashcat_ctx, hashcat_status); diff --git a/tools/test_modules/m00112.pm b/tools/test_modules/m00112.pm index ce4db24ca..0f9b3ee3d 100644 --- a/tools/test_modules/m00112.pm +++ b/tools/test_modules/m00112.pm @@ -17,7 +17,7 @@ sub module_generate_hash my $word = shift; my $salt = shift; - my $salt_bin = pack("H*", $salt); + my $salt_bin = pack ("H*", $salt); my $digest = sha1_hex ($word . $salt_bin); diff --git a/tools/test_modules/m00131.pm b/tools/test_modules/m00131.pm index 7d87b8db8..9561ca92b 100644 --- a/tools/test_modules/m00131.pm +++ b/tools/test_modules/m00131.pm @@ -33,9 +33,9 @@ sub module_verify_hash my ($digest, $word) = split (':', $line); - my ($prefix, $hash) = split('-', $digest); + my ($prefix, $hash) = split ('-', $digest); - my $salt = substr($prefix, 6, 8); + my $salt = substr ($prefix, 6, 8); return unless defined $hash; return unless defined $salt; diff --git a/tools/test_modules/m01731.pm b/tools/test_modules/m01731.pm index 3734b1ac9..d703105a4 100644 --- a/tools/test_modules/m01731.pm +++ b/tools/test_modules/m01731.pm @@ -49,4 +49,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m04800.pm b/tools/test_modules/m04800.pm index 2fa9d0f21..6bb2c5a2b 100644 --- a/tools/test_modules/m04800.pm +++ b/tools/test_modules/m04800.pm @@ -80,4 +80,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m06600.pm b/tools/test_modules/m06600.pm index 0d71db528..cc57ef087 100644 --- a/tools/test_modules/m06600.pm +++ b/tools/test_modules/m06600.pm @@ -114,4 +114,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m06700.pm b/tools/test_modules/m06700.pm index c55d6c957..205c8aa2a 100644 --- a/tools/test_modules/m06700.pm +++ b/tools/test_modules/m06700.pm @@ -105,4 +105,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m06800.pm b/tools/test_modules/m06800.pm index 0d1e54e0b..9c64422b9 100644 --- a/tools/test_modules/m06800.pm +++ b/tools/test_modules/m06800.pm @@ -69,4 +69,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m07000.pm b/tools/test_modules/m07000.pm index 04e39f788..f5e31cc6a 100644 --- a/tools/test_modules/m07000.pm +++ b/tools/test_modules/m07000.pm @@ -61,4 +61,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m07200.pm b/tools/test_modules/m07200.pm index 8e75b10ee..66fdb2b3a 100644 --- a/tools/test_modules/m07200.pm +++ b/tools/test_modules/m07200.pm @@ -47,11 +47,11 @@ sub module_verify_hash my $word = substr ($line, $index1 + 1); - my $index2 = index ($hash_in, ".", 19); + my $index2 = index ($hash_in, ".", 19); return if $index2 < 1; - my $index3 = index ($hash_in, ".", $index2 + 1); + my $index3 = index ($hash_in, ".", $index2 + 1); my $salt = substr ($hash_in, $index2 + 1, $index3 - $index2 - 1); diff --git a/tools/test_modules/m07700.pm b/tools/test_modules/m07700.pm index 07badbc6d..aa4a038b7 100644 --- a/tools/test_modules/m07700.pm +++ b/tools/test_modules/m07700.pm @@ -178,4 +178,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m07701.pm b/tools/test_modules/m07701.pm index e2d4b2156..60d0b1afb 100644 --- a/tools/test_modules/m07701.pm +++ b/tools/test_modules/m07701.pm @@ -178,4 +178,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m07800.pm b/tools/test_modules/m07800.pm index bf17095c4..bb5532120 100644 --- a/tools/test_modules/m07800.pm +++ b/tools/test_modules/m07800.pm @@ -104,4 +104,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m07801.pm b/tools/test_modules/m07801.pm index 0ea6dda86..fdd707d74 100644 --- a/tools/test_modules/m07801.pm +++ b/tools/test_modules/m07801.pm @@ -61,7 +61,7 @@ sub module_generate_hash my $hash_buf = sha1_hex ($word . substr ($theMagicArray_s, $offsetMagicArray, $lengthMagicArray) . $salt); - my $hash = sprintf("%s\$%.20s%020X", $salt, uc $hash_buf, 0); + my $hash = sprintf ("%s\$%.20s%020X", $salt, uc $hash_buf, 0); return $hash; } @@ -104,4 +104,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m08300.pm b/tools/test_modules/m08300.pm index 34a3cacb1..35caab10d 100644 --- a/tools/test_modules/m08300.pm +++ b/tools/test_modules/m08300.pm @@ -89,4 +89,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m08900.pm b/tools/test_modules/m08900.pm index d6ecada04..229534d0c 100644 --- a/tools/test_modules/m08900.pm +++ b/tools/test_modules/m08900.pm @@ -88,4 +88,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m09300.pm b/tools/test_modules/m09300.pm index 032c3d906..364ccf629 100644 --- a/tools/test_modules/m09300.pm +++ b/tools/test_modules/m09300.pm @@ -84,4 +84,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m10900.pm b/tools/test_modules/m10900.pm index f027b0d75..1db09cf33 100644 --- a/tools/test_modules/m10900.pm +++ b/tools/test_modules/m10900.pm @@ -47,7 +47,7 @@ sub module_verify_hash my @data = split (':', $digest); - return unless scalar(@data) == 4; + return unless scalar (@data) == 4; my $signature = shift @data; diff --git a/tools/test_modules/m10901.pm b/tools/test_modules/m10901.pm index d74ee2c29..75f6ca33a 100644 --- a/tools/test_modules/m10901.pm +++ b/tools/test_modules/m10901.pm @@ -23,20 +23,20 @@ sub module_generate_hash $salt = random_bytes (16); } - my $pbkdf2 = Crypt::PBKDF2->new( + my $pbkdf2 = Crypt::PBKDF2->new ( hash_class => 'HMACSHA2', iterations => $iter, output_len => 256, salt_len => 64, ); - my $p = $pbkdf2->generate($word, $salt); + my $p = $pbkdf2->generate ($word, $salt); - my $decoded_hash = $pbkdf2->decode_string($p); + my $decoded_hash = $pbkdf2->decode_string ($p); my $diter = $decoded_hash->{"iterations"}; - my $iterbytes = pack('I', unpack('N*', pack('L*', $diter))); + my $iterbytes = pack ('I', unpack ('N*', pack ('L*', $diter))); my $dsalt = $decoded_hash->{"salt"}; @@ -44,7 +44,7 @@ sub module_generate_hash my $tmp = $iterbytes . $dsalt . $dhash; - my $hash = "{PBKDF2_SHA256}" . encode_base64($tmp, ''); + my $hash = "{PBKDF2_SHA256}" . encode_base64 ($tmp, ''); return $hash; } @@ -57,11 +57,11 @@ sub module_verify_hash return unless (substr ($hash, 0, 15) eq '{PBKDF2_SHA256}'); - my $hashbytes = decode_base64(substr ($hash, 15, length $hash)); + my $hashbytes = decode_base64 (substr ($hash, 15, length $hash)); my $iterbytes = substr $hashbytes, 0, 4; - my $iter = unpack('N*', pack('L*', unpack("I",$iterbytes))); + my $iter = unpack ('N*', pack ('L*', unpack ('I', $iterbytes))); my $salt = substr $hashbytes, 4, 64; @@ -75,4 +75,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m11700.pm b/tools/test_modules/m11700.pm index bfc6a899f..94603d172 100644 --- a/tools/test_modules/m11700.pm +++ b/tools/test_modules/m11700.pm @@ -22,8 +22,8 @@ sub module_generate_hash import binascii import sys from pygost import gost34112012256 -digest = gost34112012256.new(b"$word").digest() -sys.stdout.write(binascii.hexlify(digest[::-1])) +digest = gost34112012256.new (b"$word").digest () +sys.stdout.write (binascii.hexlify (digest[::-1])) END_CODE diff --git a/tools/test_modules/m11750.pm b/tools/test_modules/m11750.pm index b1282eef9..73d28cae7 100644 --- a/tools/test_modules/m11750.pm +++ b/tools/test_modules/m11750.pm @@ -22,8 +22,8 @@ import sys from pygost import gost34112012256 key = b"$word" msg = b"$salt" -digest = hmac.new(key, msg, gost34112012256).digest() -sys.stdout.write(binascii.hexlify(digest[::-1])) +digest = hmac.new (key, msg, gost34112012256).digest () +sys.stdout.write (binascii.hexlify (digest[::-1])) END_CODE diff --git a/tools/test_modules/m11760.pm b/tools/test_modules/m11760.pm index edd96bb6d..e1edcbaee 100644 --- a/tools/test_modules/m11760.pm +++ b/tools/test_modules/m11760.pm @@ -22,8 +22,8 @@ import sys from pygost import gost34112012256 key = b"$salt" msg = b"$word" -digest = hmac.new(key, msg, gost34112012256).digest() -sys.stdout.write(binascii.hexlify(digest[::-1])) +digest = hmac.new (key, msg, gost34112012256).digest () +sys.stdout.write (binascii.hexlify (digest[::-1])) END_CODE diff --git a/tools/test_modules/m11800.pm b/tools/test_modules/m11800.pm index fe8c976dd..7dd297847 100644 --- a/tools/test_modules/m11800.pm +++ b/tools/test_modules/m11800.pm @@ -19,8 +19,8 @@ sub module_generate_hash import binascii import sys from pygost import gost34112012512 -digest = gost34112012512.new(b"$word").digest() -sys.stdout.write(binascii.hexlify(digest[::-1])) +digest = gost34112012512.new (b"$word").digest () +sys.stdout.write (binascii.hexlify (digest[::-1])) END_CODE diff --git a/tools/test_modules/m11850.pm b/tools/test_modules/m11850.pm index 96579725e..21bb4dc3c 100644 --- a/tools/test_modules/m11850.pm +++ b/tools/test_modules/m11850.pm @@ -23,8 +23,8 @@ import sys from pygost import gost34112012512 key = b"$word" msg = b"$salt" -digest = hmac.new(key, msg, gost34112012512).digest() -sys.stdout.write(binascii.hexlify(digest[::-1])) +digest = hmac.new (key, msg, gost34112012512).digest () +sys.stdout.write (binascii.hexlify (digest[::-1])) END_CODE diff --git a/tools/test_modules/m11860.pm b/tools/test_modules/m11860.pm index 0683f350d..17d78fc8c 100644 --- a/tools/test_modules/m11860.pm +++ b/tools/test_modules/m11860.pm @@ -23,8 +23,8 @@ import sys from pygost import gost34112012512 key = b"$salt" msg = b"$word" -digest = hmac.new(key, msg, gost34112012512).digest() -sys.stdout.write(binascii.hexlify(digest[::-1])) +digest = hmac.new (key, msg, gost34112012512).digest () +sys.stdout.write (binascii.hexlify (digest[::-1])) END_CODE diff --git a/tools/test_modules/m11900.pm b/tools/test_modules/m11900.pm index 5ddeb5387..f75c70486 100644 --- a/tools/test_modules/m11900.pm +++ b/tools/test_modules/m11900.pm @@ -125,7 +125,7 @@ sub module_verify_hash my @data = split (':', $digest); - return unless scalar(@data) == 4; + return unless scalar (@data) == 4; my $signature = shift @data; diff --git a/tools/test_modules/m12200.pm b/tools/test_modules/m12200.pm index 8a81f9cf7..f98198e90 100644 --- a/tools/test_modules/m12200.pm +++ b/tools/test_modules/m12200.pm @@ -66,7 +66,7 @@ sub module_verify_hash my $default_salt = 1; - my ($param, $hash) = split('\$', $digest); + my ($param, $hash) = split ('\$', $digest); $default_salt = 0 if ($param eq '1'); @@ -74,7 +74,7 @@ sub module_verify_hash if ($default_salt == 0) { - ($salt, $hash) = split('\$', $hash); + ($salt, $hash) = split ('\$', $hash); } my $word_packed = pack_if_HEX_notation ($word); diff --git a/tools/test_modules/m15300.pm b/tools/test_modules/m15300.pm index 3b48a8aa2..517d38a1b 100644 --- a/tools/test_modules/m15300.pm +++ b/tools/test_modules/m15300.pm @@ -73,27 +73,33 @@ sub get_random_dpapimk_salt return $salt_buf; } -#Thanks to Jochen Hoenicke +# Thanks to Jochen Hoenicke # (one of the authors of Palm Keyring) # for these next two subs. + sub dpapi_pbkdf2 { - my ($password, $salt, $iter, $keylen, $prf) = @_; - my ($k, $t, $u, $ui, $i); - $t = ""; - for ($k = 1; length ($t) < $keylen; $k++) + my ($password, $salt, $iter, $keylen, $prf) = @_; + my ($k, $t, $u, $ui, $i); + + $t = ""; + + for ($k = 1; length ($t) < $keylen; $k++) + { + $u = $ui = &$prf ($salt . pack ('N', $k), $password); + + for ($i = 1; $i < $iter; $i++) { - $u = $ui = &$prf ($salt.pack ('N', $k), $password); - for ($i = 1; $i < $iter; $i++) - { - # modification to fit Microsoft - # weird pbkdf2 implementation... - $ui = &$prf ($u, $password); - $u ^= $ui; - } - $t .= $u; + # modification to fit Microsoft + # weird pbkdf2 implementation... + + $ui = &$prf ($u, $password); + $u ^= $ui; } - return substr ($t, 0, $keylen); + + $t .= $u; + } + return substr ($t, 0, $keylen); } sub module_generate_hash diff --git a/tools/test_modules/m15900.pm b/tools/test_modules/m15900.pm index bf0dcf8a2..cee12b2e8 100644 --- a/tools/test_modules/m15900.pm +++ b/tools/test_modules/m15900.pm @@ -74,27 +74,34 @@ sub get_random_dpapimk_salt return $salt_buf; } -#Thanks to Jochen Hoenicke +# Thanks to Jochen Hoenicke # (one of the authors of Palm Keyring) # for these next two subs. + sub dpapi_pbkdf2 { - my ($password, $salt, $iter, $keylen, $prf) = @_; - my ($k, $t, $u, $ui, $i); - $t = ""; - for ($k = 1; length ($t) < $keylen; $k++) + my ($password, $salt, $iter, $keylen, $prf) = @_; + my ($k, $t, $u, $ui, $i); + + $t = ""; + + for ($k = 1; length ($t) < $keylen; $k++) + { + $u = $ui = &$prf ($salt . pack ('N', $k), $password); + + for ($i = 1; $i < $iter; $i++) { - $u = $ui = &$prf ($salt.pack ('N', $k), $password); - for ($i = 1; $i < $iter; $i++) - { - # modification to fit Microsoft - # weird pbkdf2 implementation... - $ui = &$prf ($u, $password); - $u ^= $ui; - } - $t .= $u; + # modification to fit Microsoft + # weird pbkdf2 implementation... + + $ui = &$prf ($u, $password); + $u ^= $ui; } - return substr ($t, 0, $keylen); + + $t .= $u; + } + + return substr ($t, 0, $keylen); } sub module_generate_hash diff --git a/tools/test_modules/m16400.pm b/tools/test_modules/m16400.pm index 88549dcc0..277ff48c9 100644 --- a/tools/test_modules/m16400.pm +++ b/tools/test_modules/m16400.pm @@ -21,7 +21,7 @@ sub module_generate_hash $md5->{_data} = $word ^ ("\x5c" x $length); $md5->{_data} .= "\x5c" x (64 - $length); - $md5->add(); + $md5->add (); my $digest = unpack ("H*", pack ('V4', @{$md5->{_state}})); diff --git a/tools/test_modules/m16500.pm b/tools/test_modules/m16500.pm index 604826d64..ed3643e39 100644 --- a/tools/test_modules/m16500.pm +++ b/tools/test_modules/m16500.pm @@ -120,4 +120,4 @@ sub get_random_jwt_salt return $header_base64 . "." . $payload_base64; } -1; \ No newline at end of file +1; diff --git a/tools/test_modules/m16600.pm b/tools/test_modules/m16600.pm index 798553c12..c0055446e 100644 --- a/tools/test_modules/m16600.pm +++ b/tools/test_modules/m16600.pm @@ -137,4 +137,4 @@ sub get_random_jwt_salt return $header_base64 . "." . $payload_base64; } -1; \ No newline at end of file +1; diff --git a/tools/test_modules/m16700.pm b/tools/test_modules/m16700.pm index 6eaddc8da..6019ee3df 100644 --- a/tools/test_modules/m16700.pm +++ b/tools/test_modules/m16700.pm @@ -169,4 +169,4 @@ sub module_verify_hash return ($new_hash, $word); } -1; \ No newline at end of file +1; diff --git a/tools/test_modules/m16900.pm b/tools/test_modules/m16900.pm index f6b90a7cc..8f99dbbb3 100644 --- a/tools/test_modules/m16900.pm +++ b/tools/test_modules/m16900.pm @@ -74,4 +74,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m17700.pm b/tools/test_modules/m17700.pm index ee7c71fb6..1bde7edd2 100644 --- a/tools/test_modules/m17700.pm +++ b/tools/test_modules/m17700.pm @@ -39,4 +39,4 @@ sub module_verify_hash return ($new_hash, $word); } -1; \ No newline at end of file +1; diff --git a/tools/test_modules/m17800.pm b/tools/test_modules/m17800.pm index 017b5269c..2c307cc36 100644 --- a/tools/test_modules/m17800.pm +++ b/tools/test_modules/m17800.pm @@ -39,4 +39,4 @@ sub module_verify_hash return ($new_hash, $word); } -1; \ No newline at end of file +1; diff --git a/tools/test_modules/m18300.pm b/tools/test_modules/m18300.pm index 5629fd4ce..bf121224a 100644 --- a/tools/test_modules/m18300.pm +++ b/tools/test_modules/m18300.pm @@ -240,4 +240,3 @@ sub module_verify_hash } 1; - diff --git a/tools/test_modules/m18400.pm b/tools/test_modules/m18400.pm index 049b5e30e..509d30440 100644 --- a/tools/test_modules/m18400.pm +++ b/tools/test_modules/m18400.pm @@ -40,7 +40,7 @@ sub module_generate_hash my $cipher = unpack ('H*', $b_cipher); my $checksum = sha256_hex ($b_plain); - my $hash = '$odf$'."*1*1*$iter*32*$checksum*16*$iv*16*$salt*0*$cipher"; + my $hash = '$odf$' . "*1*1*$iter*32*$checksum*16*$iv*16*$salt*0*$cipher"; return $hash; } diff --git a/tools/test_modules/m18600.pm b/tools/test_modules/m18600.pm index bf995bbb1..b974ce50a 100644 --- a/tools/test_modules/m18600.pm +++ b/tools/test_modules/m18600.pm @@ -54,7 +54,7 @@ sub module_generate_hash my $cipher = unpack ('H*', $b_cipher); my $checksum = sha1_hex ($b_plain); - my $hash = '$odf$'."*0*0*$iter*16*$checksum*8*$iv*16*$salt*0*$cipher"; + my $hash = '$odf$' . "*0*0*$iter*16*$checksum*8*$iv*16*$salt*0*$cipher"; return $hash; } @@ -113,7 +113,7 @@ sub module_verify_hash my $pass_hash = sha1 ($word); my $key = $kdf->PBKDF2 ($b_salt, $pass_hash); - my $cfb = Crypt::GCrypt->new( + my $cfb = Crypt::GCrypt->new ( type => 'cipher', algorithm => 'blowfish', mode => 'cfb' diff --git a/tools/test_modules/m19600.pm b/tools/test_modules/m19600.pm index ed40c9b1d..86109a6be 100644 --- a/tools/test_modules/m19600.pm +++ b/tools/test_modules/m19600.pm @@ -60,9 +60,9 @@ sub module_generate_hash my $b_seed = $pbkdf2->PBKDF2 ($mysalt, $word); # we can precompute this - my $b_kerberos_nfolded = hex2byte('6b65726265726f737b9b5b2b93132b93'); + my $b_kerberos_nfolded = hex2byte ('6b65726265726f737b9b5b2b93132b93'); - my $b_iv = hex2byte('0' x 32); + my $b_iv = hex2byte ('0' x 32); # 'key_bytes' will be the AES key used to generate 'ki' (for final hmac-sha1) # and 'ke' (AES key to decrypt/encrypt the ticket) @@ -70,8 +70,8 @@ sub module_generate_hash my $b_key_bytes = $cbc->encrypt ($b_kerberos_nfolded, $b_seed, $b_iv); # precomputed stuff - my $b_nfolded1 = hex2byte('62dc6e371a63a80958ac562b15404ac5'); - my $b_nfolded2 = hex2byte('b5b0582c14b6500aad56ab55aa80556a'); + my $b_nfolded1 = hex2byte ('62dc6e371a63a80958ac562b15404ac5'); + my $b_nfolded2 = hex2byte ('b5b0582c14b6500aad56ab55aa80556a'); my $b_ki = $cbc->encrypt ($b_nfolded1, $b_key_bytes, $b_iv); my $b_ke = $cbc->encrypt ($b_nfolded2, $b_key_bytes, $b_iv); @@ -85,7 +85,7 @@ sub module_generate_hash if (defined $edata2) { - my $len_last_block = length($edata2) % 32; + my $len_last_block = length ($edata2) % 32; my $tmp = $len_last_block + 32; @@ -93,11 +93,11 @@ sub module_generate_hash my $b_last_block = hex2byte (substr $edata2, -$len_last_block); - my $b_n_1_block = hex2byte (substr(substr($edata2, -$tmp), 0, 32)); + my $b_n_1_block = hex2byte (substr (substr ($edata2, -$tmp), 0, 32)); my $b_truncated_ticket_decrypted = $cbc->decrypt ($b_truncated_enc_ticket, $b_ke, $b_iv); - my $truncated_ticket_decrypted = byte2hex($b_truncated_ticket_decrypted); + my $truncated_ticket_decrypted = byte2hex ($b_truncated_ticket_decrypted); my $check_correct = ((substr ($truncated_ticket_decrypted, 32, 4) eq "6381" && substr ($truncated_ticket_decrypted, 38, 2) eq "30") || (substr ($truncated_ticket_decrypted, 32, 4) eq "6382")) && @@ -110,11 +110,11 @@ sub module_generate_hash my $b_n_1_decrypted = $cbc->decrypt ($b_n_1_block, $b_ke, $b_iv); - my $b_last_plain = substr $b_n_1_decrypted, 0, $len_last_block/2; + my $b_last_plain = substr $b_n_1_decrypted, 0, $len_last_block / 2; $b_last_plain = $b_last_plain ^ $b_last_block; - my $omitted = substr $b_n_1_decrypted, -(16 - $len_last_block/2); + my $omitted = substr $b_n_1_decrypted, -(16 - $len_last_block / 2); my $b_n_1 = $b_last_block . $omitted; @@ -124,7 +124,7 @@ sub module_generate_hash my $b_cleartext_ticket = $b_truncated_ticket_decrypted . $b_n_1 . $b_last_plain; - $cleartext_ticket = byte2hex($b_cleartext_ticket); + $cleartext_ticket = byte2hex ($b_cleartext_ticket); } else # validation failed { @@ -147,26 +147,26 @@ sub module_generate_hash $cleartext_ticket = $nonce . $cleartext_ticket; } # we have what is required to compute checksum - $checksum = hmac_sha1 (hex2byte($cleartext_ticket), $b_ki); + $checksum = hmac_sha1 (hex2byte ($cleartext_ticket), $b_ki); $checksum = substr $checksum, 0, 12; } - my $len_cleartext_last_block = length($cleartext_ticket) % 32; + my $len_cleartext_last_block = length ($cleartext_ticket) % 32; my $cleartext_last_block = substr $cleartext_ticket, -$len_cleartext_last_block; - my $padding = pad(length($cleartext_ticket), 32); + my $padding = pad (length ($cleartext_ticket), 32); - my $b_cleartext_last_block_padded = hex2byte($cleartext_last_block . '0' x $padding); + my $b_cleartext_last_block_padded = hex2byte ($cleartext_last_block . '0' x $padding); # we will encrypt until n-1 block (included) my $truncated_cleartext_ticket = substr $cleartext_ticket, 0, -$len_cleartext_last_block; - my $b_truncated_enc_ticket = $cbc->encrypt (hex2byte($truncated_cleartext_ticket), $b_ke, $b_iv); + my $b_truncated_enc_ticket = $cbc->encrypt (hex2byte ($truncated_cleartext_ticket), $b_ke, $b_iv); my $b_enc_ticket_n_1_block= substr $b_truncated_enc_ticket, -16; - my $b_enc_last_block = substr $b_enc_ticket_n_1_block, 0, $len_cleartext_last_block/2; + my $b_enc_last_block = substr $b_enc_ticket_n_1_block, 0, $len_cleartext_last_block / 2; # we now craft the new n-1 block my $tmp = $b_enc_ticket_n_1_block ^ $b_cleartext_last_block_padded; @@ -216,4 +216,4 @@ sub module_verify_hash return ($new_hash, $word); } -1; \ No newline at end of file +1; diff --git a/tools/test_modules/m19700.pm b/tools/test_modules/m19700.pm index 2510d14c3..018a51898 100644 --- a/tools/test_modules/m19700.pm +++ b/tools/test_modules/m19700.pm @@ -60,9 +60,9 @@ sub module_generate_hash my $b_seed = $pbkdf2->PBKDF2 ($mysalt, $word); # we can precompute this - my $b_kerberos_nfolded = hex2byte('6b65726265726f737b9b5b2b93132b93'); + my $b_kerberos_nfolded = hex2byte ('6b65726265726f737b9b5b2b93132b93'); - my $b_iv = hex2byte('0' x 32); + my $b_iv = hex2byte ('0' x 32); # 'key_bytes' will be the AES key used to generate 'ki' (for final hmac-sha1) # and 'ke' (AES key to decrypt/encrypt the ticket) @@ -72,8 +72,8 @@ sub module_generate_hash $b_key_bytes = $b_key_bytes . $cbc->encrypt ($b_key_bytes, $b_seed, $b_iv); # precomputed stuff - my $b_nfolded1 = hex2byte('62dc6e371a63a80958ac562b15404ac5'); - my $b_nfolded2 = hex2byte('b5b0582c14b6500aad56ab55aa80556a'); + my $b_nfolded1 = hex2byte ('62dc6e371a63a80958ac562b15404ac5'); + my $b_nfolded2 = hex2byte ('b5b0582c14b6500aad56ab55aa80556a'); my $b_ki = $cbc->encrypt ($b_nfolded1, $b_key_bytes, $b_iv); @@ -92,7 +92,7 @@ sub module_generate_hash if (defined $edata2) { - my $len_last_block = length($edata2) % 32; + my $len_last_block = length ($edata2) % 32; my $tmp = $len_last_block + 32; @@ -100,11 +100,11 @@ sub module_generate_hash my $b_last_block = hex2byte (substr $edata2, -$len_last_block); - my $b_n_1_block = hex2byte (substr(substr($edata2, -$tmp), 0, 32)); + my $b_n_1_block = hex2byte (substr (substr ($edata2, -$tmp), 0, 32)); my $b_truncated_ticket_decrypted = $cbc->decrypt ($b_truncated_enc_ticket, $b_ke, $b_iv); - my $truncated_ticket_decrypted = byte2hex($b_truncated_ticket_decrypted); + my $truncated_ticket_decrypted = byte2hex ($b_truncated_ticket_decrypted); my $check_correct = ((substr ($truncated_ticket_decrypted, 32, 4) eq "6381" && substr ($truncated_ticket_decrypted, 38, 2) eq "30") || (substr ($truncated_ticket_decrypted, 32, 4) eq "6382")) && @@ -117,11 +117,11 @@ sub module_generate_hash my $b_n_1_decrypted = $cbc->decrypt ($b_n_1_block, $b_ke, $b_iv); - my $b_last_plain = substr $b_n_1_decrypted, 0, $len_last_block/2; + my $b_last_plain = substr $b_n_1_decrypted, 0, $len_last_block / 2; $b_last_plain = $b_last_plain ^ $b_last_block; - my $omitted = substr $b_n_1_decrypted, -(16 - $len_last_block/2); + my $omitted = substr $b_n_1_decrypted, -(16 - $len_last_block / 2); my $b_n_1 = $b_last_block . $omitted; @@ -131,7 +131,7 @@ sub module_generate_hash my $b_cleartext_ticket = $b_truncated_ticket_decrypted . $b_n_1 . $b_last_plain; - $cleartext_ticket = byte2hex($b_cleartext_ticket); + $cleartext_ticket = byte2hex ($b_cleartext_ticket); } else # validation failed { @@ -154,26 +154,26 @@ sub module_generate_hash $cleartext_ticket = $nonce . $cleartext_ticket; } # we have what is required to compute checksum - $checksum = hmac_sha1 (hex2byte($cleartext_ticket), $b_ki); + $checksum = hmac_sha1 (hex2byte ($cleartext_ticket), $b_ki); $checksum = substr $checksum, 0, 12; } - my $len_cleartext_last_block = length($cleartext_ticket)%32; + my $len_cleartext_last_block = length ($cleartext_ticket) % 32; my $cleartext_last_block = substr $cleartext_ticket, -$len_cleartext_last_block; - my $padding = pad(length($cleartext_ticket), 32); + my $padding = pad (length ($cleartext_ticket), 32); - my $b_cleartext_last_block_padded = hex2byte($cleartext_last_block . '0' x $padding); + my $b_cleartext_last_block_padded = hex2byte ($cleartext_last_block . '0' x $padding); # we will encrypt until n-1 block (included) my $truncated_cleartext_ticket = substr $cleartext_ticket, 0, -$len_cleartext_last_block; - my $b_truncated_enc_ticket = $cbc->encrypt (hex2byte($truncated_cleartext_ticket), $b_ke, $b_iv); + my $b_truncated_enc_ticket = $cbc->encrypt (hex2byte ($truncated_cleartext_ticket), $b_ke, $b_iv); my $b_enc_ticket_n_1_block= substr $b_truncated_enc_ticket, -16; - my $b_enc_last_block = substr $b_enc_ticket_n_1_block, 0, $len_cleartext_last_block/2; + my $b_enc_last_block = substr $b_enc_ticket_n_1_block, 0, $len_cleartext_last_block / 2; # we now craft the new n-1 block my $tmp = $b_enc_ticket_n_1_block ^ $b_cleartext_last_block_padded; @@ -223,4 +223,4 @@ sub module_verify_hash return ($new_hash, $word); } -1; \ No newline at end of file +1; diff --git a/tools/test_modules/m19800.pm b/tools/test_modules/m19800.pm index 7dcc32566..7c1fe550c 100644 --- a/tools/test_modules/m19800.pm +++ b/tools/test_modules/m19800.pm @@ -60,9 +60,9 @@ sub module_generate_hash my $b_seed = $pbkdf2->PBKDF2 ($mysalt, $word); # we can precompute this - my $b_kerberos_nfolded = hex2byte('6b65726265726f737b9b5b2b93132b93'); + my $b_kerberos_nfolded = hex2byte ('6b65726265726f737b9b5b2b93132b93'); - my $b_iv = hex2byte('0' x 32); + my $b_iv = hex2byte ('0' x 32); # 'key_bytes' will be the AES key used to generate 'ki' (for final hmac-sha1) # and 'ke' (AES key to decrypt/encrypt the ticket) @@ -71,10 +71,10 @@ sub module_generate_hash # precomputed stuff # nfold 0x0000000155 to 16 bytes - my $b_nfolded1 = hex2byte('5b582c160a5aa80556ab55aad5402ab5'); + my $b_nfolded1 = hex2byte ('5b582c160a5aa80556ab55aad5402ab5'); # nfold 0x00000001aa to 16 bytes - my $b_nfolded2 = hex2byte('ae2c160b04ad5006ab55aad56a80355a'); + my $b_nfolded2 = hex2byte ('ae2c160b04ad5006ab55aad56a80355a'); my $b_ki = $cbc->encrypt ($b_nfolded1, $b_key_bytes, $b_iv); @@ -88,36 +88,36 @@ sub module_generate_hash { # Do CTS Decryption https://en.wikipedia.org/wiki/Ciphertext_stealing # Decrypt n-1 block - my $len_last_block = length($enc_timestamp) % 32; + my $len_last_block = length ($enc_timestamp) % 32; my $len_last_2_blocks = $len_last_block + 32; - my $b_n_1_block = hex2byte (substr($enc_timestamp, -$len_last_2_blocks, 32)); + my $b_n_1_block = hex2byte (substr ($enc_timestamp, -$len_last_2_blocks, 32)); my $b_n_1_decrypted = $cbc->decrypt ($b_n_1_block, $b_ke, $b_iv); # Pad the last block with last bytes from the decrypted n-1 - my $b_padded_enc_ticket = hex2byte($enc_timestamp).(substr $b_n_1_decrypted, -(16 - $len_last_block/2)); + my $b_padded_enc_ticket = hex2byte ($enc_timestamp) . (substr $b_n_1_decrypted, -(16 - $len_last_block / 2)); # Swap the last two blocks - my $b_cbc_enc_ticket = (substr $b_padded_enc_ticket, 0, -32).(substr $b_padded_enc_ticket, -16, 16). + my $b_cbc_enc_ticket = (substr $b_padded_enc_ticket, 0, -32) . (substr $b_padded_enc_ticket, -16, 16). (substr $b_padded_enc_ticket, -32, 16); # Decrypt and truncate my $b_dec_ticket_padded = $cbc->decrypt ($b_cbc_enc_ticket, $b_ke, $b_iv); - my $b_cleartext_ticket = substr $b_dec_ticket_padded, 0, length($enc_timestamp)/2; + my $b_cleartext_ticket = substr $b_dec_ticket_padded, 0, length ($enc_timestamp) / 2; - $cleartext_ticket = byte2hex($b_cleartext_ticket); + $cleartext_ticket = byte2hex ($b_cleartext_ticket); my $check_correct = ((substr ($b_cleartext_ticket, 22, 2) eq "20") && - (substr ($b_cleartext_ticket, 36, 1) eq "Z")); + (substr ($b_cleartext_ticket, 36, 1) eq "Z")); if ($check_correct == 1 && defined $checksum) { - my $b_checksum = hmac_sha1 (hex2byte($cleartext_ticket), $b_ki); + my $b_checksum = hmac_sha1 (hex2byte ($cleartext_ticket), $b_ki); - $check_correct = ($checksum eq byte2hex(substr $b_checksum, 0, 12)); + $check_correct = ($checksum eq byte2hex (substr $b_checksum, 0, 12)); } } @@ -129,27 +129,27 @@ sub module_generate_hash '32313131363134323835355aa10502030c28a2'; # we have what is required to compute checksum - $checksum = hmac_sha1 (hex2byte($cleartext_ticket), $b_ki); + $checksum = hmac_sha1 (hex2byte ($cleartext_ticket), $b_ki); - $checksum = byte2hex(substr $checksum, 0, 12); + $checksum = byte2hex (substr $checksum, 0, 12); } # CTS Encrypt our new block - my $len_cleartext_last_block = length($cleartext_ticket)%32; + my $len_cleartext_last_block = length ($cleartext_ticket) % 32; my $cleartext_last_block = substr $cleartext_ticket, -$len_cleartext_last_block; - my $padding = pad(length($cleartext_ticket), 32); + my $padding = pad (length ($cleartext_ticket), 32); - my $b_cleartext_last_block_padded = hex2byte($cleartext_last_block . '0' x $padding); + my $b_cleartext_last_block_padded = hex2byte ($cleartext_last_block . '0' x $padding); # we will encrypt until n-1 block (included) my $truncated_cleartext_ticket = substr $cleartext_ticket, 0, -$len_cleartext_last_block; - my $b_truncated_enc_ticket = $cbc->encrypt (hex2byte($truncated_cleartext_ticket), $b_ke, $b_iv); + my $b_truncated_enc_ticket = $cbc->encrypt (hex2byte ($truncated_cleartext_ticket), $b_ke, $b_iv); my $b_enc_ticket_n_1_block= substr $b_truncated_enc_ticket, -16; - my $b_enc_last_block = substr $b_enc_ticket_n_1_block, 0, $len_cleartext_last_block/2; + my $b_enc_last_block = substr $b_enc_ticket_n_1_block, 0, $len_cleartext_last_block / 2; # we now craft the new n-1 block my $tmp = $b_enc_ticket_n_1_block ^ $b_cleartext_last_block_padded; diff --git a/tools/test_modules/m19900.pm b/tools/test_modules/m19900.pm index b95dc9743..ce58a7c03 100644 --- a/tools/test_modules/m19900.pm +++ b/tools/test_modules/m19900.pm @@ -60,9 +60,9 @@ sub module_generate_hash my $b_seed = $pbkdf2->PBKDF2 ($mysalt, $word); # we can precompute this - my $b_kerberos_nfolded = hex2byte('6b65726265726f737b9b5b2b93132b93'); + my $b_kerberos_nfolded = hex2byte ('6b65726265726f737b9b5b2b93132b93'); - my $b_iv = hex2byte('0' x 32); + my $b_iv = hex2byte ('0' x 32); # 'key_bytes' will be the AES key used to generate 'ki' (for final hmac-sha1) # and 'ke' (AES key to decrypt/encrypt the ticket) @@ -73,10 +73,10 @@ sub module_generate_hash # precomputed stuff # nfold 0x0000000155 to 16 bytes - my $b_nfolded1 = hex2byte('5b582c160a5aa80556ab55aad5402ab5'); + my $b_nfolded1 = hex2byte ('5b582c160a5aa80556ab55aad5402ab5'); # nfold 0x00000001aa to 16 bytes - my $b_nfolded2 = hex2byte('ae2c160b04ad5006ab55aad56a80355a'); + my $b_nfolded2 = hex2byte ('ae2c160b04ad5006ab55aad56a80355a'); my $b_ki = $cbc->encrypt ($b_nfolded1, $b_key_bytes, $b_iv); @@ -93,36 +93,36 @@ sub module_generate_hash { # Do CTS Decryption https://en.wikipedia.org/wiki/Ciphertext_stealing # Decrypt n-1 block - my $len_last_block = length($enc_timestamp) % 32; + my $len_last_block = length ($enc_timestamp) % 32; my $len_last_2_blocks = $len_last_block + 32; - my $b_n_1_block = hex2byte (substr($enc_timestamp, -$len_last_2_blocks, 32)); + my $b_n_1_block = hex2byte (substr ($enc_timestamp, -$len_last_2_blocks, 32)); my $b_n_1_decrypted = $cbc->decrypt ($b_n_1_block, $b_ke, $b_iv); # Pad the last block with last bytes from the decrypted n-1 - my $b_padded_enc_ticket = hex2byte($enc_timestamp).(substr $b_n_1_decrypted, -(16 - $len_last_block/2)); + my $b_padded_enc_ticket = hex2byte ($enc_timestamp) . (substr $b_n_1_decrypted, -(16 - $len_last_block / 2)); # Swap the last two blocks - my $b_cbc_enc_ticket = (substr $b_padded_enc_ticket, 0, -32).(substr $b_padded_enc_ticket, -16, 16). + my $b_cbc_enc_ticket = (substr $b_padded_enc_ticket, 0, -32) . (substr $b_padded_enc_ticket, -16, 16). (substr $b_padded_enc_ticket, -32, 16); # Decrypt and truncate my $b_dec_ticket_padded = $cbc->decrypt ($b_cbc_enc_ticket, $b_ke, $b_iv); - my $b_cleartext_ticket = substr $b_dec_ticket_padded, 0, length($enc_timestamp)/2; + my $b_cleartext_ticket = substr $b_dec_ticket_padded, 0, length ($enc_timestamp) / 2; - $cleartext_ticket = byte2hex($b_cleartext_ticket); + $cleartext_ticket = byte2hex ($b_cleartext_ticket); my $check_correct = ((substr ($b_cleartext_ticket, 22, 2) eq "20") && - (substr ($b_cleartext_ticket, 36, 1) eq "Z")); + (substr ($b_cleartext_ticket, 36, 1) eq "Z")); if ($check_correct == 1 && defined $checksum) { - my $b_checksum = hmac_sha1 (hex2byte($cleartext_ticket), $b_ki); + my $b_checksum = hmac_sha1 (hex2byte ($cleartext_ticket), $b_ki); - $check_correct = ($checksum eq byte2hex(substr $b_checksum, 0, 12)); + $check_correct = ($checksum eq byte2hex (substr $b_checksum, 0, 12)); } } @@ -134,27 +134,27 @@ sub module_generate_hash '32313131363134323835355aa10502030c28a2'; # we have what is required to compute checksum - $checksum = hmac_sha1 (hex2byte($cleartext_ticket), $b_ki); + $checksum = hmac_sha1 (hex2byte ($cleartext_ticket), $b_ki); - $checksum = byte2hex(substr $checksum, 0, 12); + $checksum = byte2hex (substr $checksum, 0, 12); } # CTS Encrypt our new block - my $len_cleartext_last_block = length($cleartext_ticket)%32; + my $len_cleartext_last_block = length ($cleartext_ticket) % 32; my $cleartext_last_block = substr $cleartext_ticket, -$len_cleartext_last_block; - my $padding = pad(length($cleartext_ticket), 32); + my $padding = pad (length ($cleartext_ticket), 32); - my $b_cleartext_last_block_padded = hex2byte($cleartext_last_block . '0' x $padding); + my $b_cleartext_last_block_padded = hex2byte ($cleartext_last_block . '0' x $padding); # we will encrypt until n-1 block (included) my $truncated_cleartext_ticket = substr $cleartext_ticket, 0, -$len_cleartext_last_block; - my $b_truncated_enc_ticket = $cbc->encrypt (hex2byte($truncated_cleartext_ticket), $b_ke, $b_iv); + my $b_truncated_enc_ticket = $cbc->encrypt (hex2byte ($truncated_cleartext_ticket), $b_ke, $b_iv); my $b_enc_ticket_n_1_block= substr $b_truncated_enc_ticket, -16; - my $b_enc_last_block = substr $b_enc_ticket_n_1_block, 0, $len_cleartext_last_block/2; + my $b_enc_last_block = substr $b_enc_ticket_n_1_block, 0, $len_cleartext_last_block / 2; # we now craft the new n-1 block my $tmp = $b_enc_ticket_n_1_block ^ $b_cleartext_last_block_padded; diff --git a/tools/test_modules/m20200.pm b/tools/test_modules/m20200.pm index 823a5b279..baded5035 100644 --- a/tools/test_modules/m20200.pm +++ b/tools/test_modules/m20200.pm @@ -80,7 +80,7 @@ sub module_verify_hash $salt =~ s/\./\+/g; $salt .= '=='; - my $new_hash = module_generate_hash ($word, decode_base64($salt), $iter); + my $new_hash = module_generate_hash ($word, decode_base64 ($salt), $iter); return ($new_hash, $word); } diff --git a/tools/test_modules/m20300.pm b/tools/test_modules/m20300.pm index c9c515d60..f2482334e 100644 --- a/tools/test_modules/m20300.pm +++ b/tools/test_modules/m20300.pm @@ -80,7 +80,7 @@ sub module_verify_hash $salt =~ s/\./\+/g; $salt .= '=='; - my $new_hash = module_generate_hash ($word, decode_base64($salt), $iter); + my $new_hash = module_generate_hash ($word, decode_base64 ($salt), $iter); return ($new_hash, $word); } diff --git a/tools/test_modules/m20400.pm b/tools/test_modules/m20400.pm index 07a5feca3..3502cbcf9 100644 --- a/tools/test_modules/m20400.pm +++ b/tools/test_modules/m20400.pm @@ -80,7 +80,7 @@ sub module_verify_hash $salt =~ s/\./\+/g; $salt .= '=='; - my $new_hash = module_generate_hash ($word, decode_base64($salt), $iter); + my $new_hash = module_generate_hash ($word, decode_base64 ($salt), $iter); return ($new_hash, $word); } diff --git a/tools/test_modules/m20600.pm b/tools/test_modules/m20600.pm index a1b9de32d..e593b5e07 100644 --- a/tools/test_modules/m20600.pm +++ b/tools/test_modules/m20600.pm @@ -22,13 +22,14 @@ sub module_generate_hash $iter //= 1000; - my $digest = sha256($salt.$word); + my $digest = sha256 ($salt . $word); - for (my $i = 1; $i < $iter; $i++) { - $digest = sha256($digest); + for (my $i = 1; $i < $iter; $i++) + { + $digest = sha256 ($digest); } - chomp($digest = encode_base64($digest)); + chomp ($digest = encode_base64 ($digest)); my $hash = sprintf ("otm_sha256:%d:%s:%s", $iter, $salt, $digest); diff --git a/tools/test_rules.pl b/tools/test_rules.pl index 5a7dcc7f9..2b8ef36e2 100755 --- a/tools/test_rules.pl +++ b/tools/test_rules.pl @@ -9,7 +9,7 @@ use strict; use warnings; use Digest::MD5 qw (md5_hex); use File::Basename qw (dirname); -use YAML::XS "LoadFile"; +use YAML::XS qw (LoadFile); use Test::More; # Use `eq_or_diff` from Test::Differences if it's available for an easier to read comparison @@ -87,7 +87,7 @@ sub run_case_mode1 my $case = $cases{$rule}; - die("Expected output for mode 1 (expected_cpu) isn't defined for rule: $rule") unless defined $case->{expected_cpu}; + die ("Expected output for mode 1 (expected_cpu) isn't defined for rule: $rule") unless defined $case->{expected_cpu}; my $input_file = input_to_file ($case, $rule); @@ -105,7 +105,7 @@ sub run_case_mode2 my $case = $cases{$rule}; - die("Expected output for mode 2 (expected_opencl) isn't defined for rule: $rule") unless defined $case->{expected_opencl}; + die ("Expected output for mode 2 (expected_opencl) isn't defined for rule: $rule") unless defined $case->{expected_opencl}; my $input_file = input_to_file ($case, $rule); my $rule_file = rule_to_file ($rule); @@ -177,7 +177,7 @@ sub usage_die sub load_cases { my $file_path = $CURRENT_DIR . "/" . "rules-test-cases.yaml"; - return %{ LoadFile($file_path) }; + return %{ LoadFile ($file_path) }; } sub cleanup