diff --git a/OpenCL/inc_rp.cl b/OpenCL/inc_rp.cl index 98a6174b3..ffa84f4ab 100644 --- a/OpenCL/inc_rp.cl +++ b/OpenCL/inc_rp.cl @@ -680,24 +680,28 @@ DECLSPEC int mangle_title_sep (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p { if ((len + 4) >= RP_PASSWORD_SIZE) return (len); // cheap way to not need to check for overflow of i + 1 - mangle_lrest_ufirst (0, 0, buf, len); - for (int i = 0, idx = 0; i < len; i += 4, idx += 1) { - const u32 v = buf[idx]; + const u32 t = buf[idx]; + + buf[idx] = t | generate_cmask (t); u32 out0 = 0; u32 out1 = 0; - if (((v >> 0) & 0xff) == p0) out0 |= 0x0000ff00; - if (((v >> 8) & 0xff) == p0) out0 |= 0x00ff0000; - if (((v >> 16) & 0xff) == p0) out0 |= 0xff000000; - if (((v >> 24) & 0xff) == p0) out1 |= 0x000000ff; + if (((t >> 0) & 0xff) == p0) out0 |= 0x0000ff00; + if (((t >> 8) & 0xff) == p0) out0 |= 0x00ff0000; + if (((t >> 16) & 0xff) == p0) out0 |= 0xff000000; + if (((t >> 24) & 0xff) == p0) out1 |= 0x000000ff; buf[idx + 0] &= ~(generate_cmask (buf[idx + 0]) & out0); buf[idx + 1] &= ~(generate_cmask (buf[idx + 1]) & out1); } + const u32 t = buf[0]; + + buf[0] = t & ~(0x00000020 & generate_cmask (t)); + return (len); } diff --git a/src/rp_cpu.c b/src/rp_cpu.c index 9e6cfbf53..7f3624a33 100644 --- a/src/rp_cpu.c +++ b/src/rp_cpu.c @@ -470,6 +470,8 @@ static int mangle_title_sep (char arr[RP_PASSWORD_SIZE], int arr_len, char c) } } + MANGLE_UPPER_AT (arr, 0); + return (arr_len); }