From 7c5aad84c5b3424a150d964d9a156dc89615f601 Mon Sep 17 00:00:00 2001 From: magnum Date: Sun, 22 Dec 2024 16:13:04 +0000 Subject: [PATCH] OpenCL GOST/Streebog: Request not to inline update/final functions For the corresponding crypt formats, build times went from minutes (worst case) to a few seconds while speeds were unaffected and gost94crypt-opencl stopped failing self-test on super's AMD Vega. --- run/opencl/opencl_gost94.h | 4 ++-- run/opencl/opencl_streebog.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/run/opencl/opencl_gost94.h b/run/opencl/opencl_gost94.h index 4fea5b2e88..3965d72f4f 100644 --- a/run/opencl/opencl_gost94.h +++ b/run/opencl/opencl_gost94.h @@ -300,7 +300,7 @@ inline void rhash_gost94_compute_sum_and_hash(gost94_ctx * ctx, const uint* bloc * @param msg message chunk * @param size length of the message chunk */ -inline void gost94_update(gost94_ctx *ctx, const uchar* msg, uint size, MAYBE_LOCAL const rhash_gost94_sbox *sbox) +__attribute__((noinline)) void gost94_update(gost94_ctx *ctx, const uchar* msg, uint size, MAYBE_LOCAL const rhash_gost94_sbox *sbox) { uint index = ctx->length & 31; ctx->length += size; @@ -361,7 +361,7 @@ inline void rhash_u32_swap_copy(void* to, const void* from, uint length) { * @param ctx the algorithm context containing current hashing state * @param result calculated hash in binary form */ -inline void gost94_final(gost94_ctx *ctx, uchar *result, MAYBE_LOCAL const rhash_gost94_sbox *sbox) +__attribute__((noinline)) void gost94_final(gost94_ctx *ctx, uchar *result, MAYBE_LOCAL const rhash_gost94_sbox *sbox) { uint index = ctx->length & 31; uint* msg32 = (uint*)ctx->message; diff --git a/run/opencl/opencl_streebog.h b/run/opencl/opencl_streebog.h index 65f41a1781..508d293e8e 100644 --- a/run/opencl/opencl_streebog.h +++ b/run/opencl/opencl_streebog.h @@ -906,7 +906,7 @@ stage3(GOST34112012Context *CTX, __local localbuf *loc_buf) g0(&(CTX->h), &(CTX->Sigma), loc_buf); } -inline void +__attribute__((noinline)) void GOST34112012Update(GOST34112012Context *CTX, const uchar *data, uint len, __local localbuf *loc_buf) { if (CTX->bufsize) { @@ -937,7 +937,7 @@ GOST34112012Update(GOST34112012Context *CTX, const uchar *data, uint len, __loca } } -inline void +__attribute__((noinline)) void GOST34112012Final(GOST34112012Context *CTX, #if STREEBOG512CRYPT uint512_u