diff --git a/OpenCL/inc_common.cl b/OpenCL/inc_common.cl index 1ca20c9d7..0de9924ef 100644 --- a/OpenCL/inc_common.cl +++ b/OpenCL/inc_common.cl @@ -2806,6 +2806,24 @@ DECLSPEC int is_valid_base58_32 (const u32 v) return 1; } +DECLSPEC int is_valid_printable_8 (const u8 v) +{ + if (v > (u8) 0x7e) return 0; + if (v < (u8) 0x20) return 0; + + return 1; +} + +DECLSPEC int is_valid_printable_32 (const u32 v) +{ + if (is_valid_printable_8 ((u8) (v >> 0)) == 0) return 0; + if (is_valid_printable_8 ((u8) (v >> 8)) == 0) return 0; + if (is_valid_printable_8 ((u8) (v >> 16)) == 0) return 0; + if (is_valid_printable_8 ((u8) (v >> 24)) == 0) return 0; + + return 1; +} + DECLSPEC int hc_find_keyboard_layout_map (const u32 search, const int search_len, LOCAL_AS keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt) { for (int idx = 0; idx < keyboard_layout_mapping_cnt; idx++) diff --git a/OpenCL/inc_common.h b/OpenCL/inc_common.h index 6572c1b9e..fd6cfb348 100644 --- a/OpenCL/inc_common.h +++ b/OpenCL/inc_common.h @@ -311,6 +311,8 @@ DECLSPEC int is_valid_hex_8 (const u8 v); DECLSPEC int is_valid_hex_32 (const u32 v); DECLSPEC int is_valid_base58_8 (const u8 v); DECLSPEC int is_valid_base58_32 (const u32 v); +DECLSPEC int is_valid_printable_8 (const u8 v); +DECLSPEC int is_valid_printable_32 (const u32 v); DECLSPEC int hc_find_keyboard_layout_map (const u32 search, const int search_len, LOCAL_AS keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt); DECLSPEC int hc_execute_keyboard_layout_mapping (PRIVATE_AS u32 *w, const int pw_len, LOCAL_AS keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt); DECLSPEC void make_utf16be (PRIVATE_AS const u32x *in, PRIVATE_AS u32x *out1, PRIVATE_AS u32x *out2); diff --git a/OpenCL/m25500-pure.cl b/OpenCL/m25500-pure.cl index c5be7fef7..65395aff1 100644 --- a/OpenCL/m25500-pure.cl +++ b/OpenCL/m25500-pure.cl @@ -334,12 +334,12 @@ KERNEL_FQ void m25500_comp (KERN_ATTR_TMPS_ESALT (pbkdf2_sha256_tmp_t, pbkdf2_sh // iv - const u32 iv[4] = { - esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[0], - esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[1], - esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[2], - esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[3] - }; + const u32 iv[4]; + + iv[0] = esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[0]; + iv[1] = esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[1]; + iv[2] = esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[2]; + iv[3] = esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[3]; const u32 iv_len = esalt_bufs[DIGESTS_OFFSET_HOST].iv_len; diff --git a/OpenCL/m26600-pure.cl b/OpenCL/m26600-pure.cl index 906edc9bf..758f80074 100644 --- a/OpenCL/m26600-pure.cl +++ b/OpenCL/m26600-pure.cl @@ -334,12 +334,12 @@ KERNEL_FQ void m26600_comp (KERN_ATTR_TMPS_ESALT (pbkdf2_sha256_tmp_t, pbkdf2_sh // iv - const u32 iv[4] = { - esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[0], - esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[1], - esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[2], - esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[3] - }; + const u32 iv[4]; + + iv[0] = esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[0]; + iv[1] = esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[1]; + iv[2] = esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[2]; + iv[3] = esalt_bufs[DIGESTS_OFFSET_HOST].iv_buf[3]; const u32 iv_len = esalt_bufs[DIGESTS_OFFSET_HOST].iv_len;