Commit 244e582e authored by Ondrej Mosnáček's avatar Ondrej Mosnáček

Avoid computing a remainder also in OpenCL kernel

parent fba852c4
......@@ -344,7 +344,9 @@ __kernel void argon2_kernel_segment(
if (pass != 0 && slice != ARGON2_SYNC_POINTS - 1) {
ref_index += (slice + 1) * segment_blocks;
ref_index %= lane_blocks;
if (ref_index >= lane_blocks) {
ref_index -= lane_blocks;
}
}
__global struct block_g *mem_ref = memory +
......@@ -497,7 +499,9 @@ __kernel void argon2_kernel_oneshot(
if (pass != 0 && slice != ARGON2_SYNC_POINTS - 1) {
ref_index += (slice + 1) * segment_blocks;
ref_index %= lane_blocks;
if (ref_index >= lane_blocks) {
ref_index -= lane_blocks;
}
}
__global struct block_g *mem_ref = memory +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment