Skip to content

Commit

Permalink
OpenCL GOST/Streebog: Request not to inline update/final functions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
magnumripper committed Dec 22, 2024
1 parent e6eb5f8 commit 7c5aad8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions run/opencl/opencl_gost94.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions run/opencl/opencl_streebog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7c5aad8

Please sign in to comment.