From 8ebf4b98584213891f6e48570c91c31d22b80a81 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Sun, 13 Jun 2021 15:49:11 +0200 Subject: [PATCH] Fixed 'E' rule in pure kernel mode which was ignoring letters that are in positions that are multiples of 4 --- OpenCL/inc_rp.cl | 24 +++++++++++------------- docs/changes.txt | 7 +++++++ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/OpenCL/inc_rp.cl b/OpenCL/inc_rp.cl index 9a50e1802..8cecc661d 100644 --- a/OpenCL/inc_rp.cl +++ b/OpenCL/inc_rp.cl @@ -688,7 +688,9 @@ DECLSPEC int mangle_dupeblock_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const DECLSPEC int mangle_title_sep (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len) { - if ((len + 4) >= RP_PASSWORD_SIZE) return (len); // cheap way to not need to check for overflow of i + 1 + if (len >= RP_PASSWORD_SIZE) return (len); + + u32 rem = 0xff; for (int i = 0, idx = 0; i < len; i += 4, idx += 1) { @@ -696,22 +698,18 @@ DECLSPEC int mangle_title_sep (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p buf[idx] = t | generate_cmask (t); - u32 out0 = 0; - u32 out1 = 0; + u32 out = rem; - 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; + rem = 0; - buf[idx + 0] &= ~(generate_cmask (buf[idx + 0]) & out0); - buf[idx + 1] &= ~(generate_cmask (buf[idx + 1]) & out1); + if (((t >> 0) & 0xff) == p0) out |= 0x0000ff00; + if (((t >> 8) & 0xff) == p0) out |= 0x00ff0000; + if (((t >> 16) & 0xff) == p0) out |= 0xff000000; + if (((t >> 24) & 0xff) == p0) rem |= 0x000000ff; + + buf[idx] &= ~(generate_cmask (buf[idx]) & out); } - const u32 t = buf[0]; - - buf[0] = t & ~(0x00000020 & generate_cmask (t)); - return (len); } diff --git a/docs/changes.txt b/docs/changes.txt index fa3d12ab9..ae3649c8c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -1,5 +1,12 @@ * changes v6.2.2 -> v6.2.x +## +## Bugs +## + +- Fixed 'E' rule in pure kernel mode which was ignoring letters that are in positions that are multiples of 4 + + * changes v6.2.1 -> v6.2.2 ##