Skip to content

Commit cc59c0f

Browse files
committed
GOST OpenCL stuff: Fix type problems and NOINLINE definitions
1 parent 5ecbb1b commit cc59c0f

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

run/opencl/opencl_gost94.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ INLINE void rhash_gost94_compute_sum_and_hash(gost94_ctx * ctx, const uint* bloc
300300
* @param msg message chunk
301301
* @param size length of the message chunk
302302
*/
303-
NOINLINE void gost94_update(gost94_ctx *ctx, const uchar* msg, uint size, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
303+
static NOINLINE void gost94_update(gost94_ctx *ctx, const uchar* msg, uint size, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
304304
{
305305
uint index = ctx->length & 31;
306306
ctx->length += size;
@@ -361,7 +361,7 @@ INLINE void rhash_u32_swap_copy(void* to, const void* from, uint length) {
361361
* @param ctx the algorithm context containing current hashing state
362362
* @param result calculated hash in binary form
363363
*/
364-
NOINLINE void gost94_final(gost94_ctx *ctx, uchar *result, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
364+
static NOINLINE void gost94_final(gost94_ctx *ctx, uchar *result, MAYBE_LOCAL const rhash_gost94_sbox *sbox)
365365
{
366366
uint index = ctx->length & 31;
367367
uint* msg32 = (uint*)ctx->message;

run/opencl/opencl_streebog.h

+12-7
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
#define UNROLL16
4949
#endif
5050

51+
#if STREEBOG512CRYPT && !defined STREEBOG512
52+
#define STREEBOG512 1
53+
#endif
54+
5155
#if STREEBOG_VECTOR
5256
#define memcpy512(dst, src) do { \
5357
(dst)->VWORD = (src)->VWORD; \
@@ -906,7 +910,7 @@ stage3(GOST34112012Context *CTX, __local localbuf *loc_buf)
906910
g0(&(CTX->h), &(CTX->Sigma), loc_buf);
907911
}
908912

909-
NOINLINE void
913+
static NOINLINE void
910914
GOST34112012Update(GOST34112012Context *CTX, const uchar *data, uint len, __local localbuf *loc_buf)
911915
{
912916
if (CTX->bufsize) {
@@ -937,15 +941,16 @@ GOST34112012Update(GOST34112012Context *CTX, const uchar *data, uint len, __loca
937941
}
938942
}
939943

940-
NOINLINE void
944+
static NOINLINE void
941945
GOST34112012Final(GOST34112012Context *CTX,
942-
#if STREEBOG512CRYPT
943-
uint512_u
946+
void *_digest,
947+
__local localbuf *loc_buf)
948+
{
949+
#if STREEBOG512
950+
uint512_u *digest = _digest;
944951
#else
945-
uint256_u
952+
uint256_u *digest = _digest;
946953
#endif
947-
*digest, __local localbuf *loc_buf)
948-
{
949954
stage3(CTX, loc_buf);
950955

951956
CTX->bufsize = 0;

0 commit comments

Comments
 (0)