From cb827fcd328b912ff32396ae96fa3d134f17a5d4 Mon Sep 17 00:00:00 2001 From: philsmd Date: Tue, 11 Apr 2023 15:52:34 +0200 Subject: [PATCH] fix trailing spaces --- OpenCL/inc_hash_blake2s.cl | 6 +++--- OpenCL/inc_hash_sm3.cl | 10 +++++----- OpenCL/m31000_a0-optimized.cl | 2 +- OpenCL/m31000_a0-pure.cl | 2 +- src/user_options.c | 6 +++--- tools/2hashcat_tests/metamask2hashcat-test.py | 4 ++-- tools/test_modules/m26610.pm | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/OpenCL/inc_hash_blake2s.cl b/OpenCL/inc_hash_blake2s.cl index c10006068..cf67e5f78 100644 --- a/OpenCL/inc_hash_blake2s.cl +++ b/OpenCL/inc_hash_blake2s.cl @@ -26,7 +26,7 @@ DECLSPEC u32 blake2s_rot16_S (const u32 a) DECLSPEC u32x blake2s_rot16 (const u32x a) { u32x r; - + #if VECT_SIZE == 1 r = blake2s_rot16_S (a); #endif @@ -346,7 +346,7 @@ DECLSPEC void blake2s_update (PRIVATE_AS blake2s_ctx_t *ctx, PRIVATE_AS const u3 w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; - + blake2s_update_64 (ctx, w0, w1, w2, w3, 64); } @@ -451,7 +451,7 @@ DECLSPEC void blake2s_transform_vector (PRIVATE_AS u32x *h, PRIVATE_AS const u32 v[13] = BLAKE2S_IV_05; // ^ t1; v[14] = BLAKE2S_IV_06 ^ f0; v[15] = BLAKE2S_IV_07; // ^ f1; - + BLAKE2S_ROUND_VECTOR ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); BLAKE2S_ROUND_VECTOR (14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3); BLAKE2S_ROUND_VECTOR (11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4); diff --git a/OpenCL/inc_hash_sm3.cl b/OpenCL/inc_hash_sm3.cl index f2d53dc72..4fb51b9e0 100644 --- a/OpenCL/inc_hash_sm3.cl +++ b/OpenCL/inc_hash_sm3.cl @@ -41,7 +41,7 @@ DECLSPEC void sm3_transform (PRIVATE_AS const u32 *w0, PRIVATE_AS const u32 *w1, u32 wd_t = w3[1]; u32 we_t = w3[2]; u32 wf_t = w3[3]; - + // SM3 main loop, composed of 64 rounds (0 to 63). // The Compression Function (CF) and Message Expansion (ME) are executed step-by-step. // SM3_ROUND1_S use SM3_FF0 and SM3_GG0 functions for index 0 to 15 and SM3_ROUND2_S use SM3_FF1 and SM3_GG1 functions for index 16 to 63. @@ -93,7 +93,7 @@ DECLSPEC void sm3_transform (PRIVATE_AS const u32 *w0, PRIVATE_AS const u32 *w1, wc_t = SM3_EXPAND_S(wc_t, w3_t, w9_t, wf_t, w6_t); SM3_ROUND2_S(a, b, c, d, e, f, g, h, SM3_T40, w8_t, w8_t ^ wc_t); wd_t = SM3_EXPAND_S(wd_t, w4_t, wa_t, w0_t, w7_t); SM3_ROUND2_S(d, a, b, c, h, e, f, g, SM3_T41, w9_t, w9_t ^ wd_t); we_t = SM3_EXPAND_S(we_t, w5_t, wb_t, w1_t, w8_t); SM3_ROUND2_S(c, d, a, b, g, h, e, f, SM3_T42, wa_t, wa_t ^ we_t); - wf_t = SM3_EXPAND_S(wf_t, w6_t, wc_t, w2_t, w9_t); SM3_ROUND2_S(b, c, d, a, f, g, h, e, SM3_T43, wb_t, wb_t ^ wf_t); + wf_t = SM3_EXPAND_S(wf_t, w6_t, wc_t, w2_t, w9_t); SM3_ROUND2_S(b, c, d, a, f, g, h, e, SM3_T43, wb_t, wb_t ^ wf_t); w0_t = SM3_EXPAND_S(w0_t, w7_t, wd_t, w3_t, wa_t); SM3_ROUND2_S(a, b, c, d, e, f, g, h, SM3_T44, wc_t, wc_t ^ w0_t); w1_t = SM3_EXPAND_S(w1_t, w8_t, we_t, w4_t, wb_t); SM3_ROUND2_S(d, a, b, c, h, e, f, g, SM3_T45, wd_t, wd_t ^ w1_t); w2_t = SM3_EXPAND_S(w2_t, w9_t, wf_t, w5_t, wc_t); SM3_ROUND2_S(c, d, a, b, g, h, e, f, SM3_T46, we_t, we_t ^ w2_t); @@ -928,7 +928,7 @@ DECLSPEC void sm3_final (PRIVATE_AS sm3_ctx_t *ctx) const int pos = ctx->len & 63; append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); - + if (pos >= 56) { sm3_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); @@ -986,7 +986,7 @@ DECLSPEC void sm3_transform_vector (PRIVATE_AS const u32x *w0, PRIVATE_AS const u32x wd_t = w3[1]; u32x we_t = w3[2]; u32x wf_t = w3[3]; - + // SM3 main loop, composed of 64 rounds (0 to 63). // The Compression Function (CF) and Message Expansion (ME) are executed step-by-step. // SM3_ROUND1 use SM3_FF0 and SM3_GG0 functions for index 0 to 15 and SM3_ROUND2 use SM3_FF1 and SM3_GG1 functions for index 16 to 63. @@ -1038,7 +1038,7 @@ DECLSPEC void sm3_transform_vector (PRIVATE_AS const u32x *w0, PRIVATE_AS const wc_t = SM3_EXPAND(wc_t, w3_t, w9_t, wf_t, w6_t); SM3_ROUND2(a, b, c, d, e, f, g, h, SM3_T40, w8_t, w8_t ^ wc_t); wd_t = SM3_EXPAND(wd_t, w4_t, wa_t, w0_t, w7_t); SM3_ROUND2(d, a, b, c, h, e, f, g, SM3_T41, w9_t, w9_t ^ wd_t); we_t = SM3_EXPAND(we_t, w5_t, wb_t, w1_t, w8_t); SM3_ROUND2(c, d, a, b, g, h, e, f, SM3_T42, wa_t, wa_t ^ we_t); - wf_t = SM3_EXPAND(wf_t, w6_t, wc_t, w2_t, w9_t); SM3_ROUND2(b, c, d, a, f, g, h, e, SM3_T43, wb_t, wb_t ^ wf_t); + wf_t = SM3_EXPAND(wf_t, w6_t, wc_t, w2_t, w9_t); SM3_ROUND2(b, c, d, a, f, g, h, e, SM3_T43, wb_t, wb_t ^ wf_t); w0_t = SM3_EXPAND(w0_t, w7_t, wd_t, w3_t, wa_t); SM3_ROUND2(a, b, c, d, e, f, g, h, SM3_T44, wc_t, wc_t ^ w0_t); w1_t = SM3_EXPAND(w1_t, w8_t, we_t, w4_t, wb_t); SM3_ROUND2(d, a, b, c, h, e, f, g, SM3_T45, wd_t, wd_t ^ w1_t); w2_t = SM3_EXPAND(w2_t, w9_t, wf_t, w5_t, wc_t); SM3_ROUND2(c, d, a, b, g, h, e, f, SM3_T46, we_t, we_t ^ w2_t); diff --git a/OpenCL/m31000_a0-optimized.cl b/OpenCL/m31000_a0-optimized.cl index fbebe24f4..e3b9926ac 100644 --- a/OpenCL/m31000_a0-optimized.cl +++ b/OpenCL/m31000_a0-optimized.cl @@ -185,7 +185,7 @@ KERNEL_FQ void m31000_s04 (KERN_ATTR_RULES ()) const u32x r1 = h[DGST_R1]; const u32x r2 = h[DGST_R2]; const u32x r3 = h[DGST_R3]; - + COMPARE_S_SIMD (r0, r1, r2, r3); } } diff --git a/OpenCL/m31000_a0-pure.cl b/OpenCL/m31000_a0-pure.cl index d6fdb0a51..81919e0ff 100644 --- a/OpenCL/m31000_a0-pure.cl +++ b/OpenCL/m31000_a0-pure.cl @@ -47,7 +47,7 @@ KERNEL_FQ void m31000_mxx (KERN_ATTR_RULES ()) blake2s_init (&ctx); blake2s_update (&ctx, tmp.i, tmp.pw_len); blake2s_final (&ctx); - + const u32 r0 = ctx.h[DGST_R0]; const u32 r1 = ctx.h[DGST_R1]; const u32 r2 = ctx.h[DGST_R2]; diff --git a/src/user_options.c b/src/user_options.c index 4ebb7c3be..f62175d98 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -573,14 +573,14 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx) return -1; } - + if (user_options->brain_port > 65535) { event_log_error (hashcat_ctx, "Invalid brain port specified (greater than 65535)."); return -1; } - + if ((user_options->brain_client == true) && (user_options->brain_password_chgd == false)) { event_log_error (hashcat_ctx, "Brain clients must specify --brain-password."); @@ -1010,7 +1010,7 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx) if ((user_options->show == true) && (user_options->username == true)) { event_log_error (hashcat_ctx, "Mixing --show with --username can cause exponential delay in output."); - + return 0; } diff --git a/tools/2hashcat_tests/metamask2hashcat-test.py b/tools/2hashcat_tests/metamask2hashcat-test.py index 3ee031f05..7c4ea1ba7 100644 --- a/tools/2hashcat_tests/metamask2hashcat-test.py +++ b/tools/2hashcat_tests/metamask2hashcat-test.py @@ -3,7 +3,7 @@ from base64 import b64decode from hashlib import pbkdf2_hmac -from Crypto.Cipher import AES +from Crypto.Cipher import AES #TODO perhaps load the vault from tools/2hashcat_tests/metamask2hashcat.json similar as in tools/metamask2hashcat.py vault = {"data":"R95fzGt4UQ0uwrcrVYnIi4UcSlWn9wlmer+//526ZDwYAp50K82F1u1oacYcdjjhuEvbZnWk/uBG00UkgLLlO3WbINljqmu2QWdDEwjTgo/qWR6MU9d/82rxNiONHQE8UrZ8SV+htVr6XIB0ze3aCV0E+fwI93EeP79ZeDxuOEhuHoiYT0bHWMv5nA48AdluG4DbOo7SrDAWBVCBsEdXsOfYsS3/TIh0a/iFCMX4uhxY2824JwcWp4H36SFWyBYMZCJ3/U4DYFbbjWZtGRthoJlIik5BJq4FLu3Y1jEgza0AWlAvu4MKTEqrYSpUIghfxf1a1f+kPvxsHNq0as0kRwCXu09DObbdsiggbmeoBkxMZiFq0d9ar/3Gon0r3hfc3c124Wlivzbzu1JcZ3wURhLSsUS7b5cfG86aXHJkxmQDA5urBz6lw3bsIvlEUB2ErkQy/zD+cPwCG1Rs/WKt7KNh45lppCUkHccbf+xlpdc8OfUwj01Xp7BdH8LMR7Vx1C4hZCvSdtURVl0VaAMxHDX0MjRkwmqS","iv":"h+BoIf2CQ5BEjaIOShFE7g==","salt":"jfGI3TXguhb8GPnKSXFrMzRk2NCEc131Gt5G3kZr5+s="} @@ -38,4 +38,4 @@ print("Partially encrypted message (32 bytes):", plaintext.decode()) cipher = AES.new(key, AES.MODE_GCM, nonce=iv) plaintext = cipher.decrypt(ciphertext[:450]) -print("Partially encrypted message (450 bytes):", plaintext.decode()) \ No newline at end of file +print("Partially encrypted message (450 bytes):", plaintext.decode()) diff --git a/tools/test_modules/m26610.pm b/tools/test_modules/m26610.pm index bde52a1f7..45dc4e18c 100644 --- a/tools/test_modules/m26610.pm +++ b/tools/test_modules/m26610.pm @@ -57,7 +57,7 @@ sub module_generate_hash # TODO now the data is all ASCII 'a', would be better to have it mimic the same structure as the reference data: # [{"type":"HD Key Tree","data":{"mnemonic":[112,97,121,109,101,110,116,32,117,112,115,101,116,32,109,101,116,97,108,32,99,104,97,112,116,101,114,32,114,117,110,32,97,100,109,105,116,32,109,101,97,115,117,114,101,32,114,101,109,105,110,100,32,115,117,112,112,108,121,32,104,111,112,101,32,101,110,101,109,121,32,104,101,100,103,101,104,111,103],"numberOfAccounts":1,"hdPath":"m/44'/60'/0'/0"}}] # generated from tools/2hashcat_tests/metamask2hashcat-test.py - $pt = "a" x ($ct_min_len + int (rand ($ct_max_len - $ct_min_len)) + 1); + $pt = "a" x ($ct_min_len + int (rand ($ct_max_len - $ct_min_len)) + 1); } my $aes = Crypt::AuthEnc::GCM->new ("AES", $key, $iv_bin);