diff --git a/OpenCL/inc_hash_sha384.cl b/OpenCL/inc_hash_sha384.cl index c145210d5..d63a5ab2b 100644 --- a/OpenCL/inc_hash_sha384.cl +++ b/OpenCL/inc_hash_sha384.cl @@ -219,7 +219,7 @@ DECLSPEC void sha384_update_128 (sha384_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u if (len == 128) { - sha384_transform_vector (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, ctx->h); + sha384_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, ctx->h); ctx->w0[0] = 0; ctx->w0[1] = 0; @@ -2089,7 +2089,7 @@ DECLSPEC void sha384_update_vector_128 (sha384_ctx_vector_t *ctx, u32x *w0, u32x if (len == 128) { - sha384_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, ctx->h); + sha384_transform_vector (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, ctx->h); ctx->w0[0] = 0; ctx->w0[1] = 0; diff --git a/OpenCL/m15400_a0-optimized.cl b/OpenCL/m15400_a0-optimized.cl index 294e086e0..c87d53ba2 100644 --- a/OpenCL/m15400_a0-optimized.cl +++ b/OpenCL/m15400_a0-optimized.cl @@ -128,9 +128,39 @@ DECLSPEC void chacha20_transform (const u32x *w0, const u32x *w1, const u32 *pos * Generate a second 64 byte keystream */ - ctx[12]++; - - if (all(ctx[12] == 0)) ctx[13]++; + ctx[12] += 1; + + #if VECT_SIZE == 1 + if (ctx[12] == 0) ctx[13] += 1; + #endif + + #if VECT_SIZE >= 2 + if (ctx[12].s0 == 0) ctx[13].s0 += 1; + if (ctx[12].s1 == 0) ctx[13].s1 += 1; + #endif + + #if VECT_SIZE >= 4 + if (ctx[12].s2 == 0) ctx[13].s2 += 1; + if (ctx[12].s3 == 0) ctx[13].s3 += 1; + #endif + + #if VECT_SIZE >= 8 + if (ctx[12].s4 == 0) ctx[13].s4 += 1; + if (ctx[12].s5 == 0) ctx[13].s5 += 1; + if (ctx[12].s6 == 0) ctx[13].s6 += 1; + if (ctx[12].s7 == 0) ctx[13].s7 += 1; + #endif + + #if VECT_SIZE >= 16 + if (ctx[12].s8 == 0) ctx[13].s8 += 1; + if (ctx[12].s9 == 0) ctx[13].s9 += 1; + if (ctx[12].sa == 0) ctx[13].sa += 1; + if (ctx[12].sb == 0) ctx[13].sb += 1; + if (ctx[12].sc == 0) ctx[13].sc += 1; + if (ctx[12].sd == 0) ctx[13].sd += 1; + if (ctx[12].se == 0) ctx[13].se += 1; + if (ctx[12].sf == 0) ctx[13].sf += 1; + #endif x[16] = ctx[ 0]; x[17] = ctx[ 1]; diff --git a/OpenCL/m15400_a1-optimized.cl b/OpenCL/m15400_a1-optimized.cl index 94de59707..7b1ab79c9 100644 --- a/OpenCL/m15400_a1-optimized.cl +++ b/OpenCL/m15400_a1-optimized.cl @@ -126,9 +126,39 @@ DECLSPEC void chacha20_transform (const u32x *w0, const u32x *w1, const u32 *pos * Generate a second 64 byte keystream */ - ctx[12]++; - - if (all(ctx[12] == 0)) ctx[13]++; + ctx[12] += 1; + + #if VECT_SIZE == 1 + if (ctx[12] == 0) ctx[13] += 1; + #endif + + #if VECT_SIZE >= 2 + if (ctx[12].s0 == 0) ctx[13].s0 += 1; + if (ctx[12].s1 == 0) ctx[13].s1 += 1; + #endif + + #if VECT_SIZE >= 4 + if (ctx[12].s2 == 0) ctx[13].s2 += 1; + if (ctx[12].s3 == 0) ctx[13].s3 += 1; + #endif + + #if VECT_SIZE >= 8 + if (ctx[12].s4 == 0) ctx[13].s4 += 1; + if (ctx[12].s5 == 0) ctx[13].s5 += 1; + if (ctx[12].s6 == 0) ctx[13].s6 += 1; + if (ctx[12].s7 == 0) ctx[13].s7 += 1; + #endif + + #if VECT_SIZE >= 16 + if (ctx[12].s8 == 0) ctx[13].s8 += 1; + if (ctx[12].s9 == 0) ctx[13].s9 += 1; + if (ctx[12].sa == 0) ctx[13].sa += 1; + if (ctx[12].sb == 0) ctx[13].sb += 1; + if (ctx[12].sc == 0) ctx[13].sc += 1; + if (ctx[12].sd == 0) ctx[13].sd += 1; + if (ctx[12].se == 0) ctx[13].se += 1; + if (ctx[12].sf == 0) ctx[13].sf += 1; + #endif x[16] = ctx[ 0]; x[17] = ctx[ 1]; diff --git a/OpenCL/m15400_a3-optimized.cl b/OpenCL/m15400_a3-optimized.cl index 7f0782b71..5923316f1 100644 --- a/OpenCL/m15400_a3-optimized.cl +++ b/OpenCL/m15400_a3-optimized.cl @@ -126,9 +126,39 @@ DECLSPEC void chacha20_transform (const u32x *w0, const u32x *w1, const u32 *pos * Generate a second 64 byte keystream */ - ctx[12]++; - - if (all(ctx[12] == 0)) ctx[13]++; + ctx[12] += 1; + + #if VECT_SIZE == 1 + if (ctx[12] == 0) ctx[13] += 1; + #endif + + #if VECT_SIZE >= 2 + if (ctx[12].s0 == 0) ctx[13].s0 += 1; + if (ctx[12].s1 == 0) ctx[13].s1 += 1; + #endif + + #if VECT_SIZE >= 4 + if (ctx[12].s2 == 0) ctx[13].s2 += 1; + if (ctx[12].s3 == 0) ctx[13].s3 += 1; + #endif + + #if VECT_SIZE >= 8 + if (ctx[12].s4 == 0) ctx[13].s4 += 1; + if (ctx[12].s5 == 0) ctx[13].s5 += 1; + if (ctx[12].s6 == 0) ctx[13].s6 += 1; + if (ctx[12].s7 == 0) ctx[13].s7 += 1; + #endif + + #if VECT_SIZE >= 16 + if (ctx[12].s8 == 0) ctx[13].s8 += 1; + if (ctx[12].s9 == 0) ctx[13].s9 += 1; + if (ctx[12].sa == 0) ctx[13].sa += 1; + if (ctx[12].sb == 0) ctx[13].sb += 1; + if (ctx[12].sc == 0) ctx[13].sc += 1; + if (ctx[12].sd == 0) ctx[13].sd += 1; + if (ctx[12].se == 0) ctx[13].se += 1; + if (ctx[12].sf == 0) ctx[13].sf += 1; + #endif x[16] = ctx[ 0]; x[17] = ctx[ 1]; diff --git a/OpenCL/m18700_a1-optimized.cl b/OpenCL/m18700_a1-optimized.cl index 18ea7ffbd..584cdcd54 100644 --- a/OpenCL/m18700_a1-optimized.cl +++ b/OpenCL/m18700_a1-optimized.cl @@ -15,7 +15,7 @@ #include "inc_hash_md5.cl" #endif -DECLSPEC u32 hashCode_g (const u32 init, GLOBAL_AS u32 *w, const u32 pw_len) +DECLSPEC u32 hashCode_g (const u32 init, GLOBAL_AS const u32 *w, const u32 pw_len) { u32 hash = init;