Skip to content

Commit fb3aeec

Browse files
claudioandre-brsolardiz
authored andcommitted
OpenCL: properly initiate a mask buffer
The buffer must be initialized with zeros since it is used to calculate the position where the character will be placed in the mask expansion. SHA256 and SHA512 (crude).
1 parent 77aab40 commit fb3aeec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/opencl_rawsha256_fmt_plug.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ static void create_clobj(size_t gws, struct fmt_main *self)
261261
//Assure buffers have no "trash data".
262262
memset(plaintext, '\0', BUFFER_SIZE * gws);
263263
memset(saved_idx, '\0', sizeof(uint32_t) * gws);
264-
memset(saved_int_key_loc, 0x80, sizeof(uint32_t) * mask_gws);
264+
memset(saved_int_key_loc, '\0', sizeof(uint32_t) * mask_gws);
265265
}
266266

267267
static void release_clobj()

src/opencl_rawsha512_gpl_fmt_plug.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static void create_clobj(size_t gws, struct fmt_main *self)
293293
//Assure buffers have no "trash data".
294294
memset(plaintext, '\0', BUFFER_SIZE * gws);
295295
memset(saved_idx, '\0', sizeof(uint32_t) * gws);
296-
memset(saved_int_key_loc, 0x80, sizeof(uint32_t) * mask_gws);
296+
memset(saved_int_key_loc, '\0', sizeof(uint32_t) * mask_gws);
297297
}
298298

299299
static void release_clobj()

0 commit comments

Comments
 (0)