From e2da5c8d57427b230316b299897f7c33f63f90f3 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Sun, 12 May 2019 12:38:23 +0200 Subject: [PATCH] Some unrolling for SHA2 based algorithms --- OpenCL/inc_hash_sha224.cl | 6 ------ OpenCL/inc_hash_sha256.cl | 6 ------ OpenCL/inc_hash_sha384.cl | 7 ------- OpenCL/inc_hash_sha512.cl | 7 ------- OpenCL/m15000_a0-optimized.cl | 7 ------- OpenCL/m15000_a1-optimized.cl | 7 ------- OpenCL/m15000_a3-optimized.cl | 7 ------- 7 files changed, 47 deletions(-) diff --git a/OpenCL/inc_hash_sha224.cl b/OpenCL/inc_hash_sha224.cl index e3f5b4d1c..e93206e44 100644 --- a/OpenCL/inc_hash_sha224.cl +++ b/OpenCL/inc_hash_sha224.cl @@ -104,11 +104,6 @@ DECLSPEC void sha224_transform (const u32 *w0, const u32 *w1, const u32 *w2, con ROUND_STEP_S (0); - #ifdef IS_CUDA - ROUND_EXPAND_S (); ROUND_STEP_S (16); - ROUND_EXPAND_S (); ROUND_STEP_S (32); - ROUND_EXPAND_S (); ROUND_STEP_S (48); - #else #ifdef _unroll #pragma unroll #endif @@ -116,7 +111,6 @@ DECLSPEC void sha224_transform (const u32 *w0, const u32 *w1, const u32 *w2, con { ROUND_EXPAND_S (); ROUND_STEP_S (i); } - #endif #undef ROUND_EXPAND_S #undef ROUND_STEP_S diff --git a/OpenCL/inc_hash_sha256.cl b/OpenCL/inc_hash_sha256.cl index d6d0a69b0..de2bd5897 100644 --- a/OpenCL/inc_hash_sha256.cl +++ b/OpenCL/inc_hash_sha256.cl @@ -104,11 +104,6 @@ DECLSPEC void sha256_transform (const u32 *w0, const u32 *w1, const u32 *w2, con ROUND_STEP_S (0); - #ifdef IS_CUDA - ROUND_EXPAND_S (); ROUND_STEP_S (16); - ROUND_EXPAND_S (); ROUND_STEP_S (32); - ROUND_EXPAND_S (); ROUND_STEP_S (48); - #else #ifdef _unroll #pragma unroll #endif @@ -116,7 +111,6 @@ DECLSPEC void sha256_transform (const u32 *w0, const u32 *w1, const u32 *w2, con { ROUND_EXPAND_S (); ROUND_STEP_S (i); } - #endif #undef ROUND_EXPAND_S #undef ROUND_STEP_S diff --git a/OpenCL/inc_hash_sha384.cl b/OpenCL/inc_hash_sha384.cl index 61e2f5d3a..ea26ec734 100644 --- a/OpenCL/inc_hash_sha384.cl +++ b/OpenCL/inc_hash_sha384.cl @@ -108,12 +108,6 @@ DECLSPEC void sha384_transform (const u32 *w0, const u32 *w1, const u32 *w2, con ROUND_STEP_S (0); - #ifdef IS_CUDA - ROUND_EXPAND_S (); ROUND_STEP_S (16); - ROUND_EXPAND_S (); ROUND_STEP_S (32); - ROUND_EXPAND_S (); ROUND_STEP_S (48); - ROUND_EXPAND_S (); ROUND_STEP_S (64); - #else #ifdef _unroll #pragma unroll #endif @@ -121,7 +115,6 @@ DECLSPEC void sha384_transform (const u32 *w0, const u32 *w1, const u32 *w2, con { ROUND_EXPAND_S (); ROUND_STEP_S (i); } - #endif #undef ROUND_EXPAND_S #undef ROUND_STEP_S diff --git a/OpenCL/inc_hash_sha512.cl b/OpenCL/inc_hash_sha512.cl index 6dc91f368..783a66fbe 100644 --- a/OpenCL/inc_hash_sha512.cl +++ b/OpenCL/inc_hash_sha512.cl @@ -108,12 +108,6 @@ DECLSPEC void sha512_transform (const u32 *w0, const u32 *w1, const u32 *w2, con ROUND_STEP_S (0); - #ifdef IS_CUDA - ROUND_EXPAND_S (); ROUND_STEP_S (16); - ROUND_EXPAND_S (); ROUND_STEP_S (32); - ROUND_EXPAND_S (); ROUND_STEP_S (48); - ROUND_EXPAND_S (); ROUND_STEP_S (64); - #else #ifdef _unroll #pragma unroll #endif @@ -121,7 +115,6 @@ DECLSPEC void sha512_transform (const u32 *w0, const u32 *w1, const u32 *w2, con { ROUND_EXPAND_S (); ROUND_STEP_S (i); } - #endif #undef ROUND_EXPAND_S #undef ROUND_STEP_S diff --git a/OpenCL/m15000_a0-optimized.cl b/OpenCL/m15000_a0-optimized.cl index 7b73564a3..a4fe67e48 100644 --- a/OpenCL/m15000_a0-optimized.cl +++ b/OpenCL/m15000_a0-optimized.cl @@ -86,12 +86,6 @@ DECLSPEC void sha512_transform_intern (const u32x *w0, const u32x *w1, const u32 ROUND_STEP (0); - #ifdef IS_CUDA - ROUND_EXPAND (); ROUND_STEP (16); - ROUND_EXPAND (); ROUND_STEP (32); - ROUND_EXPAND (); ROUND_STEP (48); - ROUND_EXPAND (); ROUND_STEP (64); - #else #ifdef _unroll #pragma unroll #endif @@ -99,7 +93,6 @@ DECLSPEC void sha512_transform_intern (const u32x *w0, const u32x *w1, const u32 { ROUND_EXPAND (); ROUND_STEP (i); } - #endif /* rev digest[0] += a; diff --git a/OpenCL/m15000_a1-optimized.cl b/OpenCL/m15000_a1-optimized.cl index 1bcd7a983..e410b3102 100644 --- a/OpenCL/m15000_a1-optimized.cl +++ b/OpenCL/m15000_a1-optimized.cl @@ -84,12 +84,6 @@ DECLSPEC void sha512_transform_intern (const u32x *w0, const u32x *w1, const u32 ROUND_STEP (0); - #ifdef IS_CUDA - ROUND_EXPAND (); ROUND_STEP (16); - ROUND_EXPAND (); ROUND_STEP (32); - ROUND_EXPAND (); ROUND_STEP (48); - ROUND_EXPAND (); ROUND_STEP (64); - #else #ifdef _unroll #pragma unroll #endif @@ -97,7 +91,6 @@ DECLSPEC void sha512_transform_intern (const u32x *w0, const u32x *w1, const u32 { ROUND_EXPAND (); ROUND_STEP (i); } - #endif /* rev digest[0] += a; diff --git a/OpenCL/m15000_a3-optimized.cl b/OpenCL/m15000_a3-optimized.cl index cf1ff1432..5ff6d7bfb 100644 --- a/OpenCL/m15000_a3-optimized.cl +++ b/OpenCL/m15000_a3-optimized.cl @@ -84,12 +84,6 @@ DECLSPEC void sha512_transform_intern (const u32x *w0, const u32x *w1, const u32 ROUND_STEP (0); - #ifdef IS_CUDA - ROUND_EXPAND (); ROUND_STEP (16); - ROUND_EXPAND (); ROUND_STEP (32); - ROUND_EXPAND (); ROUND_STEP (48); - ROUND_EXPAND (); ROUND_STEP (64); - #else #ifdef _unroll #pragma unroll #endif @@ -97,7 +91,6 @@ DECLSPEC void sha512_transform_intern (const u32x *w0, const u32x *w1, const u32 { ROUND_EXPAND (); ROUND_STEP (i); } - #endif /* rev digest[0] += a;