Skip to content

Commit

Permalink
GOST OpenCL stuff: Fix type problems and NOINLINE definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
magnumripper committed Feb 8, 2025
1 parent 5ecbb1b commit cc59c0f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 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
*/
NOINLINE void gost94_update(gost94_ctx *ctx, const uchar* msg, uint size, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
static 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
*/
NOINLINE void gost94_final(gost94_ctx *ctx, uchar *result, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
static 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
19 changes: 12 additions & 7 deletions run/opencl/opencl_streebog.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
#define UNROLL16
#endif

#if STREEBOG512CRYPT && !defined STREEBOG512
#define STREEBOG512 1
#endif

#if STREEBOG_VECTOR
#define memcpy512(dst, src) do { \
(dst)->VWORD = (src)->VWORD; \
Expand Down Expand Up @@ -906,7 +910,7 @@ stage3(GOST34112012Context *CTX, __local localbuf *loc_buf)
g0(&(CTX->h), &(CTX->Sigma), loc_buf);
}

NOINLINE void
static NOINLINE void
GOST34112012Update(GOST34112012Context *CTX, const uchar *data, uint len, __local localbuf *loc_buf)
{
if (CTX->bufsize) {
Expand Down Expand Up @@ -937,15 +941,16 @@ GOST34112012Update(GOST34112012Context *CTX, const uchar *data, uint len, __loca
}
}

NOINLINE void
static NOINLINE void
GOST34112012Final(GOST34112012Context *CTX,
#if STREEBOG512CRYPT
uint512_u
void *_digest,
__local localbuf *loc_buf)
{
#if STREEBOG512
uint512_u *digest = _digest;
#else
uint256_u
uint256_u *digest = _digest;
#endif
*digest, __local localbuf *loc_buf)
{
stage3(CTX, loc_buf);

CTX->bufsize = 0;
Expand Down

0 comments on commit cc59c0f

Please sign in to comment.