diff --git a/.appveyor.yml b/.appveyor.yml index 507fdb244..bf9da44e1 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,7 +1,6 @@ environment: CYG_MIRROR: http://cygwin.mirror.constant.com CYG_PACKAGES: make,gcc-core,libiconv-devel - DOCUMENT_FOLDER: /share/doc/hashcat matrix: - CYG_ROOT: C:\cygwin64 CYG_CACHE: C:\cygwin64\var\cache\setup @@ -15,12 +14,10 @@ environment: CC: gcc - MSYSTEM: MINGW64 MSYS_CACHE: C:\msys64\var\cache\pacman\pkg - KERNEL_CACHE: C:\msys64\usr\local\bin\OpenCL\ BASH: C:\msys64\usr\bin\bash CC: gcc - MSYSTEM: MINGW32 MSYS_CACHE: C:\msys64\var\cache\pacman\pkg - KERNEL_CACHE: C:\msys64\usr\local\bin\OpenCL\ BASH: C:\msys64\usr\bin\bash CC: gcc @@ -42,23 +39,18 @@ install: - if defined MSYSTEM (%BASH% -lc "pacman -Suuy --noconfirm") build_script: - - if defined BASH (%BASH% -lc "cd $(cygpath ${APPVEYOR_BUILD_FOLDER}) && git submodule update --init && make install") + - if defined BASH (%BASH% -lc "cd $(cygpath ${APPVEYOR_BUILD_FOLDER}) && git submodule update --init && make") test_script: # some file globbing tests # 1. hash file should not exist and therefore hashcat should complain (if it does not there might be a problem) # 2. hash file should expand to example0.hash and succeed - ps: >- - if (Test-Path Env:\MSYSTEM) - { - mkdir $env:KERNEL_CACHE 2>&1 | out-null - } - - & $env:BASH -lc "hashcat.exe -m 0 --show $env:DOCUMENT_FOLDER/*file_not_found.hash" 2>&1 | out-null + & $env:BASH -lc "cd '$env:APPVEYOR_BUILD_FOLDER' && ./hashcat.exe -m 0 --show *file_not_found.hash" 2>&1 | out-null if ($LastExitCode -eq 0) { throw "test failed" } - & $env:BASH -lc "hashcat.exe -m 0 --show $env:DOCUMENT_FOLDER/*ple0.hash" + & $env:BASH -lc "cd '$env:APPVEYOR_BUILD_FOLDER' && ./hashcat.exe -m 0 --show *ple0.hash" diff --git a/OpenCL/inc_cipher_aes.cl b/OpenCL/inc_cipher_aes.cl index 74cf356f2..74b9c3700 100644 --- a/OpenCL/inc_cipher_aes.cl +++ b/OpenCL/inc_cipher_aes.cl @@ -3,7 +3,7 @@ * License.....: MIT */ -__constant u32a te0[256] = +__constant static u32a te0[256] = { 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, @@ -71,7 +71,7 @@ __constant u32a te0[256] = 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a, }; -__constant u32a te1[256] = +__constant static u32a te1[256] = { 0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, @@ -139,7 +139,7 @@ __constant u32a te1[256] = 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616, }; -__constant u32a te2[256] = +__constant static u32a te2[256] = { 0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, @@ -207,7 +207,7 @@ __constant u32a te2[256] = 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16, }; -__constant u32a te3[256] = +__constant static u32a te3[256] = { 0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, @@ -275,7 +275,7 @@ __constant u32a te3[256] = 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c, }; -__constant u32a te4[256] = +__constant static u32a te4[256] = { 0x63636363, 0x7c7c7c7c, 0x77777777, 0x7b7b7b7b, 0xf2f2f2f2, 0x6b6b6b6b, 0x6f6f6f6f, 0xc5c5c5c5, @@ -343,7 +343,7 @@ __constant u32a te4[256] = 0xb0b0b0b0, 0x54545454, 0xbbbbbbbb, 0x16161616, }; -__constant u32a td0[256] = +__constant static u32a td0[256] = { 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, @@ -411,7 +411,7 @@ __constant u32a td0[256] = 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742, }; -__constant u32a td1[256] = +__constant static u32a td1[256] = { 0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, @@ -479,7 +479,7 @@ __constant u32a td1[256] = 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857, }; -__constant u32a td2[256] = +__constant static u32a td2[256] = { 0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, @@ -547,7 +547,7 @@ __constant u32a td2[256] = 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8, }; -__constant u32a td3[256] = +__constant static u32a td3[256] = { 0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, @@ -615,7 +615,7 @@ __constant u32a td3[256] = 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0, }; -__constant u32a td4[256] = +__constant static u32a td4[256] = { 0x52525252, 0x09090909, 0x6a6a6a6a, 0xd5d5d5d5, 0x30303030, 0x36363636, 0xa5a5a5a5, 0x38383838, @@ -683,7 +683,7 @@ __constant u32a td4[256] = 0x55555555, 0x21212121, 0x0c0c0c0c, 0x7d7d7d7d, }; -__constant u32a rcon[] = +__constant static u32a rcon[] = { 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, diff --git a/OpenCL/inc_cipher_twofish.cl b/OpenCL/inc_cipher_twofish.cl index a81611cc8..8a326c347 100644 --- a/OpenCL/inc_cipher_twofish.cl +++ b/OpenCL/inc_cipher_twofish.cl @@ -21,7 +21,7 @@ #define extract_byte(x,n) (((x) >> (8 * (n))) & 0xff) -__constant u32a q_tab[2][256] = +__constant static u32a q_tab[2][256] = { { 0xA9, 0x67, 0xB3, 0xE8, 0x04, 0xFD, 0xA3, 0x76, 0x9A, 0x92, 0x80, 0x78, @@ -75,7 +75,7 @@ __constant u32a q_tab[2][256] = #define q(n,x) q_tab[n][x] -__constant u32a m_tab[4][256] = +__constant static u32a m_tab[4][256] = { { 0xBCBC3275, 0xECEC21F3, 0x202043C6, 0xB3B3C9F4, 0xDADA03DB, 0x02028B7B, 0xE2E22BFB, 0x9E9EFAC8, 0xC9C9EC4A, 0xD4D409D3, 0x18186BE6, 0x1E1E9F6B, diff --git a/OpenCL/inc_common.cl b/OpenCL/inc_common.cl index 308c55dbc..1ffbcf33f 100644 --- a/OpenCL/inc_common.cl +++ b/OpenCL/inc_common.cl @@ -3,7 +3,7 @@ * License.....: MIT */ -__constant u32 c_append_helper[64][16] = +__constant static u32a c_append_helper[64][16] = { { 0x000000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x0000ff00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, @@ -208,6 +208,26 @@ float get_entropy (const u32 *buf, const int elems) return entropy; } +int is_valid_hex_8 (const u8 v) +{ + // direct lookup table is slower thanks to CMOV + + if ((v >= '0') && (v <= '9')) return 1; + if ((v >= 'a') && (v <= 'f')) return 1; + + return 0; +} + +int is_valid_hex_32 (const u32 v) +{ + if (is_valid_hex_8 ((u8) (v >> 0)) == 0) return 0; + if (is_valid_hex_8 ((u8) (v >> 8)) == 0) return 0; + if (is_valid_hex_8 ((u8) (v >> 16)) == 0) return 0; + if (is_valid_hex_8 ((u8) (v >> 24)) == 0) return 0; + + return 1; +} + /** * vector functions */ @@ -61594,3 +61614,84 @@ __kernel void gpu_memset (__global uint4 *buf, const u32 value, const u64 gid_ma buf[gid] = (uint4) (value); } + +__kernel void gpu_atinit (__global pw_t *buf, const u64 gid_max) +{ + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + const u32 l32 = l32_from_64_S (gid); + const u32 h32 = h32_from_64_S (gid); + + pw_t pw; + + pw.i[ 0] = 0x5c5c5c5c ^ l32; + pw.i[ 1] = 0x36363636 ^ h32; + pw.i[ 2] = 0; + pw.i[ 3] = 0; + pw.i[ 4] = 0; + pw.i[ 5] = 0; + pw.i[ 6] = 0; + pw.i[ 7] = 0; + pw.i[ 8] = 0; + pw.i[ 9] = 0; + pw.i[10] = 0; + pw.i[11] = 0; + pw.i[12] = 0; + pw.i[13] = 0; + pw.i[14] = 0; + pw.i[15] = 0; + pw.i[16] = 0; + pw.i[17] = 0; + pw.i[18] = 0; + pw.i[19] = 0; + pw.i[20] = 0; + pw.i[21] = 0; + pw.i[22] = 0; + pw.i[23] = 0; + pw.i[24] = 0; + pw.i[25] = 0; + pw.i[26] = 0; + pw.i[27] = 0; + pw.i[28] = 0; + pw.i[29] = 0; + pw.i[30] = 0; + pw.i[31] = 0; + pw.i[32] = 0; + pw.i[33] = 0; + pw.i[34] = 0; + pw.i[35] = 0; + pw.i[36] = 0; + pw.i[37] = 0; + pw.i[38] = 0; + pw.i[39] = 0; + pw.i[40] = 0; + pw.i[41] = 0; + pw.i[42] = 0; + pw.i[43] = 0; + pw.i[44] = 0; + pw.i[45] = 0; + pw.i[46] = 0; + pw.i[47] = 0; + pw.i[48] = 0; + pw.i[49] = 0; + pw.i[50] = 0; + pw.i[51] = 0; + pw.i[52] = 0; + pw.i[53] = 0; + pw.i[54] = 0; + pw.i[55] = 0; + pw.i[56] = 0; + pw.i[57] = 0; + pw.i[58] = 0; + pw.i[59] = 0; + pw.i[60] = 0; + pw.i[61] = 0; + pw.i[62] = 0; + pw.i[63] = 0; // yep that's faster + + pw.pw_len = 1 + (l32 & 15); + + buf[gid] = pw; +} diff --git a/OpenCL/inc_hash_sha224.cl b/OpenCL/inc_hash_sha224.cl index 4f35938a6..51436aa28 100644 --- a/OpenCL/inc_hash_sha224.cl +++ b/OpenCL/inc_hash_sha224.cl @@ -4,7 +4,7 @@ // input buf needs to be in algorithm native byte order (md5 = LE, sha256 = BE, etc) // input buf needs to be 64 byte aligned when using md5_update() -__constant u32a k_sha256[64] = +__constant static u32a k_sha256[64] = { SHA256C00, SHA256C01, SHA256C02, SHA256C03, SHA256C04, SHA256C05, SHA256C06, SHA256C07, diff --git a/OpenCL/inc_hash_sha256.cl b/OpenCL/inc_hash_sha256.cl index 75fd99acf..0ae1e5b75 100644 --- a/OpenCL/inc_hash_sha256.cl +++ b/OpenCL/inc_hash_sha256.cl @@ -4,7 +4,7 @@ // input buf needs to be in algorithm native byte order (md5 = LE, sha256 = BE, etc) // input buf needs to be 64 byte aligned when using md5_update() -__constant u32a k_sha256[64] = +__constant static u32a k_sha256[64] = { SHA256C00, SHA256C01, SHA256C02, SHA256C03, SHA256C04, SHA256C05, SHA256C06, SHA256C07, diff --git a/OpenCL/inc_hash_sha384.cl b/OpenCL/inc_hash_sha384.cl index 8302cd379..c5471c011 100644 --- a/OpenCL/inc_hash_sha384.cl +++ b/OpenCL/inc_hash_sha384.cl @@ -4,7 +4,7 @@ // input buf needs to be in algorithm native byte order (md5 = LE, sha1 = BE, etc) // input buf needs to be 128 byte aligned when using sha512_update() -__constant u64a k_sha384[80] = +__constant static u64a k_sha384[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/inc_hash_sha512.cl b/OpenCL/inc_hash_sha512.cl index 6c58834eb..d8f7d9ca8 100644 --- a/OpenCL/inc_hash_sha512.cl +++ b/OpenCL/inc_hash_sha512.cl @@ -4,7 +4,7 @@ // input buf needs to be in algorithm native byte order (md5 = LE, sha1 = BE, etc) // input buf needs to be 128 byte aligned when using sha512_update() -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/inc_hash_whirlpool.cl b/OpenCL/inc_hash_whirlpool.cl index c0057b1b9..66db07440 100644 --- a/OpenCL/inc_hash_whirlpool.cl +++ b/OpenCL/inc_hash_whirlpool.cl @@ -6,7 +6,7 @@ #define R 10 -__constant u32a Ch[8][256] = +__constant static u32a Ch[8][256] = { { 0x18186018, 0x23238c23, 0xc6c63fc6, 0xe8e887e8, @@ -538,7 +538,7 @@ __constant u32a Ch[8][256] = } }; -__constant u32a Cl[8][256] = +__constant static u32a Cl[8][256] = { { 0xc07830d8, 0x05af4626, 0x7ef991b8, 0x136fcdfb, @@ -1070,7 +1070,7 @@ __constant u32a Cl[8][256] = }, }; -__constant u32a rch[R + 1] = +__constant static u32a rch[R + 1] = { 0x00000000, 0x1823c6e8, @@ -1085,7 +1085,7 @@ __constant u32a rch[R + 1] = 0xca2dbf07, }; -__constant u32a rcl[R + 1] = +__constant static u32a rcl[R + 1] = { 0x00000000, 0x87b8014f, diff --git a/OpenCL/inc_luks_af.cl b/OpenCL/inc_luks_af.cl index 47059bca1..9946c209c 100644 --- a/OpenCL/inc_luks_af.cl +++ b/OpenCL/inc_luks_af.cl @@ -1,7 +1,7 @@ // basically normal XXX_transform() but with a different name to avoid collisions with function nameing -__constant u32a AF_k_sha256[64] = +__constant static u32a AF_k_sha256[64] = { SHA256C00, SHA256C01, SHA256C02, SHA256C03, SHA256C04, SHA256C05, SHA256C06, SHA256C07, @@ -21,7 +21,7 @@ __constant u32a AF_k_sha256[64] = SHA256C3c, SHA256C3d, SHA256C3e, SHA256C3f, }; -__constant u64a AF_k_sha512[80] = +__constant static u64a AF_k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/inc_luks_essiv.cl b/OpenCL/inc_luks_essiv.cl index 5011ffed4..ecf3e1da4 100644 --- a/OpenCL/inc_luks_essiv.cl +++ b/OpenCL/inc_luks_essiv.cl @@ -1,4 +1,4 @@ -__constant u32a ESSIV_k_sha256[64] = +__constant static u32a ESSIV_k_sha256[64] = { SHA256C00, SHA256C01, SHA256C02, SHA256C03, SHA256C04, SHA256C05, SHA256C06, SHA256C07, diff --git a/OpenCL/inc_truecrypt_crc32.cl b/OpenCL/inc_truecrypt_crc32.cl index f6b5a5eaa..b8e464b74 100644 --- a/OpenCL/inc_truecrypt_crc32.cl +++ b/OpenCL/inc_truecrypt_crc32.cl @@ -1,4 +1,4 @@ -__constant u32a crc32tab[0x100] = +__constant static u32a crc32tab[0x100] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, diff --git a/OpenCL/inc_types.cl b/OpenCL/inc_types.cl index 269ee7170..45dc51ee4 100644 --- a/OpenCL/inc_types.cl +++ b/OpenCL/inc_types.cl @@ -1467,6 +1467,49 @@ typedef struct ethereum_scrypt } ethereum_scrypt_t; +typedef struct ethereum_presale +{ + u32 iv[4]; + u32 enc_seed[152]; + u32 enc_seed_len; + +} ethereum_presale_t; + +typedef struct tacacs_plus +{ + u32 session_buf[16]; + + u32 ct_data_buf[64]; + u32 ct_data_len; + + u32 sequence_buf[16]; + +} tacacs_plus_t; + +typedef struct apple_secure_notes +{ + u32 Z_PK; + u32 ZCRYPTOITERATIONCOUNT; + u32 ZCRYPTOSALT[16]; + u32 ZCRYPTOWRAPPEDKEY[16]; + +} apple_secure_notes_t; + +typedef struct jwt +{ + u32 salt_buf[1024]; + u32 salt_len; + +} jwt_t; + +typedef struct electrum_wallet +{ + u32 salt_type; + u32 iv[4]; + u32 encrypted[4]; + +} electrum_wallet_t; + typedef struct pdf14_tmp { u32 digest[4]; @@ -1855,6 +1898,16 @@ typedef struct dpapimk_tmp_v2 } dpapimk_tmp_v2_t; +typedef struct apple_secure_notes_tmp +{ + u32 ipad[8]; + u32 opad[8]; + + u32 dgst[8]; + u32 out[8]; + +} apple_secure_notes_tmp_t; + typedef struct bsdicrypt_tmp { u32 Kc[16]; diff --git a/OpenCL/m00600_a3-optimized.cl b/OpenCL/m00600_a3-optimized.cl index 90c6cd9f0..398e054d8 100644 --- a/OpenCL/m00600_a3-optimized.cl +++ b/OpenCL/m00600_a3-optimized.cl @@ -10,7 +10,7 @@ #include "inc_hash_functions.cl" #include "inc_types.cl" #include "inc_common.cl" -#include "inc_simd.cl", +#include "inc_simd.cl" #define BLAKE2B_FINAL 1 #define BLAKE2B_UPDATE 0 diff --git a/OpenCL/m01500_a0.cl b/OpenCL/m01500_a0.cl index 0a0987643..42c5496cf 100644 --- a/OpenCL/m01500_a0.cl +++ b/OpenCL/m01500_a0.cl @@ -34,7 +34,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x00820200, 0x00020000, 0x80800000, 0x80820200, @@ -182,7 +182,7 @@ __constant u32a c_SPtrans[8][64] = }, }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m01500_a1.cl b/OpenCL/m01500_a1.cl index c7c2e53a5..177628442 100644 --- a/OpenCL/m01500_a1.cl +++ b/OpenCL/m01500_a1.cl @@ -32,7 +32,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x00820200, 0x00020000, 0x80800000, 0x80820200, @@ -180,7 +180,7 @@ __constant u32a c_SPtrans[8][64] = }, }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m01700_a0-optimized.cl b/OpenCL/m01700_a0-optimized.cl index 2ca3eb0c0..b891f704c 100644 --- a/OpenCL/m01700_a0-optimized.cl +++ b/OpenCL/m01700_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01700_a1-optimized.cl b/OpenCL/m01700_a1-optimized.cl index 028064dc9..e55f1f9a3 100644 --- a/OpenCL/m01700_a1-optimized.cl +++ b/OpenCL/m01700_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01700_a3-optimized.cl b/OpenCL/m01700_a3-optimized.cl index c2b6aef5a..e06cb28c8 100644 --- a/OpenCL/m01700_a3-optimized.cl +++ b/OpenCL/m01700_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01710_a0-optimized.cl b/OpenCL/m01710_a0-optimized.cl index 4000020fe..821abb685 100644 --- a/OpenCL/m01710_a0-optimized.cl +++ b/OpenCL/m01710_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01710_a1-optimized.cl b/OpenCL/m01710_a1-optimized.cl index 58ede3289..72fb2a125 100644 --- a/OpenCL/m01710_a1-optimized.cl +++ b/OpenCL/m01710_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01710_a3-optimized.cl b/OpenCL/m01710_a3-optimized.cl index 27ed660d7..0a061a901 100644 --- a/OpenCL/m01710_a3-optimized.cl +++ b/OpenCL/m01710_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01720_a0-optimized.cl b/OpenCL/m01720_a0-optimized.cl index f83139b4a..47c07083a 100644 --- a/OpenCL/m01720_a0-optimized.cl +++ b/OpenCL/m01720_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01720_a1-optimized.cl b/OpenCL/m01720_a1-optimized.cl index d4d0d6a87..72c2715a2 100644 --- a/OpenCL/m01720_a1-optimized.cl +++ b/OpenCL/m01720_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01720_a3-optimized.cl b/OpenCL/m01720_a3-optimized.cl index d83ed5651..4604afb06 100644 --- a/OpenCL/m01720_a3-optimized.cl +++ b/OpenCL/m01720_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01730_a0-optimized.cl b/OpenCL/m01730_a0-optimized.cl index ad7cc2ee7..efb24779a 100644 --- a/OpenCL/m01730_a0-optimized.cl +++ b/OpenCL/m01730_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01730_a1-optimized.cl b/OpenCL/m01730_a1-optimized.cl index 59e0893c9..dbb3141df 100644 --- a/OpenCL/m01730_a1-optimized.cl +++ b/OpenCL/m01730_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01730_a3-optimized.cl b/OpenCL/m01730_a3-optimized.cl index 973936593..26d2e4e43 100644 --- a/OpenCL/m01730_a3-optimized.cl +++ b/OpenCL/m01730_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01740_a0-optimized.cl b/OpenCL/m01740_a0-optimized.cl index a6594db83..a8a8eced1 100644 --- a/OpenCL/m01740_a0-optimized.cl +++ b/OpenCL/m01740_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01740_a1-optimized.cl b/OpenCL/m01740_a1-optimized.cl index c0548edbf..310af40ae 100644 --- a/OpenCL/m01740_a1-optimized.cl +++ b/OpenCL/m01740_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m01740_a3-optimized.cl b/OpenCL/m01740_a3-optimized.cl index c1747ad3c..dc2ac9796 100644 --- a/OpenCL/m01740_a3-optimized.cl +++ b/OpenCL/m01740_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m02000_a0.cl b/OpenCL/m02000_a0.cl index 793e13ac3..1cb42cdec 100644 --- a/OpenCL/m02000_a0.cl +++ b/OpenCL/m02000_a0.cl @@ -3,8 +3,32 @@ * License.....: MIT */ -typedef uint u32; -typedef ulong u64; +typedef uint u32; +typedef ulong u64; + +typedef struct pw +{ + u32 i[64]; + + u32 pw_len; + +} pw_t; + +static u32 l32_from_64_S (u64 a) +{ + const u32 r = (u32) (a); + + return r; +} + +static u32 h32_from_64_S (u64 a) +{ + a >>= 32; + + const u32 r = (u32) (a); + + return r; +} __kernel void gpu_memset (__global uint4 *buf, const u32 value, const u64 gid_max) { @@ -15,6 +39,87 @@ __kernel void gpu_memset (__global uint4 *buf, const u32 value, const u64 gid_ma buf[gid] = (uint4) (value); } +__kernel void gpu_atinit (__global pw_t *buf, const u64 gid_max) +{ + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + const u32 l32 = l32_from_64_S (gid); + const u32 h32 = h32_from_64_S (gid); + + pw_t pw; + + pw.i[ 0] = 0x5c5c5c5c ^ l32; + pw.i[ 1] = 0x36363636 ^ h32; + pw.i[ 2] = 0; + pw.i[ 3] = 0; + pw.i[ 4] = 0; + pw.i[ 5] = 0; + pw.i[ 6] = 0; + pw.i[ 7] = 0; + pw.i[ 8] = 0; + pw.i[ 9] = 0; + pw.i[10] = 0; + pw.i[11] = 0; + pw.i[12] = 0; + pw.i[13] = 0; + pw.i[14] = 0; + pw.i[15] = 0; + pw.i[16] = 0; + pw.i[17] = 0; + pw.i[18] = 0; + pw.i[19] = 0; + pw.i[20] = 0; + pw.i[21] = 0; + pw.i[22] = 0; + pw.i[23] = 0; + pw.i[24] = 0; + pw.i[25] = 0; + pw.i[26] = 0; + pw.i[27] = 0; + pw.i[28] = 0; + pw.i[29] = 0; + pw.i[30] = 0; + pw.i[31] = 0; + pw.i[32] = 0; + pw.i[33] = 0; + pw.i[34] = 0; + pw.i[35] = 0; + pw.i[36] = 0; + pw.i[37] = 0; + pw.i[38] = 0; + pw.i[39] = 0; + pw.i[40] = 0; + pw.i[41] = 0; + pw.i[42] = 0; + pw.i[43] = 0; + pw.i[44] = 0; + pw.i[45] = 0; + pw.i[46] = 0; + pw.i[47] = 0; + pw.i[48] = 0; + pw.i[49] = 0; + pw.i[50] = 0; + pw.i[51] = 0; + pw.i[52] = 0; + pw.i[53] = 0; + pw.i[54] = 0; + pw.i[55] = 0; + pw.i[56] = 0; + pw.i[57] = 0; + pw.i[58] = 0; + pw.i[59] = 0; + pw.i[60] = 0; + pw.i[61] = 0; + pw.i[62] = 0; + pw.i[63] = 0; // yep that's faster + + pw.pw_len = 1 + (l32 & 15); + + buf[gid] = pw; +} + __kernel void m02000_mxx (__global void *pws, __global void *rules_buf, __global void *combs_buf, __global void * words_buf_r, __global void *tmps, __global void *hooks, __global void *bitmaps_buf_s1_a, __global void *bitmaps_buf_s1_b, __global void *bitmaps_buf_s1_c, __global void *bitmaps_buf_s1_d, __global void *bitmaps_buf_s2_a, __global void *bitmaps_buf_s2_b, __global void *bitmaps_buf_s2_c, __global void *bitmaps_buf_s2_d, __global void *plains_buf, __global void *digests_buf, __global void *hashes_shown, __global void *salt_bufs, __global const void *esalt_bufs, __global void *d_return_buf, __global void *d_scryptV0_buf, __global void *d_scryptV1_buf, __global void *d_scryptV2_buf, __global void *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) { } diff --git a/OpenCL/m02000_a1.cl b/OpenCL/m02000_a1.cl index 793e13ac3..1cb42cdec 100644 --- a/OpenCL/m02000_a1.cl +++ b/OpenCL/m02000_a1.cl @@ -3,8 +3,32 @@ * License.....: MIT */ -typedef uint u32; -typedef ulong u64; +typedef uint u32; +typedef ulong u64; + +typedef struct pw +{ + u32 i[64]; + + u32 pw_len; + +} pw_t; + +static u32 l32_from_64_S (u64 a) +{ + const u32 r = (u32) (a); + + return r; +} + +static u32 h32_from_64_S (u64 a) +{ + a >>= 32; + + const u32 r = (u32) (a); + + return r; +} __kernel void gpu_memset (__global uint4 *buf, const u32 value, const u64 gid_max) { @@ -15,6 +39,87 @@ __kernel void gpu_memset (__global uint4 *buf, const u32 value, const u64 gid_ma buf[gid] = (uint4) (value); } +__kernel void gpu_atinit (__global pw_t *buf, const u64 gid_max) +{ + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + const u32 l32 = l32_from_64_S (gid); + const u32 h32 = h32_from_64_S (gid); + + pw_t pw; + + pw.i[ 0] = 0x5c5c5c5c ^ l32; + pw.i[ 1] = 0x36363636 ^ h32; + pw.i[ 2] = 0; + pw.i[ 3] = 0; + pw.i[ 4] = 0; + pw.i[ 5] = 0; + pw.i[ 6] = 0; + pw.i[ 7] = 0; + pw.i[ 8] = 0; + pw.i[ 9] = 0; + pw.i[10] = 0; + pw.i[11] = 0; + pw.i[12] = 0; + pw.i[13] = 0; + pw.i[14] = 0; + pw.i[15] = 0; + pw.i[16] = 0; + pw.i[17] = 0; + pw.i[18] = 0; + pw.i[19] = 0; + pw.i[20] = 0; + pw.i[21] = 0; + pw.i[22] = 0; + pw.i[23] = 0; + pw.i[24] = 0; + pw.i[25] = 0; + pw.i[26] = 0; + pw.i[27] = 0; + pw.i[28] = 0; + pw.i[29] = 0; + pw.i[30] = 0; + pw.i[31] = 0; + pw.i[32] = 0; + pw.i[33] = 0; + pw.i[34] = 0; + pw.i[35] = 0; + pw.i[36] = 0; + pw.i[37] = 0; + pw.i[38] = 0; + pw.i[39] = 0; + pw.i[40] = 0; + pw.i[41] = 0; + pw.i[42] = 0; + pw.i[43] = 0; + pw.i[44] = 0; + pw.i[45] = 0; + pw.i[46] = 0; + pw.i[47] = 0; + pw.i[48] = 0; + pw.i[49] = 0; + pw.i[50] = 0; + pw.i[51] = 0; + pw.i[52] = 0; + pw.i[53] = 0; + pw.i[54] = 0; + pw.i[55] = 0; + pw.i[56] = 0; + pw.i[57] = 0; + pw.i[58] = 0; + pw.i[59] = 0; + pw.i[60] = 0; + pw.i[61] = 0; + pw.i[62] = 0; + pw.i[63] = 0; // yep that's faster + + pw.pw_len = 1 + (l32 & 15); + + buf[gid] = pw; +} + __kernel void m02000_mxx (__global void *pws, __global void *rules_buf, __global void *combs_buf, __global void * words_buf_r, __global void *tmps, __global void *hooks, __global void *bitmaps_buf_s1_a, __global void *bitmaps_buf_s1_b, __global void *bitmaps_buf_s1_c, __global void *bitmaps_buf_s1_d, __global void *bitmaps_buf_s2_a, __global void *bitmaps_buf_s2_b, __global void *bitmaps_buf_s2_c, __global void *bitmaps_buf_s2_d, __global void *plains_buf, __global void *digests_buf, __global void *hashes_shown, __global void *salt_bufs, __global const void *esalt_bufs, __global void *d_return_buf, __global void *d_scryptV0_buf, __global void *d_scryptV1_buf, __global void *d_scryptV2_buf, __global void *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) { } diff --git a/OpenCL/m02000_a3.cl b/OpenCL/m02000_a3.cl index 793e13ac3..1cb42cdec 100644 --- a/OpenCL/m02000_a3.cl +++ b/OpenCL/m02000_a3.cl @@ -3,8 +3,32 @@ * License.....: MIT */ -typedef uint u32; -typedef ulong u64; +typedef uint u32; +typedef ulong u64; + +typedef struct pw +{ + u32 i[64]; + + u32 pw_len; + +} pw_t; + +static u32 l32_from_64_S (u64 a) +{ + const u32 r = (u32) (a); + + return r; +} + +static u32 h32_from_64_S (u64 a) +{ + a >>= 32; + + const u32 r = (u32) (a); + + return r; +} __kernel void gpu_memset (__global uint4 *buf, const u32 value, const u64 gid_max) { @@ -15,6 +39,87 @@ __kernel void gpu_memset (__global uint4 *buf, const u32 value, const u64 gid_ma buf[gid] = (uint4) (value); } +__kernel void gpu_atinit (__global pw_t *buf, const u64 gid_max) +{ + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + const u32 l32 = l32_from_64_S (gid); + const u32 h32 = h32_from_64_S (gid); + + pw_t pw; + + pw.i[ 0] = 0x5c5c5c5c ^ l32; + pw.i[ 1] = 0x36363636 ^ h32; + pw.i[ 2] = 0; + pw.i[ 3] = 0; + pw.i[ 4] = 0; + pw.i[ 5] = 0; + pw.i[ 6] = 0; + pw.i[ 7] = 0; + pw.i[ 8] = 0; + pw.i[ 9] = 0; + pw.i[10] = 0; + pw.i[11] = 0; + pw.i[12] = 0; + pw.i[13] = 0; + pw.i[14] = 0; + pw.i[15] = 0; + pw.i[16] = 0; + pw.i[17] = 0; + pw.i[18] = 0; + pw.i[19] = 0; + pw.i[20] = 0; + pw.i[21] = 0; + pw.i[22] = 0; + pw.i[23] = 0; + pw.i[24] = 0; + pw.i[25] = 0; + pw.i[26] = 0; + pw.i[27] = 0; + pw.i[28] = 0; + pw.i[29] = 0; + pw.i[30] = 0; + pw.i[31] = 0; + pw.i[32] = 0; + pw.i[33] = 0; + pw.i[34] = 0; + pw.i[35] = 0; + pw.i[36] = 0; + pw.i[37] = 0; + pw.i[38] = 0; + pw.i[39] = 0; + pw.i[40] = 0; + pw.i[41] = 0; + pw.i[42] = 0; + pw.i[43] = 0; + pw.i[44] = 0; + pw.i[45] = 0; + pw.i[46] = 0; + pw.i[47] = 0; + pw.i[48] = 0; + pw.i[49] = 0; + pw.i[50] = 0; + pw.i[51] = 0; + pw.i[52] = 0; + pw.i[53] = 0; + pw.i[54] = 0; + pw.i[55] = 0; + pw.i[56] = 0; + pw.i[57] = 0; + pw.i[58] = 0; + pw.i[59] = 0; + pw.i[60] = 0; + pw.i[61] = 0; + pw.i[62] = 0; + pw.i[63] = 0; // yep that's faster + + pw.pw_len = 1 + (l32 & 15); + + buf[gid] = pw; +} + __kernel void m02000_mxx (__global void *pws, __global void *rules_buf, __global void *combs_buf, __global void * words_buf_r, __global void *tmps, __global void *hooks, __global void *bitmaps_buf_s1_a, __global void *bitmaps_buf_s1_b, __global void *bitmaps_buf_s1_c, __global void *bitmaps_buf_s1_d, __global void *bitmaps_buf_s2_a, __global void *bitmaps_buf_s2_b, __global void *bitmaps_buf_s2_c, __global void *bitmaps_buf_s2_d, __global void *plains_buf, __global void *digests_buf, __global void *hashes_shown, __global void *salt_bufs, __global const void *esalt_bufs, __global void *d_return_buf, __global void *d_scryptV0_buf, __global void *d_scryptV1_buf, __global void *d_scryptV2_buf, __global void *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) { } diff --git a/OpenCL/m02400_a0-optimized.cl b/OpenCL/m02400_a0-optimized.cl index bd3a613ea..be29db7b3 100644 --- a/OpenCL/m02400_a0-optimized.cl +++ b/OpenCL/m02400_a0-optimized.cl @@ -3,7 +3,7 @@ * License.....: MIT */ -#define NEW_SIMD_CODE +//#define NEW_SIMD_CODE #include "inc_vendor.cl" #include "inc_hash_constants.h" @@ -57,18 +57,39 @@ __kernel void m02400_m04 (__global pw_t *pws, __constant const kernel_rule_t *ru const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); - w1[0] = 0x80; - w1[1] = 0; - w1[2] = 0; - w1[3] = 0; - w2[0] = 0; - w2[1] = 0; - w2[2] = 0; - w2[3] = 0; - w3[0] = 0; - w3[1] = 0; - w3[2] = 16 * 8; - w3[3] = 0; + if (out_len <= 16) + { + w1[0] = 0x80; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 16 * 8; + w3[3] = 0; + } + else if (out_len <= 32) + { + w2[0] = 0x80; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 32 * 8; + w3[3] = 0; + } + else if (out_len <= 48) + { + w3[0] = 0x80; + w3[1] = 0; + w3[2] = 48 * 8; + w3[3] = 0; + } u32x a = MD5M_A; u32x b = MD5M_B; @@ -217,18 +238,39 @@ __kernel void m02400_s04 (__global pw_t *pws, __constant const kernel_rule_t *ru const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); - w1[0] = 0x80; - w1[1] = 0; - w1[2] = 0; - w1[3] = 0; - w2[0] = 0; - w2[1] = 0; - w2[2] = 0; - w2[3] = 0; - w3[0] = 0; - w3[1] = 0; - w3[2] = 16 * 8; - w3[3] = 0; + if (out_len <= 16) + { + w1[0] = 0x80; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 16 * 8; + w3[3] = 0; + } + else if (out_len <= 32) + { + w2[0] = 0x80; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 32 * 8; + w3[3] = 0; + } + else if (out_len <= 48) + { + w3[0] = 0x80; + w3[1] = 0; + w3[2] = 48 * 8; + w3[3] = 0; + } u32x a = MD5M_A; u32x b = MD5M_B; diff --git a/OpenCL/m02400_a1-optimized.cl b/OpenCL/m02400_a1-optimized.cl index 40481dea2..30b54c509 100644 --- a/OpenCL/m02400_a1-optimized.cl +++ b/OpenCL/m02400_a1-optimized.cl @@ -3,7 +3,7 @@ * License.....: MIT */ -#define NEW_SIMD_CODE +//#define NEW_SIMD_CODE #include "inc_vendor.cl" #include "inc_hash_constants.h" @@ -119,18 +119,39 @@ __kernel void m02400_m04 (__global pw_t *pws, __global const kernel_rule_t *rule * md5 */ - w1[0] = 0x80; - w1[1] = 0; - w1[2] = 0; - w1[3] = 0; - w2[0] = 0; - w2[1] = 0; - w2[2] = 0; - w2[3] = 0; - w3[0] = 0; - w3[1] = 0; - w3[2] = 16 * 8; - w3[3] = 0; + if (pw_len <= 16) + { + w1[0] = 0x80; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 16 * 8; + w3[3] = 0; + } + else if (pw_len <= 32) + { + w2[0] = 0x80; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 32 * 8; + w3[3] = 0; + } + else if (pw_len <= 48) + { + w3[0] = 0x80; + w3[1] = 0; + w3[2] = 48 * 8; + w3[3] = 0; + } u32x a = MD5M_A; u32x b = MD5M_B; @@ -343,18 +364,39 @@ __kernel void m02400_s04 (__global pw_t *pws, __global const kernel_rule_t *rule * md5 */ - w1[0] = 0x80; - w1[1] = 0; - w1[2] = 0; - w1[3] = 0; - w2[0] = 0; - w2[1] = 0; - w2[2] = 0; - w2[3] = 0; - w3[0] = 0; - w3[1] = 0; - w3[2] = 16 * 8; - w3[3] = 0; + if (pw_len <= 16) + { + w1[0] = 0x80; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 16 * 8; + w3[3] = 0; + } + else if (pw_len <= 32) + { + w2[0] = 0x80; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 32 * 8; + w3[3] = 0; + } + else if (pw_len <= 48) + { + w3[0] = 0x80; + w3[1] = 0; + w3[2] = 48 * 8; + w3[3] = 0; + } u32x a = MD5M_A; u32x b = MD5M_B; diff --git a/OpenCL/m02400_a3-optimized.cl b/OpenCL/m02400_a3-optimized.cl index bd29d259c..0a411e3d3 100644 --- a/OpenCL/m02400_a3-optimized.cl +++ b/OpenCL/m02400_a3-optimized.cl @@ -25,18 +25,39 @@ void m02400m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global const ke * algorithm specific */ - w[ 4] = 0x80; - w[ 5] = 0; - w[ 6] = 0; - w[ 7] = 0; - w[ 8] = 0; - w[ 9] = 0; - w[10] = 0; - w[11] = 0; - w[12] = 0; - w[13] = 0; - w[14] = 16 * 8; - w[15] = 0; + if (pw_len <= 16) + { + w[ 4] = 0x80; + w[ 5] = 0; + w[ 6] = 0; + w[ 7] = 0; + w[ 8] = 0; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = 16 * 8; + w[15] = 0; + } + else if (pw_len <= 32) + { + w[ 8] = 0x80; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = 32 * 8; + w[15] = 0; + } + else if (pw_len <= 48) + { + w[12] = 0x80; + w[13] = 0; + w[14] = 48 * 8; + w[15] = 0; + } /** * base @@ -219,18 +240,39 @@ void m02400s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global const ke * algorithm specific */ - w[ 4] = 0x80; - w[ 5] = 0; - w[ 6] = 0; - w[ 7] = 0; - w[ 8] = 0; - w[ 9] = 0; - w[10] = 0; - w[11] = 0; - w[12] = 0; - w[13] = 0; - w[14] = 16 * 8; - w[15] = 0; + if (pw_len <= 16) + { + w[ 4] = 0x80; + w[ 5] = 0; + w[ 6] = 0; + w[ 7] = 0; + w[ 8] = 0; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = 16 * 8; + w[15] = 0; + } + else if (pw_len <= 32) + { + w[ 8] = 0x80; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = 32 * 8; + w[15] = 0; + } + else if (pw_len <= 48) + { + w[12] = 0x80; + w[13] = 0; + w[14] = 48 * 8; + w[15] = 0; + } /** * base diff --git a/OpenCL/m02410_a0-optimized.cl b/OpenCL/m02410_a0-optimized.cl index 4db40a0b8..06b77c696 100644 --- a/OpenCL/m02410_a0-optimized.cl +++ b/OpenCL/m02410_a0-optimized.cl @@ -3,7 +3,7 @@ * License.....: MIT */ -#define NEW_SIMD_CODE +//#define NEW_SIMD_CODE #include "inc_vendor.cl" #include "inc_hash_constants.h" @@ -70,6 +70,8 @@ __kernel void m02410_m04 (__global pw_t *pws, __constant const kernel_rule_t *ru salt_buf3[2] = 0; salt_buf3[3] = 0; + const u32 salt_len = salt_bufs[salt_pos].salt_len; + /** * loop */ @@ -132,18 +134,41 @@ __kernel void m02410_m04 (__global pw_t *pws, __constant const kernel_rule_t *ru * md5 */ - w1[0] = 0x80; - w1[1] = 0; - w1[2] = 0; - w1[3] = 0; - w2[0] = 0; - w2[1] = 0; - w2[2] = 0; - w2[3] = 0; - w3[0] = 0; - w3[1] = 0; - w3[2] = 16 * 8; - w3[3] = 0; + const u32x out_salt_len = out_len + salt_len; + + if (out_salt_len <= 16) + { + w1[0] = 0x80; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 16 * 8; + w3[3] = 0; + } + else if (out_salt_len <= 32) + { + w2[0] = 0x80; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 32 * 8; + w3[3] = 0; + } + else if (out_salt_len <= 48) + { + w3[0] = 0x80; + w3[1] = 0; + w3[2] = 48 * 8; + w3[3] = 0; + } u32x a = MD5M_A; u32x b = MD5M_B; @@ -293,6 +318,8 @@ __kernel void m02410_s04 (__global pw_t *pws, __constant const kernel_rule_t *ru salt_buf3[2] = 0; salt_buf3[3] = 0; + const u32 salt_len = salt_bufs[salt_pos].salt_len; + /** * digest */ @@ -367,18 +394,41 @@ __kernel void m02410_s04 (__global pw_t *pws, __constant const kernel_rule_t *ru * md5 */ - w1[0] = 0x80; - w1[1] = 0; - w1[2] = 0; - w1[3] = 0; - w2[0] = 0; - w2[1] = 0; - w2[2] = 0; - w2[3] = 0; - w3[0] = 0; - w3[1] = 0; - w3[2] = 16 * 8; - w3[3] = 0; + const u32x out_salt_len = out_len + salt_len; + + if (out_salt_len <= 16) + { + w1[0] = 0x80; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 16 * 8; + w3[3] = 0; + } + else if (out_salt_len <= 32) + { + w2[0] = 0x80; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 32 * 8; + w3[3] = 0; + } + else if (out_salt_len <= 48) + { + w3[0] = 0x80; + w3[1] = 0; + w3[2] = 48 * 8; + w3[3] = 0; + } u32x a = MD5M_A; u32x b = MD5M_B; diff --git a/OpenCL/m02410_a1-optimized.cl b/OpenCL/m02410_a1-optimized.cl index a59926a2b..b2cd62be7 100644 --- a/OpenCL/m02410_a1-optimized.cl +++ b/OpenCL/m02410_a1-optimized.cl @@ -3,7 +3,7 @@ * License.....: MIT */ -#define NEW_SIMD_CODE +//#define NEW_SIMD_CODE #include "inc_vendor.cl" #include "inc_hash_constants.h" @@ -68,6 +68,8 @@ __kernel void m02410_m04 (__global pw_t *pws, __global const kernel_rule_t *rule salt_buf3[2] = 0; salt_buf3[3] = 0; + const u32 salt_len = salt_bufs[salt_pos].salt_len; + /** * loop */ @@ -190,18 +192,41 @@ __kernel void m02410_m04 (__global pw_t *pws, __global const kernel_rule_t *rule * md5 */ - w1[0] = 0x80; - w1[1] = 0; - w1[2] = 0; - w1[3] = 0; - w2[0] = 0; - w2[1] = 0; - w2[2] = 0; - w2[3] = 0; - w3[0] = 0; - w3[1] = 0; - w3[2] = 16 * 8; - w3[3] = 0; + const u32x pw_salt_len = pw_len + salt_len; + + if (pw_salt_len <= 16) + { + w1[0] = 0x80; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 16 * 8; + w3[3] = 0; + } + else if (pw_salt_len <= 32) + { + w2[0] = 0x80; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 32 * 8; + w3[3] = 0; + } + else if (pw_salt_len <= 48) + { + w3[0] = 0x80; + w3[1] = 0; + w3[2] = 48 * 8; + w3[3] = 0; + } u32x a = MD5M_A; u32x b = MD5M_B; @@ -351,6 +376,8 @@ __kernel void m02410_s04 (__global pw_t *pws, __global const kernel_rule_t *rule salt_buf3[2] = 0; salt_buf3[3] = 0; + const u32 salt_len = salt_bufs[salt_pos].salt_len; + /** * digest */ @@ -485,18 +512,41 @@ __kernel void m02410_s04 (__global pw_t *pws, __global const kernel_rule_t *rule * md5 */ - w1[0] = 0x80; - w1[1] = 0; - w1[2] = 0; - w1[3] = 0; - w2[0] = 0; - w2[1] = 0; - w2[2] = 0; - w2[3] = 0; - w3[0] = 0; - w3[1] = 0; - w3[2] = 16 * 8; - w3[3] = 0; + const u32x pw_salt_len = pw_len + salt_len; + + if (pw_salt_len <= 16) + { + w1[0] = 0x80; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 16 * 8; + w3[3] = 0; + } + else if (pw_salt_len <= 32) + { + w2[0] = 0x80; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 32 * 8; + w3[3] = 0; + } + else if (pw_salt_len <= 48) + { + w3[0] = 0x80; + w3[1] = 0; + w3[2] = 48 * 8; + w3[3] = 0; + } u32x a = MD5M_A; u32x b = MD5M_B; diff --git a/OpenCL/m02410_a3-optimized.cl b/OpenCL/m02410_a3-optimized.cl index fe780074a..e91f4d3fa 100644 --- a/OpenCL/m02410_a3-optimized.cl +++ b/OpenCL/m02410_a3-optimized.cl @@ -47,6 +47,8 @@ void m02410m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global const ke salt_buf3[2] = 0; salt_buf3[3] = 0; + const u32 salt_len = salt_bufs[salt_pos].salt_len; + switch_buffer_by_offset_le_S (salt_buf0, salt_buf1, salt_buf2, salt_buf3, pw_len); w[ 0] |= salt_buf0[0]; @@ -70,18 +72,41 @@ void m02410m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global const ke * algorithm specific */ - w[ 4] = 0x80; - w[ 5] = 0; - w[ 6] = 0; - w[ 7] = 0; - w[ 8] = 0; - w[ 9] = 0; - w[10] = 0; - w[11] = 0; - w[12] = 0; - w[13] = 0; - w[14] = 16 * 8; - w[15] = 0; + const u32 pw_salt_len = pw_len + salt_len; + + if (pw_salt_len <= 16) + { + w[ 4] = 0x80; + w[ 5] = 0; + w[ 6] = 0; + w[ 7] = 0; + w[ 8] = 0; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = 16 * 8; + w[15] = 0; + } + else if (pw_salt_len <= 32) + { + w[ 8] = 0x80; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = 32 * 8; + w[15] = 0; + } + else if (pw_salt_len <= 48) + { + w[12] = 0x80; + w[13] = 0; + w[14] = 48 * 8; + w[15] = 0; + } /** * base @@ -286,6 +311,8 @@ void m02410s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global const ke salt_buf3[2] = 0; salt_buf3[3] = 0; + const u32 salt_len = salt_bufs[salt_pos].salt_len; + switch_buffer_by_offset_le_S (salt_buf0, salt_buf1, salt_buf2, salt_buf3, pw_len); w[ 0] |= salt_buf0[0]; @@ -309,18 +336,41 @@ void m02410s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global const ke * algorithm specific */ - w[ 4] = 0x80; - w[ 5] = 0; - w[ 6] = 0; - w[ 7] = 0; - w[ 8] = 0; - w[ 9] = 0; - w[10] = 0; - w[11] = 0; - w[12] = 0; - w[13] = 0; - w[14] = 16 * 8; - w[15] = 0; + const u32 pw_salt_len = pw_len + salt_len; + + if (pw_salt_len <= 16) + { + w[ 4] = 0x80; + w[ 5] = 0; + w[ 6] = 0; + w[ 7] = 0; + w[ 8] = 0; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = 16 * 8; + w[15] = 0; + } + else if (pw_salt_len <= 32) + { + w[ 8] = 0x80; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = 32 * 8; + w[15] = 0; + } + else if (pw_salt_len <= 48) + { + w[12] = 0x80; + w[13] = 0; + w[14] = 48 * 8; + w[15] = 0; + } /** * base diff --git a/OpenCL/m03000_a0.cl b/OpenCL/m03000_a0.cl index 1200a0256..ed8ee83b5 100644 --- a/OpenCL/m03000_a0.cl +++ b/OpenCL/m03000_a0.cl @@ -34,7 +34,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -182,7 +182,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m03000_a1.cl b/OpenCL/m03000_a1.cl index c93bb7d6c..aea2f080b 100644 --- a/OpenCL/m03000_a1.cl +++ b/OpenCL/m03000_a1.cl @@ -32,7 +32,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -180,7 +180,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m03100_a0-optimized.cl b/OpenCL/m03100_a0-optimized.cl index dabca7d99..6890c4a19 100644 --- a/OpenCL/m03100_a0-optimized.cl +++ b/OpenCL/m03100_a0-optimized.cl @@ -53,7 +53,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -201,7 +201,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m03100_a1-optimized.cl b/OpenCL/m03100_a1-optimized.cl index 8aaae3252..636836c30 100644 --- a/OpenCL/m03100_a1-optimized.cl +++ b/OpenCL/m03100_a1-optimized.cl @@ -51,7 +51,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -199,7 +199,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m03100_a3-optimized.cl b/OpenCL/m03100_a3-optimized.cl index 632edd0b1..fb2d246fd 100644 --- a/OpenCL/m03100_a3-optimized.cl +++ b/OpenCL/m03100_a3-optimized.cl @@ -50,7 +50,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -198,7 +198,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m03200.cl b/OpenCL/m03200.cl index cb908ccaa..283e2aa75 100644 --- a/OpenCL/m03200.cl +++ b/OpenCL/m03200.cl @@ -14,7 +14,7 @@ // http://www.schneier.com/code/constants.txt -__constant u32a c_sbox0[256] = +__constant static u32a c_sbox0[256] = { 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, @@ -82,7 +82,7 @@ __constant u32a c_sbox0[256] = 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a }; -__constant u32a c_sbox1[256] = +__constant static u32a c_sbox1[256] = { 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, @@ -150,7 +150,7 @@ __constant u32a c_sbox1[256] = 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 }; -__constant u32a c_sbox2[256] = +__constant static u32a c_sbox2[256] = { 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, @@ -218,7 +218,7 @@ __constant u32a c_sbox2[256] = 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 }; -__constant u32a c_sbox3[256] = +__constant static u32a c_sbox3[256] = { 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, diff --git a/OpenCL/m05000_a0-optimized.cl b/OpenCL/m05000_a0-optimized.cl index 260e40324..f011502de 100644 --- a/OpenCL/m05000_a0-optimized.cl +++ b/OpenCL/m05000_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u64a keccakf_rndc[24] = +__constant static u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m05000_a1-optimized.cl b/OpenCL/m05000_a1-optimized.cl index 39c370c52..de6415087 100644 --- a/OpenCL/m05000_a1-optimized.cl +++ b/OpenCL/m05000_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a keccakf_rndc[24] = +__constant static u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m05000_a3-optimized.cl b/OpenCL/m05000_a3-optimized.cl index 7334426ba..e7da770e3 100644 --- a/OpenCL/m05000_a3-optimized.cl +++ b/OpenCL/m05000_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a keccakf_rndc[24] = +__constant static u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m05500_a0-optimized.cl b/OpenCL/m05500_a0-optimized.cl index 0e564e3ce..560f6ed5e 100644 --- a/OpenCL/m05500_a0-optimized.cl +++ b/OpenCL/m05500_a0-optimized.cl @@ -34,7 +34,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -182,7 +182,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m05500_a0.cl b/OpenCL/m05500_a0.cl index b9659b0f1..fda2805b2 100644 --- a/OpenCL/m05500_a0.cl +++ b/OpenCL/m05500_a0.cl @@ -35,7 +35,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -183,7 +183,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m05500_a1-optimized.cl b/OpenCL/m05500_a1-optimized.cl index d8aff3fff..45c20539f 100644 --- a/OpenCL/m05500_a1-optimized.cl +++ b/OpenCL/m05500_a1-optimized.cl @@ -32,7 +32,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -180,7 +180,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m05500_a1.cl b/OpenCL/m05500_a1.cl index 2c8a2eaf5..0d06309a1 100644 --- a/OpenCL/m05500_a1.cl +++ b/OpenCL/m05500_a1.cl @@ -33,7 +33,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -181,7 +181,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m05500_a3-optimized.cl b/OpenCL/m05500_a3-optimized.cl index f1231c240..f044b9a76 100644 --- a/OpenCL/m05500_a3-optimized.cl +++ b/OpenCL/m05500_a3-optimized.cl @@ -32,7 +32,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -180,7 +180,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m05500_a3.cl b/OpenCL/m05500_a3.cl index aa201fd4e..7c4d79717 100644 --- a/OpenCL/m05500_a3.cl +++ b/OpenCL/m05500_a3.cl @@ -33,7 +33,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -181,7 +181,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m05800-optimized.cl b/OpenCL/m05800-optimized.cl index 06ce6f8b8..eac541f45 100644 --- a/OpenCL/m05800-optimized.cl +++ b/OpenCL/m05800-optimized.cl @@ -13,7 +13,7 @@ #define COMPARE_S "inc_comp_single.cl" #define COMPARE_M "inc_comp_multi.cl" -__constant u32a c_pc_dec[1024] = +__constant static u32a c_pc_dec[1024] = { 0x00000030, 0x00000031, @@ -1041,7 +1041,7 @@ __constant u32a c_pc_dec[1024] = 0x33323031, }; -__constant u32a c_pc_len[1024] = +__constant static u32a c_pc_len[1024] = { 1, 1, diff --git a/OpenCL/m05800.cl b/OpenCL/m05800.cl index 11ce6f564..83b2fd9cc 100644 --- a/OpenCL/m05800.cl +++ b/OpenCL/m05800.cl @@ -13,7 +13,7 @@ #define COMPARE_S "inc_comp_single.cl" #define COMPARE_M "inc_comp_multi.cl" -__constant u32a c_pc_dec[1024] = +__constant static u32a c_pc_dec[1024] = { 0x00000030, 0x00000031, @@ -1041,7 +1041,7 @@ __constant u32a c_pc_dec[1024] = 0x33323031, }; -__constant u32a c_pc_len[1024] = +__constant static u32a c_pc_len[1024] = { 1, 1, diff --git a/OpenCL/m06900_a0-optimized.cl b/OpenCL/m06900_a0-optimized.cl index 87f8d41c7..2a41f78dc 100644 --- a/OpenCL/m06900_a0-optimized.cl +++ b/OpenCL/m06900_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u32a c_tables[4][256] = +__constant static u32a c_tables[4][256] = { { 0x00072000, 0x00075000, 0x00074800, 0x00071000, diff --git a/OpenCL/m06900_a1-optimized.cl b/OpenCL/m06900_a1-optimized.cl index df9f944c6..5724f1cb0 100644 --- a/OpenCL/m06900_a1-optimized.cl +++ b/OpenCL/m06900_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u32a c_tables[4][256] = +__constant static u32a c_tables[4][256] = { { 0x00072000, 0x00075000, 0x00074800, 0x00071000, diff --git a/OpenCL/m06900_a3-optimized.cl b/OpenCL/m06900_a3-optimized.cl index b3f90217f..bcde422b6 100644 --- a/OpenCL/m06900_a3-optimized.cl +++ b/OpenCL/m06900_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u32a c_tables[4][256] = +__constant static u32a c_tables[4][256] = { { 0x00072000, 0x00075000, 0x00074800, 0x00071000, diff --git a/OpenCL/m07700_a0-optimized.cl b/OpenCL/m07700_a0-optimized.cl index 387a9ddc8..cd2d2519f 100644 --- a/OpenCL/m07700_a0-optimized.cl +++ b/OpenCL/m07700_a0-optimized.cl @@ -28,7 +28,7 @@ (a)[((n)/4)+1] = x >> 32; \ } -__constant u32a sapb_trans_tbl[256] = +__constant static u32a sapb_trans_tbl[256] = { // first value hack for 0 byte as part of an optimization 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -49,7 +49,7 @@ __constant u32a sapb_trans_tbl[256] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -__constant u32a bcodeArray[48] = +__constant static u32a bcodeArray[48] = { 0x14, 0x77, 0xf3, 0xd4, 0xbb, 0x71, 0x23, 0xd0, 0x03, 0xff, 0x47, 0x93, 0x55, 0xaa, 0x66, 0x91, 0xf2, 0x88, 0x6b, 0x99, 0xbf, 0xcb, 0x32, 0x1a, 0x19, 0xd9, 0xa7, 0x82, 0x22, 0x49, 0xa2, 0x51, diff --git a/OpenCL/m07700_a1-optimized.cl b/OpenCL/m07700_a1-optimized.cl index 609e38268..ab491fedd 100644 --- a/OpenCL/m07700_a1-optimized.cl +++ b/OpenCL/m07700_a1-optimized.cl @@ -26,7 +26,7 @@ (a)[((n)/4)+1] = x >> 32; \ } -__constant u32a sapb_trans_tbl[256] = +__constant static u32a sapb_trans_tbl[256] = { // first value hack for 0 byte as part of an optimization 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -47,7 +47,7 @@ __constant u32a sapb_trans_tbl[256] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -__constant u32a bcodeArray[48] = +__constant static u32a bcodeArray[48] = { 0x14, 0x77, 0xf3, 0xd4, 0xbb, 0x71, 0x23, 0xd0, 0x03, 0xff, 0x47, 0x93, 0x55, 0xaa, 0x66, 0x91, 0xf2, 0x88, 0x6b, 0x99, 0xbf, 0xcb, 0x32, 0x1a, 0x19, 0xd9, 0xa7, 0x82, 0x22, 0x49, 0xa2, 0x51, diff --git a/OpenCL/m07700_a3-optimized.cl b/OpenCL/m07700_a3-optimized.cl index 4e07726ad..e944ca4c0 100644 --- a/OpenCL/m07700_a3-optimized.cl +++ b/OpenCL/m07700_a3-optimized.cl @@ -17,7 +17,7 @@ #define GETCHAR(a,p) (((a)[(p) / 4] >> (((p) & 3) * 8)) & 0xff) #define PUTCHAR(a,p,c) ((a)[(p) / 4] = (((a)[(p) / 4] & ~(0xff << (((p) & 3) * 8))) | ((c) << (((p) & 3) * 8)))) -__constant u32a sapb_trans_tbl[256] = +__constant static u32a sapb_trans_tbl[256] = { // first value hack for 0 byte as part of an optimization 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -38,7 +38,7 @@ __constant u32a sapb_trans_tbl[256] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -__constant u32a bcodeArray[48] = +__constant static u32a bcodeArray[48] = { 0x14, 0x77, 0xf3, 0xd4, 0xbb, 0x71, 0x23, 0xd0, 0x03, 0xff, 0x47, 0x93, 0x55, 0xaa, 0x66, 0x91, 0xf2, 0x88, 0x6b, 0x99, 0xbf, 0xcb, 0x32, 0x1a, 0x19, 0xd9, 0xa7, 0x82, 0x22, 0x49, 0xa2, 0x51, diff --git a/OpenCL/m07800_a0-optimized.cl b/OpenCL/m07800_a0-optimized.cl index 7faac4eb3..149f64ec9 100644 --- a/OpenCL/m07800_a0-optimized.cl +++ b/OpenCL/m07800_a0-optimized.cl @@ -16,7 +16,7 @@ #include "inc_simd.cl" #include "inc_hash_sha1.cl" -__constant u32 theMagicArray[64] = +__constant static u32a theMagicArray[64] = { 0x91ac5114, 0x9f675443, 0x24e73be0, 0x28747bc2, 0x863313eb, 0x5a4fcb5c, 0x080a7337, 0x0e5d1c2f, 0x338fe6e5, 0xf89baedd, 0x16f24b8d, 0x2ce1d4dc, 0xb0cbdf9d, 0xd4706d17, 0xf94d423f, 0x9b1b1194, diff --git a/OpenCL/m07800_a1-optimized.cl b/OpenCL/m07800_a1-optimized.cl index cfab6d1e5..1a5206ec5 100644 --- a/OpenCL/m07800_a1-optimized.cl +++ b/OpenCL/m07800_a1-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #include "inc_hash_sha1.cl" -__constant u32 theMagicArray[64] = +__constant static u32a theMagicArray[64] = { 0x91ac5114, 0x9f675443, 0x24e73be0, 0x28747bc2, 0x863313eb, 0x5a4fcb5c, 0x080a7337, 0x0e5d1c2f, 0x338fe6e5, 0xf89baedd, 0x16f24b8d, 0x2ce1d4dc, 0xb0cbdf9d, 0xd4706d17, 0xf94d423f, 0x9b1b1194, diff --git a/OpenCL/m07800_a3-optimized.cl b/OpenCL/m07800_a3-optimized.cl index 69098e548..00d7045bd 100644 --- a/OpenCL/m07800_a3-optimized.cl +++ b/OpenCL/m07800_a3-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #include "inc_hash_sha1.cl" -__constant u32 theMagicArray[64] = +__constant static u32a theMagicArray[64] = { 0x91ac5114, 0x9f675443, 0x24e73be0, 0x28747bc2, 0x863313eb, 0x5a4fcb5c, 0x080a7337, 0x0e5d1c2f, 0x338fe6e5, 0xf89baedd, 0x16f24b8d, 0x2ce1d4dc, 0xb0cbdf9d, 0xd4706d17, 0xf94d423f, 0x9b1b1194, diff --git a/OpenCL/m08000_a0-optimized.cl b/OpenCL/m08000_a0-optimized.cl index 12eb8d5cf..ea4dfecea 100644 --- a/OpenCL/m08000_a0-optimized.cl +++ b/OpenCL/m08000_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u32a k_sha256[64] = +__constant static u32a k_sha256[64] = { SHA256C00, SHA256C01, SHA256C02, SHA256C03, SHA256C04, SHA256C05, SHA256C06, SHA256C07, diff --git a/OpenCL/m08000_a1-optimized.cl b/OpenCL/m08000_a1-optimized.cl index 5c35b8c43..f5fa0abdf 100644 --- a/OpenCL/m08000_a1-optimized.cl +++ b/OpenCL/m08000_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u32a k_sha256[64] = +__constant static u32a k_sha256[64] = { SHA256C00, SHA256C01, SHA256C02, SHA256C03, SHA256C04, SHA256C05, SHA256C06, SHA256C07, diff --git a/OpenCL/m08000_a3-optimized.cl b/OpenCL/m08000_a3-optimized.cl index 37ad0ab06..ab8d6bbb2 100644 --- a/OpenCL/m08000_a3-optimized.cl +++ b/OpenCL/m08000_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u32a k_sha256[64] = +__constant static u32a k_sha256[64] = { SHA256C00, SHA256C01, SHA256C02, SHA256C03, SHA256C04, SHA256C05, SHA256C06, SHA256C07, diff --git a/OpenCL/m08500_a0.cl b/OpenCL/m08500_a0.cl index 49e603d03..2e6e92505 100644 --- a/OpenCL/m08500_a0.cl +++ b/OpenCL/m08500_a0.cl @@ -52,7 +52,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_ascii_to_ebcdic_pc[256] = +__constant static u32a c_ascii_to_ebcdic_pc[256] = { // little hack, can't crack 0-bytes in password, but who cares // 0xab, 0xa8, 0xae, 0xad, 0xc4, 0xf1, 0xf7, 0xf4, 0x86, 0xa1, 0xe0, 0xbc, 0xb3, 0xb0, 0xb6, 0xb5, @@ -74,7 +74,7 @@ __constant u32a c_ascii_to_ebcdic_pc[256] = 0x13, 0x10, 0x16, 0x15, 0x7f, 0x7c, 0x73, 0x70, 0x76, 0x75, 0x5e, 0x5d, 0x52, 0x51, 0x57, 0x54, }; -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -222,7 +222,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m08500_a1.cl b/OpenCL/m08500_a1.cl index c1d927375..6f59374b1 100644 --- a/OpenCL/m08500_a1.cl +++ b/OpenCL/m08500_a1.cl @@ -50,7 +50,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_ascii_to_ebcdic_pc[256] = +__constant static u32a c_ascii_to_ebcdic_pc[256] = { // little hack, can't crack 0-bytes in password, but who cares // 0xab, 0xa8, 0xae, 0xad, 0xc4, 0xf1, 0xf7, 0xf4, 0x86, 0xa1, 0xe0, 0xbc, 0xb3, 0xb0, 0xb6, 0xb5, @@ -72,7 +72,7 @@ __constant u32a c_ascii_to_ebcdic_pc[256] = 0x13, 0x10, 0x16, 0x15, 0x7f, 0x7c, 0x73, 0x70, 0x76, 0x75, 0x5e, 0x5d, 0x52, 0x51, 0x57, 0x54, }; -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -220,7 +220,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m08500_a3.cl b/OpenCL/m08500_a3.cl index 71c636154..82cb3f59c 100644 --- a/OpenCL/m08500_a3.cl +++ b/OpenCL/m08500_a3.cl @@ -50,7 +50,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_ascii_to_ebcdic_pc[256] = +__constant static u32a c_ascii_to_ebcdic_pc[256] = { // little hack, can't crack 0-bytes in password, but who cares // 0xab, 0xa8, 0xae, 0xad, 0xc4, 0xf1, 0xf7, 0xf4, 0x86, 0xa1, 0xe0, 0xbc, 0xb3, 0xb0, 0xb6, 0xb5, @@ -72,7 +72,7 @@ __constant u32a c_ascii_to_ebcdic_pc[256] = 0x13, 0x10, 0x16, 0x15, 0x7f, 0x7c, 0x73, 0x70, 0x76, 0x75, 0x5e, 0x5d, 0x52, 0x51, 0x57, 0x54, }; -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -220,7 +220,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m08600_a0.cl b/OpenCL/m08600_a0.cl index 6afc72f1d..a2b0f90ca 100644 --- a/OpenCL/m08600_a0.cl +++ b/OpenCL/m08600_a0.cl @@ -15,7 +15,7 @@ #include "inc_rp.cl" #include "inc_simd.cl" -__constant u32a lotus_magic_table[256] = +__constant static u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, diff --git a/OpenCL/m08600_a1.cl b/OpenCL/m08600_a1.cl index 9d3f65f63..7155873cb 100644 --- a/OpenCL/m08600_a1.cl +++ b/OpenCL/m08600_a1.cl @@ -13,7 +13,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u32a lotus_magic_table[256] = +__constant static u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, diff --git a/OpenCL/m08600_a3.cl b/OpenCL/m08600_a3.cl index 3d1f6ae77..7c571a3da 100644 --- a/OpenCL/m08600_a3.cl +++ b/OpenCL/m08600_a3.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u32a lotus_magic_table[256] = +__constant static u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, diff --git a/OpenCL/m08700_a0-optimized.cl b/OpenCL/m08700_a0-optimized.cl index bfda0bd09..6da04c1e2 100644 --- a/OpenCL/m08700_a0-optimized.cl +++ b/OpenCL/m08700_a0-optimized.cl @@ -15,7 +15,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u32a lotus_magic_table[256] = +__constant static u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, diff --git a/OpenCL/m08700_a1-optimized.cl b/OpenCL/m08700_a1-optimized.cl index 6d142aac9..13f1f0a2c 100644 --- a/OpenCL/m08700_a1-optimized.cl +++ b/OpenCL/m08700_a1-optimized.cl @@ -13,7 +13,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u32a lotus_magic_table[256] = +__constant static u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, diff --git a/OpenCL/m08700_a3-optimized.cl b/OpenCL/m08700_a3-optimized.cl index 06dbef6e1..b54293536 100644 --- a/OpenCL/m08700_a3-optimized.cl +++ b/OpenCL/m08700_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u32a lotus_magic_table[256] = +__constant static u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, diff --git a/OpenCL/m09000.cl b/OpenCL/m09000.cl index 9353e2bad..87002b801 100644 --- a/OpenCL/m09000.cl +++ b/OpenCL/m09000.cl @@ -14,7 +14,7 @@ // http://www.schneier.com/code/constants.txt -__constant u32a c_sbox0[256] = +__constant static u32a c_sbox0[256] = { 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, @@ -82,7 +82,7 @@ __constant u32a c_sbox0[256] = 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a }; -__constant u32a c_sbox1[256] = +__constant static u32a c_sbox1[256] = { 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, @@ -150,7 +150,7 @@ __constant u32a c_sbox1[256] = 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 }; -__constant u32a c_sbox2[256] = +__constant static u32a c_sbox2[256] = { 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, @@ -218,7 +218,7 @@ __constant u32a c_sbox2[256] = 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 }; -__constant u32a c_sbox3[256] = +__constant static u32a c_sbox3[256] = { 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, @@ -286,7 +286,7 @@ __constant u32a c_sbox3[256] = 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 }; -__constant u32a c_pbox[18] = +__constant static u32a c_pbox[18] = { 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, diff --git a/OpenCL/m09100.cl b/OpenCL/m09100.cl index 02ab80977..72a2119d4 100644 --- a/OpenCL/m09100.cl +++ b/OpenCL/m09100.cl @@ -17,7 +17,7 @@ #define COMPARE_M "inc_comp_multi.cl" // breaks if used with u8a on AMDGPU-PRO -__constant u8 lotus64_table[64] = +__constant static u8a lotus64_table[64] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', @@ -30,7 +30,7 @@ __constant u8 lotus64_table[64] = }; // break if used with u8 on NVidia driver 378.x -__constant u8a lotus_magic_table[256] = +__constant static u8a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, diff --git a/OpenCL/m09720_a0-optimized.cl b/OpenCL/m09720_a0-optimized.cl index 9d08af114..6bef77f66 100644 --- a/OpenCL/m09720_a0-optimized.cl +++ b/OpenCL/m09720_a0-optimized.cl @@ -514,8 +514,8 @@ __kernel void m09720_s04 (__global pw_t *pws, __constant const kernel_rule_t *ru { digests_buf[digests_offset].digest_buf[DGST_R0], digests_buf[digests_offset].digest_buf[DGST_R1], - digests_buf[digests_offset].digest_buf[DGST_R2], - digests_buf[digests_offset].digest_buf[DGST_R3] + 0, + 0 }; /** diff --git a/OpenCL/m09720_a1-optimized.cl b/OpenCL/m09720_a1-optimized.cl index 60b83be23..fb6baafe9 100644 --- a/OpenCL/m09720_a1-optimized.cl +++ b/OpenCL/m09720_a1-optimized.cl @@ -562,8 +562,8 @@ __kernel void m09720_s04 (__global pw_t *pws, __global const kernel_rule_t *rule { digests_buf[digests_offset].digest_buf[DGST_R0], digests_buf[digests_offset].digest_buf[DGST_R1], - digests_buf[digests_offset].digest_buf[DGST_R2], - digests_buf[digests_offset].digest_buf[DGST_R3] + 0, + 0 }; /** diff --git a/OpenCL/m09720_a3-optimized.cl b/OpenCL/m09720_a3-optimized.cl index 322ee8e66..cca7e9d85 100644 --- a/OpenCL/m09720_a3-optimized.cl +++ b/OpenCL/m09720_a3-optimized.cl @@ -475,8 +475,8 @@ void m09720s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __gl { digests_buf[digests_offset].digest_buf[DGST_R0], digests_buf[digests_offset].digest_buf[DGST_R1], - digests_buf[digests_offset].digest_buf[DGST_R2], - digests_buf[digests_offset].digest_buf[DGST_R3] + 0, + 0 }; /** diff --git a/OpenCL/m09820_a0-optimized.cl b/OpenCL/m09820_a0-optimized.cl index 27059d055..15bfc79ca 100644 --- a/OpenCL/m09820_a0-optimized.cl +++ b/OpenCL/m09820_a0-optimized.cl @@ -198,8 +198,8 @@ __kernel void m09820_s04 (__global pw_t *pws, __constant const kernel_rule_t *ru { digests_buf[digests_offset].digest_buf[DGST_R0], digests_buf[digests_offset].digest_buf[DGST_R1], - digests_buf[digests_offset].digest_buf[DGST_R2], - digests_buf[digests_offset].digest_buf[DGST_R3] + 0, + 0 }; /** diff --git a/OpenCL/m09820_a1-optimized.cl b/OpenCL/m09820_a1-optimized.cl index 9a9a6b973..04cf549fa 100644 --- a/OpenCL/m09820_a1-optimized.cl +++ b/OpenCL/m09820_a1-optimized.cl @@ -246,8 +246,8 @@ __kernel void m09820_s04 (__global pw_t *pws, __global const kernel_rule_t *rule { digests_buf[digests_offset].digest_buf[DGST_R0], digests_buf[digests_offset].digest_buf[DGST_R1], - digests_buf[digests_offset].digest_buf[DGST_R2], - digests_buf[digests_offset].digest_buf[DGST_R3] + 0, + 0 }; /** diff --git a/OpenCL/m09820_a3-optimized.cl b/OpenCL/m09820_a3-optimized.cl index 0591d9e56..b1459720d 100644 --- a/OpenCL/m09820_a3-optimized.cl +++ b/OpenCL/m09820_a3-optimized.cl @@ -143,8 +143,8 @@ void m09820s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __gl { digests_buf[digests_offset].digest_buf[DGST_R0], digests_buf[digests_offset].digest_buf[DGST_R1], - digests_buf[digests_offset].digest_buf[DGST_R2], - digests_buf[digests_offset].digest_buf[DGST_R3] + 0, + 0 }; /** diff --git a/OpenCL/m10400_a0-optimized.cl b/OpenCL/m10400_a0-optimized.cl index 066c2e1ef..3acc03bc3 100644 --- a/OpenCL/m10400_a0-optimized.cl +++ b/OpenCL/m10400_a0-optimized.cl @@ -16,7 +16,7 @@ #include "inc_simd.cl" #include "inc_hash_md5.cl" -__constant u32 padding[8] = +__constant static u32a padding[8] = { 0x5e4ebf28, 0x418a754e, diff --git a/OpenCL/m10400_a1-optimized.cl b/OpenCL/m10400_a1-optimized.cl index 891ce2427..e90bb3395 100644 --- a/OpenCL/m10400_a1-optimized.cl +++ b/OpenCL/m10400_a1-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #include "inc_hash_md5.cl" -__constant u32 padding[8] = +__constant static u32a padding[8] = { 0x5e4ebf28, 0x418a754e, diff --git a/OpenCL/m10400_a3-optimized.cl b/OpenCL/m10400_a3-optimized.cl index ae78a534e..20aa97767 100644 --- a/OpenCL/m10400_a3-optimized.cl +++ b/OpenCL/m10400_a3-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #include "inc_hash_md5.cl" -__constant u32 padding[8] = +__constant static u32a padding[8] = { 0x5e4ebf28, 0x418a754e, diff --git a/OpenCL/m10410_a0-optimized.cl b/OpenCL/m10410_a0-optimized.cl index 75fa3b971..4b4112c77 100644 --- a/OpenCL/m10410_a0-optimized.cl +++ b/OpenCL/m10410_a0-optimized.cl @@ -16,7 +16,7 @@ #include "inc_simd.cl" #include "inc_hash_md5.cl" -__constant u32 padding[8] = +__constant static u32a padding[8] = { 0x5e4ebf28, 0x418a754e, diff --git a/OpenCL/m10410_a1-optimized.cl b/OpenCL/m10410_a1-optimized.cl index c6a711b5d..73f402b77 100644 --- a/OpenCL/m10410_a1-optimized.cl +++ b/OpenCL/m10410_a1-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #include "inc_hash_md5.cl" -__constant u32 padding[8] = +__constant static u32a padding[8] = { 0x5e4ebf28, 0x418a754e, diff --git a/OpenCL/m10410_a3-optimized.cl b/OpenCL/m10410_a3-optimized.cl index d8e11e088..d064c488a 100644 --- a/OpenCL/m10410_a3-optimized.cl +++ b/OpenCL/m10410_a3-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #include "inc_hash_md5.cl" -__constant u32 padding[8] = +__constant static u32a padding[8] = { 0x5e4ebf28, 0x418a754e, diff --git a/OpenCL/m10420_a0-optimized.cl b/OpenCL/m10420_a0-optimized.cl index 70bd96102..3a424b3ad 100644 --- a/OpenCL/m10420_a0-optimized.cl +++ b/OpenCL/m10420_a0-optimized.cl @@ -15,7 +15,7 @@ #include "inc_simd.cl" #include "inc_hash_md5.cl" -__constant u32a padding[8] = +__constant static u32a padding[8] = { 0x5e4ebf28, 0x418a754e, @@ -250,8 +250,8 @@ __kernel void m10420_s04 (__global pw_t *pws, __constant const kernel_rule_t *ru { digests_buf[digests_offset].digest_buf[DGST_R0], digests_buf[digests_offset].digest_buf[DGST_R1], - digests_buf[digests_offset].digest_buf[DGST_R2], - digests_buf[digests_offset].digest_buf[DGST_R3] + 0, + 0 }; /** diff --git a/OpenCL/m10420_a1-optimized.cl b/OpenCL/m10420_a1-optimized.cl index bb494073d..6b352c937 100644 --- a/OpenCL/m10420_a1-optimized.cl +++ b/OpenCL/m10420_a1-optimized.cl @@ -13,7 +13,7 @@ #include "inc_simd.cl" #include "inc_hash_md5.cl" -__constant u32a padding[8] = +__constant static u32a padding[8] = { 0x5e4ebf28, 0x418a754e, @@ -308,8 +308,8 @@ __kernel void m10420_s04 (__global pw_t *pws, __global const kernel_rule_t *rule { digests_buf[digests_offset].digest_buf[DGST_R0], digests_buf[digests_offset].digest_buf[DGST_R1], - digests_buf[digests_offset].digest_buf[DGST_R2], - digests_buf[digests_offset].digest_buf[DGST_R3] + 0, + 0 }; /** diff --git a/OpenCL/m10420_a3-optimized.cl b/OpenCL/m10420_a3-optimized.cl index a5a884c5e..333035c16 100644 --- a/OpenCL/m10420_a3-optimized.cl +++ b/OpenCL/m10420_a3-optimized.cl @@ -13,7 +13,7 @@ #include "inc_simd.cl" #include "inc_hash_md5.cl" -__constant u32a padding[8] = +__constant static u32a padding[8] = { 0x5e4ebf28, 0x418a754e, @@ -260,8 +260,8 @@ void m10420s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __gl { digests_buf[digests_offset].digest_buf[DGST_R0], digests_buf[digests_offset].digest_buf[DGST_R1], - digests_buf[digests_offset].digest_buf[DGST_R2], - digests_buf[digests_offset].digest_buf[DGST_R3] + 0, + 0 }; /** diff --git a/OpenCL/m10500.cl b/OpenCL/m10500.cl index df455cdfe..df17517ec 100644 --- a/OpenCL/m10500.cl +++ b/OpenCL/m10500.cl @@ -13,7 +13,7 @@ #define COMPARE_S "inc_comp_single.cl" #define COMPARE_M "inc_comp_multi.cl" -__constant u32a padding[8] = +__constant static u32a padding[8] = { 0x5e4ebf28, 0x418a754e, diff --git a/OpenCL/m10800_a0-optimized.cl b/OpenCL/m10800_a0-optimized.cl index bf216e34c..e49902848 100644 --- a/OpenCL/m10800_a0-optimized.cl +++ b/OpenCL/m10800_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u64a k_sha384[80] = +__constant static u64a k_sha384[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m10800_a1-optimized.cl b/OpenCL/m10800_a1-optimized.cl index 787025f87..72acdc33b 100644 --- a/OpenCL/m10800_a1-optimized.cl +++ b/OpenCL/m10800_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha384[80] = +__constant static u64a k_sha384[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m10800_a3-optimized.cl b/OpenCL/m10800_a3-optimized.cl index 65f357f67..92c24ce87 100644 --- a/OpenCL/m10800_a3-optimized.cl +++ b/OpenCL/m10800_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha384[80] = +__constant static u64a k_sha384[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m11500_a0-optimized.cl b/OpenCL/m11500_a0-optimized.cl index 51436a929..8b7eaae95 100644 --- a/OpenCL/m11500_a0-optimized.cl +++ b/OpenCL/m11500_a0-optimized.cl @@ -15,7 +15,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u32a crc32tab[0x100] = +__constant static u32a crc32tab[0x100] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, diff --git a/OpenCL/m11500_a1-optimized.cl b/OpenCL/m11500_a1-optimized.cl index 2570b368d..c94d5ced0 100644 --- a/OpenCL/m11500_a1-optimized.cl +++ b/OpenCL/m11500_a1-optimized.cl @@ -13,7 +13,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u32a crc32tab[0x100] = +__constant static u32a crc32tab[0x100] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, diff --git a/OpenCL/m11500_a3-optimized.cl b/OpenCL/m11500_a3-optimized.cl index acda130e1..ff009e2aa 100644 --- a/OpenCL/m11500_a3-optimized.cl +++ b/OpenCL/m11500_a3-optimized.cl @@ -13,7 +13,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u32a crc32tab[0x100] = +__constant static u32a crc32tab[0x100] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, diff --git a/OpenCL/m11700_a0-optimized.cl b/OpenCL/m11700_a0-optimized.cl index d26030296..113dc0655 100644 --- a/OpenCL/m11700_a0-optimized.cl +++ b/OpenCL/m11700_a0-optimized.cl @@ -41,7 +41,7 @@ // constants -__constant u64a sbob_sl64[8][256] = +__constant static u64a sbob_sl64[8][256] = { { 0xd031c397ce553fe6, @@ -2109,7 +2109,7 @@ __constant u64a sbob_sl64[8][256] = }, }; -__constant u64a sbob_rc64[12][8] = +__constant static u64a sbob_rc64[12][8] = { { 0xe9daca1eda5b08b1, diff --git a/OpenCL/m11700_a1-optimized.cl b/OpenCL/m11700_a1-optimized.cl index 8551f1f0d..d06115300 100644 --- a/OpenCL/m11700_a1-optimized.cl +++ b/OpenCL/m11700_a1-optimized.cl @@ -39,7 +39,7 @@ // constants -__constant u64a sbob_sl64[8][256] = +__constant static u64a sbob_sl64[8][256] = { { 0xd031c397ce553fe6, @@ -2107,7 +2107,7 @@ __constant u64a sbob_sl64[8][256] = }, }; -__constant u64a sbob_rc64[12][8] = +__constant static u64a sbob_rc64[12][8] = { { 0xe9daca1eda5b08b1, diff --git a/OpenCL/m11700_a3-optimized.cl b/OpenCL/m11700_a3-optimized.cl index 3156f50a8..54e1858f9 100644 --- a/OpenCL/m11700_a3-optimized.cl +++ b/OpenCL/m11700_a3-optimized.cl @@ -39,7 +39,7 @@ // constants -__constant u64a sbob_sl64[8][256] = +__constant static u64a sbob_sl64[8][256] = { { 0xd031c397ce553fe6, @@ -2107,7 +2107,7 @@ __constant u64a sbob_sl64[8][256] = }, }; -__constant u64a sbob_rc64[12][8] = +__constant static u64a sbob_rc64[12][8] = { { 0xe9daca1eda5b08b1, diff --git a/OpenCL/m11800_a0-optimized.cl b/OpenCL/m11800_a0-optimized.cl index fb180d74e..9647d7e81 100644 --- a/OpenCL/m11800_a0-optimized.cl +++ b/OpenCL/m11800_a0-optimized.cl @@ -41,7 +41,7 @@ // constants -__constant u64a sbob_sl64[8][256] = +__constant static u64a sbob_sl64[8][256] = { { 0xd031c397ce553fe6, @@ -2109,7 +2109,7 @@ __constant u64a sbob_sl64[8][256] = }, }; -__constant u64a sbob_rc64[12][8] = +__constant static u64a sbob_rc64[12][8] = { { 0xe9daca1eda5b08b1, diff --git a/OpenCL/m11800_a1-optimized.cl b/OpenCL/m11800_a1-optimized.cl index 50a5b0045..c3d838592 100644 --- a/OpenCL/m11800_a1-optimized.cl +++ b/OpenCL/m11800_a1-optimized.cl @@ -39,7 +39,7 @@ // constants -__constant u64a sbob_sl64[8][256] = +__constant static u64a sbob_sl64[8][256] = { { 0xd031c397ce553fe6, @@ -2107,7 +2107,7 @@ __constant u64a sbob_sl64[8][256] = }, }; -__constant u64a sbob_rc64[12][8] = +__constant static u64a sbob_rc64[12][8] = { { 0xe9daca1eda5b08b1, diff --git a/OpenCL/m11800_a3-optimized.cl b/OpenCL/m11800_a3-optimized.cl index 9b9ce9111..db609fae2 100644 --- a/OpenCL/m11800_a3-optimized.cl +++ b/OpenCL/m11800_a3-optimized.cl @@ -39,7 +39,7 @@ // constants -__constant u64a sbob_sl64[8][256] = +__constant static u64a sbob_sl64[8][256] = { { 0xd031c397ce553fe6, @@ -2107,7 +2107,7 @@ __constant u64a sbob_sl64[8][256] = }, }; -__constant u64a sbob_rc64[12][8] = +__constant static u64a sbob_rc64[12][8] = { { 0xe9daca1eda5b08b1, diff --git a/OpenCL/m12400.cl b/OpenCL/m12400.cl index cd73d18d8..7ad9d767e 100644 --- a/OpenCL/m12400.cl +++ b/OpenCL/m12400.cl @@ -50,7 +50,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x00820200, 0x00020000, 0x80800000, 0x80820200, @@ -198,7 +198,7 @@ __constant u32a c_SPtrans[8][64] = }, }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m13100_a0.cl b/OpenCL/m13100_a0.cl index a82bbdc49..768cf47e9 100644 --- a/OpenCL/m13100_a0.cl +++ b/OpenCL/m13100_a0.cl @@ -86,7 +86,7 @@ void rc4_init_16 (SCR_TYPE RC4_KEY *rc4_key, const u32 data[4]) } } -u8 rc4_next_16 (SCR_TYPE RC4_KEY *rc4_key, u8 i, u8 j, __global const u32 in[4], u32 out[4]) +u8 rc4_next_16 (SCR_TYPE RC4_KEY *rc4_key, u8 i, u8 j, __global u32 *in, u32 out[4]) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m13100_a1.cl b/OpenCL/m13100_a1.cl index dc3075af3..53ecaf5f5 100644 --- a/OpenCL/m13100_a1.cl +++ b/OpenCL/m13100_a1.cl @@ -84,7 +84,7 @@ void rc4_init_16 (SCR_TYPE RC4_KEY *rc4_key, const u32 data[4]) } } -u8 rc4_next_16 (SCR_TYPE RC4_KEY *rc4_key, u8 i, u8 j, __global const u32 in[4], u32 out[4]) +u8 rc4_next_16 (SCR_TYPE RC4_KEY *rc4_key, u8 i, u8 j, __global u32 *in, u32 out[4]) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m13100_a3.cl b/OpenCL/m13100_a3.cl index 0db38f6ba..f053436ab 100644 --- a/OpenCL/m13100_a3.cl +++ b/OpenCL/m13100_a3.cl @@ -84,7 +84,7 @@ void rc4_init_16 (SCR_TYPE RC4_KEY *rc4_key, const u32 data[4]) } } -u8 rc4_next_16 (SCR_TYPE RC4_KEY *rc4_key, u8 i, u8 j, __global const u32 in[4], u32 out[4]) +u8 rc4_next_16 (SCR_TYPE RC4_KEY *rc4_key, u8 i, u8 j, __global u32 *in, u32 out[4]) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m14000_a0.cl b/OpenCL/m14000_a0.cl index afca41a8a..7a851db23 100644 --- a/OpenCL/m14000_a0.cl +++ b/OpenCL/m14000_a0.cl @@ -52,7 +52,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { /* nibble 0 */ @@ -208,7 +208,7 @@ __constant u32a c_SPtrans[8][64] = }, }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m14000_a1.cl b/OpenCL/m14000_a1.cl index faf95aaf5..bb3ed9c95 100644 --- a/OpenCL/m14000_a1.cl +++ b/OpenCL/m14000_a1.cl @@ -50,7 +50,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -198,7 +198,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m14100_a0.cl b/OpenCL/m14100_a0.cl index 2d038630b..7244acdef 100644 --- a/OpenCL/m14100_a0.cl +++ b/OpenCL/m14100_a0.cl @@ -52,7 +52,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { /* nibble 0 */ @@ -208,7 +208,7 @@ __constant u32a c_SPtrans[8][64] = }, }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m14100_a1.cl b/OpenCL/m14100_a1.cl index 69cde6c9a..1b5811c0b 100644 --- a/OpenCL/m14100_a1.cl +++ b/OpenCL/m14100_a1.cl @@ -50,7 +50,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -198,7 +198,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m14100_a3.cl b/OpenCL/m14100_a3.cl index deff80f71..ea0a09504 100644 --- a/OpenCL/m14100_a3.cl +++ b/OpenCL/m14100_a3.cl @@ -50,7 +50,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -198,7 +198,7 @@ __constant u32a c_SPtrans[8][64] = } }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m14900_a0-optimized.cl b/OpenCL/m14900_a0-optimized.cl index 687147247..a1e4fd029 100644 --- a/OpenCL/m14900_a0-optimized.cl +++ b/OpenCL/m14900_a0-optimized.cl @@ -15,7 +15,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u8a c_ftable[256] = +__constant static u8a c_ftable[256] = { 0xa3, 0xd7, 0x09, 0x83, 0xf8, 0x48, 0xf6, 0xf4, 0xb3, 0x21, 0x15, 0x78, 0x99, 0xb1, 0xaf, 0xf9, diff --git a/OpenCL/m14900_a1-optimized.cl b/OpenCL/m14900_a1-optimized.cl index 8c4fbe764..c37e1155a 100644 --- a/OpenCL/m14900_a1-optimized.cl +++ b/OpenCL/m14900_a1-optimized.cl @@ -13,7 +13,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u8a c_ftable[256] = +__constant static u8a c_ftable[256] = { 0xa3, 0xd7, 0x09, 0x83, 0xf8, 0x48, 0xf6, 0xf4, 0xb3, 0x21, 0x15, 0x78, 0x99, 0xb1, 0xaf, 0xf9, diff --git a/OpenCL/m14900_a3-optimized.cl b/OpenCL/m14900_a3-optimized.cl index d929214c9..56beb4e49 100644 --- a/OpenCL/m14900_a3-optimized.cl +++ b/OpenCL/m14900_a3-optimized.cl @@ -13,7 +13,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u8a c_ftable[256] = +__constant static u8a c_ftable[256] = { 0xa3, 0xd7, 0x09, 0x83, 0xf8, 0x48, 0xf6, 0xf4, 0xb3, 0x21, 0x15, 0x78, 0x99, 0xb1, 0xaf, 0xf9, diff --git a/OpenCL/m15000_a0-optimized.cl b/OpenCL/m15000_a0-optimized.cl index f4191d712..ebb39bd78 100644 --- a/OpenCL/m15000_a0-optimized.cl +++ b/OpenCL/m15000_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_rp_optimized.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m15000_a1-optimized.cl b/OpenCL/m15000_a1-optimized.cl index 53e4c7864..de2394049 100644 --- a/OpenCL/m15000_a1-optimized.cl +++ b/OpenCL/m15000_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m15000_a3-optimized.cl b/OpenCL/m15000_a3-optimized.cl index 593930b67..bda2c0735 100644 --- a/OpenCL/m15000_a3-optimized.cl +++ b/OpenCL/m15000_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_common.cl" #include "inc_simd.cl" -__constant u64a k_sha512[80] = +__constant static u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, diff --git a/OpenCL/m15300.cl b/OpenCL/m15300.cl index 9757b715f..ed7f51788 100644 --- a/OpenCL/m15300.cl +++ b/OpenCL/m15300.cl @@ -55,7 +55,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { /* nibble 0 */ @@ -211,7 +211,7 @@ __constant u32a c_SPtrans[8][64] = }, }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m15600.cl b/OpenCL/m15600.cl index 8aae51dbb..8a23bd17e 100644 --- a/OpenCL/m15600.cl +++ b/OpenCL/m15600.cl @@ -16,7 +16,7 @@ #define COMPARE_S "inc_comp_single.cl" #define COMPARE_M "inc_comp_multi.cl" -__constant u64a keccakf_rndc[24] = +__constant static u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m15700.cl b/OpenCL/m15700.cl index 61b2d976b..35f3729d2 100644 --- a/OpenCL/m15700.cl +++ b/OpenCL/m15700.cl @@ -243,7 +243,7 @@ void scrypt_smix (uint4 *X, uint4 *T, __global uint4 *V0, __global uint4 *V1, __ st[4 + s] ^= ~bc0 & bc1; \ } -__constant u64a keccakf_rndc[24] = +__constant static u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m16000_a0.cl b/OpenCL/m16000_a0.cl index 294066492..65972017e 100644 --- a/OpenCL/m16000_a0.cl +++ b/OpenCL/m16000_a0.cl @@ -34,7 +34,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x00820200, 0x00020000, 0x80800000, 0x80820200, @@ -182,7 +182,7 @@ __constant u32a c_SPtrans[8][64] = }, }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, @@ -330,7 +330,7 @@ __constant u32a c_skb[8][64] = }, }; -__constant u32a c_tripcode_salt[128] = +__constant static u32a c_tripcode_salt[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/OpenCL/m16000_a1.cl b/OpenCL/m16000_a1.cl index 8abcdb013..a60cc3179 100644 --- a/OpenCL/m16000_a1.cl +++ b/OpenCL/m16000_a1.cl @@ -32,7 +32,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x00820200, 0x00020000, 0x80800000, 0x80820200, @@ -180,7 +180,7 @@ __constant u32a c_SPtrans[8][64] = }, }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, @@ -328,7 +328,7 @@ __constant u32a c_skb[8][64] = }, }; -__constant u32a c_tripcode_salt[128] = +__constant static u32a c_tripcode_salt[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/OpenCL/m16000_a3.cl b/OpenCL/m16000_a3.cl index 30b471382..bbfb6e8fa 100644 --- a/OpenCL/m16000_a3.cl +++ b/OpenCL/m16000_a3.cl @@ -32,7 +32,7 @@ a = a ^ tt; \ } -__constant u32a c_SPtrans[8][64] = +__constant static u32a c_SPtrans[8][64] = { { 0x00820200, 0x00020000, 0x80800000, 0x80820200, @@ -180,7 +180,7 @@ __constant u32a c_SPtrans[8][64] = }, }; -__constant u32a c_skb[8][64] = +__constant static u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, @@ -328,7 +328,7 @@ __constant u32a c_skb[8][64] = }, }; -__constant u32a c_tripcode_salt[128] = +__constant static u32a c_tripcode_salt[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/OpenCL/m16100_a0-optimized.cl b/OpenCL/m16100_a0-optimized.cl new file mode 100644 index 000000000..ad9968811 --- /dev/null +++ b/OpenCL/m16100_a0-optimized.cl @@ -0,0 +1,585 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_rp_optimized.h" +#include "inc_rp_optimized.cl" +#include "inc_simd.cl" + +__kernel void m16100_m04 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 pw_buf0[4]; + u32 pw_buf1[4]; + + pw_buf0[0] = pws[gid].i[0]; + pw_buf0[1] = pws[gid].i[1]; + pw_buf0[2] = pws[gid].i[2]; + pw_buf0[3] = pws[gid].i[3]; + pw_buf1[0] = pws[gid].i[4]; + pw_buf1[1] = pws[gid].i[5]; + pw_buf1[2] = pws[gid].i[6]; + pw_buf1[3] = pws[gid].i[7]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * salt + */ + + const u32 session_buf = esalt_bufs[digests_offset].session_buf[0]; + const u32 sequence_buf = esalt_bufs[digests_offset].sequence_buf[0]; + + /** + * digest + */ + + const u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 ct_buf[2]; + + ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; + ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + u32x w0[4] = { 0 }; + u32x w1[4] = { 0 }; + u32x w2[4] = { 0 }; + u32x w3[4] = { 0 }; + + const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + + /** + * append salt + */ + + u32 s0[4]; + u32 s1[4]; + u32 s2[4]; + u32 s3[4]; + + s0[0] = sequence_buf | 0x00800000; + s0[1] = 0; + s0[2] = 0; + s0[3] = 0; + s1[0] = 0; + s1[1] = 0; + s1[2] = 0; + s1[3] = 0; + s2[0] = 0; + s2[1] = 0; + s2[2] = 0; + s2[3] = 0; + s3[0] = 0; + s3[1] = 0; + s3[2] = 0; + s3[3] = 0; + + switch_buffer_by_offset_le (s0, s1, s2, s3, 4 + out_len); + + const u32x pw_salt_len = 4 + out_len + 2; + + s0[0] = session_buf; + s0[1] |= w0[0]; + s0[2] |= w0[1]; + s0[3] |= w0[2]; + s1[0] |= w0[3]; + s1[1] |= w1[0]; + s1[2] |= w1[1]; + s1[3] |= w1[2]; + s2[0] |= w1[3]; + s2[1] |= 0; + s2[2] |= 0; + s2[3] |= 0; + s3[0] |= 0; + s3[1] |= 0; + s3[2] = pw_salt_len * 8; + s3[3] = 0; + + w0[0] = s0[0]; + w0[1] = s0[1]; + w0[2] = s0[2]; + w0[3] = s0[3]; + w1[0] = s1[0]; + w1[1] = s1[1]; + w1[2] = s1[2]; + w1[3] = s1[3]; + w2[0] = s2[0]; + w2[1] = s2[1]; + w2[2] = s2[2]; + w2[3] = s2[3]; + w3[0] = s3[0]; + w3[1] = s3[1]; + w3[2] = s3[2]; + w3[3] = s3[3]; + + /** + * md5 + */ + + u32x a = MD5M_A; + u32x b = MD5M_B; + u32x c = MD5M_C; + u32x d = MD5M_D; + + MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03); + + MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13); + + u32x t; + + MD5_STEP (MD5_H1, a, b, c, d, w1[1], MD5C20, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w2[0], MD5C21, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w2[3], MD5C22, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w3[2], MD5C23, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w0[1], MD5C24, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w1[0], MD5C25, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w1[3], MD5C26, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w2[2], MD5C27, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w3[1], MD5C28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w0[0], MD5C29, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w0[3], MD5C2a, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w1[2], MD5C2b, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w2[1], MD5C2c, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w3[0], MD5C2d, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w3[3], MD5C2e, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w0[2], MD5C2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33); + + a += MD5M_A; + b += MD5M_B; + c += MD5M_C; + d += MD5M_D; + + u32 test[2]; + + test[0] = a ^ ct_buf[0]; + test[1] = b ^ ct_buf[1]; + + if (sequence_buf == 0x01c0) + { + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf == 0x03c0) || (sequence_buf == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + } +} + +__kernel void m16100_m08 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16100_m16 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16100_s04 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 pw_buf0[4]; + u32 pw_buf1[4]; + + pw_buf0[0] = pws[gid].i[0]; + pw_buf0[1] = pws[gid].i[1]; + pw_buf0[2] = pws[gid].i[2]; + pw_buf0[3] = pws[gid].i[3]; + pw_buf1[0] = pws[gid].i[4]; + pw_buf1[1] = pws[gid].i[5]; + pw_buf1[2] = pws[gid].i[6]; + pw_buf1[3] = pws[gid].i[7]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * salt + */ + + const u32 session_buf = esalt_bufs[digests_offset].session_buf[0]; + const u32 sequence_buf = esalt_bufs[digests_offset].sequence_buf[0]; + + /** + * digest + */ + + const u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 ct_buf[2]; + + ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; + ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + u32x w0[4] = { 0 }; + u32x w1[4] = { 0 }; + u32x w2[4] = { 0 }; + u32x w3[4] = { 0 }; + + const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + + /** + * append salt + */ + + u32 s0[4]; + u32 s1[4]; + u32 s2[4]; + u32 s3[4]; + + s0[0] = sequence_buf | 0x00800000; + s0[1] = 0; + s0[2] = 0; + s0[3] = 0; + s1[0] = 0; + s1[1] = 0; + s1[2] = 0; + s1[3] = 0; + s2[0] = 0; + s2[1] = 0; + s2[2] = 0; + s2[3] = 0; + s3[0] = 0; + s3[1] = 0; + s3[2] = 0; + s3[3] = 0; + + switch_buffer_by_offset_le (s0, s1, s2, s3, 4 + out_len); + + const u32x pw_salt_len = 4 + out_len + 2; + + s0[0] = session_buf; + s0[1] |= w0[0]; + s0[2] |= w0[1]; + s0[3] |= w0[2]; + s1[0] |= w0[3]; + s1[1] |= w1[0]; + s1[2] |= w1[1]; + s1[3] |= w1[2]; + s2[0] |= w1[3]; + s2[1] |= 0; + s2[2] |= 0; + s2[3] |= 0; + s3[0] |= 0; + s3[1] |= 0; + s3[2] = pw_salt_len * 8; + s3[3] = 0; + + w0[0] = s0[0]; + w0[1] = s0[1]; + w0[2] = s0[2]; + w0[3] = s0[3]; + w1[0] = s1[0]; + w1[1] = s1[1]; + w1[2] = s1[2]; + w1[3] = s1[3]; + w2[0] = s2[0]; + w2[1] = s2[1]; + w2[2] = s2[2]; + w2[3] = s2[3]; + w3[0] = s3[0]; + w3[1] = s3[1]; + w3[2] = s3[2]; + w3[3] = s3[3]; + + /** + * md5 + */ + + u32x a = MD5M_A; + u32x b = MD5M_B; + u32x c = MD5M_C; + u32x d = MD5M_D; + + MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03); + + MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13); + + u32x t; + + MD5_STEP (MD5_H1, a, b, c, d, w1[1], MD5C20, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w2[0], MD5C21, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w2[3], MD5C22, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w3[2], MD5C23, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w0[1], MD5C24, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w1[0], MD5C25, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w1[3], MD5C26, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w2[2], MD5C27, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w3[1], MD5C28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w0[0], MD5C29, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w0[3], MD5C2a, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w1[2], MD5C2b, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w2[1], MD5C2c, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w3[0], MD5C2d, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w3[3], MD5C2e, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w0[2], MD5C2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33); + + a += MD5M_A; + b += MD5M_B; + c += MD5M_C; + d += MD5M_D; + + u32 test[2]; + + test[0] = a ^ ct_buf[0]; + test[1] = b ^ ct_buf[1]; + + if (sequence_buf == 0x01c0) + { + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf == 0x03c0) || (sequence_buf == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + } +} + +__kernel void m16100_s08 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16100_s16 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} diff --git a/OpenCL/m16100_a0.cl b/OpenCL/m16100_a0.cl new file mode 100644 index 000000000..a0159538a --- /dev/null +++ b/OpenCL/m16100_a0.cl @@ -0,0 +1,340 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_rp.h" +#include "inc_rp.cl" +#include "inc_scalar.cl" +#include "inc_hash_md5.cl" + +__kernel void m16100_mxx (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + COPY_PW (pws[gid]); + + md5_ctx_t ctx0; + + md5_init (&ctx0); + + u32 session0[4]; + u32 session1[4]; + u32 session2[4]; + u32 session3[4]; + + session0[0] = esalt_bufs[digests_offset].session_buf[0]; + session0[1] = 0; + session0[2] = 0; + session0[3] = 0; + session1[0] = 0; + session1[1] = 0; + session1[2] = 0; + session1[3] = 0; + session2[0] = 0; + session2[1] = 0; + session2[2] = 0; + session2[3] = 0; + session3[0] = 0; + session3[1] = 0; + session3[2] = 0; + session3[3] = 0; + + md5_update_64 (&ctx0, session0, session1, session2, session3, 4); + + u32 ct_buf[2]; + + ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; + ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; + + u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 sequence_buf0 = esalt_bufs[digests_offset].sequence_buf[0]; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + pw_t tmp = PASTE_PW; + + tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len); + + md5_ctx_t ctx = ctx0; + + md5_update (&ctx, tmp.i, tmp.pw_len); + + u32 sequence0[4]; + u32 sequence1[4]; + u32 sequence2[4]; + u32 sequence3[4]; + + sequence0[0] = sequence_buf0; + sequence0[1] = 0; + sequence0[2] = 0; + sequence0[3] = 0; + sequence1[0] = 0; + sequence1[1] = 0; + sequence1[2] = 0; + sequence1[3] = 0; + sequence2[0] = 0; + sequence2[1] = 0; + sequence2[2] = 0; + sequence2[3] = 0; + sequence3[0] = 0; + sequence3[1] = 0; + sequence3[2] = 0; + sequence3[3] = 0; + + md5_update_64 (&ctx, sequence0, sequence1, sequence2, sequence3, 2); + + md5_final (&ctx); + + u32 test[2]; + + test[0] = ctx.h[0] ^ ct_buf[0]; + test[1] = ctx.h[1] ^ ct_buf[1]; + + if (sequence_buf0 == 0x01c0) + { + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf0 == 0x03c0) || (sequence_buf0 == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + } +} + +__kernel void m16100_sxx (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + COPY_PW (pws[gid]); + + md5_ctx_t ctx0; + + md5_init (&ctx0); + + u32 session0[4]; + u32 session1[4]; + u32 session2[4]; + u32 session3[4]; + + session0[0] = esalt_bufs[digests_offset].session_buf[0]; + session0[1] = 0; + session0[2] = 0; + session0[3] = 0; + session1[0] = 0; + session1[1] = 0; + session1[2] = 0; + session1[3] = 0; + session2[0] = 0; + session2[1] = 0; + session2[2] = 0; + session2[3] = 0; + session3[0] = 0; + session3[1] = 0; + session3[2] = 0; + session3[3] = 0; + + md5_update_64 (&ctx0, session0, session1, session2, session3, 4); + + u32 ct_buf[2]; + + ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; + ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; + + u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 sequence_buf0 = esalt_bufs[digests_offset].sequence_buf[0]; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + pw_t tmp = PASTE_PW; + + tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len); + + md5_ctx_t ctx = ctx0; + + md5_update (&ctx, tmp.i, tmp.pw_len); + + u32 sequence0[4]; + u32 sequence1[4]; + u32 sequence2[4]; + u32 sequence3[4]; + + sequence0[0] = sequence_buf0; + sequence0[1] = 0; + sequence0[2] = 0; + sequence0[3] = 0; + sequence1[0] = 0; + sequence1[1] = 0; + sequence1[2] = 0; + sequence1[3] = 0; + sequence2[0] = 0; + sequence2[1] = 0; + sequence2[2] = 0; + sequence2[3] = 0; + sequence3[0] = 0; + sequence3[1] = 0; + sequence3[2] = 0; + sequence3[3] = 0; + + md5_update_64 (&ctx, sequence0, sequence1, sequence2, sequence3, 2); + + md5_final (&ctx); + + u32 test[2]; + + test[0] = ctx.h[0] ^ ct_buf[0]; + test[1] = ctx.h[1] ^ ct_buf[1]; + + if (sequence_buf0 == 0x01c0) + { + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf0 == 0x03c0) || (sequence_buf0 == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + } +} diff --git a/OpenCL/m16100_a1-optimized.cl b/OpenCL/m16100_a1-optimized.cl new file mode 100644 index 000000000..96714ee11 --- /dev/null +++ b/OpenCL/m16100_a1-optimized.cl @@ -0,0 +1,705 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_simd.cl" + +__kernel void m16100_m04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 pw_buf0[4]; + u32 pw_buf1[4]; + + pw_buf0[0] = pws[gid].i[0]; + pw_buf0[1] = pws[gid].i[1]; + pw_buf0[2] = pws[gid].i[2]; + pw_buf0[3] = pws[gid].i[3]; + pw_buf1[0] = pws[gid].i[4]; + pw_buf1[1] = pws[gid].i[5]; + pw_buf1[2] = pws[gid].i[6]; + pw_buf1[3] = pws[gid].i[7]; + + const u32 pw_l_len = pws[gid].pw_len; + + /** + * salt + */ + + const u32 session_buf = esalt_bufs[digests_offset].session_buf[0]; + const u32 sequence_buf = esalt_bufs[digests_offset].sequence_buf[0]; + + /** + * digest + */ + + const u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 ct_buf[2]; + + ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; + ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos); + + const u32x pw_len = pw_l_len + pw_r_len; + + /** + * concat password candidate + */ + + u32x wordl0[4] = { 0 }; + u32x wordl1[4] = { 0 }; + u32x wordl2[4] = { 0 }; + u32x wordl3[4] = { 0 }; + + wordl0[0] = pw_buf0[0]; + wordl0[1] = pw_buf0[1]; + wordl0[2] = pw_buf0[2]; + wordl0[3] = pw_buf0[3]; + wordl1[0] = pw_buf1[0]; + wordl1[1] = pw_buf1[1]; + wordl1[2] = pw_buf1[2]; + wordl1[3] = pw_buf1[3]; + + u32x wordr0[4] = { 0 }; + u32x wordr1[4] = { 0 }; + u32x wordr2[4] = { 0 }; + u32x wordr3[4] = { 0 }; + + wordr0[0] = ix_create_combt (combs_buf, il_pos, 0); + wordr0[1] = ix_create_combt (combs_buf, il_pos, 1); + wordr0[2] = ix_create_combt (combs_buf, il_pos, 2); + wordr0[3] = ix_create_combt (combs_buf, il_pos, 3); + wordr1[0] = ix_create_combt (combs_buf, il_pos, 4); + wordr1[1] = ix_create_combt (combs_buf, il_pos, 5); + wordr1[2] = ix_create_combt (combs_buf, il_pos, 6); + wordr1[3] = ix_create_combt (combs_buf, il_pos, 7); + + if (combs_mode == COMBINATOR_MODE_BASE_LEFT) + { + switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len); + } + else + { + switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len); + } + + u32x w0[4]; + u32x w1[4]; + u32x w2[4]; + u32x w3[4]; + + w0[0] = wordl0[0] | wordr0[0]; + w0[1] = wordl0[1] | wordr0[1]; + w0[2] = wordl0[2] | wordr0[2]; + w0[3] = wordl0[3] | wordr0[3]; + w1[0] = wordl1[0] | wordr1[0]; + w1[1] = wordl1[1] | wordr1[1]; + w1[2] = wordl1[2] | wordr1[2]; + w1[3] = wordl1[3] | wordr1[3]; + w2[0] = wordl2[0] | wordr2[0]; + w2[1] = wordl2[1] | wordr2[1]; + w2[2] = wordl2[2] | wordr2[2]; + w2[3] = wordl2[3] | wordr2[3]; + w3[0] = wordl3[0] | wordr3[0]; + w3[1] = wordl3[1] | wordr3[1]; + w3[2] = wordl3[2] | wordr3[2]; + w3[3] = wordl3[3] | wordr3[3]; + + /** + * append salt + */ + + u32 s0[4]; + u32 s1[4]; + u32 s2[4]; + u32 s3[4]; + + s0[0] = sequence_buf | 0x00800000; + s0[1] = 0; + s0[2] = 0; + s0[3] = 0; + s1[0] = 0; + s1[1] = 0; + s1[2] = 0; + s1[3] = 0; + s2[0] = 0; + s2[1] = 0; + s2[2] = 0; + s2[3] = 0; + s3[0] = 0; + s3[1] = 0; + s3[2] = 0; + s3[3] = 0; + + switch_buffer_by_offset_le (s0, s1, s2, s3, 4 + pw_len); + + const u32x pw_salt_len = 4 + pw_len + 2; + + s0[0] = session_buf; + s0[1] |= w0[0]; + s0[2] |= w0[1]; + s0[3] |= w0[2]; + s1[0] |= w0[3]; + s1[1] |= w1[0]; + s1[2] |= w1[1]; + s1[3] |= w1[2]; + s2[0] |= w1[3]; + s2[1] |= 0; + s2[2] |= 0; + s2[3] |= 0; + s3[0] |= 0; + s3[1] |= 0; + s3[2] = pw_salt_len * 8; + s3[3] = 0; + + w0[0] = s0[0]; + w0[1] = s0[1]; + w0[2] = s0[2]; + w0[3] = s0[3]; + w1[0] = s1[0]; + w1[1] = s1[1]; + w1[2] = s1[2]; + w1[3] = s1[3]; + w2[0] = s2[0]; + w2[1] = s2[1]; + w2[2] = s2[2]; + w2[3] = s2[3]; + w3[0] = s3[0]; + w3[1] = s3[1]; + w3[2] = s3[2]; + w3[3] = s3[3]; + + /** + * md5 + */ + + u32x a = MD5M_A; + u32x b = MD5M_B; + u32x c = MD5M_C; + u32x d = MD5M_D; + + MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03); + + MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13); + + u32x t; + + MD5_STEP (MD5_H1, a, b, c, d, w1[1], MD5C20, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w2[0], MD5C21, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w2[3], MD5C22, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w3[2], MD5C23, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w0[1], MD5C24, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w1[0], MD5C25, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w1[3], MD5C26, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w2[2], MD5C27, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w3[1], MD5C28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w0[0], MD5C29, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w0[3], MD5C2a, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w1[2], MD5C2b, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w2[1], MD5C2c, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w3[0], MD5C2d, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w3[3], MD5C2e, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w0[2], MD5C2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33); + + + a += MD5M_A; + b += MD5M_B; + c += MD5M_C; + d += MD5M_D; + + u32 test[2]; + + test[0] = a ^ ct_buf[0]; + test[1] = b ^ ct_buf[1]; + + if (sequence_buf == 0x01c0) + { + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf == 0x03c0) || (sequence_buf == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + } +} + +__kernel void m16100_m08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16100_m16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16100_s04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 pw_buf0[4]; + u32 pw_buf1[4]; + + pw_buf0[0] = pws[gid].i[0]; + pw_buf0[1] = pws[gid].i[1]; + pw_buf0[2] = pws[gid].i[2]; + pw_buf0[3] = pws[gid].i[3]; + pw_buf1[0] = pws[gid].i[4]; + pw_buf1[1] = pws[gid].i[5]; + pw_buf1[2] = pws[gid].i[6]; + pw_buf1[3] = pws[gid].i[7]; + + const u32 pw_l_len = pws[gid].pw_len; + + /** + * salt + */ + + const u32 session_buf = esalt_bufs[digests_offset].session_buf[0]; + const u32 sequence_buf = esalt_bufs[digests_offset].sequence_buf[0]; + + /** + * digest + */ + + const u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 ct_buf[2]; + + ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; + ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos); + + const u32x pw_len = pw_l_len + pw_r_len; + + /** + * concat password candidate + */ + + u32x wordl0[4] = { 0 }; + u32x wordl1[4] = { 0 }; + u32x wordl2[4] = { 0 }; + u32x wordl3[4] = { 0 }; + + wordl0[0] = pw_buf0[0]; + wordl0[1] = pw_buf0[1]; + wordl0[2] = pw_buf0[2]; + wordl0[3] = pw_buf0[3]; + wordl1[0] = pw_buf1[0]; + wordl1[1] = pw_buf1[1]; + wordl1[2] = pw_buf1[2]; + wordl1[3] = pw_buf1[3]; + + u32x wordr0[4] = { 0 }; + u32x wordr1[4] = { 0 }; + u32x wordr2[4] = { 0 }; + u32x wordr3[4] = { 0 }; + + wordr0[0] = ix_create_combt (combs_buf, il_pos, 0); + wordr0[1] = ix_create_combt (combs_buf, il_pos, 1); + wordr0[2] = ix_create_combt (combs_buf, il_pos, 2); + wordr0[3] = ix_create_combt (combs_buf, il_pos, 3); + wordr1[0] = ix_create_combt (combs_buf, il_pos, 4); + wordr1[1] = ix_create_combt (combs_buf, il_pos, 5); + wordr1[2] = ix_create_combt (combs_buf, il_pos, 6); + wordr1[3] = ix_create_combt (combs_buf, il_pos, 7); + + if (combs_mode == COMBINATOR_MODE_BASE_LEFT) + { + switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len); + } + else + { + switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len); + } + + u32x w0[4]; + u32x w1[4]; + u32x w2[4]; + u32x w3[4]; + + w0[0] = wordl0[0] | wordr0[0]; + w0[1] = wordl0[1] | wordr0[1]; + w0[2] = wordl0[2] | wordr0[2]; + w0[3] = wordl0[3] | wordr0[3]; + w1[0] = wordl1[0] | wordr1[0]; + w1[1] = wordl1[1] | wordr1[1]; + w1[2] = wordl1[2] | wordr1[2]; + w1[3] = wordl1[3] | wordr1[3]; + w2[0] = wordl2[0] | wordr2[0]; + w2[1] = wordl2[1] | wordr2[1]; + w2[2] = wordl2[2] | wordr2[2]; + w2[3] = wordl2[3] | wordr2[3]; + w3[0] = wordl3[0] | wordr3[0]; + w3[1] = wordl3[1] | wordr3[1]; + w3[2] = wordl3[2] | wordr3[2]; + w3[3] = wordl3[3] | wordr3[3]; + + /** + * append salt + */ + + u32 s0[4]; + u32 s1[4]; + u32 s2[4]; + u32 s3[4]; + + s0[0] = sequence_buf | 0x00800000; + s0[1] = 0; + s0[2] = 0; + s0[3] = 0; + s1[0] = 0; + s1[1] = 0; + s1[2] = 0; + s1[3] = 0; + s2[0] = 0; + s2[1] = 0; + s2[2] = 0; + s2[3] = 0; + s3[0] = 0; + s3[1] = 0; + s3[2] = 0; + s3[3] = 0; + + switch_buffer_by_offset_le (s0, s1, s2, s3, 4 + pw_len); + + const u32x pw_salt_len = 4 + pw_len + 2; + + s0[0] = session_buf; + s0[1] |= w0[0]; + s0[2] |= w0[1]; + s0[3] |= w0[2]; + s1[0] |= w0[3]; + s1[1] |= w1[0]; + s1[2] |= w1[1]; + s1[3] |= w1[2]; + s2[0] |= w1[3]; + s2[1] |= 0; + s2[2] |= 0; + s2[3] |= 0; + s3[0] |= 0; + s3[1] |= 0; + s3[2] = pw_salt_len * 8; + s3[3] = 0; + + w0[0] = s0[0]; + w0[1] = s0[1]; + w0[2] = s0[2]; + w0[3] = s0[3]; + w1[0] = s1[0]; + w1[1] = s1[1]; + w1[2] = s1[2]; + w1[3] = s1[3]; + w2[0] = s2[0]; + w2[1] = s2[1]; + w2[2] = s2[2]; + w2[3] = s2[3]; + w3[0] = s3[0]; + w3[1] = s3[1]; + w3[2] = s3[2]; + w3[3] = s3[3]; + + /** + * md5 + */ + + u32x a = MD5M_A; + u32x b = MD5M_B; + u32x c = MD5M_C; + u32x d = MD5M_D; + + MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03); + + MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13); + + u32x t; + + MD5_STEP (MD5_H1, a, b, c, d, w1[1], MD5C20, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w2[0], MD5C21, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w2[3], MD5C22, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w3[2], MD5C23, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w0[1], MD5C24, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w1[0], MD5C25, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w1[3], MD5C26, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w2[2], MD5C27, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w3[1], MD5C28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w0[0], MD5C29, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w0[3], MD5C2a, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w1[2], MD5C2b, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w2[1], MD5C2c, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w3[0], MD5C2d, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w3[3], MD5C2e, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w0[2], MD5C2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33); + + + a += MD5M_A; + b += MD5M_B; + c += MD5M_C; + d += MD5M_D; + + u32 test[2]; + + test[0] = a ^ ct_buf[0]; + test[1] = b ^ ct_buf[1]; + + if (sequence_buf == 0x01c0) + { + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf == 0x03c0) || (sequence_buf == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + } +} + +__kernel void m16100_s08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16100_s16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} diff --git a/OpenCL/m16100_a1.cl b/OpenCL/m16100_a1.cl new file mode 100644 index 000000000..56795b605 --- /dev/null +++ b/OpenCL/m16100_a1.cl @@ -0,0 +1,329 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_hash_md5.cl" + +__kernel void m16100_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + md5_ctx_t ctx0; + + md5_init (&ctx0); + + u32 session0[4]; + u32 session1[4]; + u32 session2[4]; + u32 session3[4]; + + session0[0] = esalt_bufs[digests_offset].session_buf[0]; + session0[1] = 0; + session0[2] = 0; + session0[3] = 0; + session1[0] = 0; + session1[1] = 0; + session1[2] = 0; + session1[3] = 0; + session2[0] = 0; + session2[1] = 0; + session2[2] = 0; + session2[3] = 0; + session3[0] = 0; + session3[1] = 0; + session3[2] = 0; + session3[3] = 0; + + md5_update_64 (&ctx0, session0, session1, session2, session3, 4); + + md5_update_global (&ctx0, pws[gid].i, pws[gid].pw_len); + + u32 ct_buf[2]; + + ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; + ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; + + u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 sequence_buf0 = esalt_bufs[digests_offset].sequence_buf[0]; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + md5_ctx_t ctx = ctx0; + + md5_update_global (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len); + + u32 sequence0[4]; + u32 sequence1[4]; + u32 sequence2[4]; + u32 sequence3[4]; + + sequence0[0] = sequence_buf0; + sequence0[1] = 0; + sequence0[2] = 0; + sequence0[3] = 0; + sequence1[0] = 0; + sequence1[1] = 0; + sequence1[2] = 0; + sequence1[3] = 0; + sequence2[0] = 0; + sequence2[1] = 0; + sequence2[2] = 0; + sequence2[3] = 0; + sequence3[0] = 0; + sequence3[1] = 0; + sequence3[2] = 0; + sequence3[3] = 0; + + md5_update_64 (&ctx, sequence0, sequence1, sequence2, sequence3, 2); + + md5_final (&ctx); + + u32 test[2]; + + test[0] = ctx.h[0] ^ ct_buf[0]; + test[1] = ctx.h[1] ^ ct_buf[1]; + + if (sequence_buf0 == 0x01c0) + { + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf0 == 0x03c0) || (sequence_buf0 == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + } +} + +__kernel void m16100_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + md5_ctx_t ctx0; + + md5_init (&ctx0); + + u32 session0[4]; + u32 session1[4]; + u32 session2[4]; + u32 session3[4]; + + session0[0] = esalt_bufs[digests_offset].session_buf[0]; + session0[1] = 0; + session0[2] = 0; + session0[3] = 0; + session1[0] = 0; + session1[1] = 0; + session1[2] = 0; + session1[3] = 0; + session2[0] = 0; + session2[1] = 0; + session2[2] = 0; + session2[3] = 0; + session3[0] = 0; + session3[1] = 0; + session3[2] = 0; + session3[3] = 0; + + md5_update_64 (&ctx0, session0, session1, session2, session3, 4); + + md5_update_global (&ctx0, pws[gid].i, pws[gid].pw_len); + + u32 ct_buf[2]; + + ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; + ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; + + u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 sequence_buf0 = esalt_bufs[digests_offset].sequence_buf[0]; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + md5_ctx_t ctx = ctx0; + + md5_update_global (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len); + + u32 sequence0[4]; + u32 sequence1[4]; + u32 sequence2[4]; + u32 sequence3[4]; + + sequence0[0] = sequence_buf0; + sequence0[1] = 0; + sequence0[2] = 0; + sequence0[3] = 0; + sequence1[0] = 0; + sequence1[1] = 0; + sequence1[2] = 0; + sequence1[3] = 0; + sequence2[0] = 0; + sequence2[1] = 0; + sequence2[2] = 0; + sequence2[3] = 0; + sequence3[0] = 0; + sequence3[1] = 0; + sequence3[2] = 0; + sequence3[3] = 0; + + md5_update_64 (&ctx, sequence0, sequence1, sequence2, sequence3, 2); + + md5_final (&ctx); + + u32 test[2]; + + test[0] = ctx.h[0] ^ ct_buf[0]; + test[1] = ctx.h[1] ^ ct_buf[1]; + + if (sequence_buf0 == 0x01c0) + { + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf0 == 0x03c0) || (sequence_buf0 == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + } +} diff --git a/OpenCL/m16100_a3-optimized.cl b/OpenCL/m16100_a3-optimized.cl new file mode 100644 index 000000000..148a91be8 --- /dev/null +++ b/OpenCL/m16100_a3-optimized.cl @@ -0,0 +1,801 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_simd.cl" + +void m16100m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset) +{ + /** + * modifier + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + + /** + * digest + */ + + const u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 ct_buf[2]; + + ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; + ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; + + /** + * salt + */ + + const u32 session_buf = esalt_bufs[digests_offset].session_buf[0]; + const u32 sequence_buf = esalt_bufs[digests_offset].sequence_buf[0]; + + const u32 pw_salt_len = 4 + pw_len + 2; + + u32 s0[4]; + u32 s1[4]; + u32 s2[4]; + u32 s3[4]; + + s0[0] = sequence_buf | 0x00800000; + s0[1] = 0; + s0[2] = 0; + s0[3] = 0; + s1[0] = 0; + s1[1] = 0; + s1[2] = 0; + s1[3] = 0; + s2[0] = 0; + s2[1] = 0; + s2[2] = 0; + s2[3] = 0; + s3[0] = 0; + s3[1] = 0; + s3[2] = 0; + s3[3] = 0; + + switch_buffer_by_offset_le (s0, s1, s2, s3, 4 + pw_len); + + /** + * loop + */ + + const u32 w0l = w0[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = ix_create_bft (bfs_buf, il_pos); + + const u32x w0lr = w0l | w0r; + + u32x t0[4]; + u32x t1[4]; + u32x t2[4]; + u32x t3[4]; + + t0[0] = session_buf; + t0[1] = w0lr; + t0[2] = w0[1]; + t0[3] = w0[2]; + t1[0] = w0[3]; + t1[1] = w1[0]; + t1[2] = w1[1]; + t1[3] = w1[2]; + t2[0] = w1[3]; + t2[1] = w2[0]; + t2[2] = w2[1]; + t2[3] = w2[2]; + t3[0] = w2[3]; + t3[1] = w3[0]; + t3[2] = pw_salt_len * 8; + t3[3] = 0; + + t0[1] |= s0[1]; + t0[2] |= s0[2]; + t0[3] |= s0[3]; + t1[0] |= s1[0]; + t1[1] |= s1[1]; + t1[2] |= s1[2]; + t1[3] |= s1[3]; + t2[0] |= s2[0]; + t2[1] |= s2[1]; + t2[2] |= s2[2]; + t2[3] |= s2[3]; + t3[0] |= s3[0]; + t3[1] |= s3[1]; + + /** + * md5 + */ + + u32x a = MD5M_A; + u32x b = MD5M_B; + u32x c = MD5M_C; + u32x d = MD5M_D; + + MD5_STEP (MD5_Fo, a, b, c, d, t0[0], MD5C00, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, t0[1], MD5C01, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, t0[2], MD5C02, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, t0[3], MD5C03, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, t1[0], MD5C04, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, t1[1], MD5C05, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, t1[2], MD5C06, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, t1[3], MD5C07, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, t2[0], MD5C08, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, t2[1], MD5C09, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, t2[2], MD5C0a, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, t2[3], MD5C0b, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, t3[0], MD5C0c, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, t3[1], MD5C0d, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, t3[2], MD5C0e, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, t3[3], MD5C0f, MD5S03); + + MD5_STEP (MD5_Go, a, b, c, d, t0[1], MD5C10, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, t1[2], MD5C11, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, t2[3], MD5C12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, t0[0], MD5C13, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, t1[1], MD5C14, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, t2[2], MD5C15, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, t3[3], MD5C16, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, t1[0], MD5C17, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, t2[1], MD5C18, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, t3[2], MD5C19, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, t0[3], MD5C1a, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, t2[0], MD5C1b, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, t3[1], MD5C1c, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, t0[2], MD5C1d, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, t1[3], MD5C1e, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, t3[0], MD5C1f, MD5S13); + + u32x t; + + MD5_STEP (MD5_H1, a, b, c, d, t1[1], MD5C20, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, t2[0], MD5C21, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, t2[3], MD5C22, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, t3[2], MD5C23, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, t0[1], MD5C24, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, t1[0], MD5C25, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, t1[3], MD5C26, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, t2[2], MD5C27, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, t3[1], MD5C28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, t0[0], MD5C29, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, t0[3], MD5C2a, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, t1[2], MD5C2b, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, t2[1], MD5C2c, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, t3[0], MD5C2d, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, t3[3], MD5C2e, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, t0[2], MD5C2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, t0[0], MD5C30, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, t1[3], MD5C31, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, t3[2], MD5C32, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, t1[1], MD5C33, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, t3[0], MD5C34, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, t0[3], MD5C35, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, t2[2], MD5C36, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, t0[1], MD5C37, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, t2[0], MD5C38, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, t3[3], MD5C39, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, t1[2], MD5C3a, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, t3[1], MD5C3b, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, t1[0], MD5C3c, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, t2[3], MD5C3d, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, t0[2], MD5C3e, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, t2[1], MD5C3f, MD5S33); + + a += MD5M_A; + b += MD5M_B; + c += MD5M_C; + d += MD5M_D; + + u32 test[2]; + + test[0] = a ^ ct_buf[0]; + test[1] = b ^ ct_buf[1]; + + if (sequence_buf == 0x01c0) + { + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf == 0x03c0) || (sequence_buf == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + } +} + +void m16100s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset) +{ + /** + * modifier + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + + /** + * digest + */ + + const u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 ct_buf[2]; + + ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; + ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; + + /** + * salt + */ + + const u32 session_buf = esalt_bufs[digests_offset].session_buf[0]; + const u32 sequence_buf = esalt_bufs[digests_offset].sequence_buf[0]; + + const u32 pw_salt_len = 4 + pw_len + 2; + + u32 s0[4]; + u32 s1[4]; + u32 s2[4]; + u32 s3[4]; + + s0[0] = sequence_buf | 0x00800000; + s0[1] = 0; + s0[2] = 0; + s0[3] = 0; + s1[0] = 0; + s1[1] = 0; + s1[2] = 0; + s1[3] = 0; + s2[0] = 0; + s2[1] = 0; + s2[2] = 0; + s2[3] = 0; + s3[0] = 0; + s3[1] = 0; + s3[2] = 0; + s3[3] = 0; + + switch_buffer_by_offset_le (s0, s1, s2, s3, 4 + pw_len); + + /** + * loop + */ + + const u32 w0l = w0[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = ix_create_bft (bfs_buf, il_pos); + + const u32x w0lr = w0l | w0r; + + u32x t0[4]; + u32x t1[4]; + u32x t2[4]; + u32x t3[4]; + + t0[0] = session_buf; + t0[1] = w0lr; + t0[2] = w0[1]; + t0[3] = w0[2]; + t1[0] = w0[3]; + t1[1] = w1[0]; + t1[2] = w1[1]; + t1[3] = w1[2]; + t2[0] = w1[3]; + t2[1] = w2[0]; + t2[2] = w2[1]; + t2[3] = w2[2]; + t3[0] = w2[3]; + t3[1] = w3[0]; + t3[2] = pw_salt_len * 8; + t3[3] = 0; + + t0[1] |= s0[1]; + t0[2] |= s0[2]; + t0[3] |= s0[3]; + t1[0] |= s1[0]; + t1[1] |= s1[1]; + t1[2] |= s1[2]; + t1[3] |= s1[3]; + t2[0] |= s2[0]; + t2[1] |= s2[1]; + t2[2] |= s2[2]; + t2[3] |= s2[3]; + t3[0] |= s3[0]; + t3[1] |= s3[1]; + + /** + * md5 + */ + + u32x a = MD5M_A; + u32x b = MD5M_B; + u32x c = MD5M_C; + u32x d = MD5M_D; + + MD5_STEP (MD5_Fo, a, b, c, d, t0[0], MD5C00, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, t0[1], MD5C01, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, t0[2], MD5C02, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, t0[3], MD5C03, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, t1[0], MD5C04, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, t1[1], MD5C05, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, t1[2], MD5C06, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, t1[3], MD5C07, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, t2[0], MD5C08, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, t2[1], MD5C09, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, t2[2], MD5C0a, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, t2[3], MD5C0b, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, t3[0], MD5C0c, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, t3[1], MD5C0d, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, t3[2], MD5C0e, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, t3[3], MD5C0f, MD5S03); + + MD5_STEP (MD5_Go, a, b, c, d, t0[1], MD5C10, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, t1[2], MD5C11, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, t2[3], MD5C12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, t0[0], MD5C13, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, t1[1], MD5C14, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, t2[2], MD5C15, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, t3[3], MD5C16, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, t1[0], MD5C17, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, t2[1], MD5C18, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, t3[2], MD5C19, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, t0[3], MD5C1a, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, t2[0], MD5C1b, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, t3[1], MD5C1c, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, t0[2], MD5C1d, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, t1[3], MD5C1e, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, t3[0], MD5C1f, MD5S13); + + u32x t; + + MD5_STEP (MD5_H1, a, b, c, d, t1[1], MD5C20, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, t2[0], MD5C21, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, t2[3], MD5C22, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, t3[2], MD5C23, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, t0[1], MD5C24, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, t1[0], MD5C25, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, t1[3], MD5C26, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, t2[2], MD5C27, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, t3[1], MD5C28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, t0[0], MD5C29, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, t0[3], MD5C2a, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, t1[2], MD5C2b, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, t2[1], MD5C2c, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, t3[0], MD5C2d, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, t3[3], MD5C2e, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, t0[2], MD5C2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, t0[0], MD5C30, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, t1[3], MD5C31, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, t3[2], MD5C32, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, t1[1], MD5C33, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, t3[0], MD5C34, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, t0[3], MD5C35, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, t2[2], MD5C36, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, t0[1], MD5C37, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, t2[0], MD5C38, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, t3[3], MD5C39, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, t1[2], MD5C3a, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, t3[1], MD5C3b, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, t1[0], MD5C3c, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, t2[3], MD5C3d, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, t0[2], MD5C3e, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, t2[1], MD5C3f, MD5S33); + + a += MD5M_A; + b += MD5M_B; + c += MD5M_C; + d += MD5M_D; + + u32 test[2]; + + test[0] = a ^ ct_buf[0]; + test[1] = b ^ ct_buf[1]; + + if (sequence_buf == 0x01c0) + { + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf == 0x03c0) || (sequence_buf == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + } +} + +__kernel void m16100_m04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 w0[4]; + + w0[0] = pws[gid].i[ 0]; + w0[1] = pws[gid].i[ 1]; + w0[2] = pws[gid].i[ 2]; + w0[3] = pws[gid].i[ 3]; + + u32 w1[4]; + + w1[0] = 0; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + + u32 w2[4]; + + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + + u32 w3[4]; + + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = 0; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16100m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16100_m08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 w0[4]; + + w0[0] = pws[gid].i[ 0]; + w0[1] = pws[gid].i[ 1]; + w0[2] = pws[gid].i[ 2]; + w0[3] = pws[gid].i[ 3]; + + u32 w1[4]; + + w1[0] = pws[gid].i[ 4]; + w1[1] = pws[gid].i[ 5]; + w1[2] = pws[gid].i[ 6]; + w1[3] = pws[gid].i[ 7]; + + u32 w2[4]; + + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + + u32 w3[4]; + + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = 0; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16100m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16100_m16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 w0[4]; + + w0[0] = pws[gid].i[ 0]; + w0[1] = pws[gid].i[ 1]; + w0[2] = pws[gid].i[ 2]; + w0[3] = pws[gid].i[ 3]; + + u32 w1[4]; + + w1[0] = pws[gid].i[ 4]; + w1[1] = pws[gid].i[ 5]; + w1[2] = pws[gid].i[ 6]; + w1[3] = pws[gid].i[ 7]; + + u32 w2[4]; + + w2[0] = pws[gid].i[ 8]; + w2[1] = pws[gid].i[ 9]; + w2[2] = pws[gid].i[10]; + w2[3] = pws[gid].i[11]; + + u32 w3[4]; + + w3[0] = pws[gid].i[12]; + w3[1] = pws[gid].i[13]; + w3[2] = 0; + w3[3] = 0; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16100m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16100_s04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 w0[4]; + + w0[0] = pws[gid].i[ 0]; + w0[1] = pws[gid].i[ 1]; + w0[2] = pws[gid].i[ 2]; + w0[3] = pws[gid].i[ 3]; + + u32 w1[4]; + + w1[0] = 0; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + + u32 w2[4]; + + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + + u32 w3[4]; + + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = 0; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16100s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16100_s08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 w0[4]; + + w0[0] = pws[gid].i[ 0]; + w0[1] = pws[gid].i[ 1]; + w0[2] = pws[gid].i[ 2]; + w0[3] = pws[gid].i[ 3]; + + u32 w1[4]; + + w1[0] = pws[gid].i[ 4]; + w1[1] = pws[gid].i[ 5]; + w1[2] = pws[gid].i[ 6]; + w1[3] = pws[gid].i[ 7]; + + u32 w2[4]; + + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + + u32 w3[4]; + + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = 0; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16100s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16100_s16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 w0[4]; + + w0[0] = pws[gid].i[ 0]; + w0[1] = pws[gid].i[ 1]; + w0[2] = pws[gid].i[ 2]; + w0[3] = pws[gid].i[ 3]; + + u32 w1[4]; + + w1[0] = pws[gid].i[ 4]; + w1[1] = pws[gid].i[ 5]; + w1[2] = pws[gid].i[ 6]; + w1[3] = pws[gid].i[ 7]; + + u32 w2[4]; + + w2[0] = pws[gid].i[ 8]; + w2[1] = pws[gid].i[ 9]; + w2[2] = pws[gid].i[10]; + w2[3] = pws[gid].i[11]; + + u32 w3[4]; + + w3[0] = pws[gid].i[12]; + w3[1] = pws[gid].i[13]; + w3[2] = 0; + w3[3] = 0; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16100s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} diff --git a/OpenCL/m16100_a3.cl b/OpenCL/m16100_a3.cl new file mode 100644 index 000000000..3d8ef37b4 --- /dev/null +++ b/OpenCL/m16100_a3.cl @@ -0,0 +1,363 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_hash_md5.cl" + +__kernel void m16100_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32x w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = pws[gid].i[idx]; + } + + md5_ctx_t ctx0; + + md5_init (&ctx0); + + u32 session0[4]; + u32 session1[4]; + u32 session2[4]; + u32 session3[4]; + + session0[0] = esalt_bufs[digests_offset].session_buf[0]; + session0[1] = 0; + session0[2] = 0; + session0[3] = 0; + session1[0] = 0; + session1[1] = 0; + session1[2] = 0; + session1[3] = 0; + session2[0] = 0; + session2[1] = 0; + session2[2] = 0; + session2[3] = 0; + session3[0] = 0; + session3[1] = 0; + session3[2] = 0; + session3[3] = 0; + + md5_update_64 (&ctx0, session0, session1, session2, session3, 4); + + u32 ct_buf[2]; + + ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; + ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; + + u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 sequence_buf0 = esalt_bufs[digests_offset].sequence_buf[0]; + + /** + * loop + */ + + u32x w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + w[0] = w0; + + md5_ctx_vector_t ctx; + + md5_init_vector_from_scalar (&ctx, &ctx0); + + md5_update_vector (&ctx, w, pw_len); + + u32x sequence0[4]; + u32x sequence1[4]; + u32x sequence2[4]; + u32x sequence3[4]; + + sequence0[0] = sequence_buf0; + sequence0[1] = 0; + sequence0[2] = 0; + sequence0[3] = 0; + sequence1[0] = 0; + sequence1[1] = 0; + sequence1[2] = 0; + sequence1[3] = 0; + sequence2[0] = 0; + sequence2[1] = 0; + sequence2[2] = 0; + sequence2[3] = 0; + sequence3[0] = 0; + sequence3[1] = 0; + sequence3[2] = 0; + sequence3[3] = 0; + + md5_update_vector_64 (&ctx, sequence0, sequence1, sequence2, sequence3, 2); + + md5_final_vector (&ctx); + + u32 test[2]; + + test[0] = ctx.h[0] ^ ct_buf[0]; + test[1] = ctx.h[1] ^ ct_buf[1]; + + if (sequence_buf0 == 0x01c0) + { + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf0 == 0x03c0) || (sequence_buf0 == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + } +} + +__kernel void m16100_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const tacacs_plus_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32x w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = pws[gid].i[idx]; + } + + md5_ctx_t ctx0; + + md5_init (&ctx0); + + u32 session0[4]; + u32 session1[4]; + u32 session2[4]; + u32 session3[4]; + + session0[0] = esalt_bufs[digests_offset].session_buf[0]; + session0[1] = 0; + session0[2] = 0; + session0[3] = 0; + session1[0] = 0; + session1[1] = 0; + session1[2] = 0; + session1[3] = 0; + session2[0] = 0; + session2[1] = 0; + session2[2] = 0; + session2[3] = 0; + session3[0] = 0; + session3[1] = 0; + session3[2] = 0; + session3[3] = 0; + + md5_update_64 (&ctx0, session0, session1, session2, session3, 4); + + u32 ct_buf[2]; + + ct_buf[0] = esalt_bufs[digests_offset].ct_data_buf[0]; + ct_buf[1] = esalt_bufs[digests_offset].ct_data_buf[1]; + + u32 ct_len = esalt_bufs[digests_offset].ct_data_len; + + u32 sequence_buf0 = esalt_bufs[digests_offset].sequence_buf[0]; + + /** + * loop + */ + + u32x w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + w[0] = w0; + + md5_ctx_vector_t ctx; + + md5_init_vector_from_scalar (&ctx, &ctx0); + + md5_update_vector (&ctx, w, pw_len); + + u32x sequence0[4]; + u32x sequence1[4]; + u32x sequence2[4]; + u32x sequence3[4]; + + sequence0[0] = sequence_buf0; + sequence0[1] = 0; + sequence0[2] = 0; + sequence0[3] = 0; + sequence1[0] = 0; + sequence1[1] = 0; + sequence1[2] = 0; + sequence1[3] = 0; + sequence2[0] = 0; + sequence2[1] = 0; + sequence2[2] = 0; + sequence2[3] = 0; + sequence3[0] = 0; + sequence3[1] = 0; + sequence3[2] = 0; + sequence3[3] = 0; + + md5_update_vector_64 (&ctx, sequence0, sequence1, sequence2, sequence3, 2); + + md5_final_vector (&ctx); + + u32 test[2]; + + test[0] = ctx.h[0] ^ ct_buf[0]; + test[1] = ctx.h[1] ^ ct_buf[1]; + + if (sequence_buf0 == 0x01c0) + { + const u32 action = ((test[0] >> 0) & 0xff); + // can have more than predefined ones + // const u32 priv_lvl = ((test[0] >> 8) & 0xff); + const u32 authen_type = ((test[0] >> 16) & 0xff); + const u32 authen_service = ((test[0] >> 24) & 0xff); + const u32 user_len = ((test[1] >> 0) & 0xff); + const u32 port_len = ((test[1] >> 8) & 0xff); + const u32 rem_addr_len = ((test[1] >> 16) & 0xff); + const u32 data_len = ((test[1] >> 24) & 0xff); + + if (((action == 0x01) || (action == 0x02) || (action == 0x04)) + && ((authen_type >= 0x01) && (authen_type <= 0x06)) + && ((authen_service >= 0x00) && (authen_service <= 0x09)) + && ((8 + user_len + port_len + rem_addr_len + data_len) == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else if ((sequence_buf0 == 0x03c0) || (sequence_buf0 == 0x05c0)) + { + const u32 msg_len = ((test[0] >> 0) & 0xff) << 8 + | ((test[0] >> 8) & 0xff) << 0; + const u32 data_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 flags = ((test[1] >> 0) & 0xff); + + if (((5 + msg_len) == ct_len) + && (data_len == 0) + && (flags == 0)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + else + { + const u32 status = ((test[0] >> 0) & 0xff); + const u32 flags = ((test[0] >> 8) & 0xff); + const u32 msg_len = ((test[0] >> 16) & 0xff) << 8 + | ((test[0] >> 24) & 0xff) << 0; + const u32 data_len = ((test[1] >> 0) & 0xff) << 8 + | ((test[1] >> 8) & 0xff) << 0; + + if (((status >= 0x01 && status <= 0x07) || status == 0x21) + && (flags == 0x01 || flags == 0x00) + && (6 + msg_len + data_len == ct_len)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } + } +} diff --git a/OpenCL/m16200.cl b/OpenCL/m16200.cl new file mode 100644 index 000000000..dd5614942 --- /dev/null +++ b/OpenCL/m16200.cl @@ -0,0 +1,382 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_simd.cl" +#include "inc_hash_sha256.cl" +#include "inc_cipher_aes.cl" + +#define COMPARE_S "inc_comp_single.cl" +#define COMPARE_M "inc_comp_multi.cl" + +void hmac_sha256_run_V (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[8], u32x opad[8], u32x digest[8]) +{ + digest[0] = ipad[0]; + digest[1] = ipad[1]; + digest[2] = ipad[2]; + digest[3] = ipad[3]; + digest[4] = ipad[4]; + digest[5] = ipad[5]; + digest[6] = ipad[6]; + digest[7] = ipad[7]; + + sha256_transform_vector (w0, w1, w2, w3, digest); + + w0[0] = digest[0]; + w0[1] = digest[1]; + w0[2] = digest[2]; + w0[3] = digest[3]; + w1[0] = digest[4]; + w1[1] = digest[5]; + w1[2] = digest[6]; + w1[3] = digest[7]; + w2[0] = 0x80000000; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = (64 + 32) * 8; + + digest[0] = opad[0]; + digest[1] = opad[1]; + digest[2] = opad[2]; + digest[3] = opad[3]; + digest[4] = opad[4]; + digest[5] = opad[5]; + digest[6] = opad[6]; + digest[7] = opad[7]; + + sha256_transform_vector (w0, w1, w2, w3, digest); +} + +__kernel void m16200_init (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global apple_secure_notes_tmp_t *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const apple_secure_notes_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + sha256_hmac_ctx_t sha256_hmac_ctx; + + sha256_hmac_init_global_swap (&sha256_hmac_ctx, pws[gid].i, pws[gid].pw_len); + + tmps[gid].ipad[0] = sha256_hmac_ctx.ipad.h[0]; + tmps[gid].ipad[1] = sha256_hmac_ctx.ipad.h[1]; + tmps[gid].ipad[2] = sha256_hmac_ctx.ipad.h[2]; + tmps[gid].ipad[3] = sha256_hmac_ctx.ipad.h[3]; + tmps[gid].ipad[4] = sha256_hmac_ctx.ipad.h[4]; + tmps[gid].ipad[5] = sha256_hmac_ctx.ipad.h[5]; + tmps[gid].ipad[6] = sha256_hmac_ctx.ipad.h[6]; + tmps[gid].ipad[7] = sha256_hmac_ctx.ipad.h[7]; + + tmps[gid].opad[0] = sha256_hmac_ctx.opad.h[0]; + tmps[gid].opad[1] = sha256_hmac_ctx.opad.h[1]; + tmps[gid].opad[2] = sha256_hmac_ctx.opad.h[2]; + tmps[gid].opad[3] = sha256_hmac_ctx.opad.h[3]; + tmps[gid].opad[4] = sha256_hmac_ctx.opad.h[4]; + tmps[gid].opad[5] = sha256_hmac_ctx.opad.h[5]; + tmps[gid].opad[6] = sha256_hmac_ctx.opad.h[6]; + tmps[gid].opad[7] = sha256_hmac_ctx.opad.h[7]; + + sha256_hmac_update_global_swap (&sha256_hmac_ctx, esalt_bufs[digests_offset].ZCRYPTOSALT, 16); + + for (u32 i = 0, j = 1; i < 8; i += 8, j += 1) + { + sha256_hmac_ctx_t sha256_hmac_ctx2 = sha256_hmac_ctx; + + u32 w0[4]; + u32 w1[4]; + u32 w2[4]; + u32 w3[4]; + + w0[0] = j; + w0[1] = 0; + w0[2] = 0; + w0[3] = 0; + w1[0] = 0; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = 0; + + sha256_hmac_update_64 (&sha256_hmac_ctx2, w0, w1, w2, w3, 4); + + sha256_hmac_final (&sha256_hmac_ctx2); + + tmps[gid].dgst[i + 0] = sha256_hmac_ctx2.opad.h[0]; + tmps[gid].dgst[i + 1] = sha256_hmac_ctx2.opad.h[1]; + tmps[gid].dgst[i + 2] = sha256_hmac_ctx2.opad.h[2]; + tmps[gid].dgst[i + 3] = sha256_hmac_ctx2.opad.h[3]; + tmps[gid].dgst[i + 4] = sha256_hmac_ctx2.opad.h[4]; + tmps[gid].dgst[i + 5] = sha256_hmac_ctx2.opad.h[5]; + tmps[gid].dgst[i + 6] = sha256_hmac_ctx2.opad.h[6]; + tmps[gid].dgst[i + 7] = sha256_hmac_ctx2.opad.h[7]; + + tmps[gid].out[i + 0] = tmps[gid].dgst[i + 0]; + tmps[gid].out[i + 1] = tmps[gid].dgst[i + 1]; + tmps[gid].out[i + 2] = tmps[gid].dgst[i + 2]; + tmps[gid].out[i + 3] = tmps[gid].dgst[i + 3]; + tmps[gid].out[i + 4] = tmps[gid].dgst[i + 4]; + tmps[gid].out[i + 5] = tmps[gid].dgst[i + 5]; + tmps[gid].out[i + 6] = tmps[gid].dgst[i + 6]; + tmps[gid].out[i + 7] = tmps[gid].dgst[i + 7]; + } +} + +__kernel void m16200_loop (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global apple_secure_notes_tmp_t *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const apple_secure_notes_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + const u64 gid = get_global_id (0); + + if ((gid * VECT_SIZE) >= gid_max) return; + + u32x ipad[8]; + u32x opad[8]; + + ipad[0] = packv (tmps, ipad, gid, 0); + ipad[1] = packv (tmps, ipad, gid, 1); + ipad[2] = packv (tmps, ipad, gid, 2); + ipad[3] = packv (tmps, ipad, gid, 3); + ipad[4] = packv (tmps, ipad, gid, 4); + ipad[5] = packv (tmps, ipad, gid, 5); + ipad[6] = packv (tmps, ipad, gid, 6); + ipad[7] = packv (tmps, ipad, gid, 7); + + opad[0] = packv (tmps, opad, gid, 0); + opad[1] = packv (tmps, opad, gid, 1); + opad[2] = packv (tmps, opad, gid, 2); + opad[3] = packv (tmps, opad, gid, 3); + opad[4] = packv (tmps, opad, gid, 4); + opad[5] = packv (tmps, opad, gid, 5); + opad[6] = packv (tmps, opad, gid, 6); + opad[7] = packv (tmps, opad, gid, 7); + + for (u32 i = 0; i < 8; i += 8) + { + u32x dgst[8]; + u32x out[8]; + + dgst[0] = packv (tmps, dgst, gid, i + 0); + dgst[1] = packv (tmps, dgst, gid, i + 1); + dgst[2] = packv (tmps, dgst, gid, i + 2); + dgst[3] = packv (tmps, dgst, gid, i + 3); + dgst[4] = packv (tmps, dgst, gid, i + 4); + dgst[5] = packv (tmps, dgst, gid, i + 5); + dgst[6] = packv (tmps, dgst, gid, i + 6); + dgst[7] = packv (tmps, dgst, gid, i + 7); + + out[0] = packv (tmps, out, gid, i + 0); + out[1] = packv (tmps, out, gid, i + 1); + out[2] = packv (tmps, out, gid, i + 2); + out[3] = packv (tmps, out, gid, i + 3); + out[4] = packv (tmps, out, gid, i + 4); + out[5] = packv (tmps, out, gid, i + 5); + out[6] = packv (tmps, out, gid, i + 6); + out[7] = packv (tmps, out, gid, i + 7); + + for (u32 j = 0; j < loop_cnt; j++) + { + u32x w0[4]; + u32x w1[4]; + u32x w2[4]; + u32x w3[4]; + + w0[0] = dgst[0]; + w0[1] = dgst[1]; + w0[2] = dgst[2]; + w0[3] = dgst[3]; + w1[0] = dgst[4]; + w1[1] = dgst[5]; + w1[2] = dgst[6]; + w1[3] = dgst[7]; + w2[0] = 0x80000000; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = (64 + 32) * 8; + + hmac_sha256_run_V (w0, w1, w2, w3, ipad, opad, dgst); + + out[0] ^= dgst[0]; + out[1] ^= dgst[1]; + out[2] ^= dgst[2]; + out[3] ^= dgst[3]; + out[4] ^= dgst[4]; + out[5] ^= dgst[5]; + out[6] ^= dgst[6]; + out[7] ^= dgst[7]; + } + + unpackv (tmps, dgst, gid, i + 0, dgst[0]); + unpackv (tmps, dgst, gid, i + 1, dgst[1]); + unpackv (tmps, dgst, gid, i + 2, dgst[2]); + unpackv (tmps, dgst, gid, i + 3, dgst[3]); + unpackv (tmps, dgst, gid, i + 4, dgst[4]); + unpackv (tmps, dgst, gid, i + 5, dgst[5]); + unpackv (tmps, dgst, gid, i + 6, dgst[6]); + unpackv (tmps, dgst, gid, i + 7, dgst[7]); + + unpackv (tmps, out, gid, i + 0, out[0]); + unpackv (tmps, out, gid, i + 1, out[1]); + unpackv (tmps, out, gid, i + 2, out[2]); + unpackv (tmps, out, gid, i + 3, out[3]); + unpackv (tmps, out, gid, i + 4, out[4]); + unpackv (tmps, out, gid, i + 5, out[5]); + unpackv (tmps, out, gid, i + 6, out[6]); + unpackv (tmps, out, gid, i + 7, out[7]); + } +} + +__kernel void m16200_comp (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global apple_secure_notes_tmp_t *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const apple_secure_notes_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + u32 ukey[4]; + + ukey[0] = tmps[gid].out[0]; + ukey[1] = tmps[gid].out[1]; + ukey[2] = tmps[gid].out[2]; + ukey[3] = tmps[gid].out[3]; + + #define KEYLEN 44 + + u32 ks[KEYLEN]; + + AES128_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + // unwrap and compare + + u32 A[2]; + u32 P1[2]; + u32 P2[2]; + + A[0] = swap32_S (esalt_bufs[digests_offset].ZCRYPTOWRAPPEDKEY[0]); + A[1] = swap32_S (esalt_bufs[digests_offset].ZCRYPTOWRAPPEDKEY[1]); + P1[0] = swap32_S (esalt_bufs[digests_offset].ZCRYPTOWRAPPEDKEY[2]); + P1[1] = swap32_S (esalt_bufs[digests_offset].ZCRYPTOWRAPPEDKEY[3]); + P2[0] = swap32_S (esalt_bufs[digests_offset].ZCRYPTOWRAPPEDKEY[4]); + P2[1] = swap32_S (esalt_bufs[digests_offset].ZCRYPTOWRAPPEDKEY[5]); + + for (int j = 5; j >= 0; j--) + { + const u32 it1 = 2 * j + 1; + const u32 it2 = 2 * j + 2; + + u32 in[4]; + u32 out[4]; + + // N = 2 + + in[0] = A[0]; + in[1] = A[1] ^ it2; + in[2] = P2[0]; + in[3] = P2[1]; + + AES128_decrypt (ks, in, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + A[0] = out[0]; + A[1] = out[1]; + P2[0] = out[2]; + P2[1] = out[3]; + + // N = 1 + + in[0] = A[0]; + in[1] = A[1] ^ it1; + in[2] = P1[0]; + in[3] = P1[1]; + + AES128_decrypt (ks, in, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + A[0] = out[0]; + A[1] = out[1]; + P1[0] = out[2]; + P1[1] = out[3]; + } + + if ((A[0] == 0xa6a6a6a6) + && (A[1] == 0xa6a6a6a6)) + { + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, 0); + } + } +} diff --git a/OpenCL/m16300.cl b/OpenCL/m16300.cl new file mode 100644 index 000000000..c0a5de79a --- /dev/null +++ b/OpenCL/m16300.cl @@ -0,0 +1,757 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_simd.cl" +#include "inc_hash_sha256.cl" +#include "inc_cipher_aes.cl" + +#define COMPARE_S "inc_comp_single.cl" +#define COMPARE_M "inc_comp_multi.cl" + +__constant static u64a keccakf_rndc[24] = +{ + 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, + 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, + 0x8000000080008081, 0x8000000000008009, 0x000000000000008a, + 0x0000000000000088, 0x0000000080008009, 0x000000008000000a, + 0x000000008000808b, 0x800000000000008b, 0x8000000000008089, + 0x8000000000008003, 0x8000000000008002, 0x8000000000000080, + 0x000000000000800a, 0x800000008000000a, 0x8000000080008081, + 0x8000000000008080, 0x0000000080000001, 0x8000000080008008 +}; + +#ifndef KECCAK_ROUNDS +#define KECCAK_ROUNDS 24 +#endif + +#define Theta1(s) (st[0 + s] ^ st[5 + s] ^ st[10 + s] ^ st[15 + s] ^ st[20 + s]) + +#define Theta2(s) \ +{ \ + st[ 0 + s] ^= t; \ + st[ 5 + s] ^= t; \ + st[10 + s] ^= t; \ + st[15 + s] ^= t; \ + st[20 + s] ^= t; \ +} + +#define Rho_Pi(s) \ +{ \ + u32 j = keccakf_piln[s]; \ + u32 k = keccakf_rotc[s]; \ + bc0 = st[j]; \ + st[j] = rotl64_S (t, k); \ + t = bc0; \ +} + +#define Chi(s) \ +{ \ + bc0 = st[0 + s]; \ + bc1 = st[1 + s]; \ + bc2 = st[2 + s]; \ + bc3 = st[3 + s]; \ + bc4 = st[4 + s]; \ + st[0 + s] ^= ~bc1 & bc2; \ + st[1 + s] ^= ~bc2 & bc3; \ + st[2 + s] ^= ~bc3 & bc4; \ + st[3 + s] ^= ~bc4 & bc0; \ + st[4 + s] ^= ~bc0 & bc1; \ +} + +void keccak_transform_S (u64 st[25]) +{ + const u8 keccakf_rotc[24] = + { + 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2, 14, + 27, 41, 56, 8, 25, 43, 62, 18, 39, 61, 20, 44 + }; + + const u8 keccakf_piln[24] = + { + 10, 7, 11, 17, 18, 3, 5, 16, 8, 21, 24, 4, + 15, 23, 19, 13, 12, 2, 20, 14, 22, 9, 6, 1 + }; + + /** + * Keccak + */ + + int round; + + for (round = 0; round < KECCAK_ROUNDS; round++) + { + // Theta + + u64 bc0 = Theta1 (0); + u64 bc1 = Theta1 (1); + u64 bc2 = Theta1 (2); + u64 bc3 = Theta1 (3); + u64 bc4 = Theta1 (4); + + u64 t; + + t = bc4 ^ rotl64_S (bc1, 1); Theta2 (0); + t = bc0 ^ rotl64_S (bc2, 1); Theta2 (1); + t = bc1 ^ rotl64_S (bc3, 1); Theta2 (2); + t = bc2 ^ rotl64_S (bc4, 1); Theta2 (3); + t = bc3 ^ rotl64_S (bc0, 1); Theta2 (4); + + // Rho Pi + + t = st[1]; + + Rho_Pi (0); + Rho_Pi (1); + Rho_Pi (2); + Rho_Pi (3); + Rho_Pi (4); + Rho_Pi (5); + Rho_Pi (6); + Rho_Pi (7); + Rho_Pi (8); + Rho_Pi (9); + Rho_Pi (10); + Rho_Pi (11); + Rho_Pi (12); + Rho_Pi (13); + Rho_Pi (14); + Rho_Pi (15); + Rho_Pi (16); + Rho_Pi (17); + Rho_Pi (18); + Rho_Pi (19); + Rho_Pi (20); + Rho_Pi (21); + Rho_Pi (22); + Rho_Pi (23); + + // Chi + + Chi (0); + Chi (5); + Chi (10); + Chi (15); + Chi (20); + + // Iota + + st[0] ^= keccakf_rndc[round]; + } +} + +void hmac_sha256_run_V (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[8], u32x opad[8], u32x digest[8]) +{ + digest[0] = ipad[0]; + digest[1] = ipad[1]; + digest[2] = ipad[2]; + digest[3] = ipad[3]; + digest[4] = ipad[4]; + digest[5] = ipad[5]; + digest[6] = ipad[6]; + digest[7] = ipad[7]; + + sha256_transform_vector (w0, w1, w2, w3, digest); + + w0[0] = digest[0]; + w0[1] = digest[1]; + w0[2] = digest[2]; + w0[3] = digest[3]; + w1[0] = digest[4]; + w1[1] = digest[5]; + w1[2] = digest[6]; + w1[3] = digest[7]; + w2[0] = 0x80000000; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = (64 + 32) * 8; + + digest[0] = opad[0]; + digest[1] = opad[1]; + digest[2] = opad[2]; + digest[3] = opad[3]; + digest[4] = opad[4]; + digest[5] = opad[5]; + digest[6] = opad[6]; + digest[7] = opad[7]; + + sha256_transform_vector (w0, w1, w2, w3, digest); +} + +__kernel void m16300_init (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global pbkdf2_sha256_tmp_t *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const ethereum_presale_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + sha256_hmac_ctx_t sha256_hmac_ctx; + + sha256_hmac_init_global_swap (&sha256_hmac_ctx, pws[gid].i, pws[gid].pw_len); + + tmps[gid].ipad[0] = sha256_hmac_ctx.ipad.h[0]; + tmps[gid].ipad[1] = sha256_hmac_ctx.ipad.h[1]; + tmps[gid].ipad[2] = sha256_hmac_ctx.ipad.h[2]; + tmps[gid].ipad[3] = sha256_hmac_ctx.ipad.h[3]; + tmps[gid].ipad[4] = sha256_hmac_ctx.ipad.h[4]; + tmps[gid].ipad[5] = sha256_hmac_ctx.ipad.h[5]; + tmps[gid].ipad[6] = sha256_hmac_ctx.ipad.h[6]; + tmps[gid].ipad[7] = sha256_hmac_ctx.ipad.h[7]; + + tmps[gid].opad[0] = sha256_hmac_ctx.opad.h[0]; + tmps[gid].opad[1] = sha256_hmac_ctx.opad.h[1]; + tmps[gid].opad[2] = sha256_hmac_ctx.opad.h[2]; + tmps[gid].opad[3] = sha256_hmac_ctx.opad.h[3]; + tmps[gid].opad[4] = sha256_hmac_ctx.opad.h[4]; + tmps[gid].opad[5] = sha256_hmac_ctx.opad.h[5]; + tmps[gid].opad[6] = sha256_hmac_ctx.opad.h[6]; + tmps[gid].opad[7] = sha256_hmac_ctx.opad.h[7]; + + sha256_hmac_update_global_swap (&sha256_hmac_ctx, pws[gid].i, pws[gid].pw_len); + + for (u32 i = 0, j = 1; i < 8; i += 8, j += 1) + { + sha256_hmac_ctx_t sha256_hmac_ctx2 = sha256_hmac_ctx; + + u32 w0[4]; + u32 w1[4]; + u32 w2[4]; + u32 w3[4]; + + w0[0] = j; + w0[1] = 0; + w0[2] = 0; + w0[3] = 0; + w1[0] = 0; + w1[1] = 0; + w1[2] = 0; + w1[3] = 0; + w2[0] = 0; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = 0; + + sha256_hmac_update_64 (&sha256_hmac_ctx2, w0, w1, w2, w3, 4); + + sha256_hmac_final (&sha256_hmac_ctx2); + + tmps[gid].dgst[i + 0] = sha256_hmac_ctx2.opad.h[0]; + tmps[gid].dgst[i + 1] = sha256_hmac_ctx2.opad.h[1]; + tmps[gid].dgst[i + 2] = sha256_hmac_ctx2.opad.h[2]; + tmps[gid].dgst[i + 3] = sha256_hmac_ctx2.opad.h[3]; + tmps[gid].dgst[i + 4] = sha256_hmac_ctx2.opad.h[4]; + tmps[gid].dgst[i + 5] = sha256_hmac_ctx2.opad.h[5]; + tmps[gid].dgst[i + 6] = sha256_hmac_ctx2.opad.h[6]; + tmps[gid].dgst[i + 7] = sha256_hmac_ctx2.opad.h[7]; + + tmps[gid].out[i + 0] = tmps[gid].dgst[i + 0]; + tmps[gid].out[i + 1] = tmps[gid].dgst[i + 1]; + tmps[gid].out[i + 2] = tmps[gid].dgst[i + 2]; + tmps[gid].out[i + 3] = tmps[gid].dgst[i + 3]; + tmps[gid].out[i + 4] = tmps[gid].dgst[i + 4]; + tmps[gid].out[i + 5] = tmps[gid].dgst[i + 5]; + tmps[gid].out[i + 6] = tmps[gid].dgst[i + 6]; + tmps[gid].out[i + 7] = tmps[gid].dgst[i + 7]; + } +} + +__kernel void m16300_loop (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global pbkdf2_sha256_tmp_t *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const ethereum_presale_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + const u64 gid = get_global_id (0); + + if ((gid * VECT_SIZE) >= gid_max) return; + + u32x ipad[8]; + u32x opad[8]; + + ipad[0] = packv (tmps, ipad, gid, 0); + ipad[1] = packv (tmps, ipad, gid, 1); + ipad[2] = packv (tmps, ipad, gid, 2); + ipad[3] = packv (tmps, ipad, gid, 3); + ipad[4] = packv (tmps, ipad, gid, 4); + ipad[5] = packv (tmps, ipad, gid, 5); + ipad[6] = packv (tmps, ipad, gid, 6); + ipad[7] = packv (tmps, ipad, gid, 7); + + opad[0] = packv (tmps, opad, gid, 0); + opad[1] = packv (tmps, opad, gid, 1); + opad[2] = packv (tmps, opad, gid, 2); + opad[3] = packv (tmps, opad, gid, 3); + opad[4] = packv (tmps, opad, gid, 4); + opad[5] = packv (tmps, opad, gid, 5); + opad[6] = packv (tmps, opad, gid, 6); + opad[7] = packv (tmps, opad, gid, 7); + + for (u32 i = 0; i < 8; i += 8) + { + u32x dgst[8]; + u32x out[8]; + + dgst[0] = packv (tmps, dgst, gid, i + 0); + dgst[1] = packv (tmps, dgst, gid, i + 1); + dgst[2] = packv (tmps, dgst, gid, i + 2); + dgst[3] = packv (tmps, dgst, gid, i + 3); + dgst[4] = packv (tmps, dgst, gid, i + 4); + dgst[5] = packv (tmps, dgst, gid, i + 5); + dgst[6] = packv (tmps, dgst, gid, i + 6); + dgst[7] = packv (tmps, dgst, gid, i + 7); + + out[0] = packv (tmps, out, gid, i + 0); + out[1] = packv (tmps, out, gid, i + 1); + out[2] = packv (tmps, out, gid, i + 2); + out[3] = packv (tmps, out, gid, i + 3); + out[4] = packv (tmps, out, gid, i + 4); + out[5] = packv (tmps, out, gid, i + 5); + out[6] = packv (tmps, out, gid, i + 6); + out[7] = packv (tmps, out, gid, i + 7); + + for (u32 j = 0; j < loop_cnt; j++) + { + u32x w0[4]; + u32x w1[4]; + u32x w2[4]; + u32x w3[4]; + + w0[0] = dgst[0]; + w0[1] = dgst[1]; + w0[2] = dgst[2]; + w0[3] = dgst[3]; + w1[0] = dgst[4]; + w1[1] = dgst[5]; + w1[2] = dgst[6]; + w1[3] = dgst[7]; + w2[0] = 0x80000000; + w2[1] = 0; + w2[2] = 0; + w2[3] = 0; + w3[0] = 0; + w3[1] = 0; + w3[2] = 0; + w3[3] = (64 + 32) * 8; + + hmac_sha256_run_V (w0, w1, w2, w3, ipad, opad, dgst); + + out[0] ^= dgst[0]; + out[1] ^= dgst[1]; + out[2] ^= dgst[2]; + out[3] ^= dgst[3]; + out[4] ^= dgst[4]; + out[5] ^= dgst[5]; + out[6] ^= dgst[6]; + out[7] ^= dgst[7]; + } + + unpackv (tmps, dgst, gid, i + 0, dgst[0]); + unpackv (tmps, dgst, gid, i + 1, dgst[1]); + unpackv (tmps, dgst, gid, i + 2, dgst[2]); + unpackv (tmps, dgst, gid, i + 3, dgst[3]); + unpackv (tmps, dgst, gid, i + 4, dgst[4]); + unpackv (tmps, dgst, gid, i + 5, dgst[5]); + unpackv (tmps, dgst, gid, i + 6, dgst[6]); + unpackv (tmps, dgst, gid, i + 7, dgst[7]); + + unpackv (tmps, out, gid, i + 0, out[0]); + unpackv (tmps, out, gid, i + 1, out[1]); + unpackv (tmps, out, gid, i + 2, out[2]); + unpackv (tmps, out, gid, i + 3, out[3]); + unpackv (tmps, out, gid, i + 4, out[4]); + unpackv (tmps, out, gid, i + 5, out[5]); + unpackv (tmps, out, gid, i + 6, out[6]); + unpackv (tmps, out, gid, i + 7, out[7]); + } +} + +__kernel void m16300_comp (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global pbkdf2_sha256_tmp_t *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const ethereum_presale_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /* + * AES-CBC-128 decrypt + */ + + /** + * aes decrypt key + */ + + u32 ukey[4]; + + ukey[0] = tmps[gid].out[0]; + ukey[1] = tmps[gid].out[1]; + ukey[2] = tmps[gid].out[2]; + ukey[3] = tmps[gid].out[3]; + + /** + * aes init + */ + + #define KEYLEN 60 + + u32 ks[KEYLEN]; + + AES128_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 iv[4]; + + iv[0] = esalt_bufs[digests_offset].iv[0]; + iv[1] = esalt_bufs[digests_offset].iv[1]; + iv[2] = esalt_bufs[digests_offset].iv[2]; + iv[3] = esalt_bufs[digests_offset].iv[3]; + + u32 a = iv[0]; + u32 b = iv[1]; + u32 c = iv[2]; + u32 d = iv[3]; + + u32 enc_seed_len = esalt_bufs[digests_offset].enc_seed_len; + + u64 seed[76 + 1]; // we need the + 1 to add the final \x02 + + u32 loop_idx = 0; + u32 seed_idx = 0; + + for (loop_idx = 0, seed_idx = 0; loop_idx < enc_seed_len / 4; loop_idx += 4, seed_idx += 2) + { + u32 data[4]; + + data[0] = esalt_bufs[digests_offset].enc_seed[loop_idx + 0]; + data[1] = esalt_bufs[digests_offset].enc_seed[loop_idx + 1]; + data[2] = esalt_bufs[digests_offset].enc_seed[loop_idx + 2]; + data[3] = esalt_bufs[digests_offset].enc_seed[loop_idx + 3]; + + u32 out[4]; + + AES128_decrypt (ks, data, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + a ^= out[0]; + b ^= out[1]; + c ^= out[2]; + d ^= out[3]; + + a = swap32_S (a); + b = swap32_S (b); + c = swap32_S (c); + d = swap32_S (d); + + seed[seed_idx + 0] = hl32_to_64_S (b, a); + seed[seed_idx + 1] = hl32_to_64_S (d, c); + + a = data[0]; + b = data[1]; + c = data[2]; + d = data[3]; + } + + /* + * check padding + */ + + u32 padding_len = h32_from_64_S (seed[seed_idx - 1]) >> 24; + + // the ethereum algorithm adds a \x02 after the seed i.e. keccak ($seed . "\x02") + // and the keccak adds an additional \x01 after the whole input + + u32 final_len = enc_seed_len - padding_len + 2; + + switch (padding_len) + { + case 16: + if (((seed[seed_idx - 1] & 0xffffffffffffffff) != 0x1010101010101010) || + ((seed[seed_idx - 2] & 0xffffffffffffffff) != 0x1010101010101010)) + { + return; + } + + seed[seed_idx - 2] = 0x0102; + seed[seed_idx - 1] = 0; + break; + + case 15: + if (((seed[seed_idx - 1] & 0xffffffffffffffff) != 0x0f0f0f0f0f0f0f0f) || + ((seed[seed_idx - 2] & 0xffffffffffffff00) != 0x0f0f0f0f0f0f0f00)) + { + return; + } + + seed[seed_idx - 2] &= 0x00000000000000ff; + seed[seed_idx - 2] |= 0x0000000000010200; + seed[seed_idx - 1] = 0; + break; + + case 14: + if (((seed[seed_idx - 1] & 0xffffffffffffffff) != 0x0e0e0e0e0e0e0e0e) || + ((seed[seed_idx - 2] & 0xffffffffffff0000) != 0x0e0e0e0e0e0e0000)) + { + return; + } + + seed[seed_idx - 2] &= 0x000000000000ffff; + seed[seed_idx - 2] |= 0x0000000001020000; + seed[seed_idx - 1] = 0; + break; + + case 13: + if (((seed[seed_idx - 1] & 0xffffffffffffffff) != 0x0d0d0d0d0d0d0d0d) || + ((seed[seed_idx - 2] & 0xffffffffff000000) != 0x0d0d0d0d0d000000)) + { + return; + } + + seed[seed_idx - 2] &= 0x0000000000ffffff; + seed[seed_idx - 2] |= 0x0000000102000000; + seed[seed_idx - 1] = 0; + break; + + case 12: + if (((seed[seed_idx - 1] & 0xffffffffffffffff) != 0x0c0c0c0c0c0c0c0c) || + ((seed[seed_idx - 2] & 0xffffffff00000000) != 0x0c0c0c0c00000000)) + { + return; + } + + seed[seed_idx - 2] &= 0x00000000ffffffff; + seed[seed_idx - 2] |= 0x0000010200000000; + seed[seed_idx - 1] = 0; + break; + + case 11: + if (((seed[seed_idx - 1] & 0xffffffffffffffff) != 0x0b0b0b0b0b0b0b0b) || + ((seed[seed_idx - 2] & 0xffffff0000000000) != 0x0b0b0b0000000000)) + { + return; + } + + seed[seed_idx - 2] &= 0x000000ffffffffff; + seed[seed_idx - 2] |= 0x0001020000000000; + seed[seed_idx - 1] = 0; + break; + + case 10: + if (((seed[seed_idx - 1] & 0xffffffffffffffff) != 0x0a0a0a0a0a0a0a0a) || + ((seed[seed_idx - 2] & 0xffff000000000000) != 0x0a0a000000000000)) + { + return; + } + + seed[seed_idx - 2] &= 0x0000ffffffffffff; + seed[seed_idx - 2] |= 0x0102000000000000; + seed[seed_idx - 1] = 0; + break; + + case 9: + if (((seed[seed_idx - 1] & 0xffffffffffffffff) != 0x0909090909090909) || + ((seed[seed_idx - 2] & 0xff00000000000000) != 0x0900000000000000)) + { + return; + } + + seed[seed_idx - 2] &= 0x00ffffffffffffff; + seed[seed_idx - 2] |= 0x0200000000000000; + seed[seed_idx - 1] = 0x01; + break; + + case 8: + if (((seed[seed_idx - 1] & 0xffffffffffffffff) != 0x0808080808080808) || + ((seed[seed_idx - 2] & 0x0000000000000000) != 0x0000000000000000)) + { + return; + } + + seed[seed_idx - 1] = 0x0102; + break; + + case 7: + if (((seed[seed_idx - 1] & 0xffffffffffffff00) != 0x0707070707070700) || + ((seed[seed_idx - 2] & 0x0000000000000000) != 0x0000000000000000)) + { + return; + } + + seed[seed_idx - 1] &= 0x00000000000000ff; + seed[seed_idx - 1] |= 0x0000000000010200; + break; + + case 6: + if (((seed[seed_idx - 1] & 0xffffffffffff0000) != 0x0606060606060000) || + ((seed[seed_idx - 2] & 0x0000000000000000) != 0x0000000000000000)) + { + return; + } + + seed[seed_idx - 1] &= 0x000000000000ffff; + seed[seed_idx - 1] |= 0x0000000001020000; + break; + + case 5: + if (((seed[seed_idx - 1] & 0xffffffffff000000) != 0x0505050505000000) || + ((seed[seed_idx - 2] & 0x0000000000000000) != 0x0000000000000000)) + { + return; + } + + seed[seed_idx - 1] &= 0x0000000000ffffff; + seed[seed_idx - 1] |= 0x0000000102000000; + break; + + case 4: + if (((seed[seed_idx - 1] & 0xffffffff00000000) != 0x0404040400000000) || + ((seed[seed_idx - 2] & 0x0000000000000000) != 0x0000000000000000)) + { + return; + } + + seed[seed_idx - 1] &= 0x00000000ffffffff; + seed[seed_idx - 1] |= 0x0000010200000000; + break; + + case 3: + if (((seed[seed_idx - 1] & 0xffffff0000000000) != 0x0303030000000000) || + ((seed[seed_idx - 2] & 0x0000000000000000) != 0x0000000000000000)) + { + return; + } + + seed[seed_idx - 1] &= 0x000000ffffffffff; + seed[seed_idx - 1] |= 0x0001020000000000; + break; + + case 2: + if (((seed[seed_idx - 1] & 0xffff000000000000) != 0x0202000000000000) || + ((seed[seed_idx - 2] & 0x0000000000000000) != 0x0000000000000000)) + { + return; + } + + seed[seed_idx - 1] &= 0x0000ffffffffffff; + seed[seed_idx - 1] |= 0x0102000000000000; + break; + + case 1: + if (((seed[seed_idx - 1] & 0xff00000000000000) != 0x0100000000000000) || + ((seed[seed_idx - 2] & 0x0000000000000000) != 0x0000000000000000)) + { + return; + } + + seed[seed_idx - 1] &= 0x00ffffffffffffff; + seed[seed_idx - 1] |= 0x0200000000000000; + seed[seed_idx - 0] = 0x01; + break; + + default: + return; + break; + } + + /** + * keccak + */ + + u64 st[25] = { 0 }; + + u32 keccak_idx = 0; + + for (loop_idx = 0, seed_idx = 0, keccak_idx = 0; loop_idx < final_len; loop_idx += 8, seed_idx++, keccak_idx++) + { + if (keccak_idx == 17) // or just: keccak_idx > 16 + { + keccak_transform_S (st); + + keccak_idx = 0; + } + + st[keccak_idx] ^= seed[seed_idx]; + } + + // final: + + st[16] ^= 0x8000000000000000; + + keccak_transform_S (st); + + const u32 r0 = l32_from_64_S (st[0]); + const u32 r1 = h32_from_64_S (st[0]); + const u32 r2 = l32_from_64_S (st[1]); + const u32 r3 = h32_from_64_S (st[1]); + + #define il_pos 0 + + #include COMPARE_M +} diff --git a/OpenCL/m16400_a0-optimized.cl b/OpenCL/m16400_a0-optimized.cl new file mode 100644 index 000000000..75d050ac4 --- /dev/null +++ b/OpenCL/m16400_a0-optimized.cl @@ -0,0 +1,324 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_rp_optimized.h" +#include "inc_rp_optimized.cl" +#include "inc_simd.cl" + +__kernel void m16400_m04 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 pw_buf0[4]; + u32 pw_buf1[4]; + + pw_buf0[0] = pws[gid].i[0]; + pw_buf0[1] = pws[gid].i[1]; + pw_buf0[2] = pws[gid].i[2]; + pw_buf0[3] = pws[gid].i[3]; + pw_buf1[0] = pws[gid].i[4]; + pw_buf1[1] = pws[gid].i[5]; + pw_buf1[2] = pws[gid].i[6]; + pw_buf1[3] = pws[gid].i[7]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + u32x w0[4] = { 0 }; + u32x w1[4] = { 0 }; + u32x w2[4] = { 0 }; + u32x w3[4] = { 0 }; + + const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + + w0[0] = w0[0] ^ 0x5c5c5c5c; + w0[1] = w0[1] ^ 0x5c5c5c5c; + w0[2] = w0[2] ^ 0x5c5c5c5c; + w0[3] = w0[3] ^ 0x5c5c5c5c; + w1[0] = w1[0] ^ 0x5c5c5c5c; + w1[1] = w1[1] ^ 0x5c5c5c5c; + w1[2] = w1[2] ^ 0x5c5c5c5c; + w1[3] = w1[3] ^ 0x5c5c5c5c; + w2[0] = w2[0] ^ 0x5c5c5c5c; + w2[1] = w2[1] ^ 0x5c5c5c5c; + w2[2] = w2[2] ^ 0x5c5c5c5c; + w2[3] = w2[3] ^ 0x5c5c5c5c; + w3[0] = w3[0] ^ 0x5c5c5c5c; + w3[1] = w3[1] ^ 0x5c5c5c5c; + w3[2] = 0x5c5c5c5c; + w3[3] = 0x5c5c5c5c; + + u32x a = MD5M_A; + u32x b = MD5M_B; + u32x c = MD5M_C; + u32x d = MD5M_D; + + MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03); + + MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13); + + u32x t; + + MD5_STEP (MD5_H1, a, b, c, d, w1[1], MD5C20, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w2[0], MD5C21, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w2[3], MD5C22, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w3[2], MD5C23, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w0[1], MD5C24, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w1[0], MD5C25, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w1[3], MD5C26, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w2[2], MD5C27, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w3[1], MD5C28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w0[0], MD5C29, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w0[3], MD5C2a, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w1[2], MD5C2b, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w2[1], MD5C2c, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w3[0], MD5C2d, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w3[3], MD5C2e, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w0[2], MD5C2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33); + + COMPARE_M_SIMD (a, d, c, b); + } +} + +__kernel void m16400_m08 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16400_m16 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16400_s04 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 pw_buf0[4]; + u32 pw_buf1[4]; + + pw_buf0[0] = pws[gid].i[0]; + pw_buf0[1] = pws[gid].i[1]; + pw_buf0[2] = pws[gid].i[2]; + pw_buf0[3] = pws[gid].i[3]; + pw_buf1[0] = pws[gid].i[4]; + pw_buf1[1] = pws[gid].i[5]; + pw_buf1[2] = pws[gid].i[6]; + pw_buf1[3] = pws[gid].i[7]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + u32x w0[4] = { 0 }; + u32x w1[4] = { 0 }; + u32x w2[4] = { 0 }; + u32x w3[4] = { 0 }; + + const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + + w0[0] = w0[0] ^ 0x5c5c5c5c; + w0[1] = w0[1] ^ 0x5c5c5c5c; + w0[2] = w0[2] ^ 0x5c5c5c5c; + w0[3] = w0[3] ^ 0x5c5c5c5c; + w1[0] = w1[0] ^ 0x5c5c5c5c; + w1[1] = w1[1] ^ 0x5c5c5c5c; + w1[2] = w1[2] ^ 0x5c5c5c5c; + w1[3] = w1[3] ^ 0x5c5c5c5c; + w2[0] = w2[0] ^ 0x5c5c5c5c; + w2[1] = w2[1] ^ 0x5c5c5c5c; + w2[2] = w2[2] ^ 0x5c5c5c5c; + w2[3] = w2[3] ^ 0x5c5c5c5c; + w3[0] = w3[0] ^ 0x5c5c5c5c; + w3[1] = w3[1] ^ 0x5c5c5c5c; + w3[2] = 0x5c5c5c5c; + w3[3] = 0x5c5c5c5c; + + u32x a = MD5M_A; + u32x b = MD5M_B; + u32x c = MD5M_C; + u32x d = MD5M_D; + + MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03); + + MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13); + + u32x t; + + MD5_STEP (MD5_H1, a, b, c, d, w1[1], MD5C20, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w2[0], MD5C21, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w2[3], MD5C22, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w3[2], MD5C23, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w0[1], MD5C24, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w1[0], MD5C25, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w1[3], MD5C26, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w2[2], MD5C27, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w3[1], MD5C28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w0[0], MD5C29, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w0[3], MD5C2a, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w1[2], MD5C2b, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w2[1], MD5C2c, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w3[0], MD5C2d, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w3[3], MD5C2e, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w0[2], MD5C2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30); + + if (MATCHES_NONE_VS (a, search[0])) continue; + + MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33); + + COMPARE_S_SIMD (a, d, c, b); + } +} + +__kernel void m16400_s08 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16400_s16 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} diff --git a/OpenCL/m16400_a0.cl b/OpenCL/m16400_a0.cl new file mode 100644 index 000000000..ede2fc167 --- /dev/null +++ b/OpenCL/m16400_a0.cl @@ -0,0 +1,278 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_rp.h" +#include "inc_rp.cl" +#include "inc_scalar.cl" +#include "inc_hash_md5.cl" + +void cram_md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4]) +{ + u32 a = digest[0]; + u32 b = digest[1]; + u32 c = digest[2]; + u32 d = digest[3]; + + u32 w0_t = w0[0] ^ 0x5c5c5c5c; + u32 w1_t = w0[1] ^ 0x5c5c5c5c; + u32 w2_t = w0[2] ^ 0x5c5c5c5c; + u32 w3_t = w0[3] ^ 0x5c5c5c5c; + u32 w4_t = w1[0] ^ 0x5c5c5c5c; + u32 w5_t = w1[1] ^ 0x5c5c5c5c; + u32 w6_t = w1[2] ^ 0x5c5c5c5c; + u32 w7_t = w1[3] ^ 0x5c5c5c5c; + u32 w8_t = w2[0] ^ 0x5c5c5c5c; + u32 w9_t = w2[1] ^ 0x5c5c5c5c; + u32 wa_t = w2[2] ^ 0x5c5c5c5c; + u32 wb_t = w2[3] ^ 0x5c5c5c5c; + u32 wc_t = w3[0] ^ 0x5c5c5c5c; + u32 wd_t = w3[1] ^ 0x5c5c5c5c; + u32 we_t = w3[2] ^ 0x5c5c5c5c; + u32 wf_t = w3[3] ^ 0x5c5c5c5c; + + MD5_STEP_S (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00); + MD5_STEP_S (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01); + MD5_STEP_S (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02); + MD5_STEP_S (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03); + MD5_STEP_S (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00); + MD5_STEP_S (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01); + MD5_STEP_S (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02); + MD5_STEP_S (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03); + MD5_STEP_S (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00); + MD5_STEP_S (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01); + MD5_STEP_S (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02); + MD5_STEP_S (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03); + MD5_STEP_S (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00); + MD5_STEP_S (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01); + MD5_STEP_S (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02); + MD5_STEP_S (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03); + + MD5_STEP_S (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10); + MD5_STEP_S (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11); + MD5_STEP_S (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12); + MD5_STEP_S (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13); + MD5_STEP_S (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10); + MD5_STEP_S (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11); + MD5_STEP_S (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12); + MD5_STEP_S (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13); + MD5_STEP_S (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10); + MD5_STEP_S (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11); + MD5_STEP_S (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12); + MD5_STEP_S (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13); + MD5_STEP_S (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10); + MD5_STEP_S (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11); + MD5_STEP_S (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12); + MD5_STEP_S (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13); + + u32 t; + + MD5_STEP_S (MD5_H1, a, b, c, d, w5_t, MD5C20, MD5S20); + MD5_STEP_S (MD5_H2, d, a, b, c, w8_t, MD5C21, MD5S21); + MD5_STEP_S (MD5_H1, c, d, a, b, wb_t, MD5C22, MD5S22); + MD5_STEP_S (MD5_H2, b, c, d, a, we_t, MD5C23, MD5S23); + MD5_STEP_S (MD5_H1, a, b, c, d, w1_t, MD5C24, MD5S20); + MD5_STEP_S (MD5_H2, d, a, b, c, w4_t, MD5C25, MD5S21); + MD5_STEP_S (MD5_H1, c, d, a, b, w7_t, MD5C26, MD5S22); + MD5_STEP_S (MD5_H2, b, c, d, a, wa_t, MD5C27, MD5S23); + MD5_STEP_S (MD5_H1, a, b, c, d, wd_t, MD5C28, MD5S20); + MD5_STEP_S (MD5_H2, d, a, b, c, w0_t, MD5C29, MD5S21); + MD5_STEP_S (MD5_H1, c, d, a, b, w3_t, MD5C2a, MD5S22); + MD5_STEP_S (MD5_H2, b, c, d, a, w6_t, MD5C2b, MD5S23); + MD5_STEP_S (MD5_H1, a, b, c, d, w9_t, MD5C2c, MD5S20); + MD5_STEP_S (MD5_H2, d, a, b, c, wc_t, MD5C2d, MD5S21); + MD5_STEP_S (MD5_H1, c, d, a, b, wf_t, MD5C2e, MD5S22); + MD5_STEP_S (MD5_H2, b, c, d, a, w2_t, MD5C2f, MD5S23); + + MD5_STEP_S (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30); + MD5_STEP_S (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31); + MD5_STEP_S (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32); + MD5_STEP_S (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33); + MD5_STEP_S (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30); + MD5_STEP_S (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31); + MD5_STEP_S (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32); + MD5_STEP_S (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33); + MD5_STEP_S (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30); + MD5_STEP_S (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31); + MD5_STEP_S (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32); + MD5_STEP_S (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33); + MD5_STEP_S (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30); + MD5_STEP_S (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31); + MD5_STEP_S (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32); + MD5_STEP_S (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33); + + digest[0] += a; + digest[1] += b; + digest[2] += c; + digest[3] += d; +} + +void cram_md5_update_64 (md5_ctx_t *ctx, u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const int len) +{ + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else + const int pos = ctx->len & 63; + #endif + + ctx->len += len; + + switch_buffer_by_offset_le_S (w0, w1, w2, w3, pos); + + ctx->w0[0] |= w0[0]; + ctx->w0[1] |= w0[1]; + ctx->w0[2] |= w0[2]; + ctx->w0[3] |= w0[3]; + ctx->w1[0] |= w1[0]; + ctx->w1[1] |= w1[1]; + ctx->w1[2] |= w1[2]; + ctx->w1[3] |= w1[3]; + ctx->w2[0] |= w2[0]; + ctx->w2[1] |= w2[1]; + ctx->w2[2] |= w2[2]; + ctx->w2[3] |= w2[3]; + ctx->w3[0] |= w3[0]; + ctx->w3[1] |= w3[1]; + ctx->w3[2] |= w3[2]; + ctx->w3[3] |= w3[3]; +} + +void cram_md5_update (md5_ctx_t *ctx, const u32 *w, const int len) +{ + u32 w0[4]; + u32 w1[4]; + u32 w2[4]; + u32 w3[4]; + + w0[0] = w[0]; + w0[1] = w[1]; + w0[2] = w[2]; + w0[3] = w[3]; + w1[0] = w[4]; + w1[1] = w[5]; + w1[2] = w[6]; + w1[3] = w[7]; + w2[0] = w[8]; + w2[1] = w[9]; + w2[2] = w[10]; + w2[3] = w[11]; + w3[0] = w[12]; + w3[1] = w[13]; + w3[2] = w[14]; + w3[3] = w[15]; + + cram_md5_update_64 (ctx, w0, w1, w2, w3, len); +} + +void cram_md5_final (md5_ctx_t *ctx) +{ + cram_md5_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); +} + +__kernel void m16400_mxx (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + COPY_PW (pws[gid]); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + pw_t tmp = PASTE_PW; + + tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len); + + md5_ctx_t ctx; + + md5_init (&ctx); + + cram_md5_update (&ctx, tmp.i, tmp.pw_len); + + cram_md5_final (&ctx); + + const u32 r0 = ctx.h[DGST_R0]; + const u32 r1 = ctx.h[DGST_R1]; + const u32 r2 = ctx.h[DGST_R2]; + const u32 r3 = ctx.h[DGST_R3]; + + COMPARE_M_SCALAR (r0, r1, r2, r3); + } +} + +__kernel void m16400_sxx (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * base + */ + + COPY_PW (pws[gid]); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + pw_t tmp = PASTE_PW; + + tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len); + + md5_ctx_t ctx; + + md5_init (&ctx); + + cram_md5_update (&ctx, tmp.i, tmp.pw_len); + + cram_md5_final (&ctx); + + const u32 r0 = ctx.h[DGST_R0]; + const u32 r1 = ctx.h[DGST_R1]; + const u32 r2 = ctx.h[DGST_R2]; + const u32 r3 = ctx.h[DGST_R3]; + + COMPARE_S_SCALAR (r0, r1, r2, r3); + } +} diff --git a/OpenCL/m16400_a1-optimized.cl b/OpenCL/m16400_a1-optimized.cl new file mode 100644 index 000000000..e7201890c --- /dev/null +++ b/OpenCL/m16400_a1-optimized.cl @@ -0,0 +1,418 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_scalar.cl" +#include "inc_simd.cl" +#include "inc_hash_md5.cl" + +__kernel void m16400_m04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 pw_buf0[4]; + u32 pw_buf1[4]; + + pw_buf0[0] = pws[gid].i[0]; + pw_buf0[1] = pws[gid].i[1]; + pw_buf0[2] = pws[gid].i[2]; + pw_buf0[3] = pws[gid].i[3]; + pw_buf1[0] = pws[gid].i[4]; + pw_buf1[1] = pws[gid].i[5]; + pw_buf1[2] = pws[gid].i[6]; + pw_buf1[3] = pws[gid].i[7]; + + const u32 pw_l_len = pws[gid].pw_len; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos); + + const u32x pw_len = pw_l_len + pw_r_len; + + /** + * concat password candidate + */ + + u32x wordl0[4] = { 0 }; + u32x wordl1[4] = { 0 }; + u32x wordl2[4] = { 0 }; + u32x wordl3[4] = { 0 }; + + wordl0[0] = pw_buf0[0]; + wordl0[1] = pw_buf0[1]; + wordl0[2] = pw_buf0[2]; + wordl0[3] = pw_buf0[3]; + wordl1[0] = pw_buf1[0]; + wordl1[1] = pw_buf1[1]; + wordl1[2] = pw_buf1[2]; + wordl1[3] = pw_buf1[3]; + + u32x wordr0[4] = { 0 }; + u32x wordr1[4] = { 0 }; + u32x wordr2[4] = { 0 }; + u32x wordr3[4] = { 0 }; + + wordr0[0] = ix_create_combt (combs_buf, il_pos, 0); + wordr0[1] = ix_create_combt (combs_buf, il_pos, 1); + wordr0[2] = ix_create_combt (combs_buf, il_pos, 2); + wordr0[3] = ix_create_combt (combs_buf, il_pos, 3); + wordr1[0] = ix_create_combt (combs_buf, il_pos, 4); + wordr1[1] = ix_create_combt (combs_buf, il_pos, 5); + wordr1[2] = ix_create_combt (combs_buf, il_pos, 6); + wordr1[3] = ix_create_combt (combs_buf, il_pos, 7); + + if (combs_mode == COMBINATOR_MODE_BASE_LEFT) + { + switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len); + } + else + { + switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len); + } + + u32x w0[4]; + u32x w1[4]; + u32x w2[4]; + u32x w3[4]; + + w0[0] = (wordl0[0] | wordr0[0]) ^ 0x5c5c5c5c; + w0[1] = (wordl0[1] | wordr0[1]) ^ 0x5c5c5c5c; + w0[2] = (wordl0[2] | wordr0[2]) ^ 0x5c5c5c5c; + w0[3] = (wordl0[3] | wordr0[3]) ^ 0x5c5c5c5c; + w1[0] = (wordl1[0] | wordr1[0]) ^ 0x5c5c5c5c; + w1[1] = (wordl1[1] | wordr1[1]) ^ 0x5c5c5c5c; + w1[2] = (wordl1[2] | wordr1[2]) ^ 0x5c5c5c5c; + w1[3] = (wordl1[3] | wordr1[3]) ^ 0x5c5c5c5c; + w2[0] = (wordl2[0] | wordr2[0]) ^ 0x5c5c5c5c; + w2[1] = (wordl2[1] | wordr2[1]) ^ 0x5c5c5c5c; + w2[2] = (wordl2[2] | wordr2[2]) ^ 0x5c5c5c5c; + w2[3] = (wordl2[3] | wordr2[3]) ^ 0x5c5c5c5c; + w3[0] = (wordl3[0] | wordr3[0]) ^ 0x5c5c5c5c; + w3[1] = (wordl3[1] | wordr3[1]) ^ 0x5c5c5c5c; + w3[2] = 0x5c5c5c5c; + w3[3] = 0x5c5c5c5c; + + /** + * md5 + */ + + u32x a = MD5M_A; + u32x b = MD5M_B; + u32x c = MD5M_C; + u32x d = MD5M_D; + + MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03); + + MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13); + + u32x t; + + MD5_STEP (MD5_H1, a, b, c, d, w1[1], MD5C20, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w2[0], MD5C21, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w2[3], MD5C22, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w3[2], MD5C23, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w0[1], MD5C24, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w1[0], MD5C25, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w1[3], MD5C26, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w2[2], MD5C27, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w3[1], MD5C28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w0[0], MD5C29, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w0[3], MD5C2a, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w1[2], MD5C2b, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w2[1], MD5C2c, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w3[0], MD5C2d, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w3[3], MD5C2e, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w0[2], MD5C2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33); + + COMPARE_M_SIMD (a, d, c, b); + } +} + +__kernel void m16400_m08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16400_m16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16400_s04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 pw_buf0[4]; + u32 pw_buf1[4]; + + pw_buf0[0] = pws[gid].i[0]; + pw_buf0[1] = pws[gid].i[1]; + pw_buf0[2] = pws[gid].i[2]; + pw_buf0[3] = pws[gid].i[3]; + pw_buf1[0] = pws[gid].i[4]; + pw_buf1[1] = pws[gid].i[5]; + pw_buf1[2] = pws[gid].i[6]; + pw_buf1[3] = pws[gid].i[7]; + + const u32 pw_l_len = pws[gid].pw_len; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos); + + const u32x pw_len = pw_l_len + pw_r_len; + + /** + * concat password candidate + */ + + u32x wordl0[4] = { 0 }; + u32x wordl1[4] = { 0 }; + u32x wordl2[4] = { 0 }; + u32x wordl3[4] = { 0 }; + + wordl0[0] = pw_buf0[0]; + wordl0[1] = pw_buf0[1]; + wordl0[2] = pw_buf0[2]; + wordl0[3] = pw_buf0[3]; + wordl1[0] = pw_buf1[0]; + wordl1[1] = pw_buf1[1]; + wordl1[2] = pw_buf1[2]; + wordl1[3] = pw_buf1[3]; + + u32x wordr0[4] = { 0 }; + u32x wordr1[4] = { 0 }; + u32x wordr2[4] = { 0 }; + u32x wordr3[4] = { 0 }; + + wordr0[0] = ix_create_combt (combs_buf, il_pos, 0); + wordr0[1] = ix_create_combt (combs_buf, il_pos, 1); + wordr0[2] = ix_create_combt (combs_buf, il_pos, 2); + wordr0[3] = ix_create_combt (combs_buf, il_pos, 3); + wordr1[0] = ix_create_combt (combs_buf, il_pos, 4); + wordr1[1] = ix_create_combt (combs_buf, il_pos, 5); + wordr1[2] = ix_create_combt (combs_buf, il_pos, 6); + wordr1[3] = ix_create_combt (combs_buf, il_pos, 7); + + if (combs_mode == COMBINATOR_MODE_BASE_LEFT) + { + switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len); + } + else + { + switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len); + } + + u32x w0[4]; + u32x w1[4]; + u32x w2[4]; + u32x w3[4]; + + w0[0] = (wordl0[0] | wordr0[0]) ^ 0x5c5c5c5c; + w0[1] = (wordl0[1] | wordr0[1]) ^ 0x5c5c5c5c; + w0[2] = (wordl0[2] | wordr0[2]) ^ 0x5c5c5c5c; + w0[3] = (wordl0[3] | wordr0[3]) ^ 0x5c5c5c5c; + w1[0] = (wordl1[0] | wordr1[0]) ^ 0x5c5c5c5c; + w1[1] = (wordl1[1] | wordr1[1]) ^ 0x5c5c5c5c; + w1[2] = (wordl1[2] | wordr1[2]) ^ 0x5c5c5c5c; + w1[3] = (wordl1[3] | wordr1[3]) ^ 0x5c5c5c5c; + w2[0] = (wordl2[0] | wordr2[0]) ^ 0x5c5c5c5c; + w2[1] = (wordl2[1] | wordr2[1]) ^ 0x5c5c5c5c; + w2[2] = (wordl2[2] | wordr2[2]) ^ 0x5c5c5c5c; + w2[3] = (wordl2[3] | wordr2[3]) ^ 0x5c5c5c5c; + w3[0] = (wordl3[0] | wordr3[0]) ^ 0x5c5c5c5c; + w3[1] = (wordl3[1] | wordr3[1]) ^ 0x5c5c5c5c; + w3[2] = 0x5c5c5c5c; + w3[3] = 0x5c5c5c5c; + + /** + * md5 + */ + + u32x a = MD5M_A; + u32x b = MD5M_B; + u32x c = MD5M_C; + u32x d = MD5M_D; + + MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03); + + MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13); + + u32x t; + + MD5_STEP (MD5_H1, a, b, c, d, w1[1], MD5C20, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w2[0], MD5C21, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w2[3], MD5C22, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w3[2], MD5C23, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w0[1], MD5C24, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w1[0], MD5C25, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w1[3], MD5C26, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w2[2], MD5C27, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w3[1], MD5C28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w0[0], MD5C29, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w0[3], MD5C2a, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w1[2], MD5C2b, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w2[1], MD5C2c, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w3[0], MD5C2d, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w3[3], MD5C2e, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w0[2], MD5C2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30); + + if (MATCHES_NONE_VS (a, search[0])) continue; + + MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33); + + COMPARE_S_SIMD (a, d, c, b); + } +} + +__kernel void m16400_s08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16400_s16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} diff --git a/OpenCL/m16400_a1.cl b/OpenCL/m16400_a1.cl new file mode 100644 index 000000000..b25f4cd60 --- /dev/null +++ b/OpenCL/m16400_a1.cl @@ -0,0 +1,272 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_scalar.cl" +#include "inc_hash_md5.cl" + +void cram_md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4]) +{ + u32 a = digest[0]; + u32 b = digest[1]; + u32 c = digest[2]; + u32 d = digest[3]; + + u32 w0_t = w0[0] ^ 0x5c5c5c5c; + u32 w1_t = w0[1] ^ 0x5c5c5c5c; + u32 w2_t = w0[2] ^ 0x5c5c5c5c; + u32 w3_t = w0[3] ^ 0x5c5c5c5c; + u32 w4_t = w1[0] ^ 0x5c5c5c5c; + u32 w5_t = w1[1] ^ 0x5c5c5c5c; + u32 w6_t = w1[2] ^ 0x5c5c5c5c; + u32 w7_t = w1[3] ^ 0x5c5c5c5c; + u32 w8_t = w2[0] ^ 0x5c5c5c5c; + u32 w9_t = w2[1] ^ 0x5c5c5c5c; + u32 wa_t = w2[2] ^ 0x5c5c5c5c; + u32 wb_t = w2[3] ^ 0x5c5c5c5c; + u32 wc_t = w3[0] ^ 0x5c5c5c5c; + u32 wd_t = w3[1] ^ 0x5c5c5c5c; + u32 we_t = w3[2] ^ 0x5c5c5c5c; + u32 wf_t = w3[3] ^ 0x5c5c5c5c; + + MD5_STEP_S (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00); + MD5_STEP_S (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01); + MD5_STEP_S (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02); + MD5_STEP_S (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03); + MD5_STEP_S (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00); + MD5_STEP_S (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01); + MD5_STEP_S (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02); + MD5_STEP_S (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03); + MD5_STEP_S (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00); + MD5_STEP_S (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01); + MD5_STEP_S (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02); + MD5_STEP_S (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03); + MD5_STEP_S (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00); + MD5_STEP_S (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01); + MD5_STEP_S (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02); + MD5_STEP_S (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03); + + MD5_STEP_S (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10); + MD5_STEP_S (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11); + MD5_STEP_S (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12); + MD5_STEP_S (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13); + MD5_STEP_S (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10); + MD5_STEP_S (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11); + MD5_STEP_S (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12); + MD5_STEP_S (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13); + MD5_STEP_S (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10); + MD5_STEP_S (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11); + MD5_STEP_S (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12); + MD5_STEP_S (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13); + MD5_STEP_S (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10); + MD5_STEP_S (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11); + MD5_STEP_S (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12); + MD5_STEP_S (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13); + + u32 t; + + MD5_STEP_S (MD5_H1, a, b, c, d, w5_t, MD5C20, MD5S20); + MD5_STEP_S (MD5_H2, d, a, b, c, w8_t, MD5C21, MD5S21); + MD5_STEP_S (MD5_H1, c, d, a, b, wb_t, MD5C22, MD5S22); + MD5_STEP_S (MD5_H2, b, c, d, a, we_t, MD5C23, MD5S23); + MD5_STEP_S (MD5_H1, a, b, c, d, w1_t, MD5C24, MD5S20); + MD5_STEP_S (MD5_H2, d, a, b, c, w4_t, MD5C25, MD5S21); + MD5_STEP_S (MD5_H1, c, d, a, b, w7_t, MD5C26, MD5S22); + MD5_STEP_S (MD5_H2, b, c, d, a, wa_t, MD5C27, MD5S23); + MD5_STEP_S (MD5_H1, a, b, c, d, wd_t, MD5C28, MD5S20); + MD5_STEP_S (MD5_H2, d, a, b, c, w0_t, MD5C29, MD5S21); + MD5_STEP_S (MD5_H1, c, d, a, b, w3_t, MD5C2a, MD5S22); + MD5_STEP_S (MD5_H2, b, c, d, a, w6_t, MD5C2b, MD5S23); + MD5_STEP_S (MD5_H1, a, b, c, d, w9_t, MD5C2c, MD5S20); + MD5_STEP_S (MD5_H2, d, a, b, c, wc_t, MD5C2d, MD5S21); + MD5_STEP_S (MD5_H1, c, d, a, b, wf_t, MD5C2e, MD5S22); + MD5_STEP_S (MD5_H2, b, c, d, a, w2_t, MD5C2f, MD5S23); + + MD5_STEP_S (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30); + MD5_STEP_S (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31); + MD5_STEP_S (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32); + MD5_STEP_S (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33); + MD5_STEP_S (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30); + MD5_STEP_S (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31); + MD5_STEP_S (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32); + MD5_STEP_S (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33); + MD5_STEP_S (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30); + MD5_STEP_S (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31); + MD5_STEP_S (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32); + MD5_STEP_S (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33); + MD5_STEP_S (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30); + MD5_STEP_S (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31); + MD5_STEP_S (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32); + MD5_STEP_S (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33); + + digest[0] += a; + digest[1] += b; + digest[2] += c; + digest[3] += d; +} + +void cram_md5_update_64 (md5_ctx_t *ctx, u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const int len) +{ + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else + const int pos = ctx->len & 63; + #endif + + ctx->len += len; + + switch_buffer_by_offset_le_S (w0, w1, w2, w3, pos); + + ctx->w0[0] |= w0[0]; + ctx->w0[1] |= w0[1]; + ctx->w0[2] |= w0[2]; + ctx->w0[3] |= w0[3]; + ctx->w1[0] |= w1[0]; + ctx->w1[1] |= w1[1]; + ctx->w1[2] |= w1[2]; + ctx->w1[3] |= w1[3]; + ctx->w2[0] |= w2[0]; + ctx->w2[1] |= w2[1]; + ctx->w2[2] |= w2[2]; + ctx->w2[3] |= w2[3]; + ctx->w3[0] |= w3[0]; + ctx->w3[1] |= w3[1]; + ctx->w3[2] |= w3[2]; + ctx->w3[3] |= w3[3]; +} + +void cram_md5_update_global (md5_ctx_t *ctx, const __global u32 *w, const int len) +{ + u32 w0[4]; + u32 w1[4]; + u32 w2[4]; + u32 w3[4]; + + w0[0] = w[0]; + w0[1] = w[1]; + w0[2] = w[2]; + w0[3] = w[3]; + w1[0] = w[4]; + w1[1] = w[5]; + w1[2] = w[6]; + w1[3] = w[7]; + w2[0] = w[8]; + w2[1] = w[9]; + w2[2] = w[10]; + w2[3] = w[11]; + w3[0] = w[12]; + w3[1] = w[13]; + w3[2] = w[14]; + w3[3] = w[15]; + + cram_md5_update_64 (ctx, w0, w1, w2, w3, len); +} + +void cram_md5_final (md5_ctx_t *ctx) +{ + cram_md5_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); +} + +__kernel void m16400_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + md5_ctx_t ctx0; + + md5_init (&ctx0); + + cram_md5_update_global (&ctx0, pws[gid].i, pws[gid].pw_len); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + md5_ctx_t ctx = ctx0; + + cram_md5_update_global (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len); + + cram_md5_final (&ctx); + + const u32 r0 = ctx.h[DGST_R0]; + const u32 r1 = ctx.h[DGST_R1]; + const u32 r2 = ctx.h[DGST_R2]; + const u32 r3 = ctx.h[DGST_R3]; + + COMPARE_M_SCALAR (r0, r1, r2, r3); + } +} + +__kernel void m16400_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * base + */ + + md5_ctx_t ctx0; + + md5_init (&ctx0); + + cram_md5_update_global (&ctx0, pws[gid].i, pws[gid].pw_len); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + md5_ctx_t ctx = ctx0; + + cram_md5_update_global (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len); + + cram_md5_final (&ctx); + + const u32 r0 = ctx.h[DGST_R0]; + const u32 r1 = ctx.h[DGST_R1]; + const u32 r2 = ctx.h[DGST_R2]; + const u32 r3 = ctx.h[DGST_R3]; + + COMPARE_S_SCALAR (r0, r1, r2, r3); + } +} diff --git a/OpenCL/m16400_a3-optimized.cl b/OpenCL/m16400_a3-optimized.cl new file mode 100644 index 000000000..e307908b8 --- /dev/null +++ b/OpenCL/m16400_a3-optimized.cl @@ -0,0 +1,697 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_simd.cl" +#include "inc_hash_md5.cl" + +#define MD5_STEP_REV(f,a,b,c,d,x,t,s) \ +{ \ + a -= b; \ + a = rotr32_S (a, s); \ + a -= f (b, c, d); \ + a -= x; \ + a -= t; \ +} + +#define MD5_STEP_REV1(f,a,b,c,d,x,t,s) \ +{ \ + a -= b; \ + a = rotr32_S (a, s); \ + a -= x; \ + a -= t; \ +} + +void m16400m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset) +{ + /** + * modifier + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + + /** + * pad + */ + + w[1] = w[1] ^ 0x5c5c5c5c; + w[2] = w[2] ^ 0x5c5c5c5c; + w[3] = w[3] ^ 0x5c5c5c5c; + w[4] = w[4] ^ 0x5c5c5c5c; + w[5] = w[5] ^ 0x5c5c5c5c; + w[6] = w[6] ^ 0x5c5c5c5c; + w[7] = w[7] ^ 0x5c5c5c5c; + w[8] = w[8] ^ 0x5c5c5c5c; + w[9] = w[9] ^ 0x5c5c5c5c; + w[10] = w[10] ^ 0x5c5c5c5c; + w[11] = w[11] ^ 0x5c5c5c5c; + w[12] = w[12] ^ 0x5c5c5c5c; + w[13] = w[13] ^ 0x5c5c5c5c; + w[14] = w[14] ^ 0x5c5c5c5c; + w[15] = w[15] ^ 0x5c5c5c5c; + + /** + * base + */ + + const u32 F_w0c00 = 0u + MD5C00; + const u32 F_w1c01 = w[ 1] + MD5C01; + const u32 F_w2c02 = w[ 2] + MD5C02; + const u32 F_w3c03 = w[ 3] + MD5C03; + const u32 F_w4c04 = w[ 4] + MD5C04; + const u32 F_w5c05 = w[ 5] + MD5C05; + const u32 F_w6c06 = w[ 6] + MD5C06; + const u32 F_w7c07 = w[ 7] + MD5C07; + const u32 F_w8c08 = w[ 8] + MD5C08; + const u32 F_w9c09 = w[ 9] + MD5C09; + const u32 F_wac0a = w[10] + MD5C0a; + const u32 F_wbc0b = w[11] + MD5C0b; + const u32 F_wcc0c = w[12] + MD5C0c; + const u32 F_wdc0d = w[13] + MD5C0d; + const u32 F_wec0e = w[14] + MD5C0e; + const u32 F_wfc0f = w[15] + MD5C0f; + + const u32 G_w1c10 = w[ 1] + MD5C10; + const u32 G_w6c11 = w[ 6] + MD5C11; + const u32 G_wbc12 = w[11] + MD5C12; + const u32 G_w0c13 = 0u + MD5C13; + const u32 G_w5c14 = w[ 5] + MD5C14; + const u32 G_wac15 = w[10] + MD5C15; + const u32 G_wfc16 = w[15] + MD5C16; + const u32 G_w4c17 = w[ 4] + MD5C17; + const u32 G_w9c18 = w[ 9] + MD5C18; + const u32 G_wec19 = w[14] + MD5C19; + const u32 G_w3c1a = w[ 3] + MD5C1a; + const u32 G_w8c1b = w[ 8] + MD5C1b; + const u32 G_wdc1c = w[13] + MD5C1c; + const u32 G_w2c1d = w[ 2] + MD5C1d; + const u32 G_w7c1e = w[ 7] + MD5C1e; + const u32 G_wcc1f = w[12] + MD5C1f; + + const u32 H_w5c20 = w[ 5] + MD5C20; + const u32 H_w8c21 = w[ 8] + MD5C21; + const u32 H_wbc22 = w[11] + MD5C22; + const u32 H_wec23 = w[14] + MD5C23; + const u32 H_w1c24 = w[ 1] + MD5C24; + const u32 H_w4c25 = w[ 4] + MD5C25; + const u32 H_w7c26 = w[ 7] + MD5C26; + const u32 H_wac27 = w[10] + MD5C27; + const u32 H_wdc28 = w[13] + MD5C28; + const u32 H_w0c29 = 0u + MD5C29; + const u32 H_w3c2a = w[ 3] + MD5C2a; + const u32 H_w6c2b = w[ 6] + MD5C2b; + const u32 H_w9c2c = w[ 9] + MD5C2c; + const u32 H_wcc2d = w[12] + MD5C2d; + const u32 H_wfc2e = w[15] + MD5C2e; + const u32 H_w2c2f = w[ 2] + MD5C2f; + + const u32 I_w0c30 = 0u + MD5C30; + const u32 I_w7c31 = w[ 7] + MD5C31; + const u32 I_wec32 = w[14] + MD5C32; + const u32 I_w5c33 = w[ 5] + MD5C33; + const u32 I_wcc34 = w[12] + MD5C34; + const u32 I_w3c35 = w[ 3] + MD5C35; + const u32 I_wac36 = w[10] + MD5C36; + const u32 I_w1c37 = w[ 1] + MD5C37; + const u32 I_w8c38 = w[ 8] + MD5C38; + const u32 I_wfc39 = w[15] + MD5C39; + const u32 I_w6c3a = w[ 6] + MD5C3a; + const u32 I_wdc3b = w[13] + MD5C3b; + const u32 I_w4c3c = w[ 4] + MD5C3c; + const u32 I_wbc3d = w[11] + MD5C3d; + const u32 I_w2c3e = w[ 2] + MD5C3e; + const u32 I_w9c3f = w[ 9] + MD5C3f; + + /** + * loop + */ + + u32 w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = (w0l | w0r) ^ 0x5c5c5c5c; + + u32x a = MD5M_A; + u32x b = MD5M_B; + u32x c = MD5M_C; + u32x d = MD5M_D; + + MD5_STEP (MD5_Fo, a, b, c, d, w0, F_w0c00, MD5S00); + MD5_STEP0(MD5_Fo, d, a, b, c, F_w1c01, MD5S01); + MD5_STEP0(MD5_Fo, c, d, a, b, F_w2c02, MD5S02); + MD5_STEP0(MD5_Fo, b, c, d, a, F_w3c03, MD5S03); + MD5_STEP0(MD5_Fo, a, b, c, d, F_w4c04, MD5S00); + MD5_STEP0(MD5_Fo, d, a, b, c, F_w5c05, MD5S01); + MD5_STEP0(MD5_Fo, c, d, a, b, F_w6c06, MD5S02); + MD5_STEP0(MD5_Fo, b, c, d, a, F_w7c07, MD5S03); + MD5_STEP0(MD5_Fo, a, b, c, d, F_w8c08, MD5S00); + MD5_STEP0(MD5_Fo, d, a, b, c, F_w9c09, MD5S01); + MD5_STEP0(MD5_Fo, c, d, a, b, F_wac0a, MD5S02); + MD5_STEP0(MD5_Fo, b, c, d, a, F_wbc0b, MD5S03); + MD5_STEP0(MD5_Fo, a, b, c, d, F_wcc0c, MD5S00); + MD5_STEP0(MD5_Fo, d, a, b, c, F_wdc0d, MD5S01); + MD5_STEP0(MD5_Fo, c, d, a, b, F_wec0e, MD5S02); + MD5_STEP0(MD5_Fo, b, c, d, a, F_wfc0f, MD5S03); + + MD5_STEP0(MD5_Go, a, b, c, d, G_w1c10, MD5S10); + MD5_STEP0(MD5_Go, d, a, b, c, G_w6c11, MD5S11); + MD5_STEP0(MD5_Go, c, d, a, b, G_wbc12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w0, G_w0c13, MD5S13); + MD5_STEP0(MD5_Go, a, b, c, d, G_w5c14, MD5S10); + MD5_STEP0(MD5_Go, d, a, b, c, G_wac15, MD5S11); + MD5_STEP0(MD5_Go, c, d, a, b, G_wfc16, MD5S12); + MD5_STEP0(MD5_Go, b, c, d, a, G_w4c17, MD5S13); + MD5_STEP0(MD5_Go, a, b, c, d, G_w9c18, MD5S10); + MD5_STEP0(MD5_Go, d, a, b, c, G_wec19, MD5S11); + MD5_STEP0(MD5_Go, c, d, a, b, G_w3c1a, MD5S12); + MD5_STEP0(MD5_Go, b, c, d, a, G_w8c1b, MD5S13); + MD5_STEP0(MD5_Go, a, b, c, d, G_wdc1c, MD5S10); + MD5_STEP0(MD5_Go, d, a, b, c, G_w2c1d, MD5S11); + MD5_STEP0(MD5_Go, c, d, a, b, G_w7c1e, MD5S12); + MD5_STEP0(MD5_Go, b, c, d, a, G_wcc1f, MD5S13); + + u32x t; + + MD5_STEP0(MD5_H1, a, b, c, d, H_w5c20, MD5S20); + MD5_STEP0(MD5_H2, d, a, b, c, H_w8c21, MD5S21); + MD5_STEP0(MD5_H1, c, d, a, b, H_wbc22, MD5S22); + MD5_STEP0(MD5_H2, b, c, d, a, H_wec23, MD5S23); + MD5_STEP0(MD5_H1, a, b, c, d, H_w1c24, MD5S20); + MD5_STEP0(MD5_H2, d, a, b, c, H_w4c25, MD5S21); + MD5_STEP0(MD5_H1, c, d, a, b, H_w7c26, MD5S22); + MD5_STEP0(MD5_H2, b, c, d, a, H_wac27, MD5S23); + MD5_STEP0(MD5_H1, a, b, c, d, H_wdc28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w0, H_w0c29, MD5S21); + MD5_STEP0(MD5_H1, c, d, a, b, H_w3c2a, MD5S22); + MD5_STEP0(MD5_H2, b, c, d, a, H_w6c2b, MD5S23); + MD5_STEP0(MD5_H1, a, b, c, d, H_w9c2c, MD5S20); + MD5_STEP0(MD5_H2, d, a, b, c, H_wcc2d, MD5S21); + MD5_STEP0(MD5_H1, c, d, a, b, H_wfc2e, MD5S22); + MD5_STEP0(MD5_H2, b, c, d, a, H_w2c2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, w0, I_w0c30, MD5S30); + MD5_STEP0(MD5_I , d, a, b, c, I_w7c31, MD5S31); + MD5_STEP0(MD5_I , c, d, a, b, I_wec32, MD5S32); + MD5_STEP0(MD5_I , b, c, d, a, I_w5c33, MD5S33); + MD5_STEP0(MD5_I , a, b, c, d, I_wcc34, MD5S30); + MD5_STEP0(MD5_I , d, a, b, c, I_w3c35, MD5S31); + MD5_STEP0(MD5_I , c, d, a, b, I_wac36, MD5S32); + MD5_STEP0(MD5_I , b, c, d, a, I_w1c37, MD5S33); + MD5_STEP0(MD5_I , a, b, c, d, I_w8c38, MD5S30); + MD5_STEP0(MD5_I , d, a, b, c, I_wfc39, MD5S31); + MD5_STEP0(MD5_I , c, d, a, b, I_w6c3a, MD5S32); + MD5_STEP0(MD5_I , b, c, d, a, I_wdc3b, MD5S33); + MD5_STEP0(MD5_I , a, b, c, d, I_w4c3c, MD5S30); + MD5_STEP0(MD5_I , d, a, b, c, I_wbc3d, MD5S31); + MD5_STEP0(MD5_I , c, d, a, b, I_w2c3e, MD5S32); + MD5_STEP0(MD5_I , b, c, d, a, I_w9c3f, MD5S33); + + COMPARE_M_SIMD (a, d, c, b); + } +} + +void m16400s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset) +{ + /** + * modifier + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + + /** + * pad + */ + + w[1] = w[1] ^ 0x5c5c5c5c; + w[2] = w[2] ^ 0x5c5c5c5c; + w[3] = w[3] ^ 0x5c5c5c5c; + w[4] = w[4] ^ 0x5c5c5c5c; + w[5] = w[5] ^ 0x5c5c5c5c; + w[6] = w[6] ^ 0x5c5c5c5c; + w[7] = w[7] ^ 0x5c5c5c5c; + w[8] = w[8] ^ 0x5c5c5c5c; + w[9] = w[9] ^ 0x5c5c5c5c; + w[10] = w[10] ^ 0x5c5c5c5c; + w[11] = w[11] ^ 0x5c5c5c5c; + w[12] = w[12] ^ 0x5c5c5c5c; + w[13] = w[13] ^ 0x5c5c5c5c; + w[14] = w[14] ^ 0x5c5c5c5c; + w[15] = w[15] ^ 0x5c5c5c5c; + + /** + * base + */ + + const u32 F_w0c00 = 0u + MD5C00; + const u32 F_w1c01 = w[ 1] + MD5C01; + const u32 F_w2c02 = w[ 2] + MD5C02; + const u32 F_w3c03 = w[ 3] + MD5C03; + const u32 F_w4c04 = w[ 4] + MD5C04; + const u32 F_w5c05 = w[ 5] + MD5C05; + const u32 F_w6c06 = w[ 6] + MD5C06; + const u32 F_w7c07 = w[ 7] + MD5C07; + const u32 F_w8c08 = w[ 8] + MD5C08; + const u32 F_w9c09 = w[ 9] + MD5C09; + const u32 F_wac0a = w[10] + MD5C0a; + const u32 F_wbc0b = w[11] + MD5C0b; + const u32 F_wcc0c = w[12] + MD5C0c; + const u32 F_wdc0d = w[13] + MD5C0d; + const u32 F_wec0e = w[14] + MD5C0e; + const u32 F_wfc0f = w[15] + MD5C0f; + + const u32 G_w1c10 = w[ 1] + MD5C10; + const u32 G_w6c11 = w[ 6] + MD5C11; + const u32 G_wbc12 = w[11] + MD5C12; + const u32 G_w0c13 = 0u + MD5C13; + const u32 G_w5c14 = w[ 5] + MD5C14; + const u32 G_wac15 = w[10] + MD5C15; + const u32 G_wfc16 = w[15] + MD5C16; + const u32 G_w4c17 = w[ 4] + MD5C17; + const u32 G_w9c18 = w[ 9] + MD5C18; + const u32 G_wec19 = w[14] + MD5C19; + const u32 G_w3c1a = w[ 3] + MD5C1a; + const u32 G_w8c1b = w[ 8] + MD5C1b; + const u32 G_wdc1c = w[13] + MD5C1c; + const u32 G_w2c1d = w[ 2] + MD5C1d; + const u32 G_w7c1e = w[ 7] + MD5C1e; + const u32 G_wcc1f = w[12] + MD5C1f; + + const u32 H_w5c20 = w[ 5] + MD5C20; + const u32 H_w8c21 = w[ 8] + MD5C21; + const u32 H_wbc22 = w[11] + MD5C22; + const u32 H_wec23 = w[14] + MD5C23; + const u32 H_w1c24 = w[ 1] + MD5C24; + const u32 H_w4c25 = w[ 4] + MD5C25; + const u32 H_w7c26 = w[ 7] + MD5C26; + const u32 H_wac27 = w[10] + MD5C27; + const u32 H_wdc28 = w[13] + MD5C28; + const u32 H_w0c29 = 0u + MD5C29; + const u32 H_w3c2a = w[ 3] + MD5C2a; + const u32 H_w6c2b = w[ 6] + MD5C2b; + const u32 H_w9c2c = w[ 9] + MD5C2c; + const u32 H_wcc2d = w[12] + MD5C2d; + const u32 H_wfc2e = w[15] + MD5C2e; + const u32 H_w2c2f = w[ 2] + MD5C2f; + + const u32 I_w0c30 = 0u + MD5C30; + const u32 I_w7c31 = w[ 7] + MD5C31; + const u32 I_wec32 = w[14] + MD5C32; + const u32 I_w5c33 = w[ 5] + MD5C33; + const u32 I_wcc34 = w[12] + MD5C34; + const u32 I_w3c35 = w[ 3] + MD5C35; + const u32 I_wac36 = w[10] + MD5C36; + const u32 I_w1c37 = w[ 1] + MD5C37; + const u32 I_w8c38 = w[ 8] + MD5C38; + const u32 I_wfc39 = w[15] + MD5C39; + const u32 I_w6c3a = w[ 6] + MD5C3a; + const u32 I_wdc3b = w[13] + MD5C3b; + const u32 I_w4c3c = w[ 4] + MD5C3c; + const u32 I_wbc3d = w[11] + MD5C3d; + const u32 I_w2c3e = w[ 2] + MD5C3e; + const u32 I_w9c3f = w[ 9] + MD5C3f; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * reverse + */ + + u32 a_rev = digests_buf[digests_offset].digest_buf[0]; + u32 b_rev = digests_buf[digests_offset].digest_buf[1]; + u32 c_rev = digests_buf[digests_offset].digest_buf[2]; + u32 d_rev = digests_buf[digests_offset].digest_buf[3]; + + MD5_STEP_REV (MD5_I_S, b_rev, c_rev, d_rev, a_rev, w[ 9], MD5C3f, MD5S33); + MD5_STEP_REV (MD5_I_S, c_rev, d_rev, a_rev, b_rev, w[ 2], MD5C3e, MD5S32); + MD5_STEP_REV (MD5_I_S, d_rev, a_rev, b_rev, c_rev, w[11], MD5C3d, MD5S31); + MD5_STEP_REV (MD5_I_S, a_rev, b_rev, c_rev, d_rev, w[ 4], MD5C3c, MD5S30); + MD5_STEP_REV (MD5_I_S, b_rev, c_rev, d_rev, a_rev, w[13], MD5C3b, MD5S33); + MD5_STEP_REV (MD5_I_S, c_rev, d_rev, a_rev, b_rev, w[ 6], MD5C3a, MD5S32); + MD5_STEP_REV (MD5_I_S, d_rev, a_rev, b_rev, c_rev, w[15], MD5C39, MD5S31); + MD5_STEP_REV (MD5_I_S, a_rev, b_rev, c_rev, d_rev, w[ 8], MD5C38, MD5S30); + MD5_STEP_REV (MD5_I_S, b_rev, c_rev, d_rev, a_rev, w[ 1], MD5C37, MD5S33); + MD5_STEP_REV (MD5_I_S, c_rev, d_rev, a_rev, b_rev, w[10], MD5C36, MD5S32); + MD5_STEP_REV (MD5_I_S, d_rev, a_rev, b_rev, c_rev, w[ 3], MD5C35, MD5S31); + MD5_STEP_REV (MD5_I_S, a_rev, b_rev, c_rev, d_rev, w[12], MD5C34, MD5S30); + MD5_STEP_REV (MD5_I_S, b_rev, c_rev, d_rev, a_rev, w[ 5], MD5C33, MD5S33); + MD5_STEP_REV (MD5_I_S, c_rev, d_rev, a_rev, b_rev, w[14], MD5C32, MD5S32); + MD5_STEP_REV (MD5_I_S, d_rev, a_rev, b_rev, c_rev, w[ 7], MD5C31, MD5S31); + MD5_STEP_REV (MD5_I_S, a_rev, b_rev, c_rev, d_rev, 0, MD5C30, MD5S30); + + const u32 pre_cd = c_rev ^ d_rev; + + MD5_STEP_REV1(MD5_H_S, b_rev, c_rev, d_rev, a_rev, w[ 2], MD5C2f, MD5S23); + MD5_STEP_REV1(MD5_H_S, c_rev, d_rev, a_rev, b_rev, w[15], MD5C2e, MD5S22); + + /** + * loop + */ + + u32 w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = (w0l | w0r) ^ 0x5c5c5c5c; + + const u32x pre_d = d_rev; + const u32x pre_a = a_rev - w0; + const u32x pre_b = b_rev - (pre_a ^ pre_cd); + const u32x pre_c = c_rev - (pre_a ^ pre_b ^ pre_d); + + u32x a = MD5M_A; + u32x b = MD5M_B; + u32x c = MD5M_C; + u32x d = MD5M_D; + + MD5_STEP (MD5_Fo, a, b, c, d, w0, F_w0c00, MD5S00); + MD5_STEP0(MD5_Fo, d, a, b, c, F_w1c01, MD5S01); + MD5_STEP0(MD5_Fo, c, d, a, b, F_w2c02, MD5S02); + MD5_STEP0(MD5_Fo, b, c, d, a, F_w3c03, MD5S03); + MD5_STEP0(MD5_Fo, a, b, c, d, F_w4c04, MD5S00); + MD5_STEP0(MD5_Fo, d, a, b, c, F_w5c05, MD5S01); + MD5_STEP0(MD5_Fo, c, d, a, b, F_w6c06, MD5S02); + MD5_STEP0(MD5_Fo, b, c, d, a, F_w7c07, MD5S03); + MD5_STEP0(MD5_Fo, a, b, c, d, F_w8c08, MD5S00); + MD5_STEP0(MD5_Fo, d, a, b, c, F_w9c09, MD5S01); + MD5_STEP0(MD5_Fo, c, d, a, b, F_wac0a, MD5S02); + MD5_STEP0(MD5_Fo, b, c, d, a, F_wbc0b, MD5S03); + MD5_STEP0(MD5_Fo, a, b, c, d, F_wcc0c, MD5S00); + MD5_STEP0(MD5_Fo, d, a, b, c, F_wdc0d, MD5S01); + MD5_STEP0(MD5_Fo, c, d, a, b, F_wec0e, MD5S02); + MD5_STEP0(MD5_Fo, b, c, d, a, F_wfc0f, MD5S03); + + MD5_STEP0(MD5_Go, a, b, c, d, G_w1c10, MD5S10); + MD5_STEP0(MD5_Go, d, a, b, c, G_w6c11, MD5S11); + MD5_STEP0(MD5_Go, c, d, a, b, G_wbc12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w0, G_w0c13, MD5S13); + MD5_STEP0(MD5_Go, a, b, c, d, G_w5c14, MD5S10); + MD5_STEP0(MD5_Go, d, a, b, c, G_wac15, MD5S11); + MD5_STEP0(MD5_Go, c, d, a, b, G_wfc16, MD5S12); + MD5_STEP0(MD5_Go, b, c, d, a, G_w4c17, MD5S13); + MD5_STEP0(MD5_Go, a, b, c, d, G_w9c18, MD5S10); + MD5_STEP0(MD5_Go, d, a, b, c, G_wec19, MD5S11); + MD5_STEP0(MD5_Go, c, d, a, b, G_w3c1a, MD5S12); + MD5_STEP0(MD5_Go, b, c, d, a, G_w8c1b, MD5S13); + MD5_STEP0(MD5_Go, a, b, c, d, G_wdc1c, MD5S10); + MD5_STEP0(MD5_Go, d, a, b, c, G_w2c1d, MD5S11); + MD5_STEP0(MD5_Go, c, d, a, b, G_w7c1e, MD5S12); + MD5_STEP0(MD5_Go, b, c, d, a, G_wcc1f, MD5S13); + + u32x t; + + MD5_STEP0(MD5_H1, a, b, c, d, H_w5c20, MD5S20); + MD5_STEP0(MD5_H2, d, a, b, c, H_w8c21, MD5S21); + MD5_STEP0(MD5_H1, c, d, a, b, H_wbc22, MD5S22); + MD5_STEP0(MD5_H2, b, c, d, a, H_wec23, MD5S23); + MD5_STEP0(MD5_H1, a, b, c, d, H_w1c24, MD5S20); + MD5_STEP0(MD5_H2, d, a, b, c, H_w4c25, MD5S21); + MD5_STEP0(MD5_H1, c, d, a, b, H_w7c26, MD5S22); + MD5_STEP0(MD5_H2, b, c, d, a, H_wac27, MD5S23); + MD5_STEP0(MD5_H1, a, b, c, d, H_wdc28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w0, H_w0c29, MD5S21); + MD5_STEP0(MD5_H1, c, d, a, b, H_w3c2a, MD5S22); + + if (MATCHES_NONE_VV (pre_c, c)) continue; + + MD5_STEP0(MD5_H2, b, c, d, a, H_w6c2b, MD5S23); + MD5_STEP0(MD5_H1, a, b, c, d, H_w9c2c, MD5S20); + MD5_STEP0(MD5_H2, d, a, b, c, H_wcc2d, MD5S21); + + if (MATCHES_NONE_VV (pre_d, d)) continue; + + MD5_STEP0(MD5_H1, c, d, a, b, H_wfc2e, MD5S22); + MD5_STEP0(MD5_H2, b, c, d, a, H_w2c2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, w0, I_w0c30, MD5S30); + MD5_STEP0(MD5_I , d, a, b, c, I_w7c31, MD5S31); + MD5_STEP0(MD5_I , c, d, a, b, I_wec32, MD5S32); + MD5_STEP0(MD5_I , b, c, d, a, I_w5c33, MD5S33); + MD5_STEP0(MD5_I , a, b, c, d, I_wcc34, MD5S30); + MD5_STEP0(MD5_I , d, a, b, c, I_w3c35, MD5S31); + MD5_STEP0(MD5_I , c, d, a, b, I_wac36, MD5S32); + MD5_STEP0(MD5_I , b, c, d, a, I_w1c37, MD5S33); + MD5_STEP0(MD5_I , a, b, c, d, I_w8c38, MD5S30); + MD5_STEP0(MD5_I , d, a, b, c, I_wfc39, MD5S31); + MD5_STEP0(MD5_I , c, d, a, b, I_w6c3a, MD5S32); + MD5_STEP0(MD5_I , b, c, d, a, I_wdc3b, MD5S33); + MD5_STEP0(MD5_I , a, b, c, d, I_w4c3c, MD5S30); + MD5_STEP0(MD5_I , d, a, b, c, I_wbc3d, MD5S31); + MD5_STEP0(MD5_I , c, d, a, b, I_w2c3e, MD5S32); + MD5_STEP0(MD5_I , b, c, d, a, I_w9c3f, MD5S33); + + COMPARE_S_SIMD (a, d, c, b); + } +} + +__kernel void m16400_m04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 w[16]; + + w[ 0] = pws[gid].i[ 0]; + w[ 1] = pws[gid].i[ 1]; + w[ 2] = pws[gid].i[ 2]; + w[ 3] = pws[gid].i[ 3]; + w[ 4] = 0; + w[ 5] = 0; + w[ 6] = 0; + w[ 7] = 0; + w[ 8] = 0; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = pws[gid].i[14]; + w[15] = 0; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16400m (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16400_m08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 w[16]; + + w[ 0] = pws[gid].i[ 0]; + w[ 1] = pws[gid].i[ 1]; + w[ 2] = pws[gid].i[ 2]; + w[ 3] = pws[gid].i[ 3]; + w[ 4] = pws[gid].i[ 4]; + w[ 5] = pws[gid].i[ 5]; + w[ 6] = pws[gid].i[ 6]; + w[ 7] = pws[gid].i[ 7]; + w[ 8] = 0; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = pws[gid].i[14]; + w[15] = 0; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16400m (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16400_m16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 w[16]; + + w[ 0] = pws[gid].i[ 0]; + w[ 1] = pws[gid].i[ 1]; + w[ 2] = pws[gid].i[ 2]; + w[ 3] = pws[gid].i[ 3]; + w[ 4] = pws[gid].i[ 4]; + w[ 5] = pws[gid].i[ 5]; + w[ 6] = pws[gid].i[ 6]; + w[ 7] = pws[gid].i[ 7]; + w[ 8] = pws[gid].i[ 8]; + w[ 9] = pws[gid].i[ 9]; + w[10] = pws[gid].i[10]; + w[11] = pws[gid].i[11]; + w[12] = pws[gid].i[12]; + w[13] = pws[gid].i[13]; + w[14] = pws[gid].i[14]; + w[15] = pws[gid].i[15]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16400m (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16400_s04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 w[16]; + + w[ 0] = pws[gid].i[ 0]; + w[ 1] = pws[gid].i[ 1]; + w[ 2] = pws[gid].i[ 2]; + w[ 3] = pws[gid].i[ 3]; + w[ 4] = 0; + w[ 5] = 0; + w[ 6] = 0; + w[ 7] = 0; + w[ 8] = 0; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = pws[gid].i[14]; + w[15] = 0; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16400s (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16400_s08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 w[16]; + + w[ 0] = pws[gid].i[ 0]; + w[ 1] = pws[gid].i[ 1]; + w[ 2] = pws[gid].i[ 2]; + w[ 3] = pws[gid].i[ 3]; + w[ 4] = pws[gid].i[ 4]; + w[ 5] = pws[gid].i[ 5]; + w[ 6] = pws[gid].i[ 6]; + w[ 7] = pws[gid].i[ 7]; + w[ 8] = 0; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = pws[gid].i[14]; + w[15] = 0; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16400s (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16400_s16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + u32 w[16]; + + w[ 0] = pws[gid].i[ 0]; + w[ 1] = pws[gid].i[ 1]; + w[ 2] = pws[gid].i[ 2]; + w[ 3] = pws[gid].i[ 3]; + w[ 4] = pws[gid].i[ 4]; + w[ 5] = pws[gid].i[ 5]; + w[ 6] = pws[gid].i[ 6]; + w[ 7] = pws[gid].i[ 7]; + w[ 8] = pws[gid].i[ 8]; + w[ 9] = pws[gid].i[ 9]; + w[10] = pws[gid].i[10]; + w[11] = pws[gid].i[11]; + w[12] = pws[gid].i[12]; + w[13] = pws[gid].i[13]; + w[14] = pws[gid].i[14]; + w[15] = pws[gid].i[15]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16400s (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} diff --git a/OpenCL/m16400_a3.cl b/OpenCL/m16400_a3.cl new file mode 100644 index 000000000..0cc3a6c3d --- /dev/null +++ b/OpenCL/m16400_a3.cl @@ -0,0 +1,299 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_simd.cl" +#include "inc_hash_md5.cl" + +void cram_md5_transform_vector (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4]) +{ + u32x a = digest[0]; + u32x b = digest[1]; + u32x c = digest[2]; + u32x d = digest[3]; + + u32x w0_t = w0[0] ^ 0x5c5c5c5c; + u32x w1_t = w0[1] ^ 0x5c5c5c5c; + u32x w2_t = w0[2] ^ 0x5c5c5c5c; + u32x w3_t = w0[3] ^ 0x5c5c5c5c; + u32x w4_t = w1[0] ^ 0x5c5c5c5c; + u32x w5_t = w1[1] ^ 0x5c5c5c5c; + u32x w6_t = w1[2] ^ 0x5c5c5c5c; + u32x w7_t = w1[3] ^ 0x5c5c5c5c; + u32x w8_t = w2[0] ^ 0x5c5c5c5c; + u32x w9_t = w2[1] ^ 0x5c5c5c5c; + u32x wa_t = w2[2] ^ 0x5c5c5c5c; + u32x wb_t = w2[3] ^ 0x5c5c5c5c; + u32x wc_t = w3[0] ^ 0x5c5c5c5c; + u32x wd_t = w3[1] ^ 0x5c5c5c5c; + u32x we_t = w3[2] ^ 0x5c5c5c5c; + u32x wf_t = w3[3] ^ 0x5c5c5c5c; + + MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03); + MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00); + MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01); + MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02); + MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03); + + MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13); + MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10); + MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11); + MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12); + MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13); + + u32x t; + + MD5_STEP (MD5_H1, a, b, c, d, w5_t, MD5C20, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w8_t, MD5C21, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, wb_t, MD5C22, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, we_t, MD5C23, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w1_t, MD5C24, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w4_t, MD5C25, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w7_t, MD5C26, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, wa_t, MD5C27, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, wd_t, MD5C28, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, w0_t, MD5C29, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, w3_t, MD5C2a, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w6_t, MD5C2b, MD5S23); + MD5_STEP (MD5_H1, a, b, c, d, w9_t, MD5C2c, MD5S20); + MD5_STEP (MD5_H2, d, a, b, c, wc_t, MD5C2d, MD5S21); + MD5_STEP (MD5_H1, c, d, a, b, wf_t, MD5C2e, MD5S22); + MD5_STEP (MD5_H2, b, c, d, a, w2_t, MD5C2f, MD5S23); + + MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33); + MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30); + MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31); + MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32); + MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33); + + digest[0] += a; + digest[1] += b; + digest[2] += c; + digest[3] += d; +} + +void cram_md5_update_vector_64 (md5_ctx_vector_t *ctx, u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], const int len) +{ + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else + const int pos = ctx->len & 63; + #endif + + ctx->len += len; + + switch_buffer_by_offset_le (w0, w1, w2, w3, pos); + + ctx->w0[0] |= w0[0]; + ctx->w0[1] |= w0[1]; + ctx->w0[2] |= w0[2]; + ctx->w0[3] |= w0[3]; + ctx->w1[0] |= w1[0]; + ctx->w1[1] |= w1[1]; + ctx->w1[2] |= w1[2]; + ctx->w1[3] |= w1[3]; + ctx->w2[0] |= w2[0]; + ctx->w2[1] |= w2[1]; + ctx->w2[2] |= w2[2]; + ctx->w2[3] |= w2[3]; + ctx->w3[0] |= w3[0]; + ctx->w3[1] |= w3[1]; + ctx->w3[2] |= w3[2]; + ctx->w3[3] |= w3[3]; +} + +void cram_md5_update_vector (md5_ctx_vector_t *ctx, const u32x *w, const int len) +{ + u32x w0[4]; + u32x w1[4]; + u32x w2[4]; + u32x w3[4]; + + w0[0] = w[0]; + w0[1] = w[1]; + w0[2] = w[2]; + w0[3] = w[3]; + w1[0] = w[4]; + w1[1] = w[5]; + w1[2] = w[6]; + w1[3] = w[7]; + w2[0] = w[8]; + w2[1] = w[9]; + w2[2] = w[10]; + w2[3] = w[11]; + w3[0] = w[12]; + w3[1] = w[13]; + w3[2] = w[14]; + w3[3] = w[15]; + + cram_md5_update_vector_64 (ctx, w0, w1, w2, w3, len); +} + + +void cram_md5_final_vector (md5_ctx_vector_t *ctx) +{ + cram_md5_transform_vector (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); +} + +__kernel void m16400_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32x w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = pws[gid].i[idx]; + } + + /** + * loop + */ + + u32x w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + w[0] = w0; + + md5_ctx_vector_t ctx; + + md5_init_vector (&ctx); + + cram_md5_update_vector (&ctx, w, pw_len); + + cram_md5_final_vector (&ctx); + + const u32x r0 = ctx.h[DGST_R0]; + const u32x r1 = ctx.h[DGST_R1]; + const u32x r2 = ctx.h[DGST_R2]; + const u32x r3 = ctx.h[DGST_R3]; + + COMPARE_M_SIMD (r0, r1, r2, r3); + } +} + +__kernel void m16400_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32x w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = pws[gid].i[idx]; + } + + /** + * loop + */ + + u32x w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + w[0] = w0; + + md5_ctx_vector_t ctx; + + md5_init_vector (&ctx); + + cram_md5_update_vector (&ctx, w, pw_len); + + cram_md5_final_vector (&ctx); + + const u32x r0 = ctx.h[DGST_R0]; + const u32x r1 = ctx.h[DGST_R1]; + const u32x r2 = ctx.h[DGST_R2]; + const u32x r3 = ctx.h[DGST_R3]; + + COMPARE_S_SIMD (r0, r1, r2, r3); + } +} diff --git a/OpenCL/m16511_a0.cl b/OpenCL/m16511_a0.cl new file mode 100644 index 000000000..8b2f6fe08 --- /dev/null +++ b/OpenCL/m16511_a0.cl @@ -0,0 +1,116 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_rp.h" +#include "inc_rp.cl" +#include "inc_scalar.cl" +#include "inc_hash_sha256.cl" + +__kernel void m16511_mxx (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + COPY_PW (pws[gid]); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + pw_t tmp = PASTE_PW; + + tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len); + + sha256_hmac_ctx_t ctx; + + sha256_hmac_init_swap (&ctx, tmp.i, tmp.pw_len); + + sha256_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha256_hmac_final (&ctx); + + const u32 r0 = ctx.opad.h[DGST_R0]; + const u32 r1 = ctx.opad.h[DGST_R1]; + const u32 r2 = ctx.opad.h[DGST_R2]; + const u32 r3 = ctx.opad.h[DGST_R3]; + + COMPARE_M_SCALAR (r0, r1, r2, r3); + } +} + +__kernel void m16511_sxx (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * base + */ + + COPY_PW (pws[gid]); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + pw_t tmp = PASTE_PW; + + tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len); + + sha256_hmac_ctx_t ctx; + + sha256_hmac_init_swap (&ctx, tmp.i, tmp.pw_len); + + sha256_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha256_hmac_final (&ctx); + + const u32 r0 = ctx.opad.h[DGST_R0]; + const u32 r1 = ctx.opad.h[DGST_R1]; + const u32 r2 = ctx.opad.h[DGST_R2]; + const u32 r3 = ctx.opad.h[DGST_R3]; + + COMPARE_S_SCALAR (r0, r1, r2, r3); + } +} diff --git a/OpenCL/m16511_a1.cl b/OpenCL/m16511_a1.cl new file mode 100644 index 000000000..0d9416f72 --- /dev/null +++ b/OpenCL/m16511_a1.cl @@ -0,0 +1,164 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_scalar.cl" +#include "inc_hash_sha256.cl" + +__kernel void m16511_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32 w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = swap32_S (pws[gid].i[idx]); + } + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + const u32 comb_len = combs_buf[il_pos].pw_len; + + u32 c[64]; + + #ifdef _unroll + #pragma unroll + #endif + for (int idx = 0; idx < 64; idx++) + { + c[idx] = swap32_S (combs_buf[il_pos].i[idx]); + } + + switch_buffer_by_offset_1x64_be_S (c, pw_len); + + #ifdef _unroll + #pragma unroll + #endif + for (int i = 0; i < 64; i++) + { + c[i] |= w[i]; + } + + sha256_hmac_ctx_t ctx; + + sha256_hmac_init (&ctx, c, pw_len + comb_len); + + sha256_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha256_hmac_final (&ctx); + + const u32 r0 = ctx.opad.h[DGST_R0]; + const u32 r1 = ctx.opad.h[DGST_R1]; + const u32 r2 = ctx.opad.h[DGST_R2]; + const u32 r3 = ctx.opad.h[DGST_R3]; + + COMPARE_M_SCALAR (r0, r1, r2, r3); + } +} + +__kernel void m16511_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32 w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = swap32_S (pws[gid].i[idx]); + } + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + const u32 comb_len = combs_buf[il_pos].pw_len; + + u32 c[64]; + + #ifdef _unroll + #pragma unroll + #endif + for (int idx = 0; idx < 64; idx++) + { + c[idx] = swap32_S (combs_buf[il_pos].i[idx]); + } + + switch_buffer_by_offset_1x64_be_S (c, pw_len); + + #ifdef _unroll + #pragma unroll + #endif + for (int i = 0; i < 64; i++) + { + c[i] |= w[i]; + } + + sha256_hmac_ctx_t ctx; + + sha256_hmac_init (&ctx, c, pw_len + comb_len); + + sha256_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha256_hmac_final (&ctx); + + const u32 r0 = ctx.opad.h[DGST_R0]; + const u32 r1 = ctx.opad.h[DGST_R1]; + const u32 r2 = ctx.opad.h[DGST_R2]; + const u32 r3 = ctx.opad.h[DGST_R3]; + + COMPARE_S_SCALAR (r0, r1, r2, r3); + } +} diff --git a/OpenCL/m16511_a3.cl b/OpenCL/m16511_a3.cl new file mode 100644 index 000000000..ce5963cde --- /dev/null +++ b/OpenCL/m16511_a3.cl @@ -0,0 +1,136 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_simd.cl" +#include "inc_hash_sha256.cl" + +__kernel void m16511_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32x w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = pws[gid].i[idx]; + } + + /** + * loop + */ + + u32x w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + w[0] = w0; + + sha256_hmac_ctx_t ctx; + + sha256_hmac_init (&ctx, w, pw_len); + + sha256_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha256_hmac_final (&ctx); + + const u32x r0 = ctx.opad.h[DGST_R0]; + const u32x r1 = ctx.opad.h[DGST_R1]; + const u32x r2 = ctx.opad.h[DGST_R2]; + const u32x r3 = ctx.opad.h[DGST_R3]; + + COMPARE_M_SIMD (r0, r1, r2, r3); + } +} + +__kernel void m16511_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32x w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = pws[gid].i[idx]; + } + + /** + * loop + */ + + u32x w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + w[0] = w0; + + sha256_hmac_ctx_t ctx; + + sha256_hmac_init (&ctx, w, pw_len); + + sha256_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha256_hmac_final (&ctx); + + const u32x r0 = ctx.opad.h[DGST_R0]; + const u32x r1 = ctx.opad.h[DGST_R1]; + const u32x r2 = ctx.opad.h[DGST_R2]; + const u32x r3 = ctx.opad.h[DGST_R3]; + + COMPARE_S_SIMD (r0, r1, r2, r3); + } +} diff --git a/OpenCL/m16512_a0.cl b/OpenCL/m16512_a0.cl new file mode 100644 index 000000000..9dded0326 --- /dev/null +++ b/OpenCL/m16512_a0.cl @@ -0,0 +1,116 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_rp.h" +#include "inc_rp.cl" +#include "inc_scalar.cl" +#include "inc_hash_sha384.cl" + +__kernel void m16512_mxx (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + COPY_PW (pws[gid]); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + pw_t tmp = PASTE_PW; + + tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len); + + sha384_hmac_ctx_t ctx; + + sha384_hmac_init_swap (&ctx, tmp.i, tmp.pw_len); + + sha384_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha384_hmac_final (&ctx); + + const u32x r0 = l32_from_64 (ctx.opad.h[0]); + const u32x r1 = h32_from_64 (ctx.opad.h[0]); + const u32x r2 = l32_from_64 (ctx.opad.h[1]); + const u32x r3 = h32_from_64 (ctx.opad.h[1]); + + COMPARE_M_SCALAR (r0, r1, r2, r3); + } +} + +__kernel void m16512_sxx (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * base + */ + + COPY_PW (pws[gid]); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + pw_t tmp = PASTE_PW; + + tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len); + + sha384_hmac_ctx_t ctx; + + sha384_hmac_init_swap (&ctx, tmp.i, tmp.pw_len); + + sha384_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha384_hmac_final (&ctx); + + const u32x r0 = l32_from_64 (ctx.opad.h[0]); + const u32x r1 = h32_from_64 (ctx.opad.h[0]); + const u32x r2 = l32_from_64 (ctx.opad.h[1]); + const u32x r3 = h32_from_64 (ctx.opad.h[1]); + + COMPARE_S_SCALAR (r0, r1, r2, r3); + } +} diff --git a/OpenCL/m16512_a1.cl b/OpenCL/m16512_a1.cl new file mode 100644 index 000000000..1258de6c9 --- /dev/null +++ b/OpenCL/m16512_a1.cl @@ -0,0 +1,164 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_scalar.cl" +#include "inc_hash_sha384.cl" + +__kernel void m16512_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32 w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = swap32_S (pws[gid].i[idx]); + } + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + const u32 comb_len = combs_buf[il_pos].pw_len; + + u32 c[64]; + + #ifdef _unroll + #pragma unroll + #endif + for (int idx = 0; idx < 64; idx++) + { + c[idx] = swap32_S (combs_buf[il_pos].i[idx]); + } + + switch_buffer_by_offset_1x64_be_S (c, pw_len); + + #ifdef _unroll + #pragma unroll + #endif + for (int i = 0; i < 64; i++) + { + c[i] |= w[i]; + } + + sha384_hmac_ctx_t ctx; + + sha384_hmac_init (&ctx, c, pw_len + comb_len); + + sha384_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha384_hmac_final (&ctx); + + const u32x r0 = l32_from_64 (ctx.opad.h[0]); + const u32x r1 = h32_from_64 (ctx.opad.h[0]); + const u32x r2 = l32_from_64 (ctx.opad.h[1]); + const u32x r3 = h32_from_64 (ctx.opad.h[1]); + + COMPARE_M_SCALAR (r0, r1, r2, r3); + } +} + +__kernel void m16512_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32 w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = swap32_S (pws[gid].i[idx]); + } + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + const u32 comb_len = combs_buf[il_pos].pw_len; + + u32 c[64]; + + #ifdef _unroll + #pragma unroll + #endif + for (int idx = 0; idx < 64; idx++) + { + c[idx] = swap32_S (combs_buf[il_pos].i[idx]); + } + + switch_buffer_by_offset_1x64_be_S (c, pw_len); + + #ifdef _unroll + #pragma unroll + #endif + for (int i = 0; i < 64; i++) + { + c[i] |= w[i]; + } + + sha384_hmac_ctx_t ctx; + + sha384_hmac_init (&ctx, c, pw_len + comb_len); + + sha384_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha384_hmac_final (&ctx); + + const u32x r0 = l32_from_64 (ctx.opad.h[0]); + const u32x r1 = h32_from_64 (ctx.opad.h[0]); + const u32x r2 = l32_from_64 (ctx.opad.h[1]); + const u32x r3 = h32_from_64 (ctx.opad.h[1]); + + COMPARE_S_SCALAR (r0, r1, r2, r3); + } +} diff --git a/OpenCL/m16512_a3.cl b/OpenCL/m16512_a3.cl new file mode 100644 index 000000000..9a626a3c8 --- /dev/null +++ b/OpenCL/m16512_a3.cl @@ -0,0 +1,136 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_simd.cl" +#include "inc_hash_sha384.cl" + +__kernel void m16512_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32x w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = pws[gid].i[idx]; + } + + /** + * loop + */ + + u32x w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + w[0] = w0; + + sha384_hmac_ctx_t ctx; + + sha384_hmac_init (&ctx, w, pw_len); + + sha384_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha384_hmac_final (&ctx); + + const u32x r0 = l32_from_64 (ctx.opad.h[0]); + const u32x r1 = h32_from_64 (ctx.opad.h[0]); + const u32x r2 = l32_from_64 (ctx.opad.h[1]); + const u32x r3 = h32_from_64 (ctx.opad.h[1]); + + COMPARE_M_SIMD (r0, r1, r2, r3); + } +} + +__kernel void m16512_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32x w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = pws[gid].i[idx]; + } + + /** + * loop + */ + + u32x w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + w[0] = w0; + + sha384_hmac_ctx_t ctx; + + sha384_hmac_init (&ctx, w, pw_len); + + sha384_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha384_hmac_final (&ctx); + + const u32x r0 = l32_from_64 (ctx.opad.h[0]); + const u32x r1 = h32_from_64 (ctx.opad.h[0]); + const u32x r2 = l32_from_64 (ctx.opad.h[1]); + const u32x r3 = h32_from_64 (ctx.opad.h[1]); + + COMPARE_S_SIMD (r0, r1, r2, r3); + } +} diff --git a/OpenCL/m16513_a0.cl b/OpenCL/m16513_a0.cl new file mode 100644 index 000000000..befd97473 --- /dev/null +++ b/OpenCL/m16513_a0.cl @@ -0,0 +1,116 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_rp.h" +#include "inc_rp.cl" +#include "inc_scalar.cl" +#include "inc_hash_sha512.cl" + +__kernel void m16513_mxx (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + COPY_PW (pws[gid]); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + pw_t tmp = PASTE_PW; + + tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len); + + sha512_hmac_ctx_t ctx; + + sha512_hmac_init_swap (&ctx, tmp.i, tmp.pw_len); + + sha512_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha512_hmac_final (&ctx); + + const u32x r0 = l32_from_64 (ctx.opad.h[0]); + const u32x r1 = h32_from_64 (ctx.opad.h[0]); + const u32x r2 = l32_from_64 (ctx.opad.h[1]); + const u32x r3 = h32_from_64 (ctx.opad.h[1]); + + COMPARE_M_SCALAR (r0, r1, r2, r3); + } +} + +__kernel void m16513_sxx (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * base + */ + + COPY_PW (pws[gid]); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + pw_t tmp = PASTE_PW; + + tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len); + + sha512_hmac_ctx_t ctx; + + sha512_hmac_init_swap (&ctx, tmp.i, tmp.pw_len); + + sha512_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha512_hmac_final (&ctx); + + const u32x r0 = l32_from_64 (ctx.opad.h[0]); + const u32x r1 = h32_from_64 (ctx.opad.h[0]); + const u32x r2 = l32_from_64 (ctx.opad.h[1]); + const u32x r3 = h32_from_64 (ctx.opad.h[1]); + + COMPARE_S_SCALAR (r0, r1, r2, r3); + } +} diff --git a/OpenCL/m16513_a1.cl b/OpenCL/m16513_a1.cl new file mode 100644 index 000000000..e5078c6f6 --- /dev/null +++ b/OpenCL/m16513_a1.cl @@ -0,0 +1,164 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_scalar.cl" +#include "inc_hash_sha512.cl" + +__kernel void m16513_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32 w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = swap32_S (pws[gid].i[idx]); + } + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + const u32 comb_len = combs_buf[il_pos].pw_len; + + u32 c[64]; + + #ifdef _unroll + #pragma unroll + #endif + for (int idx = 0; idx < 64; idx++) + { + c[idx] = swap32_S (combs_buf[il_pos].i[idx]); + } + + switch_buffer_by_offset_1x64_be_S (c, pw_len); + + #ifdef _unroll + #pragma unroll + #endif + for (int i = 0; i < 64; i++) + { + c[i] |= w[i]; + } + + sha512_hmac_ctx_t ctx; + + sha512_hmac_init (&ctx, c, pw_len + comb_len); + + sha512_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha512_hmac_final (&ctx); + + const u32x r0 = l32_from_64 (ctx.opad.h[0]); + const u32x r1 = h32_from_64 (ctx.opad.h[0]); + const u32x r2 = l32_from_64 (ctx.opad.h[1]); + const u32x r3 = h32_from_64 (ctx.opad.h[1]); + + COMPARE_M_SCALAR (r0, r1, r2, r3); + } +} + +__kernel void m16513_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32 w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = swap32_S (pws[gid].i[idx]); + } + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + const u32 comb_len = combs_buf[il_pos].pw_len; + + u32 c[64]; + + #ifdef _unroll + #pragma unroll + #endif + for (int idx = 0; idx < 64; idx++) + { + c[idx] = swap32_S (combs_buf[il_pos].i[idx]); + } + + switch_buffer_by_offset_1x64_be_S (c, pw_len); + + #ifdef _unroll + #pragma unroll + #endif + for (int i = 0; i < 64; i++) + { + c[i] |= w[i]; + } + + sha512_hmac_ctx_t ctx; + + sha512_hmac_init (&ctx, c, pw_len + comb_len); + + sha512_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha512_hmac_final (&ctx); + + const u32x r0 = l32_from_64 (ctx.opad.h[0]); + const u32x r1 = h32_from_64 (ctx.opad.h[0]); + const u32x r2 = l32_from_64 (ctx.opad.h[1]); + const u32x r3 = h32_from_64 (ctx.opad.h[1]); + + COMPARE_S_SCALAR (r0, r1, r2, r3); + } +} diff --git a/OpenCL/m16513_a3.cl b/OpenCL/m16513_a3.cl new file mode 100644 index 000000000..24798d1ef --- /dev/null +++ b/OpenCL/m16513_a3.cl @@ -0,0 +1,136 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_simd.cl" +#include "inc_hash_sha512.cl" + +__kernel void m16513_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32x w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = pws[gid].i[idx]; + } + + /** + * loop + */ + + u32x w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + w[0] = w0; + + sha512_hmac_ctx_t ctx; + + sha512_hmac_init (&ctx, w, pw_len); + + sha512_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha512_hmac_final (&ctx); + + const u32x r0 = l32_from_64 (ctx.opad.h[0]); + const u32x r1 = h32_from_64 (ctx.opad.h[0]); + const u32x r2 = l32_from_64 (ctx.opad.h[1]); + const u32x r3 = h32_from_64 (ctx.opad.h[1]); + + COMPARE_M_SIMD (r0, r1, r2, r3); + } +} + +__kernel void m16513_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const jwt_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * modifier + */ + + const u64 lid = get_local_id (0); + const u64 gid = get_global_id (0); + + if (gid >= gid_max) return; + + /** + * digest + */ + + const u32 search[4] = + { + digests_buf[digests_offset].digest_buf[DGST_R0], + digests_buf[digests_offset].digest_buf[DGST_R1], + digests_buf[digests_offset].digest_buf[DGST_R2], + digests_buf[digests_offset].digest_buf[DGST_R3] + }; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32x w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = pws[gid].i[idx]; + } + + /** + * loop + */ + + u32x w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + w[0] = w0; + + sha512_hmac_ctx_t ctx; + + sha512_hmac_init (&ctx, w, pw_len); + + sha512_hmac_update_global_swap (&ctx, esalt_bufs[digests_offset].salt_buf, esalt_bufs[digests_offset].salt_len); + + sha512_hmac_final (&ctx); + + const u32x r0 = l32_from_64 (ctx.opad.h[0]); + const u32x r1 = h32_from_64 (ctx.opad.h[0]); + const u32x r2 = l32_from_64 (ctx.opad.h[1]); + const u32x r3 = h32_from_64 (ctx.opad.h[1]); + + COMPARE_S_SIMD (r0, r1, r2, r3); + } +} diff --git a/OpenCL/m16600_a0-optimized.cl b/OpenCL/m16600_a0-optimized.cl new file mode 100644 index 000000000..91baafed5 --- /dev/null +++ b/OpenCL/m16600_a0-optimized.cl @@ -0,0 +1,754 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_rp_optimized.h" +#include "inc_rp_optimized.cl" +#include "inc_simd.cl" +#include "inc_cipher_aes.cl" + +__kernel void m16600_m04 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + u32 pw_buf0[4]; + u32 pw_buf1[4]; + + pw_buf0[0] = pws[gid].i[0]; + pw_buf0[1] = pws[gid].i[1]; + pw_buf0[2] = pws[gid].i[2]; + pw_buf0[3] = pws[gid].i[3]; + pw_buf1[0] = pws[gid].i[4]; + pw_buf1[1] = pws[gid].i[5]; + pw_buf1[2] = pws[gid].i[6]; + pw_buf1[3] = pws[gid].i[7]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + u32x w0[4] = { 0 }; + u32x w1[4] = { 0 }; + u32x w2[4] = { 0 }; + u32x w3[4] = { 0 }; + + const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + + append_0x80_2x4_VV (w0, w1, out_len); + + /** + * sha256 + */ + + u32x w0_t = swap32_S (w0[0]); + u32x w1_t = swap32_S (w0[1]); + u32x w2_t = swap32_S (w0[2]); + u32x w3_t = swap32_S (w0[3]); + u32x w4_t = swap32_S (w1[0]); + u32x w5_t = swap32_S (w1[1]); + u32x w6_t = swap32_S (w1[2]); + u32x w7_t = swap32_S (w1[3]); + u32x w8_t = swap32_S (w2[0]); + u32x w9_t = swap32_S (w2[1]); + u32x wa_t = swap32_S (w2[2]); + u32x wb_t = swap32_S (w2[3]); + u32x wc_t = swap32_S (w3[0]); + u32x wd_t = swap32_S (w3[1]); + u32x we_t = 0; + u32x wf_t = out_len * 8; + + u32x a = SHA256M_A; + u32x b = SHA256M_B; + u32x c = SHA256M_C; + u32x d = SHA256M_D; + u32x e = SHA256M_E; + u32x f = SHA256M_F; + u32x g = SHA256M_G; + u32x h = SHA256M_H; + + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C02); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C03); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C04); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C05); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C06); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C07); + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C08); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C09); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C0a); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C0b); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C0c); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C0d); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C0e); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C0f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C10); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C11); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C12); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C13); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C14); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C15); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C16); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C17); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C18); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C19); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C1a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C1b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C1c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C1d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C1e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C1f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C20); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C21); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C22); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C23); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C24); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C25); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C26); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C27); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C28); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C29); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C2a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C2b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C2c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C2d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C2e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C2f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C30); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C31); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C32); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C33); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C34); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C35); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C36); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C37); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C38); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C39); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C3a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C3b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C3c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C3d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C3e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C3f); + + a += SHA256M_A; + b += SHA256M_B; + c += SHA256M_C; + d += SHA256M_D; + e += SHA256M_E; + f += SHA256M_F; + g += SHA256M_G; + h += SHA256M_H; + + w0_t = a; + w1_t = b; + w2_t = c; + w3_t = d; + w4_t = e; + w5_t = f; + w6_t = g; + w7_t = h; + w8_t = 0x80000000; + w9_t = 0; + wa_t = 0; + wb_t = 0; + wc_t = 0; + wd_t = 0; + we_t = 0; + wf_t = 32 * 8; + + a = SHA256M_A; + b = SHA256M_B; + c = SHA256M_C; + d = SHA256M_D; + e = SHA256M_E; + f = SHA256M_F; + g = SHA256M_G; + h = SHA256M_H; + + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C02); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C03); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C04); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C05); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C06); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C07); + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C08); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C09); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C0a); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C0b); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C0c); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C0d); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C0e); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C0f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C10); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C11); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C12); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C13); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C14); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C15); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C16); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C17); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C18); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C19); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C1a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C1b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C1c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C1d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C1e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C1f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C20); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C21); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C22); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C23); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C24); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C25); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C26); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C27); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C28); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C29); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C2a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C2b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C2c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C2d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C2e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C2f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C30); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C31); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C32); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C33); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C34); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C35); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C36); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C37); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C38); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C39); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C3a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C3b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C3c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C3d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C3e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C3f); + + a += SHA256M_A; + b += SHA256M_B; + c += SHA256M_C; + d += SHA256M_D; + e += SHA256M_E; + f += SHA256M_F; + g += SHA256M_G; + h += SHA256M_H; + + u32 ukey[8]; + + ukey[0] = swap32_S (a); + ukey[1] = swap32_S (b); + ukey[2] = swap32_S (c); + ukey[3] = swap32_S (d); + ukey[4] = swap32_S (e); + ukey[5] = swap32_S (f); + ukey[6] = swap32_S (g); + ukey[7] = swap32_S (h); + + #define KEYLEN 60 + + u32 ks[KEYLEN]; + + aes256_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 encrypted[4]; + + encrypted[0] = esalt_bufs[digests_offset].encrypted[0]; + encrypted[1] = esalt_bufs[digests_offset].encrypted[1]; + encrypted[2] = esalt_bufs[digests_offset].encrypted[2]; + encrypted[3] = esalt_bufs[digests_offset].encrypted[3]; + + u32 out[4]; + + aes256_decrypt (ks, encrypted, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 iv[4]; + + iv[0] = esalt_bufs[digests_offset].iv[0]; + iv[1] = esalt_bufs[digests_offset].iv[1]; + iv[2] = esalt_bufs[digests_offset].iv[2]; + iv[3] = esalt_bufs[digests_offset].iv[3]; + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + if (esalt_bufs[digests_offset].salt_type == 1) + { + if (is_valid_hex_32 (out[0]) == 0) continue; + if (is_valid_hex_32 (out[1]) == 0) continue; + if (is_valid_hex_32 (out[2]) == 0) continue; + if (is_valid_hex_32 (out[3]) == 0) continue; + + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } +} + +__kernel void m16600_m08 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16600_m16 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16600_s04 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + u32 pw_buf0[4]; + u32 pw_buf1[4]; + + pw_buf0[0] = pws[gid].i[0]; + pw_buf0[1] = pws[gid].i[1]; + pw_buf0[2] = pws[gid].i[2]; + pw_buf0[3] = pws[gid].i[3]; + pw_buf1[0] = pws[gid].i[4]; + pw_buf1[1] = pws[gid].i[5]; + pw_buf1[2] = pws[gid].i[6]; + pw_buf1[3] = pws[gid].i[7]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + u32x w0[4] = { 0 }; + u32x w1[4] = { 0 }; + u32x w2[4] = { 0 }; + u32x w3[4] = { 0 }; + + const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + + append_0x80_2x4_VV (w0, w1, out_len); + + /** + * sha256 + */ + + u32x w0_t = swap32_S (w0[0]); + u32x w1_t = swap32_S (w0[1]); + u32x w2_t = swap32_S (w0[2]); + u32x w3_t = swap32_S (w0[3]); + u32x w4_t = swap32_S (w1[0]); + u32x w5_t = swap32_S (w1[1]); + u32x w6_t = swap32_S (w1[2]); + u32x w7_t = swap32_S (w1[3]); + u32x w8_t = swap32_S (w2[0]); + u32x w9_t = swap32_S (w2[1]); + u32x wa_t = swap32_S (w2[2]); + u32x wb_t = swap32_S (w2[3]); + u32x wc_t = swap32_S (w3[0]); + u32x wd_t = swap32_S (w3[1]); + u32x we_t = 0; + u32x wf_t = out_len * 8; + + u32x a = SHA256M_A; + u32x b = SHA256M_B; + u32x c = SHA256M_C; + u32x d = SHA256M_D; + u32x e = SHA256M_E; + u32x f = SHA256M_F; + u32x g = SHA256M_G; + u32x h = SHA256M_H; + + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C02); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C03); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C04); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C05); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C06); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C07); + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C08); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C09); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C0a); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C0b); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C0c); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C0d); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C0e); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C0f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C10); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C11); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C12); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C13); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C14); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C15); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C16); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C17); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C18); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C19); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C1a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C1b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C1c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C1d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C1e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C1f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C20); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C21); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C22); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C23); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C24); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C25); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C26); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C27); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C28); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C29); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C2a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C2b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C2c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C2d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C2e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C2f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C30); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C31); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C32); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C33); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C34); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C35); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C36); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C37); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C38); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C39); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C3a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C3b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C3c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C3d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C3e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C3f); + + a += SHA256M_A; + b += SHA256M_B; + c += SHA256M_C; + d += SHA256M_D; + e += SHA256M_E; + f += SHA256M_F; + g += SHA256M_G; + h += SHA256M_H; + + w0_t = a; + w1_t = b; + w2_t = c; + w3_t = d; + w4_t = e; + w5_t = f; + w6_t = g; + w7_t = h; + w8_t = 0x80000000; + w9_t = 0; + wa_t = 0; + wb_t = 0; + wc_t = 0; + wd_t = 0; + we_t = 0; + wf_t = 32 * 8; + + a = SHA256M_A; + b = SHA256M_B; + c = SHA256M_C; + d = SHA256M_D; + e = SHA256M_E; + f = SHA256M_F; + g = SHA256M_G; + h = SHA256M_H; + + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C02); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C03); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C04); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C05); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C06); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C07); + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C08); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C09); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C0a); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C0b); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C0c); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C0d); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C0e); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C0f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C10); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C11); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C12); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C13); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C14); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C15); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C16); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C17); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C18); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C19); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C1a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C1b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C1c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C1d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C1e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C1f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C20); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C21); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C22); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C23); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C24); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C25); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C26); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C27); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C28); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C29); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C2a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C2b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C2c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C2d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C2e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C2f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C30); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C31); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C32); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C33); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C34); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C35); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C36); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C37); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C38); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C39); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C3a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C3b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C3c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C3d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C3e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C3f); + + a += SHA256M_A; + b += SHA256M_B; + c += SHA256M_C; + d += SHA256M_D; + e += SHA256M_E; + f += SHA256M_F; + g += SHA256M_G; + h += SHA256M_H; + + u32 ukey[8]; + + ukey[0] = swap32_S (a); + ukey[1] = swap32_S (b); + ukey[2] = swap32_S (c); + ukey[3] = swap32_S (d); + ukey[4] = swap32_S (e); + ukey[5] = swap32_S (f); + ukey[6] = swap32_S (g); + ukey[7] = swap32_S (h); + + #define KEYLEN 60 + + u32 ks[KEYLEN]; + + aes256_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 encrypted[4]; + + encrypted[0] = esalt_bufs[digests_offset].encrypted[0]; + encrypted[1] = esalt_bufs[digests_offset].encrypted[1]; + encrypted[2] = esalt_bufs[digests_offset].encrypted[2]; + encrypted[3] = esalt_bufs[digests_offset].encrypted[3]; + + u32 out[4]; + + aes256_decrypt (ks, encrypted, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 iv[4]; + + iv[0] = esalt_bufs[digests_offset].iv[0]; + iv[1] = esalt_bufs[digests_offset].iv[1]; + iv[2] = esalt_bufs[digests_offset].iv[2]; + iv[3] = esalt_bufs[digests_offset].iv[3]; + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + if (esalt_bufs[digests_offset].salt_type == 1) + { + if (is_valid_hex_32 (out[0]) == 0) continue; + if (is_valid_hex_32 (out[1]) == 0) continue; + if (is_valid_hex_32 (out[2]) == 0) continue; + if (is_valid_hex_32 (out[3]) == 0) continue; + + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } +} + +__kernel void m16600_s08 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16600_s16 (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} diff --git a/OpenCL/m16600_a0.cl b/OpenCL/m16600_a0.cl new file mode 100644 index 000000000..97828f437 --- /dev/null +++ b/OpenCL/m16600_a0.cl @@ -0,0 +1,367 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_rp.h" +#include "inc_rp.cl" +#include "inc_scalar.cl" +#include "inc_hash_sha256.cl" +#include "inc_cipher_aes.cl" + +__kernel void m16600_mxx (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + COPY_PW (pws[gid]); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + pw_t tmp = PASTE_PW; + + tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len); + + sha256_ctx_t ctx; + + sha256_init (&ctx); + + sha256_update_swap (&ctx, tmp.i, tmp.pw_len); + + sha256_final (&ctx); + + u32 a = ctx.h[0]; + u32 b = ctx.h[1]; + u32 c = ctx.h[2]; + u32 d = ctx.h[3]; + u32 e = ctx.h[4]; + u32 f = ctx.h[5]; + u32 g = ctx.h[6]; + u32 h = ctx.h[7]; + + sha256_init (&ctx); + + ctx.w0[0] = a; + ctx.w0[1] = b; + ctx.w0[2] = c; + ctx.w0[3] = d; + ctx.w1[0] = e; + ctx.w1[1] = f; + ctx.w1[2] = g; + ctx.w1[3] = h; + + ctx.len = 32; + + sha256_final (&ctx); + + a = ctx.h[0]; + b = ctx.h[1]; + c = ctx.h[2]; + d = ctx.h[3]; + e = ctx.h[4]; + f = ctx.h[5]; + g = ctx.h[6]; + h = ctx.h[7]; + + u32 ukey[8]; + + ukey[0] = swap32_S (a); + ukey[1] = swap32_S (b); + ukey[2] = swap32_S (c); + ukey[3] = swap32_S (d); + ukey[4] = swap32_S (e); + ukey[5] = swap32_S (f); + ukey[6] = swap32_S (g); + ukey[7] = swap32_S (h); + + #define KEYLEN 60 + + u32 ks[KEYLEN]; + + aes256_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 encrypted[4]; + + encrypted[0] = esalt_bufs[digests_offset].encrypted[0]; + encrypted[1] = esalt_bufs[digests_offset].encrypted[1]; + encrypted[2] = esalt_bufs[digests_offset].encrypted[2]; + encrypted[3] = esalt_bufs[digests_offset].encrypted[3]; + + u32 out[4]; + + aes256_decrypt (ks, encrypted, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 iv[4]; + + iv[0] = esalt_bufs[digests_offset].iv[0]; + iv[1] = esalt_bufs[digests_offset].iv[1]; + iv[2] = esalt_bufs[digests_offset].iv[2]; + iv[3] = esalt_bufs[digests_offset].iv[3]; + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + if (esalt_bufs[digests_offset].salt_type == 1) + { + if (is_valid_hex_32 (out[0]) == 0) continue; + if (is_valid_hex_32 (out[1]) == 0) continue; + if (is_valid_hex_32 (out[2]) == 0) continue; + if (is_valid_hex_32 (out[3]) == 0) continue; + + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } +} + +__kernel void m16600_sxx (__global pw_t *pws, __constant const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + COPY_PW (pws[gid]); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + pw_t tmp = PASTE_PW; + + tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len); + + sha256_ctx_t ctx; + + sha256_init (&ctx); + + sha256_update_swap (&ctx, tmp.i, tmp.pw_len); + + sha256_final (&ctx); + + u32 a = ctx.h[0]; + u32 b = ctx.h[1]; + u32 c = ctx.h[2]; + u32 d = ctx.h[3]; + u32 e = ctx.h[4]; + u32 f = ctx.h[5]; + u32 g = ctx.h[6]; + u32 h = ctx.h[7]; + + sha256_init (&ctx); + + ctx.w0[0] = a; + ctx.w0[1] = b; + ctx.w0[2] = c; + ctx.w0[3] = d; + ctx.w1[0] = e; + ctx.w1[1] = f; + ctx.w1[2] = g; + ctx.w1[3] = h; + + ctx.len = 32; + + sha256_final (&ctx); + + a = ctx.h[0]; + b = ctx.h[1]; + c = ctx.h[2]; + d = ctx.h[3]; + e = ctx.h[4]; + f = ctx.h[5]; + g = ctx.h[6]; + h = ctx.h[7]; + + u32 ukey[8]; + + ukey[0] = swap32_S (a); + ukey[1] = swap32_S (b); + ukey[2] = swap32_S (c); + ukey[3] = swap32_S (d); + ukey[4] = swap32_S (e); + ukey[5] = swap32_S (f); + ukey[6] = swap32_S (g); + ukey[7] = swap32_S (h); + + #define KEYLEN 60 + + u32 ks[KEYLEN]; + + aes256_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 encrypted[4]; + + encrypted[0] = esalt_bufs[digests_offset].encrypted[0]; + encrypted[1] = esalt_bufs[digests_offset].encrypted[1]; + encrypted[2] = esalt_bufs[digests_offset].encrypted[2]; + encrypted[3] = esalt_bufs[digests_offset].encrypted[3]; + + u32 out[4]; + + aes256_decrypt (ks, encrypted, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 iv[4]; + + iv[0] = esalt_bufs[digests_offset].iv[0]; + iv[1] = esalt_bufs[digests_offset].iv[1]; + iv[2] = esalt_bufs[digests_offset].iv[2]; + iv[3] = esalt_bufs[digests_offset].iv[3]; + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + if (esalt_bufs[digests_offset].salt_type == 1) + { + if (is_valid_hex_32 (out[0]) == 0) continue; + if (is_valid_hex_32 (out[1]) == 0) continue; + if (is_valid_hex_32 (out[2]) == 0) continue; + if (is_valid_hex_32 (out[3]) == 0) continue; + + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } +} diff --git a/OpenCL/m16600_a1-optimized.cl b/OpenCL/m16600_a1-optimized.cl new file mode 100644 index 000000000..67827756b --- /dev/null +++ b/OpenCL/m16600_a1-optimized.cl @@ -0,0 +1,868 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_simd.cl" +#include "inc_cipher_aes.cl" + +__kernel void m16600_m04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + u32 pw_buf0[4]; + u32 pw_buf1[4]; + + pw_buf0[0] = pws[gid].i[0]; + pw_buf0[1] = pws[gid].i[1]; + pw_buf0[2] = pws[gid].i[2]; + pw_buf0[3] = pws[gid].i[3]; + pw_buf1[0] = pws[gid].i[4]; + pw_buf1[1] = pws[gid].i[5]; + pw_buf1[2] = pws[gid].i[6]; + pw_buf1[3] = pws[gid].i[7]; + + const u32 pw_l_len = pws[gid].pw_len; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos); + + const u32x pw_len = pw_l_len + pw_r_len; + + /** + * concat password candidate + */ + + u32x wordl0[4] = { 0 }; + u32x wordl1[4] = { 0 }; + u32x wordl2[4] = { 0 }; + u32x wordl3[4] = { 0 }; + + wordl0[0] = pw_buf0[0]; + wordl0[1] = pw_buf0[1]; + wordl0[2] = pw_buf0[2]; + wordl0[3] = pw_buf0[3]; + wordl1[0] = pw_buf1[0]; + wordl1[1] = pw_buf1[1]; + wordl1[2] = pw_buf1[2]; + wordl1[3] = pw_buf1[3]; + + u32x wordr0[4] = { 0 }; + u32x wordr1[4] = { 0 }; + u32x wordr2[4] = { 0 }; + u32x wordr3[4] = { 0 }; + + wordr0[0] = ix_create_combt (combs_buf, il_pos, 0); + wordr0[1] = ix_create_combt (combs_buf, il_pos, 1); + wordr0[2] = ix_create_combt (combs_buf, il_pos, 2); + wordr0[3] = ix_create_combt (combs_buf, il_pos, 3); + wordr1[0] = ix_create_combt (combs_buf, il_pos, 4); + wordr1[1] = ix_create_combt (combs_buf, il_pos, 5); + wordr1[2] = ix_create_combt (combs_buf, il_pos, 6); + wordr1[3] = ix_create_combt (combs_buf, il_pos, 7); + + if (combs_mode == COMBINATOR_MODE_BASE_LEFT) + { + switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len); + } + else + { + switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len); + } + + u32x w0[4]; + u32x w1[4]; + u32x w2[4]; + u32x w3[4]; + + w0[0] = wordl0[0] | wordr0[0]; + w0[1] = wordl0[1] | wordr0[1]; + w0[2] = wordl0[2] | wordr0[2]; + w0[3] = wordl0[3] | wordr0[3]; + w1[0] = wordl1[0] | wordr1[0]; + w1[1] = wordl1[1] | wordr1[1]; + w1[2] = wordl1[2] | wordr1[2]; + w1[3] = wordl1[3] | wordr1[3]; + w2[0] = wordl2[0] | wordr2[0]; + w2[1] = wordl2[1] | wordr2[1]; + w2[2] = wordl2[2] | wordr2[2]; + w2[3] = wordl2[3] | wordr2[3]; + w3[0] = wordl3[0] | wordr3[0]; + w3[1] = wordl3[1] | wordr3[1]; + w3[2] = wordl3[2] | wordr3[2]; + w3[3] = wordl3[3] | wordr3[3]; + + /** + * sha256 + */ + + u32x w0_t = swap32_S (w0[0]); + u32x w1_t = swap32_S (w0[1]); + u32x w2_t = swap32_S (w0[2]); + u32x w3_t = swap32_S (w0[3]); + u32x w4_t = swap32_S (w1[0]); + u32x w5_t = swap32_S (w1[1]); + u32x w6_t = swap32_S (w1[2]); + u32x w7_t = swap32_S (w1[3]); + u32x w8_t = swap32_S (w2[0]); + u32x w9_t = swap32_S (w2[1]); + u32x wa_t = swap32_S (w2[2]); + u32x wb_t = swap32_S (w2[3]); + u32x wc_t = swap32_S (w3[0]); + u32x wd_t = swap32_S (w3[1]); + u32x we_t = 0; + u32x wf_t = pw_len * 8; + + u32x a = SHA256M_A; + u32x b = SHA256M_B; + u32x c = SHA256M_C; + u32x d = SHA256M_D; + u32x e = SHA256M_E; + u32x f = SHA256M_F; + u32x g = SHA256M_G; + u32x h = SHA256M_H; + + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C02); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C03); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C04); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C05); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C06); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C07); + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C08); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C09); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C0a); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C0b); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C0c); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C0d); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C0e); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C0f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C10); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C11); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C12); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C13); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C14); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C15); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C16); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C17); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C18); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C19); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C1a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C1b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C1c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C1d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C1e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C1f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C20); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C21); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C22); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C23); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C24); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C25); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C26); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C27); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C28); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C29); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C2a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C2b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C2c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C2d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C2e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C2f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C30); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C31); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C32); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C33); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C34); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C35); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C36); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C37); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C38); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C39); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C3a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C3b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C3c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C3d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C3e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C3f); + + a += SHA256M_A; + b += SHA256M_B; + c += SHA256M_C; + d += SHA256M_D; + e += SHA256M_E; + f += SHA256M_F; + g += SHA256M_G; + h += SHA256M_H; + + w0_t = a; + w1_t = b; + w2_t = c; + w3_t = d; + w4_t = e; + w5_t = f; + w6_t = g; + w7_t = h; + w8_t = 0x80000000; + w9_t = 0; + wa_t = 0; + wb_t = 0; + wc_t = 0; + wd_t = 0; + we_t = 0; + wf_t = 32 * 8; + + a = SHA256M_A; + b = SHA256M_B; + c = SHA256M_C; + d = SHA256M_D; + e = SHA256M_E; + f = SHA256M_F; + g = SHA256M_G; + h = SHA256M_H; + + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C02); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C03); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C04); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C05); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C06); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C07); + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C08); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C09); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C0a); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C0b); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C0c); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C0d); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C0e); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C0f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C10); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C11); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C12); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C13); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C14); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C15); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C16); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C17); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C18); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C19); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C1a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C1b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C1c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C1d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C1e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C1f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C20); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C21); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C22); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C23); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C24); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C25); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C26); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C27); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C28); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C29); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C2a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C2b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C2c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C2d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C2e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C2f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C30); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C31); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C32); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C33); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C34); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C35); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C36); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C37); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C38); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C39); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C3a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C3b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C3c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C3d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C3e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C3f); + + a += SHA256M_A; + b += SHA256M_B; + c += SHA256M_C; + d += SHA256M_D; + e += SHA256M_E; + f += SHA256M_F; + g += SHA256M_G; + h += SHA256M_H; + + u32 ukey[8]; + + ukey[0] = swap32_S (a); + ukey[1] = swap32_S (b); + ukey[2] = swap32_S (c); + ukey[3] = swap32_S (d); + ukey[4] = swap32_S (e); + ukey[5] = swap32_S (f); + ukey[6] = swap32_S (g); + ukey[7] = swap32_S (h); + + #define KEYLEN 60 + + u32 ks[KEYLEN]; + + aes256_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 encrypted[4]; + + encrypted[0] = esalt_bufs[digests_offset].encrypted[0]; + encrypted[1] = esalt_bufs[digests_offset].encrypted[1]; + encrypted[2] = esalt_bufs[digests_offset].encrypted[2]; + encrypted[3] = esalt_bufs[digests_offset].encrypted[3]; + + u32 out[4]; + + aes256_decrypt (ks, encrypted, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 iv[4]; + + iv[0] = esalt_bufs[digests_offset].iv[0]; + iv[1] = esalt_bufs[digests_offset].iv[1]; + iv[2] = esalt_bufs[digests_offset].iv[2]; + iv[3] = esalt_bufs[digests_offset].iv[3]; + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + if (esalt_bufs[digests_offset].salt_type == 1) + { + if (is_valid_hex_32 (out[0]) == 0) continue; + if (is_valid_hex_32 (out[1]) == 0) continue; + if (is_valid_hex_32 (out[2]) == 0) continue; + if (is_valid_hex_32 (out[3]) == 0) continue; + + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } +} + +__kernel void m16600_m08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16600_m16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16600_s04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + u32 pw_buf0[4]; + u32 pw_buf1[4]; + + pw_buf0[0] = pws[gid].i[0]; + pw_buf0[1] = pws[gid].i[1]; + pw_buf0[2] = pws[gid].i[2]; + pw_buf0[3] = pws[gid].i[3]; + pw_buf1[0] = pws[gid].i[4]; + pw_buf1[1] = pws[gid].i[5]; + pw_buf1[2] = pws[gid].i[6]; + pw_buf1[3] = pws[gid].i[7]; + + const u32 pw_l_len = pws[gid].pw_len; + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos); + + const u32x pw_len = pw_l_len + pw_r_len; + + /** + * concat password candidate + */ + + u32x wordl0[4] = { 0 }; + u32x wordl1[4] = { 0 }; + u32x wordl2[4] = { 0 }; + u32x wordl3[4] = { 0 }; + + wordl0[0] = pw_buf0[0]; + wordl0[1] = pw_buf0[1]; + wordl0[2] = pw_buf0[2]; + wordl0[3] = pw_buf0[3]; + wordl1[0] = pw_buf1[0]; + wordl1[1] = pw_buf1[1]; + wordl1[2] = pw_buf1[2]; + wordl1[3] = pw_buf1[3]; + + u32x wordr0[4] = { 0 }; + u32x wordr1[4] = { 0 }; + u32x wordr2[4] = { 0 }; + u32x wordr3[4] = { 0 }; + + wordr0[0] = ix_create_combt (combs_buf, il_pos, 0); + wordr0[1] = ix_create_combt (combs_buf, il_pos, 1); + wordr0[2] = ix_create_combt (combs_buf, il_pos, 2); + wordr0[3] = ix_create_combt (combs_buf, il_pos, 3); + wordr1[0] = ix_create_combt (combs_buf, il_pos, 4); + wordr1[1] = ix_create_combt (combs_buf, il_pos, 5); + wordr1[2] = ix_create_combt (combs_buf, il_pos, 6); + wordr1[3] = ix_create_combt (combs_buf, il_pos, 7); + + if (combs_mode == COMBINATOR_MODE_BASE_LEFT) + { + switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len); + } + else + { + switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len); + } + + u32x w0[4]; + u32x w1[4]; + u32x w2[4]; + u32x w3[4]; + + w0[0] = wordl0[0] | wordr0[0]; + w0[1] = wordl0[1] | wordr0[1]; + w0[2] = wordl0[2] | wordr0[2]; + w0[3] = wordl0[3] | wordr0[3]; + w1[0] = wordl1[0] | wordr1[0]; + w1[1] = wordl1[1] | wordr1[1]; + w1[2] = wordl1[2] | wordr1[2]; + w1[3] = wordl1[3] | wordr1[3]; + w2[0] = wordl2[0] | wordr2[0]; + w2[1] = wordl2[1] | wordr2[1]; + w2[2] = wordl2[2] | wordr2[2]; + w2[3] = wordl2[3] | wordr2[3]; + w3[0] = wordl3[0] | wordr3[0]; + w3[1] = wordl3[1] | wordr3[1]; + w3[2] = wordl3[2] | wordr3[2]; + w3[3] = wordl3[3] | wordr3[3]; + + /** + * sha256 + */ + + u32x w0_t = swap32_S (w0[0]); + u32x w1_t = swap32_S (w0[1]); + u32x w2_t = swap32_S (w0[2]); + u32x w3_t = swap32_S (w0[3]); + u32x w4_t = swap32_S (w1[0]); + u32x w5_t = swap32_S (w1[1]); + u32x w6_t = swap32_S (w1[2]); + u32x w7_t = swap32_S (w1[3]); + u32x w8_t = swap32_S (w2[0]); + u32x w9_t = swap32_S (w2[1]); + u32x wa_t = swap32_S (w2[2]); + u32x wb_t = swap32_S (w2[3]); + u32x wc_t = swap32_S (w3[0]); + u32x wd_t = swap32_S (w3[1]); + u32x we_t = 0; + u32x wf_t = pw_len * 8; + + u32x a = SHA256M_A; + u32x b = SHA256M_B; + u32x c = SHA256M_C; + u32x d = SHA256M_D; + u32x e = SHA256M_E; + u32x f = SHA256M_F; + u32x g = SHA256M_G; + u32x h = SHA256M_H; + + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C02); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C03); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C04); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C05); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C06); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C07); + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C08); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C09); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C0a); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C0b); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C0c); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C0d); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C0e); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C0f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C10); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C11); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C12); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C13); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C14); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C15); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C16); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C17); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C18); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C19); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C1a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C1b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C1c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C1d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C1e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C1f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C20); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C21); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C22); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C23); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C24); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C25); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C26); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C27); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C28); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C29); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C2a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C2b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C2c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C2d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C2e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C2f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C30); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C31); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C32); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C33); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C34); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C35); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C36); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C37); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C38); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C39); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C3a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C3b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C3c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C3d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C3e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C3f); + + a += SHA256M_A; + b += SHA256M_B; + c += SHA256M_C; + d += SHA256M_D; + e += SHA256M_E; + f += SHA256M_F; + g += SHA256M_G; + h += SHA256M_H; + + w0_t = a; + w1_t = b; + w2_t = c; + w3_t = d; + w4_t = e; + w5_t = f; + w6_t = g; + w7_t = h; + w8_t = 0x80000000; + w9_t = 0; + wa_t = 0; + wb_t = 0; + wc_t = 0; + wd_t = 0; + we_t = 0; + wf_t = 32 * 8; + + a = SHA256M_A; + b = SHA256M_B; + c = SHA256M_C; + d = SHA256M_D; + e = SHA256M_E; + f = SHA256M_F; + g = SHA256M_G; + h = SHA256M_H; + + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C02); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C03); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C04); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C05); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C06); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C07); + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C08); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C09); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C0a); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C0b); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C0c); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C0d); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C0e); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C0f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C10); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C11); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C12); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C13); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C14); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C15); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C16); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C17); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C18); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C19); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C1a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C1b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C1c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C1d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C1e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C1f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C20); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C21); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C22); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C23); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C24); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C25); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C26); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C27); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C28); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C29); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C2a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C2b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C2c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C2d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C2e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C2f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C30); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C31); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C32); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C33); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C34); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C35); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C36); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C37); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C38); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C39); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C3a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C3b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C3c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C3d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C3e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C3f); + + a += SHA256M_A; + b += SHA256M_B; + c += SHA256M_C; + d += SHA256M_D; + e += SHA256M_E; + f += SHA256M_F; + g += SHA256M_G; + h += SHA256M_H; + + u32 ukey[8]; + + ukey[0] = swap32_S (a); + ukey[1] = swap32_S (b); + ukey[2] = swap32_S (c); + ukey[3] = swap32_S (d); + ukey[4] = swap32_S (e); + ukey[5] = swap32_S (f); + ukey[6] = swap32_S (g); + ukey[7] = swap32_S (h); + + #define KEYLEN 60 + + u32 ks[KEYLEN]; + + aes256_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 encrypted[4]; + + encrypted[0] = esalt_bufs[digests_offset].encrypted[0]; + encrypted[1] = esalt_bufs[digests_offset].encrypted[1]; + encrypted[2] = esalt_bufs[digests_offset].encrypted[2]; + encrypted[3] = esalt_bufs[digests_offset].encrypted[3]; + + u32 out[4]; + + aes256_decrypt (ks, encrypted, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 iv[4]; + + iv[0] = esalt_bufs[digests_offset].iv[0]; + iv[1] = esalt_bufs[digests_offset].iv[1]; + iv[2] = esalt_bufs[digests_offset].iv[2]; + iv[3] = esalt_bufs[digests_offset].iv[3]; + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + if (esalt_bufs[digests_offset].salt_type == 1) + { + if (is_valid_hex_32 (out[0]) == 0) continue; + if (is_valid_hex_32 (out[1]) == 0) continue; + if (is_valid_hex_32 (out[2]) == 0) continue; + if (is_valid_hex_32 (out[3]) == 0) continue; + + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } +} + +__kernel void m16600_s08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} + +__kernel void m16600_s16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ +} diff --git a/OpenCL/m16600_a1.cl b/OpenCL/m16600_a1.cl new file mode 100644 index 000000000..3c0f69cd6 --- /dev/null +++ b/OpenCL/m16600_a1.cl @@ -0,0 +1,361 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_scalar.cl" +#include "inc_hash_sha256.cl" +#include "inc_cipher_aes.cl" + +__kernel void m16600_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + sha256_ctx_t ctx0; + + sha256_init (&ctx0); + + sha256_update_global_swap (&ctx0, pws[gid].i, pws[gid].pw_len); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + sha256_ctx_t ctx = ctx0; + + sha256_update_global_swap (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len); + + sha256_final (&ctx); + + u32 a = ctx.h[0]; + u32 b = ctx.h[1]; + u32 c = ctx.h[2]; + u32 d = ctx.h[3]; + u32 e = ctx.h[4]; + u32 f = ctx.h[5]; + u32 g = ctx.h[6]; + u32 h = ctx.h[7]; + + sha256_init (&ctx); + + ctx.w0[0] = a; + ctx.w0[1] = b; + ctx.w0[2] = c; + ctx.w0[3] = d; + ctx.w1[0] = e; + ctx.w1[1] = f; + ctx.w1[2] = g; + ctx.w1[3] = h; + + ctx.len = 32; + + sha256_final (&ctx); + + a = ctx.h[0]; + b = ctx.h[1]; + c = ctx.h[2]; + d = ctx.h[3]; + e = ctx.h[4]; + f = ctx.h[5]; + g = ctx.h[6]; + h = ctx.h[7]; + + u32 ukey[8]; + + ukey[0] = swap32_S (a); + ukey[1] = swap32_S (b); + ukey[2] = swap32_S (c); + ukey[3] = swap32_S (d); + ukey[4] = swap32_S (e); + ukey[5] = swap32_S (f); + ukey[6] = swap32_S (g); + ukey[7] = swap32_S (h); + + #define KEYLEN 60 + + u32 ks[KEYLEN]; + + aes256_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 encrypted[4]; + + encrypted[0] = esalt_bufs[digests_offset].encrypted[0]; + encrypted[1] = esalt_bufs[digests_offset].encrypted[1]; + encrypted[2] = esalt_bufs[digests_offset].encrypted[2]; + encrypted[3] = esalt_bufs[digests_offset].encrypted[3]; + + u32 out[4]; + + aes256_decrypt (ks, encrypted, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 iv[4]; + + iv[0] = esalt_bufs[digests_offset].iv[0]; + iv[1] = esalt_bufs[digests_offset].iv[1]; + iv[2] = esalt_bufs[digests_offset].iv[2]; + iv[3] = esalt_bufs[digests_offset].iv[3]; + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + if (esalt_bufs[digests_offset].salt_type == 1) + { + if (is_valid_hex_32 (out[0]) == 0) continue; + if (is_valid_hex_32 (out[1]) == 0) continue; + if (is_valid_hex_32 (out[2]) == 0) continue; + if (is_valid_hex_32 (out[3]) == 0) continue; + + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } +} + +__kernel void m16600_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __global const bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + sha256_ctx_t ctx0; + + sha256_init (&ctx0); + + sha256_update_global_swap (&ctx0, pws[gid].i, pws[gid].pw_len); + + /** + * loop + */ + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) + { + sha256_ctx_t ctx = ctx0; + + sha256_update_global_swap (&ctx, combs_buf[il_pos].i, combs_buf[il_pos].pw_len); + + sha256_final (&ctx); + + u32 a = ctx.h[0]; + u32 b = ctx.h[1]; + u32 c = ctx.h[2]; + u32 d = ctx.h[3]; + u32 e = ctx.h[4]; + u32 f = ctx.h[5]; + u32 g = ctx.h[6]; + u32 h = ctx.h[7]; + + sha256_init (&ctx); + + ctx.w0[0] = a; + ctx.w0[1] = b; + ctx.w0[2] = c; + ctx.w0[3] = d; + ctx.w1[0] = e; + ctx.w1[1] = f; + ctx.w1[2] = g; + ctx.w1[3] = h; + + ctx.len = 32; + + sha256_final (&ctx); + + a = ctx.h[0]; + b = ctx.h[1]; + c = ctx.h[2]; + d = ctx.h[3]; + e = ctx.h[4]; + f = ctx.h[5]; + g = ctx.h[6]; + h = ctx.h[7]; + + u32 ukey[8]; + + ukey[0] = swap32_S (a); + ukey[1] = swap32_S (b); + ukey[2] = swap32_S (c); + ukey[3] = swap32_S (d); + ukey[4] = swap32_S (e); + ukey[5] = swap32_S (f); + ukey[6] = swap32_S (g); + ukey[7] = swap32_S (h); + + #define KEYLEN 60 + + u32 ks[KEYLEN]; + + aes256_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 encrypted[4]; + + encrypted[0] = esalt_bufs[digests_offset].encrypted[0]; + encrypted[1] = esalt_bufs[digests_offset].encrypted[1]; + encrypted[2] = esalt_bufs[digests_offset].encrypted[2]; + encrypted[3] = esalt_bufs[digests_offset].encrypted[3]; + + u32 out[4]; + + aes256_decrypt (ks, encrypted, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 iv[4]; + + iv[0] = esalt_bufs[digests_offset].iv[0]; + iv[1] = esalt_bufs[digests_offset].iv[1]; + iv[2] = esalt_bufs[digests_offset].iv[2]; + iv[3] = esalt_bufs[digests_offset].iv[3]; + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + if (esalt_bufs[digests_offset].salt_type == 1) + { + if (is_valid_hex_32 (out[0]) == 0) continue; + if (is_valid_hex_32 (out[1]) == 0) continue; + if (is_valid_hex_32 (out[2]) == 0) continue; + if (is_valid_hex_32 (out[3]) == 0) continue; + + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } +} diff --git a/OpenCL/m16600_a3-optimized.cl b/OpenCL/m16600_a3-optimized.cl new file mode 100644 index 000000000..48c2eceb1 --- /dev/null +++ b/OpenCL/m16600_a3-optimized.cl @@ -0,0 +1,865 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_simd.cl" +#include "inc_cipher_aes.cl" + +void m16600 (SHM_TYPE u32a *s_te0, SHM_TYPE u32a *s_te1, SHM_TYPE u32a *s_te2, SHM_TYPE u32a *s_te3, SHM_TYPE u32a *s_te4, SHM_TYPE u32a *s_td0, SHM_TYPE u32a *s_td1, SHM_TYPE u32a *s_td2, SHM_TYPE u32a *s_td3, SHM_TYPE u32a *s_td4, u32 w[16], const u32 pw_len, __global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + + /** + * loop + */ + + u32 w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + u32x w0_t = w0; + u32x w1_t = w[ 1]; + u32x w2_t = w[ 2]; + u32x w3_t = w[ 3]; + u32x w4_t = w[ 4]; + u32x w5_t = w[ 5]; + u32x w6_t = w[ 6]; + u32x w7_t = w[ 7]; + u32x w8_t = w[ 8]; + u32x w9_t = w[ 9]; + u32x wa_t = w[10]; + u32x wb_t = w[11]; + u32x wc_t = w[12]; + u32x wd_t = w[13]; + u32x we_t = w[14]; + u32x wf_t = w[15]; + + u32x a = SHA256M_A; + u32x b = SHA256M_B; + u32x c = SHA256M_C; + u32x d = SHA256M_D; + u32x e = SHA256M_E; + u32x f = SHA256M_F; + u32x g = SHA256M_G; + u32x h = SHA256M_H; + + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C02); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C03); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C04); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C05); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C06); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C07); + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C08); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C09); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C0a); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C0b); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C0c); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C0d); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C0e); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C0f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C10); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C11); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C12); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C13); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C14); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C15); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C16); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C17); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C18); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C19); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C1a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C1b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C1c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C1d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C1e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C1f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C20); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C21); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C22); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C23); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C24); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C25); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C26); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C27); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C28); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C29); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C2a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C2b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C2c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C2d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C2e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C2f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C30); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C31); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C32); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C33); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C34); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C35); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C36); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C37); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C38); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C39); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C3a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C3b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C3c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C3d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C3e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C3f); + + a += SHA256M_A; + b += SHA256M_B; + c += SHA256M_C; + d += SHA256M_D; + e += SHA256M_E; + f += SHA256M_F; + g += SHA256M_G; + h += SHA256M_H; + + w0_t = a; + w1_t = b; + w2_t = c; + w3_t = d; + w4_t = e; + w5_t = f; + w6_t = g; + w7_t = h; + w8_t = 0x80000000; + w9_t = 0; + wa_t = 0; + wb_t = 0; + wc_t = 0; + wd_t = 0; + we_t = 0; + wf_t = 32 * 8; + + a = SHA256M_A; + b = SHA256M_B; + c = SHA256M_C; + d = SHA256M_D; + e = SHA256M_E; + f = SHA256M_F; + g = SHA256M_G; + h = SHA256M_H; + + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C02); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C03); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C04); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C05); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C06); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C07); + SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C08); + SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C09); + SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C0a); + SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C0b); + SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C0c); + SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C0d); + SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C0e); + SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C0f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C10); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C11); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C12); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C13); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C14); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C15); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C16); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C17); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C18); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C19); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C1a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C1b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C1c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C1d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C1e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C1f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C20); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C21); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C22); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C23); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C24); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C25); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C26); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C27); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C28); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C29); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C2a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C2b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C2c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C2d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C2e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C2f); + + w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C30); + w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C31); + w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, SHA256C32); + w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, SHA256C33); + w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, SHA256C34); + w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, SHA256C35); + w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, SHA256C36); + w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, SHA256C37); + w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, SHA256C38); + w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, SHA256C39); + wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C3a); + wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C3b); + wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C3c); + wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C3d); + we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C3e); + wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C3f); + + a += SHA256M_A; + b += SHA256M_B; + c += SHA256M_C; + d += SHA256M_D; + e += SHA256M_E; + f += SHA256M_F; + g += SHA256M_G; + h += SHA256M_H; + + u32 ukey[8]; + + ukey[0] = swap32_S (a); + ukey[1] = swap32_S (b); + ukey[2] = swap32_S (c); + ukey[3] = swap32_S (d); + ukey[4] = swap32_S (e); + ukey[5] = swap32_S (f); + ukey[6] = swap32_S (g); + ukey[7] = swap32_S (h); + + #define KEYLEN 60 + + u32 ks[KEYLEN]; + + aes256_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 encrypted[4]; + + encrypted[0] = esalt_bufs[digests_offset].encrypted[0]; + encrypted[1] = esalt_bufs[digests_offset].encrypted[1]; + encrypted[2] = esalt_bufs[digests_offset].encrypted[2]; + encrypted[3] = esalt_bufs[digests_offset].encrypted[3]; + + u32 out[4]; + + aes256_decrypt (ks, encrypted, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 iv[4]; + + iv[0] = esalt_bufs[digests_offset].iv[0]; + iv[1] = esalt_bufs[digests_offset].iv[1]; + iv[2] = esalt_bufs[digests_offset].iv[2]; + iv[3] = esalt_bufs[digests_offset].iv[3]; + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + if (esalt_bufs[digests_offset].salt_type == 1) + { + if (is_valid_hex_32 (out[0]) == 0) continue; + if (is_valid_hex_32 (out[1]) == 0) continue; + if (is_valid_hex_32 (out[2]) == 0) continue; + if (is_valid_hex_32 (out[3]) == 0) continue; + + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } +} + +__kernel void m16600_m04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + u32 w[16]; + + w[ 0] = pws[gid].i[ 0]; + w[ 1] = pws[gid].i[ 1]; + w[ 2] = pws[gid].i[ 2]; + w[ 3] = pws[gid].i[ 3]; + w[ 4] = 0; + w[ 5] = 0; + w[ 6] = 0; + w[ 7] = 0; + w[ 8] = 0; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = 0; + w[15] = pws[gid].i[15]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16600 (s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4, w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16600_m08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + u32 w[16]; + + w[ 0] = pws[gid].i[ 0]; + w[ 1] = pws[gid].i[ 1]; + w[ 2] = pws[gid].i[ 2]; + w[ 3] = pws[gid].i[ 3]; + w[ 4] = pws[gid].i[ 4]; + w[ 5] = pws[gid].i[ 5]; + w[ 6] = pws[gid].i[ 6]; + w[ 7] = pws[gid].i[ 7]; + w[ 8] = 0; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = 0; + w[15] = pws[gid].i[15]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16600 (s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4, w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16600_m16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + u32 w[16]; + + w[ 0] = pws[gid].i[ 0]; + w[ 1] = pws[gid].i[ 1]; + w[ 2] = pws[gid].i[ 2]; + w[ 3] = pws[gid].i[ 3]; + w[ 4] = pws[gid].i[ 4]; + w[ 5] = pws[gid].i[ 5]; + w[ 6] = pws[gid].i[ 6]; + w[ 7] = pws[gid].i[ 7]; + w[ 8] = pws[gid].i[ 8]; + w[ 9] = pws[gid].i[ 9]; + w[10] = pws[gid].i[10]; + w[11] = pws[gid].i[11]; + w[12] = pws[gid].i[12]; + w[13] = pws[gid].i[13]; + w[14] = pws[gid].i[14]; + w[15] = pws[gid].i[15]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16600 (s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4, w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16600_s04 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + u32 w[16]; + + w[ 0] = pws[gid].i[ 0]; + w[ 1] = pws[gid].i[ 1]; + w[ 2] = pws[gid].i[ 2]; + w[ 3] = pws[gid].i[ 3]; + w[ 4] = 0; + w[ 5] = 0; + w[ 6] = 0; + w[ 7] = 0; + w[ 8] = 0; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = 0; + w[15] = pws[gid].i[15]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16600 (s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4, w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16600_s08 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + u32 w[16]; + + w[ 0] = pws[gid].i[ 0]; + w[ 1] = pws[gid].i[ 1]; + w[ 2] = pws[gid].i[ 2]; + w[ 3] = pws[gid].i[ 3]; + w[ 4] = pws[gid].i[ 4]; + w[ 5] = pws[gid].i[ 5]; + w[ 6] = pws[gid].i[ 6]; + w[ 7] = pws[gid].i[ 7]; + w[ 8] = 0; + w[ 9] = 0; + w[10] = 0; + w[11] = 0; + w[12] = 0; + w[13] = 0; + w[14] = 0; + w[15] = pws[gid].i[15]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16600 (s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4, w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} + +__kernel void m16600_s16 (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + u32 w[16]; + + w[ 0] = pws[gid].i[ 0]; + w[ 1] = pws[gid].i[ 1]; + w[ 2] = pws[gid].i[ 2]; + w[ 3] = pws[gid].i[ 3]; + w[ 4] = pws[gid].i[ 4]; + w[ 5] = pws[gid].i[ 5]; + w[ 6] = pws[gid].i[ 6]; + w[ 7] = pws[gid].i[ 7]; + w[ 8] = pws[gid].i[ 8]; + w[ 9] = pws[gid].i[ 9]; + w[10] = pws[gid].i[10]; + w[11] = pws[gid].i[11]; + w[12] = pws[gid].i[12]; + w[13] = pws[gid].i[13]; + w[14] = pws[gid].i[14]; + w[15] = pws[gid].i[15]; + + const u32 pw_len = pws[gid].pw_len; + + /** + * main + */ + + m16600 (s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4, w, pw_len, pws, rules_buf, combs_buf, words_buf_r, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset); +} diff --git a/OpenCL/m16600_a3.cl b/OpenCL/m16600_a3.cl new file mode 100644 index 000000000..abe32dfec --- /dev/null +++ b/OpenCL/m16600_a3.cl @@ -0,0 +1,387 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +//#define NEW_SIMD_CODE + +#include "inc_vendor.cl" +#include "inc_hash_constants.h" +#include "inc_hash_functions.cl" +#include "inc_types.cl" +#include "inc_common.cl" +#include "inc_simd.cl" +#include "inc_hash_sha256.cl" +#include "inc_cipher_aes.cl" + +__kernel void m16600_mxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32x w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = pws[gid].i[idx]; + } + + /** + * loop + */ + + u32x w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + w[0] = w0; + + sha256_ctx_vector_t ctx; + + sha256_init_vector (&ctx); + + sha256_update_vector (&ctx, w, pw_len); + + sha256_final_vector (&ctx); + + u32x a = ctx.h[0]; + u32x b = ctx.h[1]; + u32x c = ctx.h[2]; + u32x d = ctx.h[3]; + u32x e = ctx.h[4]; + u32x f = ctx.h[5]; + u32x g = ctx.h[6]; + u32x h = ctx.h[7]; + + sha256_init_vector (&ctx); + + ctx.w0[0] = a; + ctx.w0[1] = b; + ctx.w0[2] = c; + ctx.w0[3] = d; + ctx.w1[0] = e; + ctx.w1[1] = f; + ctx.w1[2] = g; + ctx.w1[3] = h; + + ctx.len = 32; + + sha256_final_vector (&ctx); + + a = ctx.h[0]; + b = ctx.h[1]; + c = ctx.h[2]; + d = ctx.h[3]; + e = ctx.h[4]; + f = ctx.h[5]; + g = ctx.h[6]; + h = ctx.h[7]; + + u32 ukey[8]; + + ukey[0] = swap32_S (a); + ukey[1] = swap32_S (b); + ukey[2] = swap32_S (c); + ukey[3] = swap32_S (d); + ukey[4] = swap32_S (e); + ukey[5] = swap32_S (f); + ukey[6] = swap32_S (g); + ukey[7] = swap32_S (h); + + #define KEYLEN 60 + + u32 ks[KEYLEN]; + + aes256_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 encrypted[4]; + + encrypted[0] = esalt_bufs[digests_offset].encrypted[0]; + encrypted[1] = esalt_bufs[digests_offset].encrypted[1]; + encrypted[2] = esalt_bufs[digests_offset].encrypted[2]; + encrypted[3] = esalt_bufs[digests_offset].encrypted[3]; + + u32 out[4]; + + aes256_decrypt (ks, encrypted, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 iv[4]; + + iv[0] = esalt_bufs[digests_offset].iv[0]; + iv[1] = esalt_bufs[digests_offset].iv[1]; + iv[2] = esalt_bufs[digests_offset].iv[2]; + iv[3] = esalt_bufs[digests_offset].iv[3]; + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + if (esalt_bufs[digests_offset].salt_type == 1) + { + if (is_valid_hex_32 (out[0]) == 0) continue; + if (is_valid_hex_32 (out[1]) == 0) continue; + if (is_valid_hex_32 (out[2]) == 0) continue; + if (is_valid_hex_32 (out[3]) == 0) continue; + + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } +} + +__kernel void m16600_sxx (__global pw_t *pws, __global const kernel_rule_t *rules_buf, __global const pw_t *combs_buf, __constant const u32x *words_buf_r, __global void *tmps, __global void *hooks, __global const u32 *bitmaps_buf_s1_a, __global const u32 *bitmaps_buf_s1_b, __global const u32 *bitmaps_buf_s1_c, __global const u32 *bitmaps_buf_s1_d, __global const u32 *bitmaps_buf_s2_a, __global const u32 *bitmaps_buf_s2_b, __global const u32 *bitmaps_buf_s2_c, __global const u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global const digest_t *digests_buf, __global u32 *hashes_shown, __global const salt_t *salt_bufs, __global const electrum_wallet_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u64 gid_max) +{ + /** + * base + */ + + const u64 gid = get_global_id (0); + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); + + /** + * aes shared + */ + + #ifdef REAL_SHM + + __local u32 s_td0[256]; + __local u32 s_td1[256]; + __local u32 s_td2[256]; + __local u32 s_td3[256]; + __local u32 s_td4[256]; + + __local u32 s_te0[256]; + __local u32 s_te1[256]; + __local u32 s_te2[256]; + __local u32 s_te3[256]; + __local u32 s_te4[256]; + + for (u32 i = lid; i < 256; i += lsz) + { + s_td0[i] = td0[i]; + s_td1[i] = td1[i]; + s_td2[i] = td2[i]; + s_td3[i] = td3[i]; + s_td4[i] = td4[i]; + + s_te0[i] = te0[i]; + s_te1[i] = te1[i]; + s_te2[i] = te2[i]; + s_te3[i] = te3[i]; + s_te4[i] = te4[i]; + } + + barrier (CLK_LOCAL_MEM_FENCE); + + #else + + __constant u32a *s_td0 = td0; + __constant u32a *s_td1 = td1; + __constant u32a *s_td2 = td2; + __constant u32a *s_td3 = td3; + __constant u32a *s_td4 = td4; + + __constant u32a *s_te0 = te0; + __constant u32a *s_te1 = te1; + __constant u32a *s_te2 = te2; + __constant u32a *s_te3 = te3; + __constant u32a *s_te4 = te4; + + #endif + + if (gid >= gid_max) return; + + /** + * base + */ + + const u32 pw_len = pws[gid].pw_len; + + u32x w[64] = { 0 }; + + for (int i = 0, idx = 0; i < pw_len; i += 4, idx += 1) + { + w[idx] = pws[gid].i[idx]; + } + + /** + * loop + */ + + u32x w0l = w[0]; + + for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE) + { + const u32x w0r = words_buf_r[il_pos / VECT_SIZE]; + + const u32x w0 = w0l | w0r; + + w[0] = w0; + + sha256_ctx_vector_t ctx; + + sha256_init_vector (&ctx); + + sha256_update_vector (&ctx, w, pw_len); + + sha256_final_vector (&ctx); + + u32x a = ctx.h[0]; + u32x b = ctx.h[1]; + u32x c = ctx.h[2]; + u32x d = ctx.h[3]; + u32x e = ctx.h[4]; + u32x f = ctx.h[5]; + u32x g = ctx.h[6]; + u32x h = ctx.h[7]; + + sha256_init_vector (&ctx); + + ctx.w0[0] = a; + ctx.w0[1] = b; + ctx.w0[2] = c; + ctx.w0[3] = d; + ctx.w1[0] = e; + ctx.w1[1] = f; + ctx.w1[2] = g; + ctx.w1[3] = h; + + ctx.len = 32; + + sha256_final_vector (&ctx); + + a = ctx.h[0]; + b = ctx.h[1]; + c = ctx.h[2]; + d = ctx.h[3]; + e = ctx.h[4]; + f = ctx.h[5]; + g = ctx.h[6]; + h = ctx.h[7]; + + u32 ukey[8]; + + ukey[0] = swap32_S (a); + ukey[1] = swap32_S (b); + ukey[2] = swap32_S (c); + ukey[3] = swap32_S (d); + ukey[4] = swap32_S (e); + ukey[5] = swap32_S (f); + ukey[6] = swap32_S (g); + ukey[7] = swap32_S (h); + + #define KEYLEN 60 + + u32 ks[KEYLEN]; + + aes256_set_decrypt_key (ks, ukey, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 encrypted[4]; + + encrypted[0] = esalt_bufs[digests_offset].encrypted[0]; + encrypted[1] = esalt_bufs[digests_offset].encrypted[1]; + encrypted[2] = esalt_bufs[digests_offset].encrypted[2]; + encrypted[3] = esalt_bufs[digests_offset].encrypted[3]; + + u32 out[4]; + + aes256_decrypt (ks, encrypted, out, s_td0, s_td1, s_td2, s_td3, s_td4); + + u32 iv[4]; + + iv[0] = esalt_bufs[digests_offset].iv[0]; + iv[1] = esalt_bufs[digests_offset].iv[1]; + iv[2] = esalt_bufs[digests_offset].iv[2]; + iv[3] = esalt_bufs[digests_offset].iv[3]; + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + if (esalt_bufs[digests_offset].salt_type == 1) + { + if (is_valid_hex_32 (out[0]) == 0) continue; + if (is_valid_hex_32 (out[1]) == 0) continue; + if (is_valid_hex_32 (out[2]) == 0) continue; + if (is_valid_hex_32 (out[3]) == 0) continue; + + if (atomic_inc (&hashes_shown[digests_offset]) == 0) + { + mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos); + } + } + } +} diff --git a/docs/changes.txt b/docs/changes.txt index 956ffe74f..8f7f01abd 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -1,19 +1,80 @@ -* changes v4.0.1 -> xxx: +* changes v4.0.1 -> v4.1.0 + +## +## Features +## + +- Added option --benchmark-all to benchmark all hash-modes (not just the default selection) +- Removed option --gpu-temp-retain that tried to retain GPU temperature at X degrees celsius - please use driver-specific tools +- Removed option --powertune-enable to enable power tuning - please use driver specific tools ## ## Algorithms ## - Added hash-mode 16000 = Tripcode +- Added hash-mode 16100 = TACACS+ +- Added hash-mode 16200 = Apple Secure Notes +- Added hash-mode 16300 = Ethereum Pre-Sale Wallet, PBKDF2-SHA256 +- Added hash-mode 16400 = CRAM-MD5 Dovecot +- Added hash-mode 16500 = JWT (JSON Web Token) +- Added hash-mode 16600 = Electrum Wallet (Salt-Type 1-3) ## ## Bugs ## -- Fixed a hash parsing problem when using --show/--left together with hashes with long salts that require pure kernels +- Fixed a hash parsing problem for 7-Zip hashes: allow a longer crc32 data length field within the hash format +- Fixed a hash parsing problem when using --show/--left with hashes with long salts that required pure kernels +- Fixed a mask-length check issue: Return -1 in case the mask-length is not within the password-length range +- Fixed a restore issue leading to "Restore value is greater than keyspace" when mask-files or wordlist-folders were used +- Fixed a uninitialized value in OpenCL kernels 9720, 9820 and 10420 leading to absurd benchmark performance +- Fixed invalid support for SIMD in -m 400 +- Fixed the maximum password length check in password-reassembling function +- Fixed the output of --show if $HEX[] passwords were present within the potfile + +## +## Improvements +## + +- OpenCL Kernels: Remove password length restriction to 16 for Cisco-PIX and Cisco-ASA hashes +- Terminal: Display Set Cost/Rounds During Benchmarking +- Terminal: Show [r]esume in prompt only in pause mode, and show [p]ause in prompt only in resume mode + +## +## Technical +## + +- Documents: Added docs/limits.txt +- Files: Copy include/ folder and its content when SHARED is set to 1 in Makefile +- Files: Switched back to relative current working directory on windows to work around problems with unicode characters +- Hashcat Context: Fixed a memory leak in shutdown phase +- Hash Parser: Changed the way large strings are handled/truncated within the event buffer if they are too large to fit +- Hash Parser: Fixed a memory leak in shutdown phase +- Hash Parser: Fixed the use of strtok_r () calls +- OpenCL Devices: Fixed several memory leaks in shutdown phase +- OpenCL Runtime: Updated rocm detection +- OpenCL Runtime: Enforce to use OpenCL version 1.2 to restrain OpenCL runtimes to make use of the __generic address space qualifier +- OpenCL Runtime: Add current timestamp to OpenCL kernel source in order to force OpenCL JiT compiler to recompile and not use the cache +- OpenCL Kernels: Replace variables from uXX to uXXa if used in __constant space +- OpenCL Kernels: Use a special kernel to initialize the password buffer used during autotune measurements, to reduce startup time +- OpenCL Kernels: Use static declaraction for uXXa variables used in __constant space +- Returncode: Enforce returncode 0 in case the user selected --speed-only or --progress-only and no other error occured +- Self Test: Skip self-test for mode 15700 because the settings are too high and cause startup times that are too long +- Self Test: Skip self-test for mode 8900 - user-configurable scrypt settings are incompatible with fixed settings in the self-test hash +- Terminal: Send clear line code to the same output stream as the message immediately following +- Terminal: Add workitem settings to status display (can be handy for debugging) +- Timer: Switch from gettimeofday() to clock_gettime() to work around problems on cygwin +- User Options: According to getopts manpage the last element of the option array has to be filled with zeros * changes v4.0.0 -> v4.0.1: +## +## Improvements +## + +- Changed the maximum length of the substring of a hash shown whenever the parser found a problem while parsing the hash + ## ## Bugs ## diff --git a/docs/license.txt b/docs/license.txt index 10240fe10..a69c7f79f 100644 --- a/docs/license.txt +++ b/docs/license.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2017 Jens Steube +Copyright (c) 2015-2018 Jens Steube Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/docs/limits.txt b/docs/limits.txt new file mode 100644 index 000000000..7c97ff5a6 --- /dev/null +++ b/docs/limits.txt @@ -0,0 +1,72 @@ +## +## Maximum password lengths vary depending on kernel, hash type, and encoding +## + +See https://hashcat.net/faq/lengths + +## +## Generic hash modes only support salt lengths up to 256 +## + +This limitation on salt lengths only affects generic hash modes, such as md5(pass.salt). + +Dedicated hash modes allow unlimited salt length support. + +## +## File and folder names including UTF-16 characters are not supported +## + +UTF-16 is mostly seen on Windows. UTF-8 (as mostly used on Linux and macOS) are fine. + +Important: That does not mean UTF-16 file content, which is fully supported. + +It only means the filename itself. + +## +## The use of --keep-guessing eventually skips reporting duplicate passwords +## + +This does not mean that valid passwords are skipped; they are always reported. + +Only if you hit the same password twice for the same hash the password may be shown only once. + +If --keep-guessing is not used, this can not occur. + +This limitation cannot be fixed, because it would require too much device (GPU/CPU) memory. + +If we wanted to report back all possible password candidates executed in a single kernel invocation, it would require this much memory: + +Number-of-MCU * Max-threads-per-device * Max-accel * Max-inner-loops * sizeof (plain_t) + +For example, on a Vega64: 64 * 512 * 1024 * 1024 * 20 = 687,194,767,360 bytes + +## +## Hashcat GPU memory usage may be limited by maximum allocation sizes of OpenCL drivers +## + +Most hashcat hash modes only use a single OpenCL allocation. + +The size of this allocation is limited by GPU drivers / OpenCL runtimes. + +Only a few modes (like scrypt) make more than one allocation. + +## +## The maximum number of functions per rule is limited to 31 +## + +This makes the size of one rule 128 byte. + +On the other hand, there is a 25% OpenCL single allocation memory limit. + +A typical GPU of today has 8GB = 2GB/128 = 16M rules max + +If hashcat supported more functions per rule, it would be limited to fewer rules. + +This is a trade-off game. + +## +## Position identifiers in rules are limited to 36 +## + +The upper limit of maximum 36 positions for various rule functions (0-9, A-Z) was a design decision by the original authors of the rule engine. + diff --git a/docs/readme.txt b/docs/readme.txt index 29b179c05..02b37be5e 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -1,4 +1,4 @@ -hashcat v4.0.1 +hashcat v4.1.0 ============== AMD GPUs on Linux require "RadeonOpenCompute (ROCm)" Software Platform (1.6.180 or later) @@ -39,7 +39,7 @@ NVIDIA GPUs require "NVIDIA Driver" (367.x or later) - MD4 - MD5 -- Half MD5 (left, mid, right) +- Half MD5 - SHA1 - SHA-224 - SHA-256 @@ -48,19 +48,15 @@ NVIDIA GPUs require "NVIDIA Driver" (367.x or later) - SHA-3 (Keccak) - BLAKE2b-512 - SipHash -- Skip32 - RIPEMD-160 - Whirlpool -- DES (PT = $salt, key = $pass) -- 3DES (PT = $salt, key = $pass) -- ChaCha20 - GOST R 34.11-94 - GOST R 34.11-2012 (Streebog) 256-bit - GOST R 34.11-2012 (Streebog) 512-bit - md5($pass.$salt) - md5($salt.$pass) -- md5(unicode($pass).$salt) -- md5($salt.unicode($pass)) +- md5(utf16le($pass).$salt) +- md5($salt.utf16le($pass)) - md5($salt.$pass.$salt) - md5($salt.md5($pass)) - md5($salt.md5($salt.$pass)) @@ -71,8 +67,8 @@ NVIDIA GPUs require "NVIDIA Driver" (367.x or later) - md5(sha1($pass)) - sha1($pass.$salt) - sha1($salt.$pass) -- sha1(unicode($pass).$salt) -- sha1($salt.unicode($pass)) +- sha1(utf16le($pass).$salt) +- sha1($salt.utf16le($pass)) - sha1(sha1($pass)) - sha1($salt.sha1($pass)) - sha1(md5($pass)) @@ -80,12 +76,12 @@ NVIDIA GPUs require "NVIDIA Driver" (367.x or later) - sha1(CX) - sha256($pass.$salt) - sha256($salt.$pass) -- sha256(unicode($pass).$salt) -- sha256($salt.unicode($pass)) +- sha256(utf16le($pass).$salt) +- sha256($salt.utf16le($pass)) - sha512($pass.$salt) - sha512($salt.$pass) -- sha512(unicode($pass).$salt) -- sha512($salt.unicode($pass)) +- sha512(utf16le($pass).$salt) +- sha512($salt.utf16le($pass)) - HMAC-MD5 (key = $pass) - HMAC-MD5 (key = $salt) - HMAC-SHA1 (key = $pass) @@ -94,144 +90,162 @@ NVIDIA GPUs require "NVIDIA Driver" (367.x or later) - HMAC-SHA256 (key = $salt) - HMAC-SHA512 (key = $pass) - HMAC-SHA512 (key = $salt) +- DES (PT = $salt, key = $pass) +- 3DES (PT = $salt, key = $pass) +- Skip32 (PT = $salt, key = $pass) +- ChaCha20 +- phpass +- scrypt - PBKDF2-HMAC-MD5 - PBKDF2-HMAC-SHA1 - PBKDF2-HMAC-SHA256 - PBKDF2-HMAC-SHA512 -- MyBB -- phpBB3 -- SMF (Simple Machines Forum) -- vBulletin -- IPB (Invision Power Board) -- WBB (Woltlab Burning Board) +- Skype +- WPA/WPA2 +- WPA/WPA2 PMK +- iSCSI CHAP authentication, MD5(CHAP) +- IKE-PSK MD5 +- IKE-PSK SHA1 +- NetNTLMv1 +- NetNTLMv1+ESS +- NetNTLMv2 +- IPMI2 RAKP HMAC-SHA1 +- Kerberos 5 AS-REQ Pre-Auth etype 23 +- DNSSEC (NSEC3) +- CRAM-MD5 +- PostgreSQL CRAM (MD5) +- MySQL CRAM (SHA1) +- SIP digest authentication (MD5) +- Kerberos 5 TGS-REP etype 23 +- TACACS+ +- JWT (JSON Web Token) +- SMF (Simple Machines Forum) > v1.1 +- phpBB3 (MD5) +- vBulletin < v3.8.5 +- vBulletin >= v3.8.5 +- MyBB 1.2+ +- IPB2+ (Invision Power Board) +- WBB3 (Woltlab Burning Board) +- Joomla < 2.5.18 +- Joomla >= 2.5.18 (MD5) +- WordPress (MD5) +- PHPS +- Drupal7 - osCommerce - xt:Commerce - PrestaShop -- MediaWiki B type -- WordPress -- Drupal 7 -- Joomla -- PHPS - Django (SHA-1) - Django (PBKDF2-SHA256) - Tripcode -- Episerver -- ColdFusion 10+ -- Apache MD5-APR -- MySQL +- MediaWiki B type +- OpenCart +- Redmine +- PunBB +- Atlassian (PBKDF2-HMAC-SHA1) - PostgreSQL -- MSSQL +- MSSQL (2000) +- MSSQL (2005) +- MSSQL (2012, 2014) +- MySQL323 +- MySQL4.1/MySQL5 - Oracle H: Type (Oracle 7+) - Oracle S: Type (Oracle 11+) - Oracle T: Type (Oracle 12+) -- Sybase +- Sybase ASE +- Episerver 6.x < .NET 4 +- Episerver 6.x >= .NET 4 +- Apache $apr1$ MD5, md5apr1, MD5 (APR) +- ColdFusion 10+ - hMailServer -- DNSSEC (NSEC3) -- IKE-PSK -- IPMI2 RAKP -- iSCSI CHAP -- CRAM-MD5 -- MySQL CRAM (SHA1) -- PostgreSQL CRAM (MD5) -- SIP digest authentication (MD5) -- WPA/WPA2 -- WPA/WPA2 PMK -- NetNTLMv1 -- NetNTLMv1+ESS -- NetNTLMv2 -- Kerberos 5 AS-REQ Pre-Auth etype 23 -- Kerberos 5 TGS-REP etype 23 -- Netscape LDAP SHA/SSHA -- FileZilla Server +- nsldap, SHA-1(Base64), Netscape LDAP SHA +- nsldaps, SSHA-1(Base64), Netscape LDAP SSHA +- SSHA-256(Base64), LDAP {SSHA256} +- SSHA-512(Base64), LDAP {SSHA512} +- CRAM-MD5 Dovecot +- FileZilla Server >= 0.9.55 +- CRC32 - LM - NTLM - Domain Cached Credentials (DCC), MS Cache - Domain Cached Credentials 2 (DCC2), MS Cache 2 -- DPAPI masterkey file v1 and v2 -- MS-AzureSync PBKDF2-HMAC-SHA256 -- descrypt -- bsdicrypt -- md5crypt -- sha256crypt -- sha512crypt -- bcrypt -- scrypt -- macOS v10.4 -- macOS v10.5 -- macOS v10.6 +- DPAPI masterkey file v1 +- DPAPI masterkey file v2 +- MS-AzureSync PBKDF2-HMAC-SHA256 +- descrypt, DES (Unix), Traditional DES +- BSDi Crypt, Extended DES +- md5crypt, MD5 (Unix), Cisco-IOS $1$ (MD5) +- bcrypt $2*$, Blowfish (Unix) +- sha256crypt $5$, SHA256 (Unix) +- sha512crypt $6$, SHA512 (Unix) +- macOS v10.4, MacOS v10.5, MacOS v10.6 - macOS v10.7 -- macOS v10.8 -- macOS v10.9 -- macOS v10.10 -- iTunes backup < 10.0 -- iTunes backup >= 10.0 +- macOS v10.8+ (PBKDF2-SHA512) - AIX {smd5} - AIX {ssha1} - AIX {ssha256} - AIX {ssha512} -- Cisco-ASA MD5 - Cisco-PIX MD5 +- Cisco-ASA MD5 - Cisco-IOS $1$ (MD5) - Cisco-IOS type 4 (SHA256) -- Cisco $8$ (PBKDF2-SHA256) -- Cisco $9$ (scrypt) -- Juniper IVE +- Cisco-IOS $8$ (PBKDF2-SHA256) +- Cisco-IOS $9$ (scrypt) - Juniper NetScreen/SSG (ScreenOS) +- Juniper IVE - Juniper/NetBSD sha1crypt -- Fortigate (FortiOS) +- FortiGate (FortiOS) - Samsung Android Password/PIN - Windows Phone 8+ PIN/password -- GRUB 2 -- CRC32 +- Citrix NetScaler - RACF +- GRUB 2 - Radmin2 -- Redmine -- PunBB -- OpenCart -- Atlassian (PBKDF2-HMAC-SHA1) -- Citrix NetScaler +- ArubaOS - SAP CODVN B (BCODE) - SAP CODVN F/G (PASSCODE) - SAP CODVN H (PWDSALTEDHASH) iSSHA-1 +- Lotus Notes/Domino 5 +- Lotus Notes/Domino 6 +- Lotus Notes/Domino 8 - PeopleSoft - PeopleSoft PS_TOKEN -- Skype -- WinZip - 7-Zip - RAR3-hp - RAR5 - AxCrypt - AxCrypt in-memory SHA1 +- WinZip +- iTunes backup < 10.0 +- iTunes backup >= 10.0 +- TrueCrypt +- Android FDE <= 4.3 +- Android FDE (Samsung DEK) +- eCryptfs +- VeraCrypt +- LUKS +- MS Office <= 2003 +- MS Office 2007 +- MS Office 2010 +- MS Office 2013 - PDF 1.1 - 1.3 (Acrobat 2 - 4) - PDF 1.4 - 1.6 (Acrobat 5 - 8) - PDF 1.7 Level 3 (Acrobat 9) - PDF 1.7 Level 8 (Acrobat 10 - 11) -- MS Office <= 2003 MD5 -- MS Office <= 2003 SHA1 -- MS Office 2007 -- MS Office 2010 -- MS Office 2013 -- Lotus Notes/Domino 5 -- Lotus Notes/Domino 6 -- Lotus Notes/Domino 8 +- Apple Secure Notes +- Password Safe v2 +- Password Safe v3 +- LastPass + LastPass sniffed +- 1Password, agilekeychain +- 1Password, cloudkeychain - Bitcoin/Litecoin wallet.dat - Blockchain, My Wallet - Blockchain, My Wallet, V2 -- 1Password, agilekeychain -- 1Password, cloudkeychain -- LastPass -- Password Safe v2 -- Password Safe v3 +- Electrum Wallet (Salt-Type 1-3) - KeePass 1 (AES/Twofish) and KeePass 2 (AES) - JKS Java Key Store Private Keys (SHA1) - Ethereum Wallet, PBKDF2-HMAC-SHA256 - Ethereum Wallet, SCRYPT -- eCryptfs -- Android FDE <= 4.3 -- Android FDE (Samsung DEK) -- TrueCrypt -- VeraCrypt -- LUKS +- Ethereum Pre-Sale Wallet, PBKDF2-HMAC-SHA256 - Plaintext ## diff --git a/extra/tab_completion/hashcat.sh b/extra/tab_completion/hashcat.sh index c22e953e3..59c81a8bf 100644 --- a/extra/tab_completion/hashcat.sh +++ b/extra/tab_completion/hashcat.sh @@ -174,9 +174,9 @@ _hashcat_contains () _hashcat () { - local VERSION=4.0.1 + local VERSION=4.1.0 - local HASH_MODES="0 10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 124 130 131 132 133 140 141 150 160 200 300 400 500 501 600 900 1000 1100 1400 1410 1411 1420 1421 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2501 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 3910 4010 4110 4300 4400 4500 4520 4521 4522 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 5800 6000 6100 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 9100 9200 9300 9400 9500 9600 9700 9710 9720 9800 9810 9820 9900 10000 10100 10200 10300 10400 10410 10420 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11700 11800 11900 12000 12001 12100 12200 12300 12400 12500 12600 12700 12800 12900 13000 13100 13200 13300 13400 13500 13600 13800 13900 14000 14100 14700 14800 14900 15000 15100 15200 15300 15400 15500 15600 15700 15900 16000" + local HASH_MODES="0 10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 124 130 131 132 133 140 141 150 160 200 300 400 500 501 600 900 1000 1100 1400 1410 1411 1420 1421 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2501 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 3910 4010 4110 4300 4400 4500 4520 4521 4522 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 5800 6000 6100 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 9100 9200 9300 9400 9500 9600 9700 9710 9720 9800 9810 9820 9900 10000 10100 10200 10300 10400 10410 10420 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11700 11800 11900 12000 12001 12100 12200 12300 12400 12500 12600 12700 12800 12900 13000 13100 13200 13300 13400 13500 13600 13800 13900 14000 14100 14700 14800 14900 15000 15100 15200 15300 15400 15500 15600 15700 15900 16000 16100 16200 16300 16400 16500 16600" local ATTACK_MODES="0 1 3 6 7" local HCCAPX_MESSAGE_PAIR="0 1 2 3 4 5" local OUTFILE_FORMATS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15" @@ -189,8 +189,8 @@ _hashcat () local BUILD_IN_CHARSETS='?l ?u ?d ?a ?b ?s ?h ?H' local SHORT_OPTS="-m -a -V -v -h -b -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -i -I -s -l -O" - local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --markov-hcstat --markov-disable --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --wordlist-autohex-disable --separator --show --left --username --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --example-hashes --opencl-info --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-disable --gpu-temp-abort --gpu-temp-retain --powertune-enable --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable" - local OPTIONS="-m -a -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -s -l --hash-type --attack-mode --status-timer --markov-hcstat --markov-threshold --runtime --session --timer --outfile --outfile-format --outfile-check-timer --outfile-check-dir --separator --remove-timer --potfile-path --restore-file-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-abort --gpu-temp-retain --skip --limit --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment-min --increment-max --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to" + local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --markov-hcstat --markov-disable --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --wordlist-autohex-disable --separator --show --left --username --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --example-hashes --opencl-info --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-disable --gpu-temp-abort --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable" + local OPTIONS="-m -a -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -s -l --hash-type --attack-mode --status-timer --markov-hcstat --markov-threshold --runtime --session --timer --outfile --outfile-format --outfile-check-timer --outfile-check-dir --separator --remove-timer --potfile-path --restore-file-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-abort --skip --limit --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment-min --increment-max --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to" COMPREPLY=() local cur="${COMP_WORDS[COMP_CWORD]}" @@ -361,7 +361,7 @@ _hashcat () -t|-p|-c|-j|-k|-g| \ --status-timer|--markov-threshold|--runtime|--session|--separator|--segment-size|--rule-left|--rule-right| \ - --nvidia-spin-damp|--gpu-temp-abort|--gpu-temp-retain|--generate-rules|--generate-rules-func-min|--generate-rules-func-max| \ + --nvidia-spin-damp|--gpu-temp-abort|--generate-rules|--generate-rules-func-min|--generate-rules-func-max| \ --increment-min|--increment-max|--remove-timer|--bitmap-min|--bitmap-max|--skip|--limit|--generate-rules-seed| \ --outfile-check-timer|--outfile-check-dir|--induction-dir|--scrypt-tmto|--encoding-from|--encoding-to|--optimized-kernel-enable|--self-test-disable) return 0 diff --git a/include/benchmark.h b/include/benchmark.h index fcd4e035d..0080eea0a 100644 --- a/include/benchmark.h +++ b/include/benchmark.h @@ -6,7 +6,6 @@ #ifndef _BENCHMARK_H #define _BENCHMARK_H -extern const unsigned int DEFAULT_BENCHMARK_ALGORITHMS_CNT; -extern const unsigned int DEFAULT_BENCHMARK_ALGORITHMS_BUF[]; +int benchmark_next (hashcat_ctx_t *hashcat_ctx); #endif // _BENCHMARK_H diff --git a/include/common.h b/include/common.h index 45d3019bb..ac5e17dda 100644 --- a/include/common.h +++ b/include/common.h @@ -104,7 +104,7 @@ but this is nededed for VS compiler which doesn't have inline keyword but has __ #define SALT_MAX_OLD 51 #define HCBUFSIZ_TINY 0x1000 -#define HCBUFSIZ_LARGE 0x50000 +#define HCBUFSIZ_LARGE 0xb0000 #define CPT_CACHE 0x20000 #define PARAMCNT 64 diff --git a/include/convert.h b/include/convert.h index d15b538ab..e87eba667 100644 --- a/include/convert.h +++ b/include/convert.h @@ -27,21 +27,20 @@ void u8_to_hex_lower (const u8 v, u8 hex[2]); void u32_to_hex_lower (const u32 v, u8 hex[8]); void u64_to_hex_lower (const u64 v, u8 hex[16]); -u8 int_to_base32 (const u8 c); -u8 base32_to_int (const u8 c); -u8 int_to_base64 (const u8 c); -u8 base64_to_int (const u8 c); - -u8 int_to_itoa32 (const u8 c); -u8 itoa32_to_int (const u8 c); -u8 int_to_itoa64 (const u8 c); -u8 itoa64_to_int (const u8 c); - -u8 int_to_bf64 (const u8 c); -u8 bf64_to_int (const u8 c); - -u8 int_to_lotus64 (const u8 c); -u8 lotus64_to_int (const u8 c); +u8 int_to_base32 (const u8 c); +u8 base32_to_int (const u8 c); +u8 int_to_base64 (const u8 c); +u8 base64_to_int (const u8 c); +u8 int_to_base64url (const u8 c); +u8 base64url_to_int (const u8 c); +u8 int_to_itoa32 (const u8 c); +u8 itoa32_to_int (const u8 c); +u8 int_to_itoa64 (const u8 c); +u8 itoa64_to_int (const u8 c); +u8 int_to_bf64 (const u8 c); +u8 bf64_to_int (const u8 c); +u8 int_to_lotus64 (const u8 c); +u8 lotus64_to_int (const u8 c); int base32_decode (u8 (*f) (const u8), const u8 *in_buf, int in_len, u8 *out_buf); int base32_encode (u8 (*f) (const u8), const u8 *in_buf, int in_len, u8 *out_buf); diff --git a/include/ext_ADL.h b/include/ext_ADL.h index 0f3469cd6..4d6898cd8 100644 --- a/include/ext_ADL.h +++ b/include/ext_ADL.h @@ -23,15 +23,9 @@ #define ADL_MAX_PATH 256 -#define ADL_DL_FANCTRL_SUPPORTS_PERCENT_READ 1 -#define ADL_DL_FANCTRL_SUPPORTS_PERCENT_WRITE 2 #define ADL_DL_FANCTRL_SPEED_TYPE_PERCENT 1 #define ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED 1 -#define ADL_OD6_SETSTATE_PERFORMANCE 0x00000001 -#define ADL_OD6_GETSTATEINFO_CUSTOM_PERFORMANCE 0x00000004 -#define ADL_OD6_FANSPEED_TYPE_PERCENT 0x00000001 - typedef struct AdapterInfo { int iSize; @@ -241,15 +235,6 @@ typedef struct ADLOD6StateInfo ADLOD6PerformanceLevel aLevels [2]; } ADLOD6StateInfo; -typedef struct ADLOD6PowerControlInfo -{ - int iMinValue; - int iMaxValue; - int iStepValue; - int iExtValue; - int iExtMask; -} ADLOD6PowerControlInfo; - #if defined (__MSC_VER) #define ADL_API_CALL __cdecl #elif defined (_WIN32) || defined (__WIN32__) @@ -287,26 +272,15 @@ typedef int (ADL_API_CALL *ADL_ADAPTER_VIDEOBIOSINFO_GET) (int, ADLBiosInfo *); typedef int (ADL_API_CALL *ADL_OVERDRIVE5_FANSPEEDINFO_GET) (int, int, ADLFanSpeedInfo *); typedef int (ADL_API_CALL *ADL_OVERDRIVE5_FANSPEED_GET) (int, int, ADLFanSpeedValue *); typedef int (ADL_API_CALL *ADL_OVERDRIVE6_FANSPEED_GET) (int, ADLOD6FanSpeedInfo *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE5_FANSPEED_SET) (int, int, ADLFanSpeedValue *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_FANSPEED_SET) (int, ADLOD6FanSpeedValue *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE5_FANSPEEDTODEFAULT_SET) (int, int); typedef int (ADL_API_CALL *ADL_OVERDRIVE5_ODPARAMETERS_GET) (int, ADLODParameters *); typedef int (ADL_API_CALL *ADL_OVERDRIVE5_ODPERFORMANCELEVELS_GET) (int, int, ADLODPerformanceLevels *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE5_ODPERFORMANCELEVELS_SET) (int, ADLODPerformanceLevels *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_POWERCONTROL_SET) (int, int); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_POWERCONTROL_GET) (int, int *, int *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_POWERCONTROLINFO_GET) (int, ADLOD6PowerControlInfo *); typedef int (ADL_API_CALL *ADL_ADAPTER_ACTIVE_GET) (int, int *); -typedef int (ADL_API_CALL *ADL_DISPLAYENABLE_SET) (int, int *, int, int); typedef int (ADL_API_CALL *ADL_OVERDRIVE_CAPS) (int, int *, int *, int *); typedef int (ADL_API_CALL *ADL_OVERDRIVE6_CURRENTSTATUS_GET) (int, ADLOD6CurrentStatus *); typedef int (ADL_API_CALL *ADL_OVERDRIVE6_STATEINFO_GET) (int, int, ADLOD6MemClockState *); typedef int (ADL_API_CALL *ADL_OVERDRIVE6_CAPABILITIES_GET) (int, ADLOD6Capabilities *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_STATE_SET) (int, int, ADLOD6StateInfo *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_POWERCONTROL_CAPS) (int, int *); typedef int (ADL_API_CALL *ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET) (int, int *, int *); typedef int (ADL_API_CALL *ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET) (int, ADLOD6ParameterRange *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_FANSPEED_RESET) (int); #if defined (_POSIX) typedef void *ADL_LIB; @@ -332,26 +306,13 @@ typedef struct hm_adl_lib ADL_OVERDRIVE5_FANSPEEDINFO_GET ADL_Overdrive5_FanSpeedInfo_Get; ADL_OVERDRIVE5_FANSPEED_GET ADL_Overdrive5_FanSpeed_Get; ADL_OVERDRIVE6_FANSPEED_GET ADL_Overdrive6_FanSpeed_Get; - ADL_OVERDRIVE5_FANSPEED_SET ADL_Overdrive5_FanSpeed_Set; - ADL_OVERDRIVE6_FANSPEED_SET ADL_Overdrive6_FanSpeed_Set; - ADL_OVERDRIVE5_FANSPEEDTODEFAULT_SET ADL_Overdrive5_FanSpeedToDefault_Set; - ADL_OVERDRIVE5_ODPARAMETERS_GET ADL_Overdrive5_ODParameters_Get; - ADL_OVERDRIVE5_ODPERFORMANCELEVELS_GET ADL_Overdrive5_ODPerformanceLevels_Get; - ADL_OVERDRIVE5_ODPERFORMANCELEVELS_SET ADL_Overdrive5_ODPerformanceLevels_Set; - ADL_OVERDRIVE6_POWERCONTROLINFO_GET ADL_Overdrive6_PowerControlInfo_Get; - ADL_OVERDRIVE6_POWERCONTROL_GET ADL_Overdrive6_PowerControl_Get; - ADL_OVERDRIVE6_POWERCONTROL_SET ADL_Overdrive6_PowerControl_Set; ADL_ADAPTER_ACTIVE_GET ADL_Adapter_Active_Get; - ADL_DISPLAYENABLE_SET ADL_DisplayEnable_Set; ADL_OVERDRIVE_CAPS ADL_Overdrive_Caps; - ADL_OVERDRIVE6_POWERCONTROL_CAPS ADL_Overdrive6_PowerControl_Caps; ADL_OVERDRIVE6_CAPABILITIES_GET ADL_Overdrive6_Capabilities_Get; ADL_OVERDRIVE6_STATEINFO_GET ADL_Overdrive6_StateInfo_Get; ADL_OVERDRIVE6_CURRENTSTATUS_GET ADL_Overdrive6_CurrentStatus_Get; - ADL_OVERDRIVE6_STATE_SET ADL_Overdrive6_State_Set; ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET ADL_Overdrive6_TargetTemperatureData_Get; ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET ADL_Overdrive6_TargetTemperatureRangeInfo_Get; - ADL_OVERDRIVE6_FANSPEED_RESET ADL_Overdrive6_FanSpeed_Reset; } hm_adl_lib_t; diff --git a/include/ext_nvapi.h b/include/ext_nvapi.h index 39654ed52..e3df0cffa 100644 --- a/include/ext_nvapi.h +++ b/include/ext_nvapi.h @@ -30,9 +30,6 @@ typedef char NvAPI_ShortString[NVAPI_SHORT_STRING_MAX]; #define MAKE_NVAPI_VERSION(typeName,ver) (NvU32)(sizeof(typeName) | ((ver)<<16)) #define NVAPI_MAX_PHYSICAL_GPUS 64 -#define NVAPI_MAX_COOLER_PER_GPU 20 - -#define GPU_COOLER_LEVELS_VER 0x10000 typedef enum _NvAPI_Status { @@ -192,13 +189,6 @@ typedef struct struct_NvLevel } NvLevel; -typedef struct struct_NV_GPU_COOLER_LEVELS -{ - NvU32 Version; - NvLevel Levels[NVAPI_MAX_COOLER_PER_GPU]; - -} NV_GPU_COOLER_LEVELS; - NVAPI_INTERFACE NvAPI_QueryInterface (unsigned int offset); NVAPI_INTERFACE NvAPI_Initialize (void); NVAPI_INTERFACE NvAPI_Unload (void); @@ -206,8 +196,6 @@ NVAPI_INTERFACE NvAPI_GetErrorMessage (NvAPI_Status nr,NvAPI_ShortString szDesc) NVAPI_INTERFACE NvAPI_EnumPhysicalGPUs (NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount); NVAPI_INTERFACE NvAPI_GPU_GetPerfPoliciesInfo (NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_INFO_PARAMS_V1 *perfPolicies_info); NVAPI_INTERFACE NvAPI_GPU_GetPerfPoliciesStatus (NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 *perfPolicies_status); -NVAPI_INTERFACE NvAPI_GPU_SetCoolerLevels (NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex, NV_GPU_COOLER_LEVELS *pCoolerLevels); -NVAPI_INTERFACE NvAPI_GPU_RestoreCoolerSettings (NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex); NVAPI_INTERFACE NvAPI_GPU_GetBusId (NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusId); NVAPI_INTERFACE NvAPI_GPU_GetBusSlotId (NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusSlotId); @@ -230,8 +218,6 @@ typedef int (*NVAPI_API_CALL NVAPI_GETERRORMESSAGE) (NvAPI_Status, NvAPI_ShortSt typedef int (*NVAPI_API_CALL NVAPI_ENUMPHYSICALGPUS) (NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *); typedef int (*NVAPI_API_CALL NVAPI_GPU_GETPERFPOLICIESINFO) (NvPhysicalGpuHandle, NV_GPU_PERF_POLICIES_INFO_PARAMS_V1 *); typedef int (*NVAPI_API_CALL NVAPI_GPU_GETPERFPOLICIESSTATUS) (NvPhysicalGpuHandle, NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 *); -typedef int (*NVAPI_API_CALL NVAPI_GPU_SETCOOLERLEVELS) (NvPhysicalGpuHandle, NvU32, NV_GPU_COOLER_LEVELS *); -typedef int (*NVAPI_API_CALL NVAPI_GPU_RESTORECOOLERSETTINGS) (NvPhysicalGpuHandle, NvU32); typedef int (*NVAPI_API_CALL NVAPI_GPU_GETBUSID) (NvPhysicalGpuHandle, NvU32 *); typedef int (*NVAPI_API_CALL NVAPI_GPU_GETBUSSLOTID) (NvPhysicalGpuHandle, NvU32 *); @@ -252,8 +238,6 @@ typedef struct hm_nvapi_lib NVAPI_ENUMPHYSICALGPUS NvAPI_EnumPhysicalGPUs; NVAPI_GPU_GETPERFPOLICIESINFO NvAPI_GPU_GetPerfPoliciesInfo; NVAPI_GPU_GETPERFPOLICIESSTATUS NvAPI_GPU_GetPerfPoliciesStatus; - NVAPI_GPU_SETCOOLERLEVELS NvAPI_GPU_SetCoolerLevels; - NVAPI_GPU_RESTORECOOLERSETTINGS NvAPI_GPU_RestoreCoolerSettings; NVAPI_GPU_GETBUSID NvAPI_GPU_GetBusId; NVAPI_GPU_GETBUSSLOTID NvAPI_GPU_GetBusSlotId; diff --git a/include/ext_nvml.h b/include/ext_nvml.h index 915fe34d8..b951caacb 100644 --- a/include/ext_nvml.h +++ b/include/ext_nvml.h @@ -181,7 +181,6 @@ typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_NAME) (nvmlDevice_t, char * typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_HANDLE_BY_INDEX) (unsigned int, nvmlDevice_t *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_TEMPERATURE) (nvmlDevice_t, nvmlTemperatureSensors_t, unsigned int *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_FAN_SPEED) (nvmlDevice_t, unsigned int *); -typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_POWER_USAGE) (nvmlDevice_t, unsigned int *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_UTILIZATION_RATES) (nvmlDevice_t, nvmlUtilization_t *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_CLOCKINFO) (nvmlDevice_t, nvmlClockType_t, unsigned int *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_THRESHOLD) (nvmlDevice_t, nvmlTemperatureThresholds_t, unsigned int *); @@ -191,9 +190,6 @@ typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_CURRENTCLOCKSTHROTTLEREASON typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_SUPPORTEDCLOCKSTHROTTLEREASONS) (nvmlDevice_t, unsigned long long *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_SET_COMPUTEMODE) (nvmlDevice_t, nvmlComputeMode_t); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_SET_OPERATIONMODE) (nvmlDevice_t, nvmlGpuOperationMode_t); -typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_POWERMANAGEMENTLIMITCONSTRAINTS) (nvmlDevice_t, unsigned int *, unsigned int *); -typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_SET_POWERMANAGEMENTLIMIT) (nvmlDevice_t, unsigned int); -typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_POWERMANAGEMENTLIMIT) (nvmlDevice_t, unsigned int *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_PCIINFO) (nvmlDevice_t, nvmlPciInfo_t *); #if defined (_POSIX) @@ -214,7 +210,6 @@ typedef struct hm_nvml_lib NVML_DEVICE_GET_HANDLE_BY_INDEX nvmlDeviceGetHandleByIndex; NVML_DEVICE_GET_TEMPERATURE nvmlDeviceGetTemperature; NVML_DEVICE_GET_FAN_SPEED nvmlDeviceGetFanSpeed; - NVML_DEVICE_GET_POWER_USAGE nvmlDeviceGetPowerUsage; NVML_DEVICE_GET_UTILIZATION_RATES nvmlDeviceGetUtilizationRates; NVML_DEVICE_GET_CLOCKINFO nvmlDeviceGetClockInfo; NVML_DEVICE_GET_THRESHOLD nvmlDeviceGetTemperatureThreshold; @@ -222,11 +217,6 @@ typedef struct hm_nvml_lib NVML_DEVICE_GET_CURRPCIELINKWIDTH nvmlDeviceGetCurrPcieLinkWidth; NVML_DEVICE_GET_CURRENTCLOCKSTHROTTLEREASONS nvmlDeviceGetCurrentClocksThrottleReasons; NVML_DEVICE_GET_SUPPORTEDCLOCKSTHROTTLEREASONS nvmlDeviceGetSupportedClocksThrottleReasons; - NVML_DEVICE_SET_COMPUTEMODE nvmlDeviceSetComputeMode; - NVML_DEVICE_SET_OPERATIONMODE nvmlDeviceSetGpuOperationMode; - NVML_DEVICE_GET_POWERMANAGEMENTLIMITCONSTRAINTS nvmlDeviceGetPowerManagementLimitConstraints; - NVML_DEVICE_SET_POWERMANAGEMENTLIMIT nvmlDeviceSetPowerManagementLimit; - NVML_DEVICE_GET_POWERMANAGEMENTLIMIT nvmlDeviceGetPowerManagementLimit; NVML_DEVICE_GET_PCIINFO nvmlDeviceGetPciInfo; } hm_nvml_lib_t; diff --git a/include/ext_xnvctrl.h b/include/ext_xnvctrl.h deleted file mode 100644 index b63a73bc1..000000000 --- a/include/ext_xnvctrl.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Author......: See docs/credits.txt - * License.....: MIT - */ - -#ifndef _EXT_XNVCTRL_H -#define _EXT_XNVCTRL_H - -/** - * Stuff from X11/Xlib.h - */ - -typedef void *(*XOPENDISPLAY) (char *); -typedef int (*XCLOSEDISPLAY) (void *); - -/** - * Declarations from NVCtrl.h - */ - -#define NV_CTRL_TARGET_TYPE_GPU 1 -#define NV_CTRL_TARGET_TYPE_COOLER 5 /* e.g., fan */ - -#define NV_CTRL_GPU_COOLER_MANUAL_CONTROL 319 /* RW-G */ -#define NV_CTRL_GPU_COOLER_MANUAL_CONTROL_FALSE 0 -#define NV_CTRL_GPU_COOLER_MANUAL_CONTROL_TRUE 1 - -#define NV_CTRL_THERMAL_COOLER_CURRENT_LEVEL 417 /* R--C */ -#define NV_CTRL_THERMAL_COOLER_LEVEL 320 /* RW-C */ - -/* - * NV_CTRL_PCI_BUS - Returns the PCI bus number the specified device is using. - */ - -#define NV_CTRL_PCI_BUS 239 /* R--GI */ - -/* - * NV_CTRL_PCI_DEVICE - Returns the PCI device number the specified device is - * using. - */ - -#define NV_CTRL_PCI_DEVICE 240 /* R--GI */ - -/* - * NV_CTRL_PCI_FUNCTION - Returns the PCI function number the specified device - * is using. - */ - -#define NV_CTRL_PCI_FUNCTION 241 /* R--GI */ - -/* - * NV_CTRL_GPU_CORE_THRESHOLD reflects the temperature at which the - * GPU is throttled to prevent overheating. - */ - -#define NV_CTRL_GPU_CORE_THRESHOLD 61 /* R--G */ - -/** - * hashcat stuff from here - */ - -typedef int HM_ADAPTER_XNVCTRL; - -#if defined(_WIN32) || defined(__WIN32__) -#define XNVCTRL_API_CALL __stdcall -#else -#define XNVCTRL_API_CALL -#endif - -typedef int (*XNVCTRL_API_CALL XNVCTRLQUERYTARGETCOUNT) (void *, int, int *); -typedef int (*XNVCTRL_API_CALL XNVCTRLQUERYTARGETATTRIBUTE) (void *, int, int, unsigned int, unsigned int, int *); -typedef void (*XNVCTRL_API_CALL XNVCTRLSETTARGETATTRIBUTE) (void *, int, int, unsigned int, unsigned int, int); - -#if defined (_POSIX) -typedef void *XNVCTRL_LIB; -#else -typedef HINSTANCE XNVCTRL_LIB; -#endif - -typedef struct hm_xnvctrl_lib -{ - void *dpy; - - XNVCTRL_LIB lib_x11; - XNVCTRL_LIB lib_xnvctrl; - - XOPENDISPLAY XOpenDisplay; - XCLOSEDISPLAY XCloseDisplay; - - XNVCTRLQUERYTARGETCOUNT XNVCTRLQueryTargetCount; - XNVCTRLQUERYTARGETATTRIBUTE XNVCTRLQueryTargetAttribute; - XNVCTRLSETTARGETATTRIBUTE XNVCTRLSetTargetAttribute; - -} hm_xnvctrl_lib_t; - -typedef hm_xnvctrl_lib_t XNVCTRL_PTR; - -#endif // _EXT_XNVCTRL_H diff --git a/include/hashes.h b/include/hashes.h index 376a89dd3..8af3e3a7b 100644 --- a/include/hashes.h +++ b/include/hashes.h @@ -17,6 +17,8 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 salt_pos); +void hashes_init_filename (hashcat_ctx_t *hashcat_ctx); + int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx); int hashes_init_stage2 (hashcat_ctx_t *hashcat_ctx); int hashes_init_stage3 (hashcat_ctx_t *hashcat_ctx); diff --git a/include/hlfmt.h b/include/hlfmt.h index 2979f0bd8..c551766e8 100644 --- a/include/hlfmt.h +++ b/include/hlfmt.h @@ -10,7 +10,7 @@ #define HLFMTS_CNT 11 -char *strhlfmt (const u32 hashfile_format); +const char *strhlfmt (const u32 hashfile_format); void hlfmt_hash (hashcat_ctx_t *hashcat_ctx, u32 hashfile_format, char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len); void hlfmt_user (hashcat_ctx_t *hashcat_ctx, u32 hashfile_format, char *line_buf, int line_len, char **userbuf_pos, int *userbuf_len); diff --git a/include/hwmon.h b/include/hwmon.h index 18c99fd21..e3f64ec7d 100644 --- a/include/hwmon.h +++ b/include/hwmon.h @@ -21,10 +21,6 @@ int hm_get_utilization_with_device_id (hashcat_ctx_t *hashcat_ctx, const int hm_get_memoryspeed_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 device_id); int hm_get_corespeed_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 device_id); int hm_get_throttle_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 device_id); -int hm_set_fanspeed_with_device_id_adl (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed, const int fanpolicy); -int hm_set_fanspeed_with_device_id_nvapi (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed, const int fanpolicy); -int hm_set_fanspeed_with_device_id_xnvctrl (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed); -int hm_set_fanspeed_with_device_id_sysfs (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed); int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx); void hwmon_ctx_destroy (hashcat_ctx_t *hashcat_ctx); diff --git a/include/interface.h b/include/interface.h index d58eb3668..0848772a6 100644 --- a/include/interface.h +++ b/include/interface.h @@ -469,6 +469,49 @@ typedef struct ethereum_scrypt } ethereum_scrypt_t; +typedef struct ethereum_presale +{ + u32 iv[4]; + u32 enc_seed[152]; + u32 enc_seed_len; + +} ethereum_presale_t; + +typedef struct tacacs_plus +{ + u32 session_buf[16]; + + u32 ct_data_buf[64]; + u32 ct_data_len; + + u32 sequence_buf[16]; + +} tacacs_plus_t; + +typedef struct apple_secure_notes +{ + u32 Z_PK; + u32 ZCRYPTOITERATIONCOUNT; + u32 ZCRYPTOSALT[16]; + u32 ZCRYPTOWRAPPEDKEY[16]; + +} apple_secure_notes_t; + +typedef struct jwt +{ + u32 salt_buf[1024]; + u32 salt_len; + +} jwt_t; + +typedef struct electrum_wallet +{ + u32 salt_type; + u32 iv[4]; + u32 encrypted[4]; + +} electrum_wallet_t; + typedef struct luks_tmp { u32 ipad32[8]; @@ -903,6 +946,16 @@ typedef struct dpapimk_tmp_v2 } dpapimk_tmp_v2_t; +typedef struct apple_secure_notes_tmp +{ + u32 ipad[8]; + u32 opad[8]; + + u32 dgst[8]; + u32 out[8]; + +} apple_secure_notes_tmp_t; + typedef struct seven_zip_hook { u32 ukey[8]; @@ -1283,6 +1336,18 @@ typedef enum display_len DISPLAY_LEN_MAX_15900 = 1 + 7 + 1 + 1 + 1 + 1 + 1 + 100 + 1 + 6 + 1 + 6 + 1 + 10 + 1 + 32 + 1 + 4 + 1 + 512, DISPLAY_LEN_MIN_16000 = 10, DISPLAY_LEN_MAX_16000 = 10, + DISPLAY_LEN_MIN_16100 = 1 + 11 + 1 + 1 + 1 + 8 + 12 + 1 + 4, + DISPLAY_LEN_MAX_16100 = 1 + 11 + 1 + 1 + 1 + 8 + 256 + 1 + 4, + DISPLAY_LEN_MIN_16200 = 5 + 1 + 1 + 1 + 5 + 1 + 32 + 1 + 48, + DISPLAY_LEN_MAX_16200 = 5 + 1 + 6 + 1 + 5 + 1 + 32 + 1 + 48, + DISPLAY_LEN_MIN_16300 = 11 + 1 + 64 + 1 + 40 + 1 + 32, + DISPLAY_LEN_MAX_16300 = 11 + 1 + 1248 + 1 + 40 + 1 + 32, + DISPLAY_LEN_MIN_16400 = 10 + 32 + 32, + DISPLAY_LEN_MAX_16400 = 10 + 32 + 32, + DISPLAY_LEN_MIN_16500 = 1 + 1 + 1 + 1 + 43, + DISPLAY_LEN_MAX_16500 = 2047 + 1 + 2047 + 1 + 86, + DISPLAY_LEN_MIN_16600 = 10 + 1 + 1 + 32 + 1 + 32, + DISPLAY_LEN_MAX_16600 = 10 + 1 + 1 + 32 + 1 + 32, DISPLAY_LEN_MIN_99999 = 1, DISPLAY_LEN_MAX_99999 = 55, @@ -1411,6 +1476,11 @@ typedef enum hash_type HASH_TYPE_CHACHA20 = 60, HASH_TYPE_DPAPIMK = 61, HASH_TYPE_JKS_SHA1 = 62, + HASH_TYPE_TACACS_PLUS = 63, + HASH_TYPE_APPLE_SECURE_NOTES = 64, + HASH_TYPE_CRAM_MD5_DOVECOT = 65, + HASH_TYPE_JWT = 66, + HASH_TYPE_ELECTRUM_WALLET = 67, } hash_type_t; @@ -1608,6 +1678,14 @@ typedef enum kern_type KERN_TYPE_ETHEREUM_SCRYPT = 15700, KERN_TYPE_DPAPIMK_V2 = 15900, KERN_TYPE_TRIPCODE = 16000, + KERN_TYPE_TACACS_PLUS = 16100, + KERN_TYPE_APPLE_SECURE_NOTES = 16200, + KERN_TYPE_ETHEREUM_PRESALE = 16300, + KERN_TYPE_CRAM_MD5_DOVECOT = 16400, + KERN_TYPE_JWT_HS256 = 16511, + KERN_TYPE_JWT_HS384 = 16512, + KERN_TYPE_JWT_HS512 = 16513, + KERN_TYPE_ELECTRUM_WALLET13 = 16600, KERN_TYPE_PLAINTEXT = 99999, } kern_type_t; @@ -1682,6 +1760,8 @@ typedef enum rounds_count ROUNDS_DPAPIMK_V1 = 24000 - 1, // from 4000 to 24000 (possibly more) ROUNDS_DPAPIMK_V2 = 8000 - 1, // from 4000 to 24000 (possibly more) ROUNDS_ETHEREUM_PBKDF2 = 262144 - 1, + ROUNDS_APPLE_SECURE_NOTES = 20000, + ROUNDS_ETHEREUM_PRESALE = 2000 - 1, ROUNDS_STDOUT = 0 } rounds_count_t; @@ -1690,182 +1770,189 @@ typedef enum rounds_count * input functions */ -int bcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int cisco4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int dcc_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int dcc2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int descrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int des_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int episerver_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int ipb2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int joomla_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int postgresql_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int netscreen_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int keccak_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int blake2b_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int chacha20_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int lm_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int md4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int md5s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int md5half_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int md5md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int md5pix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int md5asa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int md5apr1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int md5crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int mssql2000_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int mssql2005_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int netntlmv1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int netntlmv2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int oracleh_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int oracles_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int oraclet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int osc_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int arubaos_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int macos1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int macos512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int phpass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha1b64_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha1b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha1s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha1sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha224_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha256s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha384_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha512s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha512crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int smf_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int vb3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int vb30_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int wpa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int psafe2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int psafe3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int ikepsk_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int ikepsk_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int androidpin_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int ripemd160_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int whirlpool_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int truecrypt_parse_hash_1k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int truecrypt_parse_hash_2k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int md5aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha256aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha512aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int agilekey_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha1aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int lastpass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int gost_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha256crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int mssql2012_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha512macos_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int episerver4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha512grub_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha512b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int hmacsha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int hmacsha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int hmacsha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int hmacmd5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int krb5pa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int krb5tgs_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sapb_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sapg_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int drupal7_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sybasease_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int mysql323_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int rakp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int netscaler_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int chap_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int cloudkey_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int nsec3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int wbb3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int racf_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int lotus5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int lotus6_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int lotus8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int hmailserver_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int phps_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int mediawiki_b_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int peoplesoft_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int skype_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int androidfde_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int scrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int juniper_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int cisco8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int cisco9_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int office2007_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int office2010_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int office2013_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int oldoffice01_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int oldoffice01cm1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int oldoffice01cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int oldoffice34_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int oldoffice34cm1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int oldoffice34cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int radmin2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int djangosha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int djangopbkdf2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int siphash_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int crammd5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int saph_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int redmine_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int punbb_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int pdf11_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int pdf11cm1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int pdf11cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int pdf14_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int pdf17l3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int pdf17l8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int pbkdf2_sha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int prestashop_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int postgresql_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int mysql_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int bitcoin_wallet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sip_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int crc32_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int seven_zip_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int gost2012sbog_256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int gost2012sbog_512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int pbkdf2_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int pbkdf2_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int pbkdf2_sha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int ecryptfs_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int bsdicrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int rar3hp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int rar5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int cf10_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int mywallet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int mywalletv2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int ms_drsr_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int androidfde_samsung_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int axcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha1axcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int keepass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int pstoken_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int zip2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int veracrypt_parse_hash_200000 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int veracrypt_parse_hash_500000 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int veracrypt_parse_hash_327661 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int veracrypt_parse_hash_655331 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int win8phone_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int opencart_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int plaintext_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha1cx_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int luks_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig, const int keyslot_idx); -int itunes_backup_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int skip32_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int fortigate_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int sha256b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int filezilla_server_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int netbsd_sha1crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int atlassian_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int dpapimk_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int jks_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int ethereum_pbkdf2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int ethereum_scrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); -int tripcode_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig); +int bcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int cisco4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int dcc_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int dcc2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int descrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int des_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int episerver_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int ipb2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int joomla_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int postgresql_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int netscreen_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int keccak_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int blake2b_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int chacha20_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int lm_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int md4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int md5s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int md5half_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int md5md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int md5pix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int md5asa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int md5apr1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int md5crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int mssql2000_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int mssql2005_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int netntlmv1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int netntlmv2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int oracleh_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int oracles_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int oraclet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int osc_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int arubaos_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int macos1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int macos512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int phpass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha1b64_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha1b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha1s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha1sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha224_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha256s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha384_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha512s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha512crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int smf_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int vb3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int vb30_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int wpa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int psafe2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int psafe3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int ikepsk_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int ikepsk_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int androidpin_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int ripemd160_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int whirlpool_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int truecrypt_parse_hash_1k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int truecrypt_parse_hash_2k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int md5aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha256aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha512aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int agilekey_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha1aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int lastpass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int gost_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha256crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int mssql2012_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha512macos_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int episerver4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha512grub_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha512b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int hmacsha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int hmacsha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int hmacsha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int hmacmd5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int krb5pa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int krb5tgs_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sapb_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sapg_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int drupal7_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sybasease_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int mysql323_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int rakp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int netscaler_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int chap_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int cloudkey_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int nsec3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int wbb3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int racf_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int lotus5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int lotus6_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int lotus8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int hmailserver_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int phps_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int mediawiki_b_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int peoplesoft_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int skype_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int androidfde_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int scrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int juniper_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int cisco8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int cisco9_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int office2007_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int office2010_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int office2013_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int oldoffice01_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int oldoffice01cm1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int oldoffice01cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int oldoffice34_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int oldoffice34cm1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int oldoffice34cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int radmin2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int djangosha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int djangopbkdf2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int siphash_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int crammd5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int crammd5_dovecot_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int saph_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int redmine_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int punbb_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int pdf11_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int pdf11cm1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int pdf11cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int pdf14_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int pdf17l3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int pdf17l8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int pbkdf2_sha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int prestashop_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int postgresql_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int mysql_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int bitcoin_wallet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sip_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int crc32_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int seven_zip_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int gost2012sbog_256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int gost2012sbog_512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int pbkdf2_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int pbkdf2_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int pbkdf2_sha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int ecryptfs_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int bsdicrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int rar3hp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int rar5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int cf10_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int mywallet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int mywalletv2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int ms_drsr_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int androidfde_samsung_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int axcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha1axcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int keepass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int pstoken_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int zip2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int veracrypt_parse_hash_200000 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int veracrypt_parse_hash_500000 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int veracrypt_parse_hash_327661 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int veracrypt_parse_hash_655331 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int win8phone_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int opencart_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int plaintext_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha1cx_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int luks_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig, const int keyslot_idx); +int itunes_backup_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int skip32_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int fortigate_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int sha256b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int filezilla_server_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int netbsd_sha1crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int atlassian_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int dpapimk_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int jks_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int ethereum_pbkdf2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int ethereum_scrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int tripcode_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int tacacs_plus_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int apple_secure_notes_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int ethereum_presale_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int jwt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); +int electrum_wallet13_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig); + /** * hook functions */ @@ -1876,9 +1963,9 @@ void seven_zip_hook_func (hc_device_param_t *device_param, void *hook_salts_buf, * output functions */ -char *stroptitype (const u32 opti_type); -char *strhashtype (const u32 hash_mode); -char *strparser (const u32 parser_status); +const char *stroptitype (const u32 opti_type); +const char *strhashtype (const u32 hash_mode); +const char *strparser (const u32 parser_status); int check_old_hccap (const char *hashfile); void to_hccapx_t (hashcat_ctx_t *hashcat_ctx, hccapx_t *hccapx, const u32 salt_pos, const u32 digest_pos); @@ -1891,6 +1978,10 @@ u32 hashconfig_forced_kernel_threads (hashcat_ctx_t *hashcat_ctx); u32 hashconfig_get_kernel_threads (hashcat_ctx_t *hashcat_ctx, const hc_device_param_t *device_param); u32 hashconfig_get_kernel_loops (hashcat_ctx_t *hashcat_ctx); int hashconfig_general_defaults (hashcat_ctx_t *hashcat_ctx); +int hashconfig_get_pw_min (hashcat_ctx_t *hashcat_ctx, const bool optimized_kernel); +int hashconfig_get_pw_max (hashcat_ctx_t *hashcat_ctx, const bool optimized_kernel); +int hashconfig_get_salt_min (hashcat_ctx_t *hashcat_ctx, const bool optimized_kernel); +int hashconfig_get_salt_max (hashcat_ctx_t *hashcat_ctx, const bool optimized_kernel); void hashconfig_benchmark_defaults (hashcat_ctx_t *hashcat_ctx, salt_t *salt, void *esalt, void *hook_salt); const char *hashconfig_benchmark_mask (hashcat_ctx_t *hashcat_ctx); diff --git a/include/opencl.h b/include/opencl.h index 7955dab52..dc1c88de9 100644 --- a/include/opencl.h +++ b/include/opencl.h @@ -63,6 +63,7 @@ int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par int run_kernel_mp (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 kern_run, const u64 num); int run_kernel_tm (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param); int run_kernel_amp (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u64 num); +int run_kernel_atinit (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 num); int run_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u32 value, const u64 size); int run_kernel_bzero (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 size); int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 pws_cnt); @@ -80,6 +81,7 @@ void opencl_ctx_destroy (hashcat_ctx_t *hashcat_ctx); int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime); void opencl_ctx_devices_destroy (hashcat_ctx_t *hashcat_ctx); +void opencl_ctx_devices_sync_tuning (hashcat_ctx_t *hashcat_ctx); void opencl_ctx_devices_update_power (hashcat_ctx_t *hashcat_ctx); void opencl_ctx_devices_kernel_loops (hashcat_ctx_t *hashcat_ctx); diff --git a/include/rp_cpu.h b/include/rp_cpu.h index da1b088d0..5d07efb9b 100644 --- a/include/rp_cpu.h +++ b/include/rp_cpu.h @@ -11,7 +11,7 @@ #define RULE_RC_SYNTAX_ERROR -1 #define RULE_RC_REJECT_ERROR -2 -int _old_apply_rule (char *rule, int rule_len, char in[RP_PASSWORD_SIZE], int in_len, char out[RP_PASSWORD_SIZE]); +int _old_apply_rule (const char *rule, int rule_len, char in[RP_PASSWORD_SIZE], int in_len, char out[RP_PASSWORD_SIZE]); int run_rule_engine (const int rule_len, const char *rule_buf); diff --git a/include/shared.h b/include/shared.h index c2ef98e3a..77077f122 100644 --- a/include/shared.h +++ b/include/shared.h @@ -37,9 +37,6 @@ void setup_environment_variables (void); void setup_umask (void); void setup_seeding (const bool rp_gen_seed_chgd, const u32 rp_gen_seed); -int hc_stat (const char *pathname, hc_stat_t *buf); -int hc_fstat (int fd, hc_stat_t *buf); - void hc_qsort_r (void *base, size_t nmemb, size_t size, int (*compar) (const void *, const void *, void *), void *arg); void *hc_bsearch_r (const void *key, const void *base, size_t nmemb, size_t size, int (*compar) (const void *, const void *, void *), void *arg); @@ -59,10 +56,6 @@ void hc_string_trim_leading (char *s); size_t hc_fread (void *ptr, size_t size, size_t nmemb, FILE *stream); void hc_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream); -hc_time_t hc_time (hc_time_t *t); -struct tm *hc_gmtime (const hc_time_t *t, MAYBE_UNUSED struct tm *result); -char *hc_ctime (const hc_time_t *t, char *buf, MAYBE_UNUSED const size_t buf_size); - bool hc_same_files (char *file1, char *file2); #endif // _SHARED_H diff --git a/include/status.h b/include/status.h index 77db1f719..69094e176 100644 --- a/include/status.h +++ b/include/status.h @@ -20,7 +20,7 @@ int status_get_device_info_cnt (const hashcat_ctx_t *hashcat_ int status_get_device_info_active (const hashcat_ctx_t *hashcat_ctx); bool status_get_skipped_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); char *status_get_session (const hashcat_ctx_t *hashcat_ctx); -char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx); +const char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx); int status_get_status_number (const hashcat_ctx_t *hashcat_ctx); int status_get_guess_mode (const hashcat_ctx_t *hashcat_ctx); char *status_get_guess_base (const hashcat_ctx_t *hashcat_ctx); @@ -34,7 +34,7 @@ double status_get_guess_mod_percent (const hashcat_ctx_t *hashcat_ char *status_get_guess_charset (const hashcat_ctx_t *hashcat_ctx); int status_get_guess_mask_length (const hashcat_ctx_t *hashcat_ctx); char *status_get_guess_candidates_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); -char *status_get_hash_type (const hashcat_ctx_t *hashcat_ctx); +const char *status_get_hash_type (const hashcat_ctx_t *hashcat_ctx); const char *status_get_hash_target (const hashcat_ctx_t *hashcat_ctx); int status_get_digests_done (const hashcat_ctx_t *hashcat_ctx); int status_get_digests_cnt (const hashcat_ctx_t *hashcat_ctx); @@ -47,7 +47,7 @@ double status_get_msec_paused (const hashcat_ctx_t *hashcat_ double status_get_msec_real (const hashcat_ctx_t *hashcat_ctx); char *status_get_time_started_absolute (const hashcat_ctx_t *hashcat_ctx); char *status_get_time_started_relative (const hashcat_ctx_t *hashcat_ctx); -hc_time_t status_get_sec_etc (const hashcat_ctx_t *hashcat_ctx); +time_t status_get_sec_etc (const hashcat_ctx_t *hashcat_ctx); char *status_get_time_estimated_absolute (const hashcat_ctx_t *hashcat_ctx); char *status_get_time_estimated_relative (const hashcat_ctx_t *hashcat_ctx); u64 status_get_restore_point (const hashcat_ctx_t *hashcat_ctx); @@ -84,6 +84,10 @@ int status_get_corespeed_dev (const hashcat_ctx_t *hashcat_ int status_get_memoryspeed_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); int status_get_progress_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); double status_get_runtime_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); +int status_get_kernel_accel_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); +int status_get_kernel_loops_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); +int status_get_kernel_threads_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); +int status_get_vector_width_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id); int status_progress_init (hashcat_ctx_t *hashcat_ctx); void status_progress_destroy (hashcat_ctx_t *hashcat_ctx); diff --git a/include/terminal.h b/include/terminal.h index 7bbcc3acf..eab674145 100644 --- a/include/terminal.h +++ b/include/terminal.h @@ -22,12 +22,12 @@ #endif // _WIN void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag); -void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const hc_time_t proc_start, const hc_time_t proc_stop); +void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const time_t proc_stop); int setup_console (void); -void send_prompt (void); -void clear_prompt (void); +void send_prompt (hashcat_ctx_t *hashcat_ctx); +void clear_prompt (hashcat_ctx_t *hashcat_ctx); void *thread_keypress (void *p); diff --git a/include/types.h b/include/types.h index de0f4a179..f3e0e43e7 100644 --- a/include/types.h +++ b/include/types.h @@ -43,20 +43,14 @@ typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; -// time - -#if defined (_WIN) -typedef __time64_t hc_time_t; -#else -typedef time_t hc_time_t; -#endif - // timer #if defined (_WIN) typedef LARGE_INTEGER hc_timer_t; -#else +#elif defined(__APPLE__) && defined(MISSING_CLOCK_GETTIME) typedef struct timeval hc_timer_t; +#else +typedef struct timespec hc_timer_t; #endif // thread @@ -73,14 +67,6 @@ typedef pthread_t hc_thread_t; typedef pthread_mutex_t hc_thread_mutex_t; #endif -// stat - -#if defined (_WIN) -typedef struct _stat64 hc_stat_t; -#else -typedef struct stat hc_stat_t; -#endif - // enums typedef enum loglevel @@ -520,6 +506,7 @@ typedef enum user_options_defaults ADVICE_DISABLE = false, ATTACK_MODE = ATTACK_MODE_STRAIGHT, BENCHMARK = false, + BENCHMARK_ALL = false, BITMAP_MAX = 24, BITMAP_MIN = 16, DEBUG_MODE = 0, @@ -527,7 +514,6 @@ typedef enum user_options_defaults FORCE = false, GPU_TEMP_ABORT = 90, GPU_TEMP_DISABLE = false, - GPU_TEMP_RETAIN = 75, HASH_MODE = 0, HCCAPX_MESSAGE_PAIR = 0, HEX_CHARSET = false, @@ -558,7 +544,6 @@ typedef enum user_options_defaults OUTFILE_FORMAT = 3, WORDLIST_AUTOHEX_DISABLE = false, POTFILE_DISABLE = false, - POWERTUNE_ENABLE = false, QUIET = false, REMOVE = false, REMOVE_TIMER = 60, @@ -593,22 +578,22 @@ typedef enum user_options_map IDX_ADVICE_DISABLE = 0xff00, IDX_ATTACK_MODE = 'a', IDX_BENCHMARK = 'b', - IDX_BITMAP_MAX = 0xff01, - IDX_BITMAP_MIN = 0xff02, - IDX_CPU_AFFINITY = 0xff03, + IDX_BENCHMARK_ALL = 0xff01, + IDX_BITMAP_MAX = 0xff02, + IDX_BITMAP_MIN = 0xff03, + IDX_CPU_AFFINITY = 0xff04, IDX_CUSTOM_CHARSET_1 = '1', IDX_CUSTOM_CHARSET_2 = '2', IDX_CUSTOM_CHARSET_3 = '3', IDX_CUSTOM_CHARSET_4 = '4', - IDX_DEBUG_FILE = 0xff04, - IDX_DEBUG_MODE = 0xff05, - IDX_ENCODING_FROM = 0xff06, - IDX_ENCODING_TO = 0xff07, - IDX_EXAMPLE_HASHES = 0xff08, - IDX_FORCE = 0xff09, - IDX_GPU_TEMP_ABORT = 0xff0a, - IDX_GPU_TEMP_DISABLE = 0xff0b, - IDX_GPU_TEMP_RETAIN = 0xff0c, + IDX_DEBUG_FILE = 0xff05, + IDX_DEBUG_MODE = 0xff06, + IDX_ENCODING_FROM = 0xff07, + IDX_ENCODING_TO = 0xff08, + IDX_EXAMPLE_HASHES = 0xff09, + IDX_FORCE = 0xff0a, + IDX_GPU_TEMP_ABORT = 0xff0b, + IDX_GPU_TEMP_DISABLE = 0xff0c, IDX_HASH_MODE = 'm', IDX_HCCAPX_MESSAGE_PAIR = 0xff0d, IDX_HELP = 'h', @@ -648,37 +633,36 @@ typedef enum user_options_map IDX_WORDLIST_AUTOHEX_DISABLE = 0xff25, IDX_POTFILE_DISABLE = 0xff26, IDX_POTFILE_PATH = 0xff27, - IDX_POWERTUNE_ENABLE = 0xff28, - IDX_QUIET = 0xff29, - IDX_REMOVE = 0xff2a, - IDX_REMOVE_TIMER = 0xff2b, - IDX_RESTORE = 0xff2c, - IDX_RESTORE_DISABLE = 0xff2d, - IDX_RESTORE_FILE_PATH = 0xff2e, + IDX_QUIET = 0xff28, + IDX_REMOVE = 0xff29, + IDX_REMOVE_TIMER = 0xff2a, + IDX_RESTORE = 0xff2b, + IDX_RESTORE_DISABLE = 0xff2c, + IDX_RESTORE_FILE_PATH = 0xff2d, IDX_RP_FILE = 'r', - IDX_RP_GEN_FUNC_MAX = 0xff2f, - IDX_RP_GEN_FUNC_MIN = 0xff30, + IDX_RP_GEN_FUNC_MAX = 0xff2e, + IDX_RP_GEN_FUNC_MIN = 0xff2f, IDX_RP_GEN = 'g', - IDX_RP_GEN_SEED = 0xff31, + IDX_RP_GEN_SEED = 0xff30, IDX_RULE_BUF_L = 'j', IDX_RULE_BUF_R = 'k', - IDX_RUNTIME = 0xff32, - IDX_SCRYPT_TMTO = 0xff33, - IDX_SELF_TEST_DISABLE = 0xff34, + IDX_RUNTIME = 0xff31, + IDX_SCRYPT_TMTO = 0xff32, + IDX_SELF_TEST_DISABLE = 0xff33, IDX_SEGMENT_SIZE = 'c', IDX_SEPARATOR = 'p', - IDX_SESSION = 0xff35, - IDX_SHOW = 0xff36, + IDX_SESSION = 0xff34, + IDX_SHOW = 0xff35, IDX_SKIP = 's', - IDX_STATUS = 0xff37, - IDX_STATUS_TIMER = 0xff38, - IDX_STDOUT_FLAG = 0xff39, - IDX_SPEED_ONLY = 0xff3a, - IDX_PROGRESS_ONLY = 0xff3b, - IDX_TRUECRYPT_KEYFILES = 0xff3c, - IDX_USERNAME = 0xff3d, - IDX_VERACRYPT_KEYFILES = 0xff3e, - IDX_VERACRYPT_PIM = 0xff3f, + IDX_STATUS = 0xff36, + IDX_STATUS_TIMER = 0xff37, + IDX_STDOUT_FLAG = 0xff38, + IDX_SPEED_ONLY = 0xff39, + IDX_PROGRESS_ONLY = 0xff3a, + IDX_TRUECRYPT_KEYFILES = 0xff3b, + IDX_USERNAME = 0xff3c, + IDX_VERACRYPT_KEYFILES = 0xff3d, + IDX_VERACRYPT_PIM = 0xff3e, IDX_VERSION_LOWER = 'v', IDX_VERSION = 'V', IDX_WORKLOAD_PROFILE = 'w' @@ -763,7 +747,7 @@ typedef struct outfile_data { char *file_name; off_t seek; - hc_time_t ctime; + time_t ctime; } outfile_data_t; @@ -780,6 +764,7 @@ typedef struct logfile_ctx typedef struct hashes { const char *hashfile; + char *hashfile_hcdmp; u32 hashlist_mode; u32 hashlist_format; @@ -859,10 +844,10 @@ struct hashconfig u32 salt_min; u32 salt_max; - int (*parse_func) (u8 *, u32, hash_t *, const struct hashconfig *); + int (*parse_func) (u8 *, u32, hash_t *, struct hashconfig *); - char *st_hash; - char *st_pass; + const char *st_hash; + const char *st_pass; }; typedef struct hashconfig hashconfig_t; @@ -890,7 +875,7 @@ typedef struct bs_word typedef struct cpt { u32 cracked; - hc_time_t timestamp; + time_t timestamp; } cpt_t; @@ -949,9 +934,12 @@ typedef struct hc_device_param u32 kernel_threads_by_wgs_kernel_amp; u32 kernel_threads_by_wgs_kernel_tm; u32 kernel_threads_by_wgs_kernel_memset; + u32 kernel_threads_by_wgs_kernel_atinit; u32 kernel_loops; u32 kernel_accel; + u32 kernel_loops_prev; + u32 kernel_accel_prev; u32 kernel_loops_min; u32 kernel_loops_max; u32 kernel_loops_min_sav; // the _sav are required because each -i iteration @@ -1049,6 +1037,7 @@ typedef struct hc_device_param cl_kernel kernel_amp; cl_kernel kernel_tm; cl_kernel kernel_memset; + cl_kernel kernel_atinit; cl_context context; @@ -1102,6 +1091,7 @@ typedef struct hc_device_param void *kernel_params_amp[PARAMCNT]; void *kernel_params_tm[PARAMCNT]; void *kernel_params_memset[PARAMCNT]; + void *kernel_params_atinit[PARAMCNT]; u32 kernel_params_buf32[PARAMCNT]; u64 kernel_params_buf64[PARAMCNT]; @@ -1121,6 +1111,9 @@ typedef struct hc_device_param u32 kernel_params_memset_buf32[PARAMCNT]; u64 kernel_params_memset_buf64[PARAMCNT]; + u32 kernel_params_atinit_buf32[PARAMCNT]; + u64 kernel_params_atinit_buf64[PARAMCNT]; + } hc_device_param_t; typedef struct opencl_ctx @@ -1158,7 +1151,6 @@ typedef struct opencl_ctx bool need_adl; bool need_nvml; bool need_nvapi; - bool need_xnvctrl; bool need_sysfs; int comptime; @@ -1170,7 +1162,6 @@ typedef struct opencl_ctx #include "ext_ADL.h" #include "ext_nvapi.h" #include "ext_nvml.h" -#include "ext_xnvctrl.h" #include "ext_sysfs.h" typedef struct hm_attrs @@ -1178,7 +1169,6 @@ typedef struct hm_attrs HM_ADAPTER_ADL adl; HM_ADAPTER_NVML nvml; HM_ADAPTER_NVAPI nvapi; - HM_ADAPTER_XNVCTRL xnvctrl; HM_ADAPTER_SYSFS sysfs; int od_version; @@ -1186,9 +1176,7 @@ typedef struct hm_attrs bool buslanes_get_supported; bool corespeed_get_supported; bool fanspeed_get_supported; - bool fanspeed_set_supported; bool fanpolicy_get_supported; - bool fanpolicy_set_supported; bool memoryspeed_get_supported; bool temperature_get_supported; bool threshold_shutdown_get_supported; @@ -1205,14 +1193,11 @@ typedef struct hwmon_ctx void *hm_adl; void *hm_nvml; void *hm_nvapi; - void *hm_xnvctrl; void *hm_sysfs; hm_attrs_t *hm_device; ADLOD6MemClockState *od_clock_mem_status; - int *od_power_control_status; - unsigned int *nvml_power_limit; } hwmon_ctx_t; @@ -1250,13 +1235,21 @@ typedef struct dictstat { u64 cnt; - hc_stat_t stat; + struct stat stat; char encoding_from[64]; char encoding_to[64]; } dictstat_t; +typedef struct hashdump +{ + int version; + + hashes_t hashes; + +} hashdump_t; + typedef struct dictstat_ctx { bool enabled; @@ -1499,6 +1492,7 @@ typedef struct user_options bool advice_disable; bool benchmark; + bool benchmark_all; bool example_hashes; bool force; bool gpu_temp_disable; @@ -1519,7 +1513,6 @@ typedef struct user_options bool outfile_autohex; bool wordlist_autohex_disable; bool potfile_disable; - bool powertune_enable; bool quiet; bool remove; bool restore; @@ -1534,13 +1527,13 @@ typedef struct user_options bool username; bool version; char *cpu_affinity; - char *custom_charset_1; - char *custom_charset_2; - char *custom_charset_3; + const char *custom_charset_1; + const char *custom_charset_2; + const char *custom_charset_3; char *custom_charset_4; char *debug_file; - char *encoding_from; - char *encoding_to; + const char *encoding_from; + const char *encoding_to; char *induction_dir; char *markov_hcstat; char *opencl_devices; @@ -1551,8 +1544,8 @@ typedef struct user_options char *potfile_path; char *restore_file_path; char **rp_files; - char *rule_buf_l; - char *rule_buf_r; + const char *rule_buf_l; + const char *rule_buf_r; char separator; const char *session; char *truecrypt_keyfiles; @@ -1562,7 +1555,6 @@ typedef struct user_options u32 bitmap_min; u32 debug_mode; u32 gpu_temp_abort; - u32 gpu_temp_retain; u32 hash_mode; u32 hccapx_message_pair; u32 increment_max; @@ -1729,7 +1721,7 @@ typedef struct cpt_ctx cpt_t *cpt_buf; int cpt_pos; - hc_time_t cpt_start; + time_t cpt_start; u64 cpt_total; } cpt_ctx_t; @@ -1747,13 +1739,17 @@ typedef struct device_info int memoryspeed_dev; double runtime_msec_dev; int progress_dev; + int kernel_accel_dev; + int kernel_loops_dev; + int kernel_threads_dev; + int vector_width_dev; } device_info_t; typedef struct hashcat_status { const char *hash_target; - char *hash_type; + const char *hash_type; int guess_mode; char *guess_base; int guess_base_offset; @@ -1766,7 +1762,7 @@ typedef struct hashcat_status char *guess_charset; int guess_mask_length; char *session; - char *status_string; + const char *status_string; int status_number; char *time_estimated_absolute; char *time_estimated_relative; @@ -1872,8 +1868,8 @@ typedef struct status_ctx * timer */ - hc_time_t runtime_start; - hc_time_t runtime_stop; + time_t runtime_start; + time_t runtime_stop; hc_timer_t timer_running; // timer on current dict hc_timer_t timer_paused; // timer on current dict @@ -1894,9 +1890,9 @@ typedef struct hashcat_user typedef struct cache_hit { - char *dictfile; + const char *dictfile; - hc_stat_t stat; + struct stat stat; u64 cached_cnt; u64 keyspace; @@ -1905,7 +1901,7 @@ typedef struct cache_hit typedef struct cache_generate { - char *dictfile; + const char *dictfile; double percent; @@ -1913,7 +1909,7 @@ typedef struct cache_generate u64 cnt; u64 cnt2; - hc_time_t runtime; + time_t runtime; } cache_generate_t; diff --git a/src/Makefile b/src/Makefile index 2f5ef2e2f..31771b552 100644 --- a/src/Makefile +++ b/src/Makefile @@ -5,7 +5,8 @@ SHARED := 0 DEBUG := 0 -PRODUCTION := 0 +PRODUCTION := 1 +PRODUCTION_VERSION := v4.1.0 ## ## Detect Operating System @@ -39,6 +40,41 @@ ifneq ($(findstring clean,$(MAKECMDGOALS)),) MAKEFLAGS += -j 1 endif +## +## Native compiler paths +## + +CC := gcc +FIND := find +INSTALL := install +RM := rm +SED := sed +SED_IN_PLACE := -i + +ifeq ($(UNAME),Darwin) +CC := clang +# the sed -i option of macOS requires a parameter for the backup file (we just use "") +SED_IN_PLACE := -i "" +PROD_VERS := $(shell sw_vers -productVersion | cut -d. -f2) +endif + +ifeq ($(UNAME),FreeBSD) +CC := cc +SED := gsed +endif + +## +## Version +## + +ifeq ($(PRODUCTION),1) +VERSION_TAG := $(PRODUCTION_VERSION) +else +VERSION_TAG := $(shell git describe --tags --dirty=+ || echo $(PRODUCTION_VERSION)) +endif # PRODUCTION + +VERSION_PURE := $(shell echo "$(VERSION_TAG)" | $(SED) 's/.*v\([\.0-9]*\).*/\1/') + ## ## Installation paths (Linux only) ## @@ -47,17 +83,19 @@ DESTDIR ?= PREFIX ?= /usr/local INSTALL_FOLDER ?= $(PREFIX)/bin -LIBRARY_FOLDER ?= $(PREFIX)/lib SHARED_ROOT_FOLDER ?= $(PREFIX)/share SHARED_FOLDER ?= $(SHARED_ROOT_FOLDER)/hashcat DOCUMENT_FOLDER ?= $(SHARED_ROOT_FOLDER)/doc/hashcat +LIBRARY_FOLDER ?= $(PREFIX)/lib +LIBRARY_DEV_ROOT_FOLDER ?= $(PREFIX)/include +LIBRARY_DEV_FOLDER ?= $(LIBRARY_DEV_ROOT_FOLDER)/hashcat ## ## Filenames for library and frontend ## HASHCAT_FRONTEND := hashcat -HASHCAT_LIBRARY := libhashcat.so +HASHCAT_LIBRARY := libhashcat.so.$(VERSION_PURE) ifeq ($(UNAME),CYGWIN) HASHCAT_FRONTEND := hashcat.exe @@ -77,28 +115,6 @@ endif # MSYS2 OPENCL_HEADERS_KHRONOS := deps/OpenCL-Headers -## -## Native compiler paths -## - -CC := gcc -FIND := find -INSTALL := install -RM := rm -SED := sed -SED_IN_PLACE := -i - -ifeq ($(UNAME),Darwin) -CC := clang -# the sed -i option of macOS requires a parameter for the backup file (we just use "") -SED_IN_PLACE := -i "" -endif - -ifeq ($(UNAME),FreeBSD) -CC := cc -SED := gsed -endif - ## ## Cross compiler paths ## @@ -114,8 +130,8 @@ CC_WIN_64 := x86_64-w64-mingw32-gcc ## Then patch the makefile withe the patches from tools/win-iconv-*.diff and run make install ## -WIN_ICONV_32 := /opt/win-iconv-32 -WIN_ICONV_64 := /opt/win-iconv-64 +WIN_ICONV_32 := /opt/win-iconv-32 +WIN_ICONV_64 := /opt/win-iconv-64 ## ## Misc stuff @@ -123,13 +139,6 @@ WIN_ICONV_64 := /opt/win-iconv-64 COMPTIME := $(shell date +%s) -# the following variable value will be automatically replaced by the "git archive" command -# (which is automatically run for every github release) -# the value will be something like this: "tag: vX.Y.Z, refs/pull/K/head" or "HEAD -> master, tag: vX.Y.Z" - -VERSION_EXPORT := $Format:%D$ -VERSION_TAG := $(shell test -d .git && git describe --tags --dirty=+ || echo "$(VERSION_EXPORT)" | $(SED) 's/.*: v\([\.0-9]*\).*/v\1/') - ## ## General compiler and linker options ## @@ -201,6 +210,7 @@ CFLAGS_NATIVE += -DWITH_HWMON LFLAGS_NATIVE := $(LFLAGS) LFLAGS_NATIVE += -lpthread LFLAGS_NATIVE += -ldl +LFLAGS_NATIVE += -lrt endif # Linux ifeq ($(UNAME),FreeBSD) @@ -215,6 +225,11 @@ endif # FreeBSD ifeq ($(UNAME),Darwin) export MACOSX_DEPLOYMENT_TARGET=10.9 CFLAGS_NATIVE := $(CFLAGS) + +ifeq ($(shell test $(PROD_VERS) -le 11; echo $$?), 0) +CFLAGS_NATIVE += -DMISSING_CLOCK_GETTIME +endif + LFLAGS_NATIVE := $(LFLAGS) LFLAGS_NATIVE += -framework OpenCL LFLAGS_NATIVE += -lpthread @@ -254,6 +269,7 @@ CFLAGS_CROSS_LINUX64 += -I$(OPENCL_HEADERS_KHRONOS)/ CFLAGS_CROSS_LINUX64 += -m64 CFLAGS_CROSS_LINUX64 += -DWITH_HWMON CFLAGS_CROSS_WIN32 := $(CFLAGS) +CFLAGS_CROSS_WIN32 += -D__MINGW_USE_VC2005_COMPAT #hack to get 64-bit time_t CFLAGS_CROSS_WIN32 += -I$(OPENCL_HEADERS_KHRONOS)/ CFLAGS_CROSS_WIN32 += -I$(WIN_ICONV_32)/include/ CFLAGS_CROSS_WIN32 += -m32 @@ -281,7 +297,7 @@ LFLAGS_CROSS_WIN64 += -lpsapi ## Objects ## -OBJS_ALL := affinity autotune benchmark bitmap bitops combinator common convert cpt cpu_aes cpu_crc32 cpu_des cpu_md4 cpu_md5 cpu_sha1 cpu_sha256 debugfile dictstat dispatch dynloader event ext_ADL ext_nvapi ext_nvml ext_OpenCL ext_sysfs ext_xnvctrl ext_lzma lzma_sdk/Alloc lzma_sdk/Lzma2Dec lzma_sdk/LzmaDec filehandling folder hashcat hashes hlfmt hwmon induct interface locking logfile loopback memory monitor mpsp opencl outfile_check outfile pidfile potfile restore rp rp_cpu rp_kernel_on_cpu rp_kernel_on_cpu_optimized selftest shared status stdout straight terminal thread timer tuningdb usage user_options wordlist +OBJS_ALL := affinity autotune benchmark bitmap bitops combinator common convert cpt cpu_aes cpu_crc32 cpu_des cpu_md4 cpu_md5 cpu_sha1 cpu_sha256 debugfile dictstat dispatch dynloader event ext_ADL ext_nvapi ext_nvml ext_OpenCL ext_sysfs ext_lzma lzma_sdk/Alloc lzma_sdk/Lzma2Dec lzma_sdk/LzmaDec filehandling folder hashcat hashes hlfmt hwmon induct interface locking logfile loopback memory monitor mpsp opencl outfile_check outfile pidfile potfile restore rp rp_cpu rp_kernel_on_cpu rp_kernel_on_cpu_optimized selftest shared status stdout straight terminal thread timer tuningdb usage user_options wordlist NATIVE_STATIC_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).NATIVE.STATIC.o) NATIVE_SHARED_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).NATIVE.SHARED.o) @@ -299,7 +315,15 @@ WIN_64_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).WIN.64.o) default: $(HASHCAT_FRONTEND) clean: - $(RM) -f obj/*.o obj/lzma_sdk/*.o *.bin *.exe *.so *.dll *.pid hashcat core + $(RM) -f $(HASHCAT_FRONTEND) + $(RM) -f $(HASHCAT_LIBRARY) + $(RM) -f obj/lzma_sdk/*.o + $(RM) -f obj/*.o + $(RM) -f *.bin *.exe + $(RM) -f *.pid + $(RM) -f *.restore + $(RM) -f *.log + $(RM) -f core $(RM) -rf *.induct $(RM) -rf *.outfiles $(RM) -rf *.dSYM @@ -322,70 +346,91 @@ win64: hashcat64.exe ## ## Targets: Linux install -## How to make /usr/bin/install doing recursive?? ## +# allow (whitelist) "make install" only on unix-based systems (also disallow cygwin/msys) + +ifneq ($(findstring install,$(MAKECMDGOALS)),) + ifeq (,$(filter $(UNAME),Linux FreeBSD Darwin)) + define ERROR_INSTALL_DISALLOWED +! The 'install' target is not allowed on this operating system ($(UNAME)). \ +Only Linux, FreeBSD and Darwin can use the 'install' target + endef + + $(error $(ERROR_INSTALL_DISALLOWED)) + endif +endif + ifeq ($(SHARED),1) -install: install_docs install_shared install_library install_hashcat +install: install_docs install_shared install_library install_library_dev install_hashcat else -install: install_docs install_shared install_hashcat +install: install_docs install_shared install_hashcat endif # we need this extra target to make sure that for parallel builds (i.e. 2+ Makefile targets could possible run at the same time) # the root folder of the shared directory is created first (and is a dependency for the targets that depend on it) -install_make_share_root: - $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_ROOT_FOLDER) - -install_docs: install_make_share_root - $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER) - $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/docs - $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/charsets - $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/masks - $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/rules - $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/extra - $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion - $(INSTALL) -m 644 example.dict $(DESTDIR)$(DOCUMENT_FOLDER)/ - $(INSTALL) -m 644 example0.hash $(DESTDIR)$(DOCUMENT_FOLDER)/ - $(INSTALL) -m 644 example400.hash $(DESTDIR)$(DOCUMENT_FOLDER)/ - $(INSTALL) -m 644 example500.hash $(DESTDIR)$(DOCUMENT_FOLDER)/ - $(INSTALL) -m 755 example0.sh $(DESTDIR)$(DOCUMENT_FOLDER)/ - $(INSTALL) -m 755 example400.sh $(DESTDIR)$(DOCUMENT_FOLDER)/ - $(INSTALL) -m 755 example500.sh $(DESTDIR)$(DOCUMENT_FOLDER)/ - $(INSTALL) -m 644 extra/tab_completion/hashcat.sh $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion/ - $(INSTALL) -m 644 extra/tab_completion/howto.txt $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion/ - $(INSTALL) -m 755 extra/tab_completion/install $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion/ - $(FIND) docs/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; - $(FIND) docs/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; - $(FIND) charsets/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; - $(FIND) charsets/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; - $(FIND) masks/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; - $(FIND) masks/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; - $(FIND) rules/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; - $(FIND) rules/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; - $(SED) $(SED_IN_PLACE) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example0.sh - $(SED) $(SED_IN_PLACE) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example400.sh - $(SED) $(SED_IN_PLACE) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example500.sh - -install_shared: install_make_share_root - $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER) - $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)/OpenCL - $(INSTALL) -m 644 hashcat.hctune $(DESTDIR)$(SHARED_FOLDER)/ - $(INSTALL) -m 644 hashcat.hcstat2 $(DESTDIR)$(SHARED_FOLDER)/ - $(FIND) OpenCL/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)/{} \; - $(FIND) OpenCL/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(SHARED_FOLDER)/{} \; +install_make_library_dev_root: + $(INSTALL) -m 755 -d $(DESTDIR)$(LIBRARY_DEV_ROOT_FOLDER) + +install_make_shared_root: + $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_ROOT_FOLDER) + +install_docs: install_make_shared_root + $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER) + $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/docs + $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/charsets + $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/masks + $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/rules + $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/extra + $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion + $(INSTALL) -m 644 example.dict $(DESTDIR)$(DOCUMENT_FOLDER)/ + $(INSTALL) -m 644 example0.hash $(DESTDIR)$(DOCUMENT_FOLDER)/ + $(INSTALL) -m 644 example400.hash $(DESTDIR)$(DOCUMENT_FOLDER)/ + $(INSTALL) -m 644 example500.hash $(DESTDIR)$(DOCUMENT_FOLDER)/ + $(INSTALL) -m 755 example0.sh $(DESTDIR)$(DOCUMENT_FOLDER)/ + $(INSTALL) -m 755 example400.sh $(DESTDIR)$(DOCUMENT_FOLDER)/ + $(INSTALL) -m 755 example500.sh $(DESTDIR)$(DOCUMENT_FOLDER)/ + $(INSTALL) -m 644 extra/tab_completion/hashcat.sh $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion/ + $(INSTALL) -m 644 extra/tab_completion/howto.txt $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion/ + $(INSTALL) -m 755 extra/tab_completion/install $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion/ + $(FIND) docs/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; + $(FIND) docs/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; + $(FIND) charsets/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; + $(FIND) charsets/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; + $(FIND) masks/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; + $(FIND) masks/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; + $(FIND) rules/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; + $(FIND) rules/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; + $(SED) $(SED_IN_PLACE) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example0.sh + $(SED) $(SED_IN_PLACE) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example400.sh + $(SED) $(SED_IN_PLACE) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example500.sh + +install_shared: install_make_shared_root + $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER) + $(INSTALL) -m 644 hashcat.hctune $(DESTDIR)$(SHARED_FOLDER)/ + $(INSTALL) -m 644 hashcat.hcstat2 $(DESTDIR)$(SHARED_FOLDER)/ + $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)/OpenCL + $(FIND) OpenCL/ -mindepth 1 -type d -execdir $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)/OpenCL/{} \; + $(FIND) OpenCL/ -mindepth 1 -type f -execdir $(INSTALL) -m 644 {} $(DESTDIR)$(SHARED_FOLDER)/OpenCL/{} \; install_library: $(HASHCAT_LIBRARY) - $(INSTALL) -m 755 -d $(DESTDIR)$(LIBRARY_FOLDER) - $(INSTALL) -m 755 $(HASHCAT_LIBRARY) $(DESTDIR)$(LIBRARY_FOLDER)/ + $(INSTALL) -m 755 -d $(DESTDIR)$(LIBRARY_FOLDER) + $(INSTALL) -m 755 $(HASHCAT_LIBRARY) $(DESTDIR)$(LIBRARY_FOLDER)/ + +install_library_dev: install_make_library_dev_root + $(INSTALL) -m 755 -d $(DESTDIR)$(LIBRARY_DEV_FOLDER) + $(FIND) include/ -mindepth 1 -type d -execdir $(INSTALL) -m 755 -d $(DESTDIR)$(LIBRARY_DEV_FOLDER)/{} \; + $(FIND) include/ -mindepth 1 -type f -execdir $(INSTALL) -m 644 {} $(DESTDIR)$(LIBRARY_DEV_FOLDER)/{} \; install_hashcat: $(HASHCAT_FRONTEND) - $(INSTALL) -m 755 -d $(DESTDIR)$(INSTALL_FOLDER) - $(INSTALL) -m 755 $(HASHCAT_FRONTEND) $(DESTDIR)$(INSTALL_FOLDER)/ + $(INSTALL) -m 755 -d $(DESTDIR)$(INSTALL_FOLDER) + $(INSTALL) -m 755 $(HASHCAT_FRONTEND) $(DESTDIR)$(INSTALL_FOLDER)/ uninstall: $(RM) -f $(DESTDIR)$(INSTALL_FOLDER)/$(HASHCAT_FRONTEND) $(RM) -f $(DESTDIR)$(LIBRARY_FOLDER)/$(HASHCAT_LIBRARY) + $(RM) -rf $(DESTDIR)$(LIBRARY_DEV_FOLDER) $(RM) -rf $(DESTDIR)$(SHARED_FOLDER) $(RM) -rf $(DESTDIR)$(DOCUMENT_FOLDER) @@ -400,14 +445,14 @@ obj/%.NATIVE.SHARED.o: src/%.c $(CC) -c $(CFLAGS_NATIVE) $< -o $@ -fpic $(HASHCAT_LIBRARY): $(NATIVE_SHARED_OBJS) - $(CC) $^ $(LFLAGS_NATIVE) -o $@ -shared + $(CC) $^ -o $@ $(LFLAGS_NATIVE) -shared -Wl,-soname,$(HASHCAT_LIBRARY) ifeq ($(SHARED),1) $(HASHCAT_FRONTEND): src/main.c $(HASHCAT_LIBRARY) - $(CC) $(CFLAGS_NATIVE) $^ -L. -lhashcat $(LFLAGS_NATIVE) -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -DINSTALL_FOLDER=\"$(INSTALL_FOLDER)\" -DSHARED_FOLDER=\"$(SHARED_FOLDER)\" -DDOCUMENT_FOLDER=\"$(DOCUMENT_FOLDER)\" -o $@ + $(CC) $(CFLAGS_NATIVE) $^ -o $@ $(HASHCAT_LIBRARY) $(LFLAGS_NATIVE) -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -DINSTALL_FOLDER=\"$(INSTALL_FOLDER)\" -DSHARED_FOLDER=\"$(SHARED_FOLDER)\" -DDOCUMENT_FOLDER=\"$(DOCUMENT_FOLDER)\" else $(HASHCAT_FRONTEND): src/main.c $(NATIVE_STATIC_OBJS) - $(CC) $(CFLAGS_NATIVE) $^ $(LFLAGS_NATIVE) -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -DINSTALL_FOLDER=\"$(INSTALL_FOLDER)\" -DSHARED_FOLDER=\"$(SHARED_FOLDER)\" -DDOCUMENT_FOLDER=\"$(DOCUMENT_FOLDER)\" -o $@ + $(CC) $(CFLAGS_NATIVE) $^ -o $@ $(LFLAGS_NATIVE) -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -DINSTALL_FOLDER=\"$(INSTALL_FOLDER)\" -DSHARED_FOLDER=\"$(SHARED_FOLDER)\" -DDOCUMENT_FOLDER=\"$(DOCUMENT_FOLDER)\" endif ## diff --git a/src/affinity.c b/src/affinity.c index 213d5fea0..4a79f12fb 100644 --- a/src/affinity.c +++ b/src/affinity.c @@ -65,7 +65,7 @@ int set_cpu_affinity (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx) if (devices == NULL) return -1; - char *saveptr; + char *saveptr = NULL; char *next = strtok_r (devices, ",", &saveptr); @@ -99,7 +99,7 @@ int set_cpu_affinity (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx) CPU_SET ((cpu_id - 1), &cpuset); #endif - } while ((next = strtok_r (NULL, ",", &saveptr)) != NULL); + } while ((next = strtok_r ((char *) NULL, ",", &saveptr)) != NULL); hcfree (devices); diff --git a/src/autotune.c b/src/autotune.c index ff639f3e7..074e71f4e 100644 --- a/src/autotune.c +++ b/src/autotune.c @@ -103,14 +103,7 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param int CL_rc; - for (u32 i = 0; i < kernel_power_max; i++) - { - device_param->pws_buf[i].i[0] = i; - device_param->pws_buf[i].i[1] = 0x01234567; - device_param->pws_buf[i].pw_len = 7 + (i & 7); - } - - CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, kernel_power_max * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL); + CL_rc = run_kernel_atinit (hashcat_ctx, device_param, device_param->d_pws_buf, kernel_power_max); if (CL_rc == -1) return -1; @@ -159,8 +152,6 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param } } - #define VERIFIER_CNT 1 - // first find out highest kernel-loops that stays below target_msec if (kernel_loops_min < kernel_loops_max) @@ -171,20 +162,13 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param double exec_msec = try_run (hashcat_ctx, device_param, kernel_accel_min, kernel_loops); - for (int i = 0; i < VERIFIER_CNT; i++) - { - double exec_msec_v = try_run (hashcat_ctx, device_param, kernel_accel_min, kernel_loops); - - exec_msec = MIN (exec_msec, exec_msec_v); - } - if (exec_msec < target_msec) break; } } // now the same for kernel-accel but with the new kernel-loops from previous loop set - #define STEPS_CNT 10 + #define STEPS_CNT 16 if (kernel_accel_min < kernel_accel_max) { @@ -197,74 +181,42 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param double exec_msec = try_run (hashcat_ctx, device_param, kernel_accel_try, kernel_loops); - for (int verifier_idx = 0; verifier_idx < VERIFIER_CNT; verifier_idx++) - { - double exec_msec_v = try_run (hashcat_ctx, device_param, kernel_accel_try, kernel_loops); - - exec_msec = MIN (exec_msec, exec_msec_v); - } - if (exec_msec > target_msec) break; kernel_accel = kernel_accel_try; } } - // at this point we want to know the actual runtime for the following reason: - // we need a reference for the balancing loop following up, and this - // the balancing loop can have an effect that the creates a new opportunity, for example: - // if the target is 95 ms and the current runtime is 48ms the above loop - // stopped the execution because the previous exec_msec was > 95ms - // due to the rebalance it's possible that the runtime reduces from 48ms to 47ms - // and this creates the possibility to double the workload -> 47 * 2 = 95ms, which is < 96ms + // now find the middle balance between kernel_accel and kernel_loops + // while respecting allowed ranges at the same time - double exec_msec_pre_final = try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops); - - for (int verifier_idx = 0; verifier_idx < VERIFIER_CNT; verifier_idx++) - { - double exec_msec_pre_final_v = try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops); - - exec_msec_pre_final = MIN (exec_msec_pre_final, exec_msec_pre_final_v); - } - - u32 diff = kernel_loops - kernel_accel; - - if ((kernel_loops_min < kernel_loops_max) && (kernel_accel_min < kernel_accel_max)) + if (kernel_accel < kernel_loops) { - u32 kernel_accel_orig = kernel_accel; - u32 kernel_loops_orig = kernel_loops; + const u32 kernel_accel_orig = kernel_accel; + const u32 kernel_loops_orig = kernel_loops; - for (u32 f = 1; f < 1024; f++) + for (int i = 1; i < STEPS_CNT; i++) { - const u32 kernel_accel_try = kernel_accel_orig * f; - const u32 kernel_loops_try = kernel_loops_orig / f; + const u32 kernel_accel_try = kernel_accel_orig * (1u << i); + const u32 kernel_loops_try = kernel_loops_orig / (1u << i); + if (kernel_accel_try < kernel_accel_min) continue; if (kernel_accel_try > kernel_accel_max) break; - if (kernel_loops_try < kernel_loops_min) break; - u32 diff_new = kernel_loops_try - kernel_accel_try; - - if (diff_new > diff) break; - - double exec_msec = try_run (hashcat_ctx, device_param, kernel_accel_try, kernel_loops_try); - - for (int verifier_idx = 0; verifier_idx < VERIFIER_CNT; verifier_idx++) - { - double exec_msec_v = try_run (hashcat_ctx, device_param, kernel_accel_try, kernel_loops_try); + if (kernel_loops_try > kernel_loops_max) continue; + if (kernel_loops_try < kernel_loops_min) break; - exec_msec = MIN (exec_msec, exec_msec_v); - } + kernel_accel = kernel_accel_try; + kernel_loops = kernel_loops_try; - for (int verifier_idx = 0; verifier_idx < VERIFIER_CNT; verifier_idx++) - { - exec_msec_pre_final = exec_msec; + // too much if the next test is true - kernel_accel = kernel_accel_try; - kernel_loops = kernel_loops_try; - } + if (kernel_loops_try < kernel_accel_try) break; } } + double exec_msec_pre_final = try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops); + const u32 exec_left = target_msec / exec_msec_pre_final; const u32 accel_left = kernel_accel_max / kernel_accel; @@ -280,13 +232,6 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param // reset them fake words - /* - memset (device_param->pws_buf, 0, kernel_power_max * sizeof (pw_t)); - - hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, kernel_power_max * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL); - hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_amp_buf, CL_TRUE, 0, kernel_power_max * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL); - */ - CL_rc = run_kernel_memset (hashcat_ctx, device_param, device_param->d_pws_buf, 0, device_param->size_pws); if (CL_rc == -1) return -1; @@ -334,27 +279,6 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param device_param->kernel_power = kernel_power; - #if defined (DEBUG) - - user_options_t *user_options = hashcat_ctx->user_options; - - if (user_options->quiet == false) - { - clear_prompt (); - - printf - ( - "- Device #%u: autotuned kernel-accel to %u" EOL - "- Device #%u: autotuned kernel-loops to %u" EOL, - device_param->device_id + 1, kernel_accel, - device_param->device_id + 1, kernel_loops - ); - - send_prompt (); - } - - #endif - return 0; } diff --git a/src/benchmark.c b/src/benchmark.c index 5633fe326..858ef114b 100644 --- a/src/benchmark.c +++ b/src/benchmark.c @@ -4,167 +4,72 @@ */ #include "common.h" +#include "types.h" +#include "interface.h" #include "benchmark.h" -const unsigned int DEFAULT_BENCHMARK_ALGORITHMS_CNT = 157; - const unsigned int DEFAULT_BENCHMARK_ALGORITHMS_BUF[] = { - 900, 0, - 5100, 100, 1400, - 10800, 1700, - 5000, - 10100, - 14900, - 6000, - 6100, - 6900, - 11700, - 11800, - 14000, - 14100, - 400, - 8900, - 11900, - 12000, - 10900, - 12100, - 23, 2500, - 2501, - 5300, - 5400, + 1000, + 3000, 5500, 5600, - 7300, - 7500, - 13100, - 8300, - 11100, - 11200, - 11400, - 121, - 2611, - 2711, - 2811, - 8400, - 13900, - 11, - 2612, - 7900, - 21, - 11000, - 124, - 10000, - 16000, - 3711, - 4521, - 4522, - 12, - 131, - 132, - 1731, - 200, - 300, - 3100, - 112, - 12300, - 8000, - 141, - 1441, - 1600, - 12600, - 1421, - 101, - 111, - 1411, - 1711, - 3000, - 1000, - 1100, - 2100, - 15300, - 15900, - 12800, 1500, - 12400, 500, 3200, - 7400, 1800, - 122, - 1722, + 7500, + 13100, + 15300, + 15900, 7100, - 6300, - 6700, - 6400, - 6500, - 2400, - 2410, - 5700, - 9200, - 9300, - 22, - 501, - 5800, - 8100, - 8500, - 7200, - 9900, - 7700, - 7800, - 10300, - 8600, - 8700, - 9100, - 133, - 13500, 11600, - 13600, 12500, 13000, - 13200, - 13300, 6211, - 6221, - 6231, - 6241, - 13711, - 13721, - 13731, - 13741, - 13751, - 13761, - 8800, - 12900, - 12200, - 9700, - 9710, - 9800, - 9810, - 9400, - 9500, - 9600, - 10400, - 10410, - 10500, - 10600, - 10700, - 9000, - 5200, + 13400, 6800, - 6600, - 8200, 11300, - 12700, - 15200, - 13400, - 15500, - 15600, - 125, - 15400 + -1, }; + +int benchmark_next (hashcat_ctx_t *hashcat_ctx) +{ + const user_options_t *user_options = hashcat_ctx->user_options; + + static int cur = 0; + + if (user_options->benchmark_all == false) + { + const int hash_mode = DEFAULT_BENCHMARK_ALGORITHMS_BUF[cur]; + + if (hash_mode == -1) return -1; + + cur++; + + return hash_mode; + } + else + { + for (int i = cur; i < 99999; i++) + { + const char *name = strhashtype (i); + + if (name) + { + const int hash_mode = i; + + cur = hash_mode + 1; + + return hash_mode; + } + } + } + + return -1; +} diff --git a/src/combinator.c b/src/combinator.c index 608290730..8e9118ca5 100644 --- a/src/combinator.c +++ b/src/combinator.c @@ -150,7 +150,7 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) // we also have to switch wordlist related rules! - char *tmpc = user_options->rule_buf_l; + const char *tmpc = user_options->rule_buf_l; user_options->rule_buf_l = user_options->rule_buf_r; user_options->rule_buf_r = tmpc; diff --git a/src/convert.c b/src/convert.c index fcd58d9d9..a2aaae87f 100644 --- a/src/convert.c +++ b/src/convert.c @@ -429,6 +429,44 @@ u8 base64_to_int (const u8 c) return tbl[c]; } +u8 int_to_base64url (const u8 c) +{ + const u8 tbl[0x40] = + { + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, + 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, + 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, + 0x77, 0x78, 0x79, 0x7a, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2d, 0x5f, + }; + + return tbl[c]; +} + +u8 base64url_to_int (const u8 c) +{ + const u8 tbl[0x100] = + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, + 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, + 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x00, 0x00, 0x00, 0x00, 0x3f, + 0x00, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + + return tbl[c]; +} + u8 int_to_bf64 (const u8 c) { const u8 tbl[0x40] = diff --git a/src/cpt.c b/src/cpt.c index 9d67d8220..534c16f67 100644 --- a/src/cpt.c +++ b/src/cpt.c @@ -30,7 +30,7 @@ int cpt_ctx_init (hashcat_ctx_t *hashcat_ctx) cpt_ctx->cpt_total = 0; cpt_ctx->cpt_pos = 0; - cpt_ctx->cpt_start = hc_time (NULL); + cpt_ctx->cpt_start = time (NULL); return 0; } @@ -56,5 +56,5 @@ void cpt_ctx_reset (hashcat_ctx_t *hashcat_ctx) cpt_ctx->cpt_total = 0; cpt_ctx->cpt_pos = 0; - cpt_ctx->cpt_start = hc_time (NULL); + cpt_ctx->cpt_start = time (NULL); } diff --git a/src/dispatch.c b/src/dispatch.c index 37a71824f..b843783e1 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -271,6 +271,9 @@ static int calc_stdin (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par if (user_options->speed_only == true) break; } + device_param->kernel_accel_prev = device_param->kernel_accel; + device_param->kernel_loops_prev = device_param->kernel_loops; + device_param->kernel_accel = 0; device_param->kernel_loops = 0; @@ -688,6 +691,9 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) hcfree (hashcat_ctx_tmp); } + device_param->kernel_accel_prev = device_param->kernel_accel; + device_param->kernel_loops_prev = device_param->kernel_loops; + device_param->kernel_accel = 0; device_param->kernel_loops = 0; diff --git a/src/event.c b/src/event.c index eb20d114e..3073a97f8 100644 --- a/src/event.c +++ b/src/event.c @@ -45,12 +45,20 @@ void event_call (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, cons event_ctx->old_len[i] = event_ctx->old_len[i - 1]; } + u32 copy_len = 0; + if (buf) { - memcpy (event_ctx->old_buf[0], buf, len); + // truncate the whole buffer if needed (such that it fits into the old_buf): + + const u32 max_buf_len = sizeof (event_ctx->old_buf[0]); + + copy_len = MIN (len, max_buf_len - 1); + + memcpy (event_ctx->old_buf[0], buf, copy_len); } - event_ctx->old_len[0] = len; + event_ctx->old_len[0] = copy_len; } } diff --git a/src/ext_xnvctrl.c b/src/ext_xnvctrl.c deleted file mode 100644 index d3e06a904..000000000 --- a/src/ext_xnvctrl.c +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Author......: See docs/credits.txt - * License.....: MIT - */ - -#include "common.h" -#include "types.h" -#include "event.h" -#include "memory.h" -#include "ext_xnvctrl.h" diff --git a/src/folder.c b/src/folder.c index 811026b3e..a3c9a7303 100644 --- a/src/folder.c +++ b/src/folder.c @@ -16,8 +16,8 @@ int sort_by_stringptr (const void *p1, const void *p2) { - const char **s1 = (const char **) p1; - const char **s2 = (const char **) p2; + const char* const *s1 = (const char* const *) p1; + const char* const *s2 = (const char* const *) p2; return strcmp (*s1, *s2); } @@ -38,9 +38,9 @@ static int get_exec_path (char *exec_path, const size_t exec_path_sz) #elif defined (_WIN) - const DWORD len = GetModuleFileName (NULL, exec_path, exec_path_sz - 1); + memset (exec_path, 0, exec_path_sz); - if (len == 0) return -1; + const int len = 0; #elif defined (__APPLE__) @@ -407,16 +407,9 @@ int folder_config_init (hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const char *ins hc_asprintf (&cpath, "%s\\OpenCL\\", shared_dir); - char *cpath_real = (char *) hcmalloc (HCBUFSIZ_TINY); + char *cpath_real; - if (GetFullPathName (cpath, HCBUFSIZ_TINY - 1, cpath_real, NULL) == 0) - { - event_log_error (hashcat_ctx, "%s: %s", cpath, "GetFullPathName()."); - - hcfree (cwd); - - return -1; - } + hc_asprintf (&cpath_real, "%s\\OpenCL\\", shared_dir); #else diff --git a/src/hashcat.c b/src/hashcat.c index a9d00d53a..d7bd672ba 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -193,6 +193,12 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx) EVENT (EVENT_AUTOTUNE_FINISHED); + /** + * find same opencl devices and equal results + */ + + opencl_ctx_devices_sync_tuning (hashcat_ctx); + /** * autotune modified kernel_accel, which modifies opencl_ctx->kernel_power_all */ @@ -214,9 +220,9 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx) hc_timer_set (&status_ctx->timer_running); - hc_time_t runtime_start; + time_t runtime_start; - hc_time (&runtime_start); + time (&runtime_start); status_ctx->runtime_start = runtime_start; @@ -268,11 +274,27 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx) status_ctx->devices_status = STATUS_EXHAUSTED; } + if (status_ctx->devices_status == STATUS_EXHAUSTED) + { + // the options speed-only and progress-only cause hashcat to abort quickly. + // therefore, they will end up (if no other error occured) as STATUS_EXHAUSTED. + // however, that can create confusion in hashcats RC, because exhausted translates to RC = 1. + // but then having RC = 1 does not match our expection if we use for speed-only and progress-only. + // to get hashcat to return RC = 0 we have to set it to CRACKED or BYPASS + // note: other options like --show, --left, --benchmark, --keyspace, --opencl-info, etc. + // not not reach this section of the code, they've returned already with rc 0. + + if ((user_options->speed_only == true) || (user_options->progress_only == true)) + { + status_ctx->devices_status = STATUS_BYPASS; + } + } + // update some timer - hc_time_t runtime_stop; + time_t runtime_stop; - hc_time (&runtime_stop); + time (&runtime_stop); status_ctx->runtime_stop = runtime_stop; @@ -377,7 +399,10 @@ static int inner1_loop (hashcat_ctx_t *hashcat_ctx) if (status_ctx->run_main_level3 == false) break; } - if (straight_ctx->dicts_pos + 1 == straight_ctx->dicts_cnt) straight_ctx->dicts_pos = 0; + if (status_ctx->run_main_level3 == true) + { + if (straight_ctx->dicts_pos + 1 == straight_ctx->dicts_cnt) straight_ctx->dicts_pos = 0; + } } else { @@ -426,6 +451,12 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx) return -1; } + /** + * generate hashlist filename for later use + */ + + hashes_init_filename (hashcat_ctx); + /** * load hashes, stage 1 */ @@ -766,7 +797,10 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx) if (status_ctx->run_main_level2 == false) break; } - if (mask_ctx->masks_pos + 1 == mask_ctx->masks_cnt) mask_ctx->masks_pos = 0; + if (status_ctx->run_main_level2 == true) + { + if (mask_ctx->masks_pos + 1 == mask_ctx->masks_cnt) mask_ctx->masks_pos = 0; + } } else { @@ -811,16 +845,21 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx) return 0; } +static void event_stub (MAYBE_UNUSED const u32 id, MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) +{ + +} + int hashcat_init (hashcat_ctx_t *hashcat_ctx, void (*event) (const u32, struct hashcat_ctx *, const void *, const size_t)) { if (event == NULL) { - fprintf (stderr, "Event callback function is mandatory\n"); - - return -1; + hashcat_ctx->event = event_stub; + } + else + { + hashcat_ctx->event = event; } - - hashcat_ctx->event = event; hashcat_ctx->bitmap_ctx = (bitmap_ctx_t *) hcmalloc (sizeof (bitmap_ctx_t)); hashcat_ctx->combinator_ctx = (combinator_ctx_t *) hcmalloc (sizeof (combinator_ctx_t)); @@ -862,6 +901,7 @@ void hashcat_destroy (hashcat_ctx_t *hashcat_ctx) hcfree (hashcat_ctx->dictstat_ctx); hcfree (hashcat_ctx->event_ctx); hcfree (hashcat_ctx->folder_config); + hcfree (hashcat_ctx->hashcat_user); hcfree (hashcat_ctx->hashconfig); hcfree (hashcat_ctx->hashes); hcfree (hashcat_ctx->hwmon_ctx); @@ -1086,7 +1126,7 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx) // start logfile entry - const hc_time_t proc_start = hc_time (NULL); + const time_t proc_start = time (NULL); logfile_generate_topid (hashcat_ctx); @@ -1120,9 +1160,11 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx) } else { - for (u32 algorithm_pos = 0; algorithm_pos < DEFAULT_BENCHMARK_ALGORITHMS_CNT; algorithm_pos++) + int hash_mode; + + while ((hash_mode = benchmark_next (hashcat_ctx)) != -1) { - user_options->hash_mode = DEFAULT_BENCHMARK_ALGORITHMS_BUF[algorithm_pos]; + user_options->hash_mode = hash_mode; rc_final = outer_loop (hashcat_ctx); @@ -1157,7 +1199,7 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx) // final logfile entry - const hc_time_t proc_stop = hc_time (NULL); + const time_t proc_stop = time (NULL); logfile_top_uint (proc_start); logfile_top_uint (proc_stop); @@ -1330,6 +1372,10 @@ int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_st device_info->memoryspeed_dev = status_get_memoryspeed_dev (hashcat_ctx, device_id); device_info->progress_dev = status_get_progress_dev (hashcat_ctx, device_id); device_info->runtime_msec_dev = status_get_runtime_msec_dev (hashcat_ctx, device_id); + device_info->kernel_accel_dev = status_get_kernel_accel_dev (hashcat_ctx, device_id); + device_info->kernel_loops_dev = status_get_kernel_loops_dev (hashcat_ctx, device_id); + device_info->kernel_threads_dev = status_get_kernel_threads_dev (hashcat_ctx, device_id); + device_info->vector_width_dev = status_get_vector_width_dev (hashcat_ctx, device_id); } hashcat_status->hashes_msec_all = status_get_hashes_msec_all (hashcat_ctx); diff --git a/src/hashes.c b/src/hashes.c index 8e9fdd7b5..86af3de1e 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -14,6 +14,7 @@ #include "filehandling.h" #include "hlfmt.h" #include "interface.h" +#include "terminal.h" #include "logfile.h" #include "loopback.h" #include "mpsp.h" @@ -403,7 +404,7 @@ int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, { hc_thread_mutex_lock (status_ctx->mux_display); - cpt_ctx->cpt_buf[cpt_ctx->cpt_pos].timestamp = hc_time (NULL); + cpt_ctx->cpt_buf[cpt_ctx->cpt_pos].timestamp = time (NULL); cpt_ctx->cpt_buf[cpt_ctx->cpt_pos].cracked = cpt_cracked; cpt_ctx->cpt_pos++; @@ -448,7 +449,7 @@ int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, return 0; } -int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) +void hashes_init_filename (hashcat_ctx_t *hashcat_ctx) { hashconfig_t *hashconfig = hashcat_ctx->hashconfig; hashes_t *hashes = hashcat_ctx->hashes; @@ -461,31 +462,61 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) * load hashes, part I: find input mode, count hashes */ - u32 hashlist_mode = 0; - u32 hashlist_format = HLFMT_HASHCAT; - - u32 hashes_avail = 0; - if ((user_options->benchmark == false) && (user_options->stdout_flag == false) && (user_options->keyspace == false)) { - hashlist_mode = (hc_path_exist (hash_or_file) == true) ? HL_MODE_FILE : HL_MODE_ARG; - if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE) { - hashlist_mode = HL_MODE_ARG; + hashes->hashlist_mode = HL_MODE_ARG; - char *hashfile = hash_or_file; + hashes->hashfile = hash_or_file; - hashes->hashfile = hashfile; + hc_asprintf (&hashes->hashfile_hcdmp, "%s.hcdmp", hashes->hashfile); } + else + { + hashes->hashlist_mode = (hc_path_exist (hash_or_file) == true) ? HL_MODE_FILE : HL_MODE_ARG; + + if (hashes->hashlist_mode == HL_MODE_FILE) + { + hashes->hashfile = hash_or_file; + + hc_asprintf (&hashes->hashfile_hcdmp, "%s.hcdmp", hashes->hashfile); + } + } + } + else + { + hashes->hashlist_mode = HL_MODE_ARG; + } +} + +int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) +{ + hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + hashes_t *hashes = hashcat_ctx->hashes; + user_options_t *user_options = hashcat_ctx->user_options; + user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; + + /** + * load hashes, part I: find input mode, count hashes + */ + + const char *hashfile = hashes->hashfile; + const u32 hashlist_mode = hashes->hashlist_mode; + + u32 hashlist_format = HLFMT_HASHCAT; + + u32 hashes_avail = 0; + if ((user_options->benchmark == false) && (user_options->stdout_flag == false) && (user_options->keyspace == false)) + { if (hashlist_mode == HL_MODE_ARG) { if ((hashconfig->hash_mode == 2500) || (hashconfig->hash_mode == 2501)) { - hc_stat_t st; + struct stat st; - if (hc_stat (hashes->hashfile, &st) == -1) + if (stat (hashes->hashfile, &st) == -1) { event_log_error (hashcat_ctx, "%s: %s", hashes->hashfile, strerror (errno)); @@ -510,9 +541,9 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) } else if (hashconfig->hash_mode == 14600) { - hc_stat_t st; + struct stat st; - if (hc_stat (hashes->hashfile, &st) == -1) + if (stat (hashes->hashfile, &st) == -1) { event_log_error (hashcat_ctx, "%s: %s", hashes->hashfile, strerror (errno)); @@ -528,10 +559,6 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) } else if (hashlist_mode == HL_MODE_FILE) { - char *hashfile = hash_or_file; - - hashes->hashfile = hashfile; - FILE *fp = NULL; if ((fp = fopen (hashfile, "rb")) == NULL) @@ -574,14 +601,11 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) } else { - hashlist_mode = HL_MODE_ARG; - hashes_avail = 1; } if (hashconfig->hash_mode == 3000) hashes_avail *= 2; - hashes->hashlist_mode = hashlist_mode; hashes->hashlist_format = hashlist_format; /** @@ -707,7 +731,7 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) } else if (hashlist_mode == HL_MODE_ARG) { - char *input_buf = hash_or_file; + char *input_buf = user_options_extra->hc_hash; u32 input_len = strlen (input_buf); @@ -753,9 +777,7 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) if ((hashconfig->hash_mode == 2500) || (hashconfig->hash_mode == 2501)) { - hashlist_mode = HL_MODE_FILE; - - hashes->hashlist_mode = hashlist_mode; + hashes->hashlist_mode = HL_MODE_FILE; FILE *fp = fopen (hash_buf, "rb"); @@ -876,9 +898,7 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) } else if (hashconfig->hash_mode == 14600) { - hashlist_mode = HL_MODE_FILE; - - hashes->hashlist_mode = hashlist_mode; + hashes->hashlist_mode = HL_MODE_FILE; for (int keyslot_idx = 0; keyslot_idx < LUKS_NUMKEYS; keyslot_idx++) { @@ -914,8 +934,6 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) } else if (hashlist_mode == HL_MODE_FILE) { - const char *hashfile = hashes->hashfile; - FILE *fp; if ((fp = fopen (hashfile, "rb")) == NULL) @@ -929,8 +947,8 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) char *line_buf = (char *) hcmalloc (HCBUFSIZ_LARGE); - hc_time_t prev = 0; - hc_time_t now = 0; + time_t prev = 0; + time_t now = 0; while (!feof (fp)) { @@ -1035,7 +1053,15 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) if (parser_status < PARSER_GLOBAL_ZERO) { - event_log_warning (hashcat_ctx, "Hashfile '%s' on line %u (%s): %s", hashes->hashfile, line_num, line_buf, strparser (parser_status)); + char *tmp_line_buf; + + hc_asprintf (&tmp_line_buf, "%s", line_buf); + + compress_terminal_line_length (tmp_line_buf, 38, 32); + + event_log_warning (hashcat_ctx, "Hashfile '%s' on line %u (%s): %s", hashes->hashfile, line_num, tmp_line_buf, strparser (parser_status)); + + hcfree (tmp_line_buf); continue; } @@ -1049,7 +1075,15 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) if (parser_status < PARSER_GLOBAL_ZERO) { - event_log_warning (hashcat_ctx, "Hashfile '%s' on line %u (%s): %s", hashes->hashfile, line_num, line_buf, strparser (parser_status)); + char *tmp_line_buf; + + hc_asprintf (&tmp_line_buf, "%s", line_buf); + + compress_terminal_line_length (tmp_line_buf, 38, 32); + + event_log_warning (hashcat_ctx, "Hashfile '%s' on line %u (%s): %s", hashes->hashfile, line_num, tmp_line_buf, strparser (parser_status)); + + hcfree (tmp_line_buf); continue; } @@ -1065,7 +1099,15 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) if (parser_status < PARSER_GLOBAL_ZERO) { - event_log_warning (hashcat_ctx, "Hashfile '%s' on line %u (%s): %s", hashes->hashfile, line_num, line_buf, strparser (parser_status)); + char *tmp_line_buf; + + hc_asprintf (&tmp_line_buf, "%s", line_buf); + + compress_terminal_line_length (tmp_line_buf, 38, 32); + + event_log_warning (hashcat_ctx, "Hashfile '%s' on line %u (%s): %s", hashes->hashfile, line_num, tmp_line_buf, strparser (parser_status)); + + hcfree (tmp_line_buf); continue; } @@ -1082,7 +1124,15 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) if (parser_status < PARSER_GLOBAL_ZERO) { - event_log_warning (hashcat_ctx, "Hashfile '%s' on line %u (%s): %s", hashes->hashfile, line_num, line_buf, strparser (parser_status)); + char *tmp_line_buf; + + hc_asprintf (&tmp_line_buf, "%s", line_buf); + + compress_terminal_line_length (tmp_line_buf, 38, 32); + + event_log_warning (hashcat_ctx, "Hashfile '%s' on line %u (%s): %s", hashes->hashfile, line_num, tmp_line_buf, strparser (parser_status)); + + hcfree (tmp_line_buf); continue; } @@ -1090,11 +1140,11 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) hashes_cnt++; } - hc_time (&now); + time (&now); if ((now - prev) == 0) continue; - hc_time (&prev); + time (&prev); hashlist_parse_t hashlist_parse; @@ -1582,7 +1632,7 @@ int hashes_init_selftest (hashcat_ctx_t *hashcat_ctx) for (int i = 0, j = 0; j < st_hash_len; i += 1, j += 2) { - const u8 c = hex_to_u8 ((u8 *) hashconfig->st_hash + j); + const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j); tmpdata[i] = c; } @@ -1607,7 +1657,7 @@ int hashes_init_selftest (hashcat_ctx_t *hashcat_ctx) for (int i = 0; i < st_hash_len; i += 2) { - const u8 c = hex_to_u8 ((u8 *) hashconfig->st_hash + i); + const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + i); fputc (c, fp); } @@ -1638,7 +1688,14 @@ int hashes_init_selftest (hashcat_ctx_t *hashcat_ctx) } } - parser_status = hashconfig->parse_func ((u8 *) hashconfig->st_hash, strlen (hashconfig->st_hash), &hash, hashconfig_st); + // Make sure that we do not modify constant data. Make a copy of the constant self-test hash + // Note: sometimes parse_func () modifies the data internally. We always need to use a copy of the original data + + char *tmpdata = hcstrdup (hashconfig->st_hash); + + parser_status = hashconfig->parse_func ((u8 *) tmpdata, strlen (hashconfig->st_hash), &hash, hashconfig_st); + + hcfree (tmpdata); hcfree (hashconfig_st); } @@ -1709,6 +1766,8 @@ void hashes_destroy (hashcat_ctx_t *hashcat_ctx) hcfree (hashes->st_esalts_buf); hcfree (hashes->st_hook_salts_buf); + hcfree (hashes->hashfile_hcdmp); + memset (hashes, 0, sizeof (hashes_t)); } diff --git a/src/hlfmt.c b/src/hlfmt.c index 6b1cdcca2..804dee68c 100644 --- a/src/hlfmt.c +++ b/src/hlfmt.c @@ -9,16 +9,16 @@ #include "filehandling.h" #include "hlfmt.h" -static const char HLFMT_TEXT_HASHCAT[] = "native hashcat"; -static const char HLFMT_TEXT_PWDUMP[] = "pwdump"; -static const char HLFMT_TEXT_PASSWD[] = "passwd"; -static const char HLFMT_TEXT_SHADOW[] = "shadow"; -static const char HLFMT_TEXT_DCC[] = "DCC"; -static const char HLFMT_TEXT_DCC2[] = "DCC 2"; -static const char HLFMT_TEXT_NETNTLM1[] = "NetNTLMv1"; -static const char HLFMT_TEXT_NETNTLM2[] = "NetNTLMv2"; -static const char HLFMT_TEXT_NSLDAP[] = "nsldap"; -static const char HLFMT_TEXT_NSLDAPS[] = "nsldaps"; +static const char *HLFMT_TEXT_HASHCAT = "native hashcat"; +static const char *HLFMT_TEXT_PWDUMP = "pwdump"; +static const char *HLFMT_TEXT_PASSWD = "passwd"; +static const char *HLFMT_TEXT_SHADOW = "shadow"; +static const char *HLFMT_TEXT_DCC = "DCC"; +static const char *HLFMT_TEXT_DCC2 = "DCC 2"; +static const char *HLFMT_TEXT_NETNTLM1 = "NetNTLMv1"; +static const char *HLFMT_TEXT_NETNTLM2 = "NetNTLMv2"; +static const char *HLFMT_TEXT_NSLDAP = "nsldap"; +static const char *HLFMT_TEXT_NSLDAPS = "nsldaps"; // hlfmt hashcat @@ -292,23 +292,23 @@ static void hlfmt_user_shadow (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, char *li // hlfmt main -char *strhlfmt (const u32 hashfile_format) +const char *strhlfmt (const u32 hashfile_format) { switch (hashfile_format) { - case HLFMT_HASHCAT: return ((char *) HLFMT_TEXT_HASHCAT); - case HLFMT_PWDUMP: return ((char *) HLFMT_TEXT_PWDUMP); - case HLFMT_PASSWD: return ((char *) HLFMT_TEXT_PASSWD); - case HLFMT_SHADOW: return ((char *) HLFMT_TEXT_SHADOW); - case HLFMT_DCC: return ((char *) HLFMT_TEXT_DCC); - case HLFMT_DCC2: return ((char *) HLFMT_TEXT_DCC2); - case HLFMT_NETNTLM1: return ((char *) HLFMT_TEXT_NETNTLM1); - case HLFMT_NETNTLM2: return ((char *) HLFMT_TEXT_NETNTLM2); - case HLFMT_NSLDAP: return ((char *) HLFMT_TEXT_NSLDAP); - case HLFMT_NSLDAPS: return ((char *) HLFMT_TEXT_NSLDAPS); + case HLFMT_HASHCAT: return HLFMT_TEXT_HASHCAT; + case HLFMT_PWDUMP: return HLFMT_TEXT_PWDUMP; + case HLFMT_PASSWD: return HLFMT_TEXT_PASSWD; + case HLFMT_SHADOW: return HLFMT_TEXT_SHADOW; + case HLFMT_DCC: return HLFMT_TEXT_DCC; + case HLFMT_DCC2: return HLFMT_TEXT_DCC2; + case HLFMT_NETNTLM1: return HLFMT_TEXT_NETNTLM1; + case HLFMT_NETNTLM2: return HLFMT_TEXT_NETNTLM2; + case HLFMT_NSLDAP: return HLFMT_TEXT_NSLDAP; + case HLFMT_NSLDAPS: return HLFMT_TEXT_NSLDAPS; } - return ((char *) "Unknown"); + return "Unknown"; } void hlfmt_hash (hashcat_ctx_t *hashcat_ctx, u32 hashfile_format, char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len) diff --git a/src/hwmon.c b/src/hwmon.c index 5f0082e98..4f94c3be5 100644 --- a/src/hwmon.c +++ b/src/hwmon.c @@ -188,114 +188,6 @@ static int hm_SYSFS_get_fan_speed_current (hashcat_ctx_t *hashcat_ctx, const int return 0; } -static int hm_SYSFS_set_fan_control (hashcat_ctx_t *hashcat_ctx, const int device_id, int val) -{ - char *syspath = hm_SYSFS_get_syspath_hwmon (hashcat_ctx, device_id); - - if (syspath == NULL) return -1; - - char *path; - - hc_asprintf (&path, "%s/pwm1_enable", syspath); - - hcfree (syspath); - - FILE *fd = fopen (path, "w"); - - if (fd == NULL) - { - event_log_error (hashcat_ctx, "%s: %s", path, strerror (errno)); - - hcfree (path); - - return -1; - } - - fprintf (fd, "%d", val); - - fclose (fd); - - hcfree (path); - - return 0; -} - -static int hm_SYSFS_set_fan_speed_target (hashcat_ctx_t *hashcat_ctx, const int device_id, int val) -{ - char *syspath = hm_SYSFS_get_syspath_hwmon (hashcat_ctx, device_id); - - if (syspath == NULL) return -1; - - char *path; - char *path_max; - - hc_asprintf (&path, "%s/pwm1", syspath); - hc_asprintf (&path_max, "%s/pwm1_max", syspath); - - hcfree (syspath); - - FILE *fd_max = fopen (path_max, "r"); - - if (fd_max == NULL) - { - event_log_error (hashcat_ctx, "%s: %s", path_max, strerror (errno)); - - hcfree (path); - hcfree (path_max); - - return -1; - } - - int pwm1_max = 0; - - if (fscanf (fd_max, "%d", &pwm1_max) != 1) - { - fclose (fd_max); - - event_log_error (hashcat_ctx, "%s: unexpected data.", path_max); - - hcfree (path); - hcfree (path_max); - - return -1; - } - - fclose (fd_max); - - if (pwm1_max == 0) - { - event_log_error (hashcat_ctx, "%s: pwm1_max cannot be 0.", path_max); - - hcfree (path); - hcfree (path_max); - - return -1; - } - - const float p1 = (float) pwm1_max / 100.0f; - - FILE *fd = fopen (path, "w"); - - if (fd == NULL) - { - event_log_error (hashcat_ctx, "%s: %s", path, strerror (errno)); - - hcfree (path); - hcfree (path_max); - - return -1; - } - - fprintf (fd, "%d", (int) ((float) val * p1)); - - fclose (fd); - - hcfree (path); - hcfree (path_max); - - return 0; -} - static int hm_SYSFS_get_temperature_current (hashcat_ctx_t *hashcat_ctx, const int device_id, int *val) { char *syspath = hm_SYSFS_get_syspath_hwmon (hashcat_ctx, device_id); @@ -507,38 +399,6 @@ static int hm_SYSFS_get_pp_dpm_pcie (hashcat_ctx_t *hashcat_ctx, const int devic return 0; } -static int hm_SYSFS_set_power_dpm_force_performance_level (hashcat_ctx_t *hashcat_ctx, const int device_id, const char *val) -{ - char *syspath = hm_SYSFS_get_syspath_device (hashcat_ctx, device_id); - - if (syspath == NULL) return -1; - - char *path; - - hc_asprintf (&path, "%s/power_dpm_force_performance_level", syspath); - - hcfree (syspath); - - FILE *fd = fopen (path, "w"); - - if (fd == NULL) - { - event_log_error (hashcat_ctx, "%s: %s", path, strerror (errno)); - - hcfree (path); - - return -1; - } - - fprintf (fd, "%s", val); - - fclose (fd); - - hcfree (path); - - return 0; -} - // nvml functions static int nvml_init (hashcat_ctx_t *hashcat_ctx) @@ -666,7 +526,6 @@ static int nvml_init (hashcat_ctx_t *hashcat_ctx) HC_LOAD_FUNC(nvml, nvmlDeviceGetHandleByIndex, NVML_DEVICE_GET_HANDLE_BY_INDEX, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetTemperature, NVML_DEVICE_GET_TEMPERATURE, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetFanSpeed, NVML_DEVICE_GET_FAN_SPEED, NVML, 0) - HC_LOAD_FUNC(nvml, nvmlDeviceGetPowerUsage, NVML_DEVICE_GET_POWER_USAGE, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetUtilizationRates, NVML_DEVICE_GET_UTILIZATION_RATES, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetClockInfo, NVML_DEVICE_GET_CLOCKINFO, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetTemperatureThreshold, NVML_DEVICE_GET_THRESHOLD, NVML, 0) @@ -674,11 +533,6 @@ static int nvml_init (hashcat_ctx_t *hashcat_ctx) HC_LOAD_FUNC(nvml, nvmlDeviceGetCurrPcieLinkWidth, NVML_DEVICE_GET_CURRPCIELINKWIDTH, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetCurrentClocksThrottleReasons, NVML_DEVICE_GET_CURRENTCLOCKSTHROTTLEREASONS, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetSupportedClocksThrottleReasons, NVML_DEVICE_GET_SUPPORTEDCLOCKSTHROTTLEREASONS, NVML, 0) - HC_LOAD_FUNC(nvml, nvmlDeviceSetComputeMode, NVML_DEVICE_SET_COMPUTEMODE, NVML, 0) - HC_LOAD_FUNC(nvml, nvmlDeviceSetGpuOperationMode, NVML_DEVICE_SET_OPERATIONMODE, NVML, 0) - HC_LOAD_FUNC(nvml, nvmlDeviceGetPowerManagementLimitConstraints, NVML_DEVICE_GET_POWERMANAGEMENTLIMITCONSTRAINTS, NVML, 0) - HC_LOAD_FUNC(nvml, nvmlDeviceSetPowerManagementLimit, NVML_DEVICE_SET_POWERMANAGEMENTLIMIT, NVML, 0) - HC_LOAD_FUNC(nvml, nvmlDeviceGetPowerManagementLimit, NVML_DEVICE_GET_POWERMANAGEMENTLIMIT, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetPciInfo, NVML_DEVICE_GET_PCIINFO, NVML, 0) return 0; @@ -784,28 +638,6 @@ static int hm_NVML_nvmlDeviceGetHandleByIndex (hashcat_ctx_t *hashcat_ctx, unsig return 0; } -/* -static int hm_NVML_nvmlDeviceGetName (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, char *name, unsigned int length) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetName (device, name, length); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetName(): %s", string); - - return -1; - } - - return 0; -} -*/ - static int hm_NVML_nvmlDeviceGetTemperature (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlTemperatureSensors_t sensorType, unsigned int *temp) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; @@ -846,28 +678,6 @@ static int hm_NVML_nvmlDeviceGetFanSpeed (hashcat_ctx_t *hashcat_ctx, nvmlDevice return 0; } -/* -static int hm_NVML_nvmlDeviceGetPowerUsage (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *power) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetPowerUsage (device, power); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetPowerUsage(): %s", string); - - return -1; - } - - return 0; -} -*/ - static int hm_NVML_nvmlDeviceGetUtilizationRates (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlUtilization_t *utilization) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; @@ -928,41 +738,39 @@ static int hm_NVML_nvmlDeviceGetTemperatureThreshold (hashcat_ctx_t *hashcat_ctx return 0; } -/* -static int hm_NVML_nvmlDeviceGetCurrPcieLinkGeneration (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *currLinkGen) +static int hm_NVML_nvmlDeviceGetCurrPcieLinkWidth (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *currLinkWidth) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; NVML_PTR *nvml = hwmon_ctx->hm_nvml; - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetCurrPcieLinkGeneration (device, currLinkGen); + const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetCurrPcieLinkWidth (device, currLinkWidth); if (nvml_rc != NVML_SUCCESS) { const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - event_log_error (hashcat_ctx, "nvmlDeviceGetCurrPcieLinkGeneration(): %s", string); + event_log_error (hashcat_ctx, "nvmlDeviceGetCurrPcieLinkWidth(): %s", string); return -1; } return 0; } -*/ -static int hm_NVML_nvmlDeviceGetCurrPcieLinkWidth (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *currLinkWidth) +static int hm_NVML_nvmlDeviceGetPciInfo (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlPciInfo_t *pci) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; NVML_PTR *nvml = hwmon_ctx->hm_nvml; - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetCurrPcieLinkWidth (device, currLinkWidth); + const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetPciInfo (device, pci); if (nvml_rc != NVML_SUCCESS) { const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - event_log_error (hashcat_ctx, "nvmlDeviceGetCurrPcieLinkWidth(): %s", string); + event_log_error (hashcat_ctx, "nvmlDeviceGetPciInfo(): %s", string); return -1; } @@ -970,283 +778,114 @@ static int hm_NVML_nvmlDeviceGetCurrPcieLinkWidth (hashcat_ctx_t *hashcat_ctx, n return 0; } -/* -static int hm_NVML_nvmlDeviceGetCurrentClocksThrottleReasons (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned long long *clocksThrottleReasons) +// nvapi functions + +static int nvapi_init (hashcat_ctx_t *hashcat_ctx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - NVML_PTR *nvml = hwmon_ctx->hm_nvml; + NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetCurrentClocksThrottleReasons (device, clocksThrottleReasons); + memset (nvapi, 0, sizeof (NVAPI_PTR)); - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); + #if defined (_WIN) - event_log_error (hashcat_ctx, "nvmlDeviceGetCurrentClocksThrottleReasons(): %s", string); + #if defined (_WIN64) + nvapi->lib = hc_dlopen ("nvapi64.dll"); + #else + nvapi->lib = hc_dlopen ("nvapi.dll"); + #endif - return -1; - } + #else - return 0; -} -*/ + #if defined (__CYGWIN__) -/* -static int hm_NVML_nvmlDeviceGetSupportedClocksThrottleReasons (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned long long *supportedClocksThrottleReasons) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; + #if defined (__x86_x64__) + nvapi->lib = hc_dlopen ("nvapi64.dll", RTLD_NOW); + #else + nvapi->lib = hc_dlopen ("nvapi.dll", RTLD_NOW); + #endif - NVML_PTR *nvml = hwmon_ctx->hm_nvml; + #else + nvapi->lib = hc_dlopen ("nvapi.so", RTLD_NOW); // uhm yes, but .. yeah + #endif - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetSupportedClocksThrottleReasons (device, supportedClocksThrottleReasons); + #endif - if (nvml_rc != NVML_SUCCESS) + if (!nvapi->lib) { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetSupportedClocksThrottleReasons(): %s", string); + //if (user_options->quiet == false) + // event_log_error (hashcat_ctx, "Load of NVAPI library failed. Proceeding without NVAPI HWMon enabled."); return -1; } + HC_LOAD_FUNC(nvapi, nvapi_QueryInterface, NVAPI_QUERYINTERFACE, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_Initialize, NVAPI_INITIALIZE, nvapi_QueryInterface, 0x0150E828u, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_Unload, NVAPI_UNLOAD, nvapi_QueryInterface, 0xD22BDD7Eu, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_GetErrorMessage, NVAPI_GETERRORMESSAGE, nvapi_QueryInterface, 0x6C2D048Cu, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_EnumPhysicalGPUs, NVAPI_ENUMPHYSICALGPUS, nvapi_QueryInterface, 0xE5AC921Fu, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetPerfPoliciesInfo, NVAPI_GPU_GETPERFPOLICIESINFO, nvapi_QueryInterface, 0x409D9841u, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetPerfPoliciesStatus, NVAPI_GPU_GETPERFPOLICIESSTATUS, nvapi_QueryInterface, 0x3D358A0Cu, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetBusId, NVAPI_GPU_GETBUSID, nvapi_QueryInterface, 0x1BE0B8E5u, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetBusSlotId, NVAPI_GPU_GETBUSSLOTID, nvapi_QueryInterface, 0x2A0A350Fu, NVAPI, 0) + return 0; } -*/ -/* -static int hm_NVML_nvmlDeviceSetComputeMode (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlComputeMode_t mode) +static void nvapi_close (hashcat_ctx_t *hashcat_ctx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceSetComputeMode (device, mode); + NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - if (nvml_rc != NVML_SUCCESS) + if (nvapi) { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceSetComputeMode(): %s", string); + if (nvapi->lib) + hc_dlclose (nvapi->lib); - return -1; + hcfree (nvapi); } +} - return 0; +static void hm_NvAPI_GetErrorMessage (NVAPI_PTR *nvapi, const NvAPI_Status NvAPI_rc, NvAPI_ShortString string) +{ + nvapi->NvAPI_GetErrorMessage (NvAPI_rc, string); } -*/ -/* -static int hm_NVML_nvmlDeviceSetGpuOperationMode (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlGpuOperationMode_t mode) +static int hm_NvAPI_Initialize (hashcat_ctx_t *hashcat_ctx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - NVML_PTR *nvml = hwmon_ctx->hm_nvml; + NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceSetGpuOperationMode (device, mode); + const NvAPI_Status NvAPI_rc = nvapi->NvAPI_Initialize (); - if (nvml_rc != NVML_SUCCESS) + if (NvAPI_rc == NVAPI_LIBRARY_NOT_FOUND) return -1; + + if (NvAPI_rc != NVAPI_OK) { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); + NvAPI_ShortString string = { 0 }; + + hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); - event_log_error (hashcat_ctx, "nvmlDeviceSetGpuOperationMode(): %s", string); + event_log_error (hashcat_ctx, "NvAPI_Initialize(): %s", string); return -1; } return 0; } -*/ -static int hm_NVML_nvmlDeviceGetPowerManagementLimitConstraints (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *minLimit, unsigned int *maxLimit) +static int hm_NvAPI_Unload (hashcat_ctx_t *hashcat_ctx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - NVML_PTR *nvml = hwmon_ctx->hm_nvml; + NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetPowerManagementLimitConstraints (device, minLimit, maxLimit); + const NvAPI_Status NvAPI_rc = nvapi->NvAPI_Unload (); - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetPowerManagementLimitConstraints(): %s", string); - - return -1; - } - - return 0; -} - -static int hm_NVML_nvmlDeviceSetPowerManagementLimit (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int limit) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceSetPowerManagementLimit (device, limit); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceSetPowerManagementLimit(): %s", string); - - return -1; - } - - return 0; -} - -static int hm_NVML_nvmlDeviceGetPowerManagementLimit (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *limit) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetPowerManagementLimit (device, limit); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetPowerManagementLimit(): %s", string); - - return -1; - } - - return 0; -} - -static int hm_NVML_nvmlDeviceGetPciInfo (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlPciInfo_t *pci) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetPciInfo (device, pci); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetPciInfo(): %s", string); - - return -1; - } - - return 0; -} - -// nvapi functions - -static int nvapi_init (hashcat_ctx_t *hashcat_ctx) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - - memset (nvapi, 0, sizeof (NVAPI_PTR)); - - #if defined (_WIN) - - #if defined (_WIN64) - nvapi->lib = hc_dlopen ("nvapi64.dll"); - #else - nvapi->lib = hc_dlopen ("nvapi.dll"); - #endif - - #else - - #if defined (__CYGWIN__) - - #if defined (__x86_x64__) - nvapi->lib = hc_dlopen ("nvapi64.dll", RTLD_NOW); - #else - nvapi->lib = hc_dlopen ("nvapi.dll", RTLD_NOW); - #endif - - #else - nvapi->lib = hc_dlopen ("nvapi.so", RTLD_NOW); // uhm yes, but .. yeah - #endif - - #endif - - if (!nvapi->lib) - { - //if (user_options->quiet == false) - // event_log_error (hashcat_ctx, "Load of NVAPI library failed. Proceeding without NVAPI HWMon enabled."); - - return -1; - } - - HC_LOAD_FUNC(nvapi, nvapi_QueryInterface, NVAPI_QUERYINTERFACE, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_Initialize, NVAPI_INITIALIZE, nvapi_QueryInterface, 0x0150E828u, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_Unload, NVAPI_UNLOAD, nvapi_QueryInterface, 0xD22BDD7Eu, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_GetErrorMessage, NVAPI_GETERRORMESSAGE, nvapi_QueryInterface, 0x6C2D048Cu, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_EnumPhysicalGPUs, NVAPI_ENUMPHYSICALGPUS, nvapi_QueryInterface, 0xE5AC921Fu, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetPerfPoliciesInfo, NVAPI_GPU_GETPERFPOLICIESINFO, nvapi_QueryInterface, 0x409D9841u, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetPerfPoliciesStatus, NVAPI_GPU_GETPERFPOLICIESSTATUS, nvapi_QueryInterface, 0x3D358A0Cu, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_GPU_SetCoolerLevels, NVAPI_GPU_SETCOOLERLEVELS, nvapi_QueryInterface, 0x891FA0AEu, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetBusId, NVAPI_GPU_GETBUSID, nvapi_QueryInterface, 0x1BE0B8E5u, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetBusSlotId, NVAPI_GPU_GETBUSSLOTID, nvapi_QueryInterface, 0x2A0A350Fu, NVAPI, 0) - - return 0; -} - -static void nvapi_close (hashcat_ctx_t *hashcat_ctx) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - - if (nvapi) - { - if (nvapi->lib) - hc_dlclose (nvapi->lib); - - hcfree (nvapi); - } -} - -static void hm_NvAPI_GetErrorMessage (NVAPI_PTR *nvapi, const NvAPI_Status NvAPI_rc, NvAPI_ShortString string) -{ - nvapi->NvAPI_GetErrorMessage (NvAPI_rc, string); -} - -static int hm_NvAPI_Initialize (hashcat_ctx_t *hashcat_ctx) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - - const NvAPI_Status NvAPI_rc = nvapi->NvAPI_Initialize (); - - if (NvAPI_rc == NVAPI_LIBRARY_NOT_FOUND) return -1; - - if (NvAPI_rc != NVAPI_OK) - { - NvAPI_ShortString string = { 0 }; - - hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); - - event_log_error (hashcat_ctx, "NvAPI_Initialize(): %s", string); - - return -1; - } - - return 0; -} - -static int hm_NvAPI_Unload (hashcat_ctx_t *hashcat_ctx) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - - const NvAPI_Status NvAPI_rc = nvapi->NvAPI_Unload (); - - if (NvAPI_rc != NVAPI_OK) + if (NvAPI_rc != NVAPI_OK) { NvAPI_ShortString string = { 0 }; @@ -1283,435 +922,42 @@ static int hm_NvAPI_EnumPhysicalGPUs (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuH } static int hm_NvAPI_GPU_GetPerfPoliciesInfo (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_INFO_PARAMS_V1 *perfPolicies_info) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - - const NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetPerfPoliciesInfo (hPhysicalGpu, perfPolicies_info); - - if (NvAPI_rc != NVAPI_OK) - { - NvAPI_ShortString string = { 0 }; - - hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); - - event_log_error (hashcat_ctx, "NvAPI_GPU_GetPerfPoliciesInfo(): %s", string); - - return -1; - } - - return 0; -} - -static int hm_NvAPI_GPU_GetPerfPoliciesStatus (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 *perfPolicies_status) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - - const NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetPerfPoliciesStatus (hPhysicalGpu, perfPolicies_status); - - if (NvAPI_rc != NVAPI_OK) - { - NvAPI_ShortString string = { 0 }; - - hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); - - event_log_error (hashcat_ctx, "NvAPI_GPU_GetPerfPoliciesStatus(): %s", string); - - return -1; - } - - return 0; -} - -static int hm_NvAPI_GPU_SetCoolerLevels (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex, NV_GPU_COOLER_LEVELS *pCoolerLevels) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - - const NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_SetCoolerLevels (hPhysicalGpu, coolerIndex, pCoolerLevels); - - if (NvAPI_rc != NVAPI_OK) - { - NvAPI_ShortString string = { 0 }; - - hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); - - event_log_error (hashcat_ctx, "NvAPI_GPU_SetCoolerLevels(): %s", string); - - return -1; - } - - return 0; -} - -static int hm_NvAPI_GPU_GetBusId (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusId) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - - const NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetBusId (hPhysicalGpu, pBusId); - - if (NvAPI_rc != NVAPI_OK) - { - NvAPI_ShortString string = { 0 }; - - hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); - - event_log_error (hashcat_ctx, "NvAPI_GPU_GetBusId(): %s", string); - - return -1; - } - - return 0; -} - -static int hm_NvAPI_GPU_GetBusSlotId (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusSlotId) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - - const NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetBusSlotId (hPhysicalGpu, pBusSlotId); - - if (NvAPI_rc != NVAPI_OK) - { - NvAPI_ShortString string = { 0 }; - - hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); - - event_log_error (hashcat_ctx, "NvAPI_GPU_GetBusSlotId(): %s", string); - - return -1; - } - - return 0; -} - -/* -#if defined (__MINGW64__) - -void __security_check_cookie (uintptr_t _StackCookie); - -void __security_check_cookie (uintptr_t _StackCookie) -{ - (void) _StackCookie; -} - -void __GSHandlerCheck (); - -void __GSHandlerCheck () -{ -} - -#endif -*/ - -// xnvctrl functions - -static int xnvctrl_init (hashcat_ctx_t *hashcat_ctx) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - memset (xnvctrl, 0, sizeof (XNVCTRL_PTR)); - - #if defined (_WIN) - - // unsupport platform? - return -1; - - #else - - xnvctrl->lib_x11 = dlopen ("libX11.so", RTLD_LAZY); - - if (xnvctrl->lib_x11 == NULL) - { - //event_log_error (hashcat_ctx, "Failed to load the X11 library: %s", dlerror()); - //event_log_error (hashcat_ctx, "Please install the libx11-dev package."); - - return -1; - } - - xnvctrl->lib_xnvctrl = dlopen ("libXNVCtrl.so", RTLD_LAZY); - - if (xnvctrl->lib_xnvctrl == NULL) - { - //event_log_error (hashcat_ctx, "Failed to load the XNVCTRL library: %s", dlerror()); - //event_log_error (hashcat_ctx, "Please install the libxnvctrl-dev package."); - - return -1; - } - - HC_LOAD_FUNC2 (xnvctrl, XOpenDisplay, XOPENDISPLAY, lib_x11, X11, 0); - HC_LOAD_FUNC2 (xnvctrl, XCloseDisplay, XCLOSEDISPLAY, lib_x11, X11, 0); - - HC_LOAD_FUNC2 (xnvctrl, XNVCTRLQueryTargetCount, XNVCTRLQUERYTARGETCOUNT, lib_xnvctrl, XNVCTRL, 0); - HC_LOAD_FUNC2 (xnvctrl, XNVCTRLQueryTargetAttribute, XNVCTRLQUERYTARGETATTRIBUTE, lib_xnvctrl, XNVCTRL, 0); - HC_LOAD_FUNC2 (xnvctrl, XNVCTRLSetTargetAttribute, XNVCTRLSETTARGETATTRIBUTE, lib_xnvctrl, XNVCTRL, 0); - - return 0; - - #endif -} - -static void xnvctrl_close (hashcat_ctx_t *hashcat_ctx) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl) - { - #if defined (_POSIX) - - if (xnvctrl->lib_x11) - { - dlclose (xnvctrl->lib_x11); - } - - if (xnvctrl->lib_xnvctrl) - { - dlclose (xnvctrl->lib_xnvctrl); - } - - #endif - - hcfree (xnvctrl); - } -} - -static int hm_XNVCTRL_XOpenDisplay (hashcat_ctx_t *hashcat_ctx) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XOpenDisplay == NULL) return -1; - - void *dpy = xnvctrl->XOpenDisplay (NULL); - - if (dpy == NULL) - { - event_log_error (hashcat_ctx, "XOpenDisplay() failed."); - - return -1; - } - - xnvctrl->dpy = dpy; - - return 0; -} - -static void hm_XNVCTRL_XCloseDisplay (hashcat_ctx_t *hashcat_ctx) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XCloseDisplay == NULL) return; - - if (xnvctrl->dpy == NULL) return; - - xnvctrl->XCloseDisplay (xnvctrl->dpy); -} - -static int hm_XNVCTRL_query_target_count (hashcat_ctx_t *hashcat_ctx, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetCount == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const int rc = xnvctrl->XNVCTRLQueryTargetCount (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "%s", "XNVCTRLQueryTargetCount() failed."); - - return -1; - } - - return 0; -} - -static int hm_XNVCTRL_get_fan_control (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const bool rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, gpu, 0, NV_CTRL_GPU_COOLER_MANUAL_CONTROL, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "XNVCTRLQueryTargetAttribute() failed."); - - // help the user to fix the problem - - event_log_warning (hashcat_ctx, "This error typically occurs when you did not set up NVidia Coolbits."); - event_log_warning (hashcat_ctx, "To fix, run this command:"); - event_log_warning (hashcat_ctx, " sudo nvidia-xconfig --cool-bits=12"); - event_log_warning (hashcat_ctx, "Do not forget to restart X afterwards."); - event_log_warning (hashcat_ctx, NULL); - - return -1; - } - - return 0; -} - -static int hm_XNVCTRL_set_fan_control (hashcat_ctx_t *hashcat_ctx, const int gpu, int val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLSetTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - int cur; - - int rc = hm_XNVCTRL_get_fan_control (hashcat_ctx, gpu, &cur); - - if (rc == -1) return -1; - - xnvctrl->XNVCTRLSetTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, gpu, 0, NV_CTRL_GPU_COOLER_MANUAL_CONTROL, val); - - rc = hm_XNVCTRL_get_fan_control (hashcat_ctx, gpu, &cur); - - if (rc == -1) return -1; - - if (cur != val) return -1; - - return 0; -} - -/* -static int hm_XNVCTRL_get_core_threshold (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const bool rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, gpu, 0, NV_CTRL_GPU_CORE_THRESHOLD, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "XNVCTRLQueryTargetAttribute(NV_CTRL_GPU_CORE_THRESHOLD) failed."); - - return -1; - } - - return 0; -} -*/ - -/* -static int hm_XNVCTRL_get_fan_speed_current (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const bool rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_COOLER, gpu, 0, NV_CTRL_THERMAL_COOLER_CURRENT_LEVEL, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "XNVCTRLQueryTargetAttribute(NV_CTRL_THERMAL_COOLER_CURRENT_LEVEL) failed."); - - return -1; - } - - return 0; -} -*/ - -static int hm_XNVCTRL_get_fan_speed_target (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const int rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_COOLER, gpu, 0, NV_CTRL_THERMAL_COOLER_LEVEL, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "%s", "XNVCTRLQueryTargetAttribute(NV_CTRL_THERMAL_COOLER_LEVEL) failed."); - - return -1; - } - - return 0; -} - -static int hm_XNVCTRL_set_fan_speed_target (hashcat_ctx_t *hashcat_ctx, const int gpu, int val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLSetTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - int cur; +{ + hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - int rc = hm_XNVCTRL_get_fan_speed_target (hashcat_ctx, gpu, &cur); + NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - if (rc == -1) return -1; + const NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetPerfPoliciesInfo (hPhysicalGpu, perfPolicies_info); - xnvctrl->XNVCTRLSetTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_COOLER, gpu, 0, NV_CTRL_THERMAL_COOLER_LEVEL, val); + if (NvAPI_rc != NVAPI_OK) + { + NvAPI_ShortString string = { 0 }; - rc = hm_XNVCTRL_get_fan_speed_target (hashcat_ctx, gpu, &cur); + hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); - if (rc == -1) return -1; + event_log_error (hashcat_ctx, "NvAPI_GPU_GetPerfPoliciesInfo(): %s", string); - if (cur != val) return -1; + return -1; + } return 0; } -static int hm_XNVCTRL_get_pci_bus (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) +static int hm_NvAPI_GPU_GetPerfPoliciesStatus (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 *perfPolicies_status) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; + NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; + const NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetPerfPoliciesStatus (hPhysicalGpu, perfPolicies_status); - if (xnvctrl->dpy == NULL) return -1; + if (NvAPI_rc != NVAPI_OK) + { + NvAPI_ShortString string = { 0 }; - const int rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, gpu, 0, NV_CTRL_PCI_BUS, val); + hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); - if (rc == false) - { - event_log_error (hashcat_ctx, "%s", "XNVCTRLQueryTargetAttribute(NV_CTRL_PCI_BUS) failed."); + event_log_error (hashcat_ctx, "NvAPI_GPU_GetPerfPoliciesStatus(): %s", string); return -1; } @@ -1719,21 +965,21 @@ static int hm_XNVCTRL_get_pci_bus (hashcat_ctx_t *hashcat_ctx, const int gpu, in return 0; } -static int hm_XNVCTRL_get_pci_device (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) +static int hm_NvAPI_GPU_GetBusId (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusId) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; + NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; + const NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetBusId (hPhysicalGpu, pBusId); - if (xnvctrl->dpy == NULL) return -1; + if (NvAPI_rc != NVAPI_OK) + { + NvAPI_ShortString string = { 0 }; - const int rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, gpu, 0, NV_CTRL_PCI_DEVICE, val); + hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); - if (rc == false) - { - event_log_error (hashcat_ctx, "%s", "XNVCTRLQueryTargetAttribute(NV_CTRL_PCI_DEVICE) failed."); + event_log_error (hashcat_ctx, "NvAPI_GPU_GetBusId(): %s", string); return -1; } @@ -1741,21 +987,21 @@ static int hm_XNVCTRL_get_pci_device (hashcat_ctx_t *hashcat_ctx, const int gpu, return 0; } -static int hm_XNVCTRL_get_pci_function (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) +static int hm_NvAPI_GPU_GetBusSlotId (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusSlotId) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; + NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; + const NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_GetBusSlotId (hPhysicalGpu, pBusSlotId); - if (xnvctrl->dpy == NULL) return -1; + if (NvAPI_rc != NVAPI_OK) + { + NvAPI_ShortString string = { 0 }; - const int rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, gpu, 0, NV_CTRL_PCI_FUNCTION, val); + hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); - if (rc == false) - { - event_log_error (hashcat_ctx, "%s", "XNVCTRLQueryTargetAttribute(NV_CTRL_PCI_FUNCTION) failed."); + event_log_error (hashcat_ctx, "NvAPI_GPU_GetBusSlotId(): %s", string); return -1; } @@ -1813,26 +1059,13 @@ static int adl_init (hashcat_ctx_t *hashcat_ctx) HC_LOAD_FUNC(adl, ADL_Overdrive5_FanSpeedInfo_Get, ADL_OVERDRIVE5_FANSPEEDINFO_GET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive5_FanSpeed_Get, ADL_OVERDRIVE5_FANSPEED_GET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive6_FanSpeed_Get, ADL_OVERDRIVE6_FANSPEED_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive5_FanSpeed_Set, ADL_OVERDRIVE5_FANSPEED_SET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_FanSpeed_Set, ADL_OVERDRIVE6_FANSPEED_SET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive5_FanSpeedToDefault_Set, ADL_OVERDRIVE5_FANSPEEDTODEFAULT_SET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive5_ODParameters_Get, ADL_OVERDRIVE5_ODPARAMETERS_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive5_ODPerformanceLevels_Get, ADL_OVERDRIVE5_ODPERFORMANCELEVELS_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive5_ODPerformanceLevels_Set, ADL_OVERDRIVE5_ODPERFORMANCELEVELS_SET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_PowerControlInfo_Get, ADL_OVERDRIVE6_POWERCONTROLINFO_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_PowerControl_Get, ADL_OVERDRIVE6_POWERCONTROL_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_PowerControl_Set, ADL_OVERDRIVE6_POWERCONTROL_SET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Adapter_Active_Get, ADL_ADAPTER_ACTIVE_GET, ADL, 0) - //HC_LOAD_FUNC(adl, ADL_DisplayEnable_Set, ADL_DISPLAYENABLE_SET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive_Caps, ADL_OVERDRIVE_CAPS, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_PowerControl_Caps, ADL_OVERDRIVE6_POWERCONTROL_CAPS, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive6_Capabilities_Get, ADL_OVERDRIVE6_CAPABILITIES_GET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive6_StateInfo_Get, ADL_OVERDRIVE6_STATEINFO_GET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive6_CurrentStatus_Get, ADL_OVERDRIVE6_CURRENTSTATUS_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_State_Set, ADL_OVERDRIVE6_STATE_SET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive6_TargetTemperatureData_Get, ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive6_TargetTemperatureRangeInfo_Get, ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_FanSpeed_Reset, ADL_OVERDRIVE6_FANSPEED_RESET, ADL, 0) return 0; } @@ -1930,260 +1163,11 @@ static int hm_ADL_Overdrive5_Temperature_Get (hashcat_ctx_t *hashcat_ctx, int iA ADL_PTR *adl = hwmon_ctx->hm_adl; - const int ADL_rc = adl->ADL_Overdrive5_Temperature_Get (iAdapterIndex, iThermalControllerIndex, lpTemperature); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive5_Temperature_Get(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive6_Temperature_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *iTemperature) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive6_Temperature_Get (iAdapterIndex, iTemperature); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_Temperature_Get(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive_CurrentActivity_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLPMActivity *lpActivity) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive5_CurrentActivity_Get (iAdapterIndex, lpActivity); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive5_CurrentActivity_Get(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive5_FanSpeed_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex, ADLFanSpeedValue *lpFanSpeedValue) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive5_FanSpeed_Get (iAdapterIndex, iThermalControllerIndex, lpFanSpeedValue); - - if ((ADL_rc != ADL_OK) && (ADL_rc != ADL_ERR_NOT_SUPPORTED)) // exception allowed only here - { - event_log_error (hashcat_ctx, "ADL_Overdrive5_FanSpeed_Get(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive6_FanSpeed_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6FanSpeedInfo *lpFanSpeedInfo) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive6_FanSpeed_Get (iAdapterIndex, lpFanSpeedInfo); - - if ((ADL_rc != ADL_OK) && (ADL_rc != ADL_ERR_NOT_SUPPORTED)) // exception allowed only here - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_FanSpeed_Get(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive5_FanSpeed_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex, ADLFanSpeedValue *lpFanSpeedValue) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive5_FanSpeed_Set (iAdapterIndex, iThermalControllerIndex, lpFanSpeedValue); - - if ((ADL_rc != ADL_OK) && (ADL_rc != ADL_ERR_NOT_SUPPORTED)) // exception allowed only here - { - event_log_error (hashcat_ctx, "ADL_Overdrive5_FanSpeed_Set(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive6_FanSpeed_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6FanSpeedValue *lpFanSpeedValue) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive6_FanSpeed_Set (iAdapterIndex, lpFanSpeedValue); - - if ((ADL_rc != ADL_OK) && (ADL_rc != ADL_ERR_NOT_SUPPORTED)) // exception allowed only here - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_FanSpeed_Set(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive5_FanSpeedToDefault_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive5_FanSpeedToDefault_Set (iAdapterIndex, iThermalControllerIndex); - - if ((ADL_rc != ADL_OK) && (ADL_rc != ADL_ERR_NOT_SUPPORTED)) // exception allowed only here - { - event_log_error (hashcat_ctx, "ADL_Overdrive5_FanSpeedToDefault_Set(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive_PowerControlInfo_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6PowerControlInfo *powertune) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive6_PowerControlInfo_Get (iAdapterIndex, powertune); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_PowerControlInfo_Get(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive_PowerControl_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *iCurrentValue) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - int default_value = 0; - - const int ADL_rc = adl->ADL_Overdrive6_PowerControl_Get (iAdapterIndex, iCurrentValue, &default_value); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_PowerControl_Get(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive_PowerControl_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int level) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - ADLOD6PowerControlInfo powertune = {0, 0, 0, 0, 0}; - - const int hm_rc = hm_ADL_Overdrive_PowerControlInfo_Get (hashcat_ctx, iAdapterIndex, &powertune); - - if (hm_rc == -1) return -1; - - int min = powertune.iMinValue; - int max = powertune.iMaxValue; - int step = powertune.iStepValue; - - if (level < min || level > max) - { - event_log_error (hashcat_ctx, "ADL PowerControl level invalid."); - - return -1; - } - - if (step == 0) - { - event_log_error (hashcat_ctx, "ADL PowerControl step invalid."); - - return -1; - } - - if (level % step != 0) - { - event_log_error (hashcat_ctx, "ADL PowerControl step invalid."); - - return -1; - } - - const int ADL_rc = adl->ADL_Overdrive6_PowerControl_Set (iAdapterIndex, level); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_PowerControl_Set(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive_Caps (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *od_supported, int *od_enabled, int *od_version) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive_Caps (iAdapterIndex, od_supported, od_enabled, od_version); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive_Caps(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive6_PowerControl_Caps (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *lpSupported) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive6_PowerControl_Caps (iAdapterIndex, lpSupported); + const int ADL_rc = adl->ADL_Overdrive5_Temperature_Get (iAdapterIndex, iThermalControllerIndex, lpTemperature); if (ADL_rc != ADL_OK) { - event_log_error (hashcat_ctx, "ADL_Overdrive6_PowerControl_Caps(): %d", ADL_rc); + event_log_error (hashcat_ctx, "ADL_Overdrive5_Temperature_Get(): %d", ADL_rc); return -1; } @@ -2191,17 +1175,17 @@ static int hm_ADL_Overdrive6_PowerControl_Caps (hashcat_ctx_t *hashcat_ctx, int return 0; } -static int hm_ADL_Overdrive_Capabilities_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6Capabilities *caps) +static int hm_ADL_Overdrive6_Temperature_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *iTemperature) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; ADL_PTR *adl = hwmon_ctx->hm_adl; - const int ADL_rc = adl->ADL_Overdrive6_Capabilities_Get (iAdapterIndex, caps); + const int ADL_rc = adl->ADL_Overdrive6_Temperature_Get (iAdapterIndex, iTemperature); if (ADL_rc != ADL_OK) { - event_log_error (hashcat_ctx, "ADL_Overdrive6_Capabilities_Get(): %d", ADL_rc); + event_log_error (hashcat_ctx, "ADL_Overdrive6_Temperature_Get(): %d", ADL_rc); return -1; } @@ -2209,64 +1193,17 @@ static int hm_ADL_Overdrive_Capabilities_Get (hashcat_ctx_t *hashcat_ctx, int iA return 0; } -static int hm_ADL_Overdrive_StateInfo_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int type, ADLOD6MemClockState *state) +static int hm_ADL_Overdrive_CurrentActivity_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLPMActivity *lpActivity) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; ADL_PTR *adl = hwmon_ctx->hm_adl; - const int ADL_rc = adl->ADL_Overdrive6_StateInfo_Get (iAdapterIndex, type, state); - - if (ADL_rc == ADL_OK) - { - // check if clocks are okay with step sizes - // if not run a little hack: adjust the clocks to nearest clock size (clock down just a little bit) - - ADLOD6Capabilities caps; - - const int hm_rc = hm_ADL_Overdrive_Capabilities_Get (hashcat_ctx, iAdapterIndex, &caps); - - if (hm_rc == -1) return -1; - - if (state->state.aLevels[0].iEngineClock % caps.sEngineClockRange.iStep != 0) - { - event_log_error (hashcat_ctx, "ADL engine step size invalid for performance level 1."); - - //state->state.aLevels[0].iEngineClock -= state->state.aLevels[0].iEngineClock % caps.sEngineClockRange.iStep; - - return -1; - } - - if (state->state.aLevels[1].iEngineClock % caps.sEngineClockRange.iStep != 0) - { - event_log_error (hashcat_ctx, "ADL engine step size invalid for performance level 2."); - - //state->state.aLevels[1].iEngineClock -= state->state.aLevels[1].iEngineClock % caps.sEngineClockRange.iStep; - - return -1; - } - - if (state->state.aLevels[0].iMemoryClock % caps.sMemoryClockRange.iStep != 0) - { - event_log_error (hashcat_ctx, "ADL memory step size invalid for performance level 1."); - - //state->state.aLevels[0].iMemoryClock -= state->state.aLevels[0].iMemoryClock % caps.sMemoryClockRange.iStep; - - return -1; - } - - if (state->state.aLevels[1].iMemoryClock % caps.sMemoryClockRange.iStep != 0) - { - event_log_error (hashcat_ctx, "ADL memory step size invalid for performance level 2."); - - //state->state.aLevels[1].iMemoryClock -= state->state.aLevels[1].iMemoryClock % caps.sMemoryClockRange.iStep; + const int ADL_rc = adl->ADL_Overdrive5_CurrentActivity_Get (iAdapterIndex, lpActivity); - return -1; - } - } - else + if (ADL_rc != ADL_OK) { - event_log_error (hashcat_ctx, "ADL_Overdrive6_StateInfo_Get(): %d", ADL_rc); + event_log_error (hashcat_ctx, "ADL_Overdrive5_CurrentActivity_Get(): %d", ADL_rc); return -1; } @@ -2274,53 +1211,35 @@ static int hm_ADL_Overdrive_StateInfo_Get (hashcat_ctx_t *hashcat_ctx, int iAdap return 0; } -static int hm_ADL_Overdrive_State_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int type, ADLOD6StateInfo *state) +static int hm_ADL_Overdrive5_FanSpeed_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex, ADLFanSpeedValue *lpFanSpeedValue) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; ADL_PTR *adl = hwmon_ctx->hm_adl; - // sanity checks - - ADLOD6Capabilities caps; - - const int hm_rc = hm_ADL_Overdrive_Capabilities_Get (hashcat_ctx, iAdapterIndex, &caps); - - if (hm_rc == -1) return -1; - - if (state->aLevels[0].iEngineClock < caps.sEngineClockRange.iMin || state->aLevels[1].iEngineClock > caps.sEngineClockRange.iMax) - { - event_log_error (hashcat_ctx, "ADL engine clock outside valid range."); - - return -1; - } + const int ADL_rc = adl->ADL_Overdrive5_FanSpeed_Get (iAdapterIndex, iThermalControllerIndex, lpFanSpeedValue); - if (state->aLevels[1].iEngineClock % caps.sEngineClockRange.iStep != 0) + if ((ADL_rc != ADL_OK) && (ADL_rc != ADL_ERR_NOT_SUPPORTED)) // exception allowed only here { - event_log_error (hashcat_ctx, "ADL engine step size invalid."); + event_log_error (hashcat_ctx, "ADL_Overdrive5_FanSpeed_Get(): %d", ADL_rc); return -1; } - if (state->aLevels[0].iMemoryClock < caps.sMemoryClockRange.iMin || state->aLevels[1].iMemoryClock > caps.sMemoryClockRange.iMax) - { - event_log_error (hashcat_ctx, "ADL memory clock outside valid range."); - - return -1; - } + return 0; +} - if (state->aLevels[1].iMemoryClock % caps.sMemoryClockRange.iStep != 0) - { - event_log_error (hashcat_ctx, "ADL memory step size invalid."); +static int hm_ADL_Overdrive6_FanSpeed_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6FanSpeedInfo *lpFanSpeedInfo) +{ + hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - return -1; - } + ADL_PTR *adl = hwmon_ctx->hm_adl; - const int ADL_rc = adl->ADL_Overdrive6_State_Set (iAdapterIndex, type, state); + const int ADL_rc = adl->ADL_Overdrive6_FanSpeed_Get (iAdapterIndex, lpFanSpeedInfo); - if (ADL_rc != ADL_OK) + if ((ADL_rc != ADL_OK) && (ADL_rc != ADL_ERR_NOT_SUPPORTED)) // exception allowed only here { - event_log_error (hashcat_ctx, "ADL_Overdrive6_State_Set(): %d", ADL_rc); + event_log_error (hashcat_ctx, "ADL_Overdrive6_FanSpeed_Get(): %d", ADL_rc); return -1; } @@ -2328,17 +1247,17 @@ static int hm_ADL_Overdrive_State_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterI return 0; } -static int hm_ADL_Overdrive6_TargetTemperatureData_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *cur_temp, int *default_temp) +static int hm_ADL_Overdrive_Caps (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *od_supported, int *od_enabled, int *od_version) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; ADL_PTR *adl = hwmon_ctx->hm_adl; - const int ADL_rc = adl->ADL_Overdrive6_TargetTemperatureData_Get (iAdapterIndex, cur_temp, default_temp); + const int ADL_rc = adl->ADL_Overdrive_Caps (iAdapterIndex, od_supported, od_enabled, od_version); if (ADL_rc != ADL_OK) { - event_log_error (hashcat_ctx, "ADL_Overdrive6_TargetTemperatureData_Get(): %d", ADL_rc); + event_log_error (hashcat_ctx, "ADL_Overdrive_Caps(): %d", ADL_rc); return -1; } @@ -2346,17 +1265,17 @@ static int hm_ADL_Overdrive6_TargetTemperatureData_Get (hashcat_ctx_t *hashcat_c return 0; } -static int hm_ADL_Overdrive6_FanSpeed_Reset (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex) +static int hm_ADL_Overdrive6_TargetTemperatureData_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *cur_temp, int *default_temp) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; ADL_PTR *adl = hwmon_ctx->hm_adl; - const int ADL_rc = adl->ADL_Overdrive6_FanSpeed_Reset (iAdapterIndex); + const int ADL_rc = adl->ADL_Overdrive6_TargetTemperatureData_Get (iAdapterIndex, cur_temp, default_temp); if (ADL_rc != ADL_OK) { - event_log_error (hashcat_ctx, "ADL_Overdrive6_FanSpeed_Reset(): %d", ADL_rc); + event_log_error (hashcat_ctx, "ADL_Overdrive6_TargetTemperatureData_Get(): %d", ADL_rc); return -1; } @@ -3053,273 +1972,26 @@ int hm_get_throttle_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 device if (hwmon_ctx->hm_nvapi) { - NV_GPU_PERF_POLICIES_INFO_PARAMS_V1 perfPolicies_info; - NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 perfPolicies_status; - - memset (&perfPolicies_info, 0, sizeof (NV_GPU_PERF_POLICIES_INFO_PARAMS_V1)); - memset (&perfPolicies_status, 0, sizeof (NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1)); - - perfPolicies_info.version = MAKE_NVAPI_VERSION (NV_GPU_PERF_POLICIES_INFO_PARAMS_V1, 1); - perfPolicies_status.version = MAKE_NVAPI_VERSION (NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1, 1); - - hm_NvAPI_GPU_GetPerfPoliciesInfo (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvapi, &perfPolicies_info); - - perfPolicies_status.info_value = perfPolicies_info.info_value; - - hm_NvAPI_GPU_GetPerfPoliciesStatus (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvapi, &perfPolicies_status); - - return perfPolicies_status.throttle & 2; - } - } - - hwmon_ctx->hm_device[device_id].throttle_get_supported = false; - - return -1; -} - -int hm_set_fanspeed_with_device_id_adl (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed, const int fanpolicy) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - if (hwmon_ctx->enabled == false) return -1; - - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) return -1; - - if (hwmon_ctx->hm_adl) - { - if (fanpolicy == 1) - { - if (hwmon_ctx->hm_device[device_id].od_version == 5) - { - ADLFanSpeedValue lpFanSpeedValue; - - memset (&lpFanSpeedValue, 0, sizeof (lpFanSpeedValue)); - - lpFanSpeedValue.iSize = sizeof (lpFanSpeedValue); - lpFanSpeedValue.iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_PERCENT; - lpFanSpeedValue.iFlags = ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED; - lpFanSpeedValue.iFanSpeed = fanspeed; - - if (hm_ADL_Overdrive5_FanSpeed_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, 0, &lpFanSpeedValue) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - if (hwmon_ctx->hm_device[device_id].od_version == 6) - { - ADLOD6FanSpeedValue fan_speed_value; - - memset (&fan_speed_value, 0, sizeof (fan_speed_value)); - - fan_speed_value.iSpeedType = ADL_OD6_FANSPEED_TYPE_PERCENT; - fan_speed_value.iFanSpeed = fanspeed; - - if (hm_ADL_Overdrive6_FanSpeed_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &fan_speed_value) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - } - else - { - if (hwmon_ctx->hm_device[device_id].od_version == 5) - { - if (hm_ADL_Overdrive5_FanSpeedToDefault_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, 0) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - if (hwmon_ctx->hm_device[device_id].od_version == 6) - { - if (hm_ADL_Overdrive6_FanSpeed_Reset (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - } - } - - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; -} - -int hm_set_fanspeed_with_device_id_nvapi (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed, const int fanpolicy) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - if (hwmon_ctx->enabled == false) return -1; - - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) return -1; - - if (hwmon_ctx->hm_nvapi) - { - if (fanpolicy == 1) - { - NV_GPU_COOLER_LEVELS CoolerLevels; - - memset (&CoolerLevels, 0, sizeof (NV_GPU_COOLER_LEVELS)); - - CoolerLevels.Version = GPU_COOLER_LEVELS_VER | sizeof (NV_GPU_COOLER_LEVELS); - - CoolerLevels.Levels[0].Level = fanspeed; - CoolerLevels.Levels[0].Policy = 1; - - if (hm_NvAPI_GPU_SetCoolerLevels (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvapi, 0, &CoolerLevels) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - if (fanpolicy != 1) - { - NV_GPU_COOLER_LEVELS CoolerLevels; - - memset (&CoolerLevels, 0, sizeof (NV_GPU_COOLER_LEVELS)); - - CoolerLevels.Version = GPU_COOLER_LEVELS_VER | sizeof (NV_GPU_COOLER_LEVELS); - - CoolerLevels.Levels[0].Level = 100; - CoolerLevels.Levels[0].Policy = 0x20; - - if (hm_NvAPI_GPU_SetCoolerLevels (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvapi, 0, &CoolerLevels) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - } - - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; -} - -int hm_set_fanspeed_with_device_id_xnvctrl (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - if (hwmon_ctx->enabled == false) return -1; - - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) return -1; - - if (hwmon_ctx->hm_xnvctrl) - { - if (hm_XNVCTRL_set_fan_speed_target (hashcat_ctx, hwmon_ctx->hm_device[device_id].xnvctrl, fanspeed) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; -} - -int hm_set_fanspeed_with_device_id_sysfs (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - if (hwmon_ctx->enabled == false) return -1; - - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) return -1; - - if (hwmon_ctx->hm_sysfs) - { - if (hm_SYSFS_set_fan_speed_target (hashcat_ctx, device_id, fanspeed) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; -} - -static int hm_set_fanctrl_with_device_id_xnvctrl (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - if (hwmon_ctx->enabled == false) return -1; - - if (hwmon_ctx->hm_device[device_id].fanpolicy_set_supported == false) return -1; - - if (hwmon_ctx->hm_xnvctrl) - { - if (hm_XNVCTRL_set_fan_control (hashcat_ctx, hwmon_ctx->hm_device[device_id].xnvctrl, val) == -1) - { - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported = false; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported = false; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; + NV_GPU_PERF_POLICIES_INFO_PARAMS_V1 perfPolicies_info; + NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 perfPolicies_status; - return -1; -} + memset (&perfPolicies_info, 0, sizeof (NV_GPU_PERF_POLICIES_INFO_PARAMS_V1)); + memset (&perfPolicies_status, 0, sizeof (NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1)); -static int hm_set_fanctrl_with_device_id_sysfs (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; + perfPolicies_info.version = MAKE_NVAPI_VERSION (NV_GPU_PERF_POLICIES_INFO_PARAMS_V1, 1); + perfPolicies_status.version = MAKE_NVAPI_VERSION (NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1, 1); - if (hwmon_ctx->enabled == false) return -1; + hm_NvAPI_GPU_GetPerfPoliciesInfo (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvapi, &perfPolicies_info); - if (hwmon_ctx->hm_device[device_id].fanpolicy_set_supported == false) return -1; + perfPolicies_status.info_value = perfPolicies_info.info_value; - if (hwmon_ctx->hm_sysfs) - { - if (hm_SYSFS_set_fan_control (hashcat_ctx, device_id, val) == -1) - { - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported = false; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; + hm_NvAPI_GPU_GetPerfPoliciesStatus (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvapi, &perfPolicies_status); - return -1; + return perfPolicies_status.throttle & 2; } - - return 0; } - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported = false; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; + hwmon_ctx->hm_device[device_id].throttle_get_supported = false; return -1; } @@ -3348,19 +2020,17 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) * Initialize shared libraries */ - hm_attrs_t *hm_adapters_adl = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); - hm_attrs_t *hm_adapters_nvapi = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); - hm_attrs_t *hm_adapters_nvml = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); - hm_attrs_t *hm_adapters_xnvctrl = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); - hm_attrs_t *hm_adapters_sysfs = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); - - #define FREE_ADAPTERS \ - { \ - hcfree (hm_adapters_adl); \ - hcfree (hm_adapters_nvapi); \ - hcfree (hm_adapters_nvml); \ - hcfree (hm_adapters_xnvctrl); \ - hcfree (hm_adapters_sysfs); \ + hm_attrs_t *hm_adapters_adl = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); + hm_attrs_t *hm_adapters_nvapi = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); + hm_attrs_t *hm_adapters_nvml = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); + hm_attrs_t *hm_adapters_sysfs = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); + + #define FREE_ADAPTERS \ + { \ + hcfree (hm_adapters_adl); \ + hcfree (hm_adapters_nvapi); \ + hcfree (hm_adapters_nvml); \ + hcfree (hm_adapters_sysfs); \ } if (opencl_ctx->need_nvml == true) @@ -3387,18 +2057,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) } } - if ((opencl_ctx->need_xnvctrl == true) && (hwmon_ctx->hm_nvml)) // xnvctrl can't work alone, we need nvml, too - { - hwmon_ctx->hm_xnvctrl = (XNVCTRL_PTR *) hcmalloc (sizeof (XNVCTRL_PTR)); - - if (xnvctrl_init (hashcat_ctx) == -1) - { - hcfree (hwmon_ctx->hm_xnvctrl); - - hwmon_ctx->hm_xnvctrl = NULL; - } - } - if (opencl_ctx->need_adl == true) { hwmon_ctx->hm_adl = (ADL_PTR *) hcmalloc (sizeof (ADL_PTR)); @@ -3521,9 +2179,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hm_adapters_nvapi[platform_devices_id].nvapi = nvGPUHandle[i]; - hm_adapters_nvapi[platform_devices_id].fanspeed_set_supported = true; hm_adapters_nvapi[platform_devices_id].fanpolicy_get_supported = true; - hm_adapters_nvapi[platform_devices_id].fanpolicy_set_supported = true; hm_adapters_nvapi[platform_devices_id].throttle_get_supported = true; } } @@ -3533,58 +2189,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) } } - if (hwmon_ctx->hm_xnvctrl) - { - if (hm_XNVCTRL_XOpenDisplay (hashcat_ctx) == 0) - { - int tmp_in = 0; - - hm_XNVCTRL_query_target_count (hashcat_ctx, &tmp_in); - - for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) - { - hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; - - if ((device_param->device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - - if (device_param->device_vendor_id != VENDOR_ID_NV) continue; - - for (int i = 0; i < tmp_in; i++) - { - int pci_bus = 0; - int pci_device = 0; - int pci_function = 0; - - const int rc1 = hm_XNVCTRL_get_pci_bus (hashcat_ctx, i, &pci_bus); - - if (rc1 == -1) continue; - - const int rc2 = hm_XNVCTRL_get_pci_device (hashcat_ctx, i, &pci_device); - - if (rc2 == -1) continue; - - const int rc3 = hm_XNVCTRL_get_pci_function (hashcat_ctx, i, &pci_function); - - if (rc3 == -1) continue; - - if ((device_param->pcie_bus == pci_bus) - && (device_param->pcie_device == pci_device) - && (device_param->pcie_function == pci_function)) - { - const u32 platform_devices_id = device_param->platform_devices_id; - - hm_adapters_xnvctrl[platform_devices_id].xnvctrl = i; - - hm_adapters_xnvctrl[platform_devices_id].fanspeed_get_supported = true; - hm_adapters_xnvctrl[platform_devices_id].fanspeed_set_supported = true; - hm_adapters_xnvctrl[platform_devices_id].fanpolicy_get_supported = true; - hm_adapters_xnvctrl[platform_devices_id].fanpolicy_set_supported = true; - } - } - } - } - } - if (hwmon_ctx->hm_adl) { if (hm_ADL_Main_Control_Create (hashcat_ctx, ADL_Main_Memory_Alloc, 0) == 0) @@ -3644,9 +2248,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hm_adapters_adl[platform_devices_id].buslanes_get_supported = true; hm_adapters_adl[platform_devices_id].corespeed_get_supported = true; hm_adapters_adl[platform_devices_id].fanspeed_get_supported = true; - hm_adapters_adl[platform_devices_id].fanspeed_set_supported = true; hm_adapters_adl[platform_devices_id].fanpolicy_get_supported = true; - hm_adapters_adl[platform_devices_id].fanpolicy_set_supported = true; hm_adapters_adl[platform_devices_id].memoryspeed_get_supported = true; hm_adapters_adl[platform_devices_id].temperature_get_supported = true; hm_adapters_adl[platform_devices_id].threshold_slowdown_get_supported = true; @@ -3676,9 +2278,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hm_adapters_sysfs[hm_adapters_id].buslanes_get_supported = true; hm_adapters_sysfs[hm_adapters_id].corespeed_get_supported = true; hm_adapters_sysfs[hm_adapters_id].fanspeed_get_supported = true; - hm_adapters_sysfs[hm_adapters_id].fanspeed_set_supported = true; hm_adapters_sysfs[hm_adapters_id].fanpolicy_get_supported = true; - hm_adapters_sysfs[hm_adapters_id].fanpolicy_set_supported = true; hm_adapters_sysfs[hm_adapters_id].memoryspeed_get_supported = true; hm_adapters_sysfs[hm_adapters_id].temperature_get_supported = true; @@ -3687,7 +2287,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) } } - if (hwmon_ctx->hm_adl == NULL && hwmon_ctx->hm_nvml == NULL && hwmon_ctx->hm_xnvctrl == NULL && hwmon_ctx->hm_sysfs == NULL) + if (hwmon_ctx->hm_adl == NULL && hwmon_ctx->hm_nvml == NULL && hwmon_ctx->hm_sysfs == NULL) { FREE_ADAPTERS; @@ -3706,10 +2306,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->od_clock_mem_status = (ADLOD6MemClockState *) hccalloc (opencl_ctx->devices_cnt, sizeof (ADLOD6MemClockState)); - hwmon_ctx->od_power_control_status = (int *) hccalloc (opencl_ctx->devices_cnt, sizeof (int)); - - hwmon_ctx->nvml_power_limit = (unsigned int *) hccalloc (opencl_ctx->devices_cnt, sizeof (unsigned int)); - /** * HM devices: copy */ @@ -3730,7 +2326,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].sysfs = hm_adapters_sysfs[platform_devices_id].sysfs; hwmon_ctx->hm_device[device_id].nvapi = 0; hwmon_ctx->hm_device[device_id].nvml = 0; - hwmon_ctx->hm_device[device_id].xnvctrl = 0; hwmon_ctx->hm_device[device_id].od_version = 0; if (hwmon_ctx->hm_adl) @@ -3740,9 +2335,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].buslanes_get_supported |= hm_adapters_adl[platform_devices_id].buslanes_get_supported; hwmon_ctx->hm_device[device_id].corespeed_get_supported |= hm_adapters_adl[platform_devices_id].corespeed_get_supported; hwmon_ctx->hm_device[device_id].fanspeed_get_supported |= hm_adapters_adl[platform_devices_id].fanspeed_get_supported; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported |= hm_adapters_adl[platform_devices_id].fanspeed_set_supported; hwmon_ctx->hm_device[device_id].fanpolicy_get_supported |= hm_adapters_adl[platform_devices_id].fanpolicy_get_supported; - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported |= hm_adapters_adl[platform_devices_id].fanpolicy_set_supported; hwmon_ctx->hm_device[device_id].memoryspeed_get_supported |= hm_adapters_adl[platform_devices_id].memoryspeed_get_supported; hwmon_ctx->hm_device[device_id].temperature_get_supported |= hm_adapters_adl[platform_devices_id].temperature_get_supported; hwmon_ctx->hm_device[device_id].threshold_shutdown_get_supported |= hm_adapters_adl[platform_devices_id].threshold_shutdown_get_supported; @@ -3756,9 +2349,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].buslanes_get_supported |= hm_adapters_sysfs[platform_devices_id].buslanes_get_supported; hwmon_ctx->hm_device[device_id].corespeed_get_supported |= hm_adapters_sysfs[platform_devices_id].corespeed_get_supported; hwmon_ctx->hm_device[device_id].fanspeed_get_supported |= hm_adapters_sysfs[platform_devices_id].fanspeed_get_supported; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported |= hm_adapters_sysfs[platform_devices_id].fanspeed_set_supported; hwmon_ctx->hm_device[device_id].fanpolicy_get_supported |= hm_adapters_sysfs[platform_devices_id].fanpolicy_get_supported; - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported |= hm_adapters_sysfs[platform_devices_id].fanpolicy_set_supported; hwmon_ctx->hm_device[device_id].memoryspeed_get_supported |= hm_adapters_sysfs[platform_devices_id].memoryspeed_get_supported; hwmon_ctx->hm_device[device_id].temperature_get_supported |= hm_adapters_sysfs[platform_devices_id].temperature_get_supported; hwmon_ctx->hm_device[device_id].threshold_shutdown_get_supported |= hm_adapters_sysfs[platform_devices_id].threshold_shutdown_get_supported; @@ -3774,7 +2365,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].sysfs = 0; hwmon_ctx->hm_device[device_id].nvapi = hm_adapters_nvapi[platform_devices_id].nvapi; hwmon_ctx->hm_device[device_id].nvml = hm_adapters_nvml[platform_devices_id].nvml; - hwmon_ctx->hm_device[device_id].xnvctrl = hm_adapters_xnvctrl[platform_devices_id].xnvctrl; hwmon_ctx->hm_device[device_id].od_version = 0; if (hwmon_ctx->hm_nvml) @@ -3782,9 +2372,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].buslanes_get_supported |= hm_adapters_nvml[platform_devices_id].buslanes_get_supported; hwmon_ctx->hm_device[device_id].corespeed_get_supported |= hm_adapters_nvml[platform_devices_id].corespeed_get_supported; hwmon_ctx->hm_device[device_id].fanspeed_get_supported |= hm_adapters_nvml[platform_devices_id].fanspeed_get_supported; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported |= hm_adapters_nvml[platform_devices_id].fanspeed_set_supported; hwmon_ctx->hm_device[device_id].fanpolicy_get_supported |= hm_adapters_nvml[platform_devices_id].fanpolicy_get_supported; - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported |= hm_adapters_nvml[platform_devices_id].fanpolicy_set_supported; hwmon_ctx->hm_device[device_id].memoryspeed_get_supported |= hm_adapters_nvml[platform_devices_id].memoryspeed_get_supported; hwmon_ctx->hm_device[device_id].temperature_get_supported |= hm_adapters_nvml[platform_devices_id].temperature_get_supported; hwmon_ctx->hm_device[device_id].threshold_shutdown_get_supported |= hm_adapters_nvml[platform_devices_id].threshold_shutdown_get_supported; @@ -3798,9 +2386,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].buslanes_get_supported |= hm_adapters_nvapi[platform_devices_id].buslanes_get_supported; hwmon_ctx->hm_device[device_id].corespeed_get_supported |= hm_adapters_nvapi[platform_devices_id].corespeed_get_supported; hwmon_ctx->hm_device[device_id].fanspeed_get_supported |= hm_adapters_nvapi[platform_devices_id].fanspeed_get_supported; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported |= hm_adapters_nvapi[platform_devices_id].fanspeed_set_supported; hwmon_ctx->hm_device[device_id].fanpolicy_get_supported |= hm_adapters_nvapi[platform_devices_id].fanpolicy_get_supported; - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported |= hm_adapters_nvapi[platform_devices_id].fanpolicy_set_supported; hwmon_ctx->hm_device[device_id].memoryspeed_get_supported |= hm_adapters_nvapi[platform_devices_id].memoryspeed_get_supported; hwmon_ctx->hm_device[device_id].temperature_get_supported |= hm_adapters_nvapi[platform_devices_id].temperature_get_supported; hwmon_ctx->hm_device[device_id].threshold_shutdown_get_supported |= hm_adapters_nvapi[platform_devices_id].threshold_shutdown_get_supported; @@ -3808,22 +2394,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].throttle_get_supported |= hm_adapters_nvapi[platform_devices_id].throttle_get_supported; hwmon_ctx->hm_device[device_id].utilization_get_supported |= hm_adapters_nvapi[platform_devices_id].utilization_get_supported; } - - if (hwmon_ctx->hm_xnvctrl) - { - hwmon_ctx->hm_device[device_id].buslanes_get_supported |= hm_adapters_xnvctrl[platform_devices_id].buslanes_get_supported; - hwmon_ctx->hm_device[device_id].corespeed_get_supported |= hm_adapters_xnvctrl[platform_devices_id].corespeed_get_supported; - hwmon_ctx->hm_device[device_id].fanspeed_get_supported |= hm_adapters_xnvctrl[platform_devices_id].fanspeed_get_supported; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported |= hm_adapters_xnvctrl[platform_devices_id].fanspeed_set_supported; - hwmon_ctx->hm_device[device_id].fanpolicy_get_supported |= hm_adapters_xnvctrl[platform_devices_id].fanpolicy_get_supported; - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported |= hm_adapters_xnvctrl[platform_devices_id].fanpolicy_set_supported; - hwmon_ctx->hm_device[device_id].memoryspeed_get_supported |= hm_adapters_xnvctrl[platform_devices_id].memoryspeed_get_supported; - hwmon_ctx->hm_device[device_id].temperature_get_supported |= hm_adapters_xnvctrl[platform_devices_id].temperature_get_supported; - hwmon_ctx->hm_device[device_id].threshold_shutdown_get_supported |= hm_adapters_xnvctrl[platform_devices_id].threshold_shutdown_get_supported; - hwmon_ctx->hm_device[device_id].threshold_slowdown_get_supported |= hm_adapters_xnvctrl[platform_devices_id].threshold_slowdown_get_supported; - hwmon_ctx->hm_device[device_id].throttle_get_supported |= hm_adapters_xnvctrl[platform_devices_id].throttle_get_supported; - hwmon_ctx->hm_device[device_id].utilization_get_supported |= hm_adapters_xnvctrl[platform_devices_id].utilization_get_supported; - } } // by calling the different functions here this will disable them in case they will error out @@ -3843,421 +2413,15 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) FREE_ADAPTERS; - /** - * powertune on user request - */ - - if (user_options->powertune_enable == true) - { - for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) - { - hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; - - if (device_param->skipped == true) continue; - - if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - - if (opencl_ctx->devices_param[device_id].device_vendor_id == VENDOR_ID_AMD) - { - if (hwmon_ctx->hm_adl) - { - /** - * Temporary fix: - * with AMD r9 295x cards it seems that we need to set the powertune value just AFTER the ocl init stuff - * otherwise after hc_clCreateContext () etc, powertune value was set back to "normal" and cards unfortunately - * were not working @ full speed (setting hm_ADL_Overdrive_PowerControl_Set () here seems to fix the problem) - * Driver / ADL bug? - */ - - if (hwmon_ctx->hm_device[device_id].od_version == 6) - { - int ADL_rc; - - // check powertune capabilities first, if not available then skip device - - int powertune_supported = 0; - - ADL_rc = hm_ADL_Overdrive6_PowerControl_Caps (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &powertune_supported); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to get ADL PowerControl capabilities."); - - return -1; - } - - // first backup current value, we will restore it later - - if (powertune_supported != 0) - { - // powercontrol settings - - ADLOD6PowerControlInfo powertune = {0, 0, 0, 0, 0}; - - ADL_rc = hm_ADL_Overdrive_PowerControlInfo_Get (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &powertune); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to get current ADL PowerControl values."); - - return -1; - } - - ADL_rc = hm_ADL_Overdrive_PowerControl_Get (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &hwmon_ctx->od_power_control_status[device_id]); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to get current ADL PowerControl values."); - - return -1; - } - - ADL_rc = hm_ADL_Overdrive_PowerControl_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, powertune.iMaxValue); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to set new ADL PowerControl values."); - - return -1; - } - - // clocks - - memset (&hwmon_ctx->od_clock_mem_status[device_id], 0, sizeof (ADLOD6MemClockState)); - - hwmon_ctx->od_clock_mem_status[device_id].state.iNumberOfPerformanceLevels = 2; - - ADL_rc = hm_ADL_Overdrive_StateInfo_Get (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, ADL_OD6_GETSTATEINFO_CUSTOM_PERFORMANCE, &hwmon_ctx->od_clock_mem_status[device_id]); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to get ADL memory and engine clock frequency."); - - return -1; - } - - // Query capabilities only to see if profiles were not "damaged", if so output a warning but do accept the users profile settings - - ADLOD6Capabilities caps = {0, 0, 0, {0, 0, 0}, {0, 0, 0}, 0, 0}; - - ADL_rc = hm_ADL_Overdrive_Capabilities_Get (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &caps); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to get ADL device capabilities."); - - return -1; - } - - int engine_clock_max = (int) (0.6666f * caps.sEngineClockRange.iMax); - int memory_clock_max = (int) (0.6250f * caps.sMemoryClockRange.iMax); - - int warning_trigger_engine = (int) (0.25f * engine_clock_max); - int warning_trigger_memory = (int) (0.25f * memory_clock_max); - - int engine_clock_profile_max = hwmon_ctx->od_clock_mem_status[device_id].state.aLevels[1].iEngineClock; - int memory_clock_profile_max = hwmon_ctx->od_clock_mem_status[device_id].state.aLevels[1].iMemoryClock; - - // warning if profile has too low max values - - if ((engine_clock_max - engine_clock_profile_max) > warning_trigger_engine) - { - event_log_error (hashcat_ctx, "Custom profile has low maximum engine clock value. Expect reduced performance."); - } - - if ((memory_clock_max - memory_clock_profile_max) > warning_trigger_memory) - { - event_log_error (hashcat_ctx, "Custom profile has low maximum memory clock value. Expect reduced performance."); - } - - ADLOD6StateInfo *performance_state = (ADLOD6StateInfo*) hccalloc (1, sizeof (ADLOD6StateInfo) + sizeof (ADLOD6PerformanceLevel)); - - performance_state->iNumberOfPerformanceLevels = 2; - - performance_state->aLevels[0].iEngineClock = engine_clock_profile_max; - performance_state->aLevels[1].iEngineClock = engine_clock_profile_max; - performance_state->aLevels[0].iMemoryClock = memory_clock_profile_max; - performance_state->aLevels[1].iMemoryClock = memory_clock_profile_max; - - ADL_rc = hm_ADL_Overdrive_State_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, ADL_OD6_SETSTATE_PERFORMANCE, performance_state); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to set ADL performance state."); - - return -1; - } - - hcfree (performance_state); - } - - // set powertune value only - - if (powertune_supported != 0) - { - // powertune set - ADLOD6PowerControlInfo powertune = {0, 0, 0, 0, 0}; - - ADL_rc = hm_ADL_Overdrive_PowerControlInfo_Get (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &powertune); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to get current ADL PowerControl settings."); - - return -1; - } - - ADL_rc = hm_ADL_Overdrive_PowerControl_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, powertune.iMaxValue); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to set new ADL PowerControl values."); - - return -1; - } - } - } - } - - if (hwmon_ctx->hm_sysfs) - { - hm_SYSFS_set_power_dpm_force_performance_level (hashcat_ctx, device_id, "high"); - } - } - - if (opencl_ctx->devices_param[device_id].device_vendor_id == VENDOR_ID_NV) - { - // first backup current value, we will restore it later - - unsigned int limit; - - bool powertune_supported = false; - - if (hm_NVML_nvmlDeviceGetPowerManagementLimit (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvml, &limit) == NVML_SUCCESS) - { - powertune_supported = true; - } - - // if backup worked, activate the maximum allowed - - if (powertune_supported == true) - { - unsigned int minLimit; - unsigned int maxLimit; - - if (hm_NVML_nvmlDeviceGetPowerManagementLimitConstraints (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvml, &minLimit, &maxLimit) == NVML_SUCCESS) - { - if (maxLimit > 0) - { - if (hm_NVML_nvmlDeviceSetPowerManagementLimit (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvml, maxLimit) == NVML_SUCCESS) - { - // now we can be sure we need to reset later - - hwmon_ctx->nvml_power_limit[device_id] = limit; - } - } - } - } - } - } - } - - /** - * Store initial fanspeed if gpu_temp_retain is enabled - */ - - if (user_options->gpu_temp_retain > 0) - { - bool one_success = false; - - for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) - { - hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; - - if (device_param->skipped == true) continue; - - if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - - if (hwmon_ctx->hm_device[device_id].fanspeed_get_supported == false) continue; - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) continue; - - const int fanspeed = hm_get_fanspeed_with_device_id (hashcat_ctx, device_id); - - if (fanspeed == -1) continue; - - if (device_param->device_vendor_id == VENDOR_ID_AMD) - { - if (hwmon_ctx->hm_adl) - { - hm_set_fanspeed_with_device_id_adl (hashcat_ctx, device_id, fanspeed, 1); - } - - if (hwmon_ctx->hm_sysfs) - { - hm_set_fanctrl_with_device_id_sysfs (hashcat_ctx, device_id, 1); - - hm_set_fanspeed_with_device_id_sysfs (hashcat_ctx, device_id, fanspeed); - } - } - else if (device_param->device_vendor_id == VENDOR_ID_NV) - { - if (hwmon_ctx->hm_xnvctrl) - { - hm_set_fanctrl_with_device_id_xnvctrl (hashcat_ctx, device_id, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_TRUE); - - hm_set_fanspeed_with_device_id_xnvctrl (hashcat_ctx, device_id, fanspeed); - } - - if (hwmon_ctx->hm_nvapi) - { - hm_set_fanspeed_with_device_id_nvapi (hashcat_ctx, device_id, fanspeed, 1); - } - } - - if ((hwmon_ctx->hm_device[device_id].fanpolicy_set_supported == true) && (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == true)) one_success = true; - } - - if (one_success == false) user_options->gpu_temp_retain = 0; - } - return 0; } void hwmon_ctx_destroy (hashcat_ctx_t *hashcat_ctx) { - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; - user_options_t *user_options = hashcat_ctx->user_options; + hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; if (hwmon_ctx->enabled == false) return; - // reset default fan speed - - if (user_options->gpu_temp_retain > 0) - { - for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) - { - hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; - - if (device_param->skipped == true) continue; - - if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - - if (hwmon_ctx->hm_device[device_id].fanspeed_get_supported == false) continue; - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) continue; - - int rc = -1; - - if (device_param->device_vendor_id == VENDOR_ID_AMD) - { - if (hwmon_ctx->hm_adl) - { - rc = hm_set_fanspeed_with_device_id_adl (hashcat_ctx, device_id, 100, 0); - } - - if (hwmon_ctx->hm_sysfs) - { - rc = hm_set_fanctrl_with_device_id_sysfs (hashcat_ctx, device_id, 2); - } - } - else if (device_param->device_vendor_id == VENDOR_ID_NV) - { - if (hwmon_ctx->hm_xnvctrl) - { - rc = hm_set_fanctrl_with_device_id_xnvctrl (hashcat_ctx, device_id, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_FALSE); - } - - if (hwmon_ctx->hm_nvapi) - { - rc = hm_set_fanspeed_with_device_id_nvapi (hashcat_ctx, device_id, 100, 0); - } - } - - if (rc == -1) event_log_error (hashcat_ctx, "Failed to restore default fan speed and policy for device #%u", device_id + 1); - } - } - - // reset power tuning - - if (user_options->powertune_enable == true) - { - for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) - { - hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; - - if (device_param->skipped == true) continue; - - if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - - if (opencl_ctx->devices_param[device_id].device_vendor_id == VENDOR_ID_AMD) - { - if (hwmon_ctx->hm_adl) - { - if (hwmon_ctx->hm_device[device_id].od_version == 6) - { - // check powertune capabilities first, if not available then skip device - - int powertune_supported = 0; - - if ((hm_ADL_Overdrive6_PowerControl_Caps (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &powertune_supported)) == -1) - { - //event_log_error (hashcat_ctx, "Failed to get ADL PowerControl capabilities."); - - continue; - } - - if (powertune_supported != 0) - { - // powercontrol settings - - if ((hm_ADL_Overdrive_PowerControl_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, hwmon_ctx->od_power_control_status[device_id])) == -1) - { - //event_log_error (hashcat_ctx, "Failed to restore the ADL PowerControl values."); - - continue; - } - - // clocks - - ADLOD6StateInfo *performance_state = (ADLOD6StateInfo*) hccalloc (1, sizeof (ADLOD6StateInfo) + sizeof (ADLOD6PerformanceLevel)); - - performance_state->iNumberOfPerformanceLevels = 2; - - performance_state->aLevels[0].iEngineClock = hwmon_ctx->od_clock_mem_status[device_id].state.aLevels[0].iEngineClock; - performance_state->aLevels[1].iEngineClock = hwmon_ctx->od_clock_mem_status[device_id].state.aLevels[1].iEngineClock; - performance_state->aLevels[0].iMemoryClock = hwmon_ctx->od_clock_mem_status[device_id].state.aLevels[0].iMemoryClock; - performance_state->aLevels[1].iMemoryClock = hwmon_ctx->od_clock_mem_status[device_id].state.aLevels[1].iMemoryClock; - - if ((hm_ADL_Overdrive_State_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, ADL_OD6_SETSTATE_PERFORMANCE, performance_state)) == -1) - { - //event_log_error (hashcat_ctx, "Failed to restore ADL performance state."); - - continue; - } - - hcfree (performance_state); - } - } - } - - if (hwmon_ctx->hm_sysfs) - { - hm_SYSFS_set_power_dpm_force_performance_level (hashcat_ctx, device_id, "auto"); - } - } - - if (opencl_ctx->devices_param[device_id].device_vendor_id == VENDOR_ID_NV) - { - unsigned int power_limit = hwmon_ctx->nvml_power_limit[device_id]; - - if (power_limit > 0) - { - hm_NVML_nvmlDeviceSetPowerManagementLimit (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvml, power_limit); - } - } - } - } - // unload shared libraries if (hwmon_ctx->hm_nvml) @@ -4274,13 +2438,6 @@ void hwmon_ctx_destroy (hashcat_ctx_t *hashcat_ctx) nvapi_close (hashcat_ctx); } - if (hwmon_ctx->hm_xnvctrl) - { - hm_XNVCTRL_XCloseDisplay (hashcat_ctx); - - xnvctrl_close (hashcat_ctx); - } - if (hwmon_ctx->hm_adl) { hm_ADL_Main_Control_Destroy (hashcat_ctx); @@ -4296,8 +2453,6 @@ void hwmon_ctx_destroy (hashcat_ctx_t *hashcat_ctx) // free memory - hcfree (hwmon_ctx->nvml_power_limit); - hcfree (hwmon_ctx->od_power_control_status); hcfree (hwmon_ctx->od_clock_mem_status); hcfree (hwmon_ctx->hm_device); diff --git a/src/induct.c b/src/induct.c index ba02be91d..a6e5e070a 100644 --- a/src/induct.c +++ b/src/induct.c @@ -13,14 +13,14 @@ static int sort_by_mtime (const void *p1, const void *p2) { - const char **f1 = (const char **) p1; - const char **f2 = (const char **) p2; + const char* const *f1 = (const char* const *) p1; + const char* const *f2 = (const char* const *) p2; - hc_stat_t s1; - hc_stat_t s2; + struct stat s1; + struct stat s2; - const int rc1 = hc_stat (*f1, &s1); - const int rc2 = hc_stat (*f2, &s2); + const int rc1 = stat (*f1, &s1); + const int rc2 = stat (*f2, &s2); if (rc1 < rc2) return 1; if (rc1 > rc2) return -1; @@ -69,7 +69,7 @@ int induct_ctx_init (hashcat_ctx_t *hashcat_ctx) { char *root_directory_mv; - hc_asprintf (&root_directory_mv, "%s/%s.induct.%d", folder_config->session_dir, user_options->session, (int) hc_time (NULL)); + hc_asprintf (&root_directory_mv, "%s/%s.induct.%d", folder_config->session_dir, user_options->session, (int) time (NULL)); if (rename (root_directory, root_directory_mv) != 0) { diff --git a/src/interface.c b/src/interface.c index 1c6f754cd..821941e91 100644 --- a/src/interface.c +++ b/src/interface.c @@ -23,626 +23,645 @@ #include "interface.h" #include "ext_lzma.h" -static char ST_PASS_HASHCAT_PLAIN[] = "hashcat"; -static char ST_PASS_HASHCAT_EXCL[] = "hashcat!"; -static char ST_PASS_HASHCAT_EXCL3[] = "hashcat!!!"; -static char ST_PASS_HASHCAT_ONE[] = "hashcat1"; -static char ST_PASS_HASHCAT_ONET3[] = "hashcat1hashcat1hashcat1"; -static char ST_PASS_HEX_02501[] = "d57c2900bd83d5098003bf803ad7e204260a84ac164f12e03552d92280a6943e"; -static char ST_PASS_BIN_09710[] = "\x91\xb2\xe0\x62\xb9"; -static char ST_PASS_BIN_09810[] = "\xb8\xf6\x36\x19\xca"; -static char ST_PASS_BIN_10410[] = "\x6a\x8a\xed\xcc\xb7"; +static const char *ST_PASS_HASHCAT_PLAIN = "hashcat"; +static const char *ST_PASS_HASHCAT_EXCL = "hashcat!"; +static const char *ST_PASS_HASHCAT_EXCL3 = "hashcat!!!"; +static const char *ST_PASS_HASHCAT_ONE = "hashcat1"; +static const char *ST_PASS_HASHCAT_ONET3 = "hashcat1hashcat1hashcat1"; +static const char *ST_PASS_HEX_02501 = "d57c2900bd83d5098003bf803ad7e204260a84ac164f12e03552d92280a6943e"; +static const char *ST_PASS_BIN_09710 = "\x91\xb2\xe0\x62\xb9"; +static const char *ST_PASS_BIN_09810 = "\xb8\xf6\x36\x19\xca"; +static const char *ST_PASS_BIN_10410 = "\x6a\x8a\xed\xcc\xb7"; /** * Missing self-test hashes: * * ST_HASH_01500 the self-test can't work because the salt is part of the code at compile-time + * ST_HASH_08900 the self-test can't work because the scrypt settings is part of the code at compile-time * ST_HASH_1374x missing example hash * ST_HASH_1376x missing example hash * ST_HASH_14600 multi-hash-mode algorithm, unlikely to match self-test hash settings + * ST_HASH_15700 the self-test is disabled, because the original scrypt settings would create a too long startup time + * ST_HASH_16500 multi-hash-mode algorithm, unlikely to match self-test hash settings */ -static char ST_HASH_00000[] = "8743b52063cd84097a65d1633f5c74f5"; -static char ST_HASH_00010[] = "3d83c8e717ff0e7ecfe187f088d69954:343141"; -static char ST_HASH_00011[] = "8368ba576d44779d4ca110c234fbfd32:22868223712338656660744185004422"; -static char ST_HASH_00012[] = "93a8cf6a7d43e3b5bcd2dc6abb3e02c6:27032153220030464358344758762807"; -static char ST_HASH_00020[] = "57ab8499d08c59a7211c77f557bf9425:4247"; -static char ST_HASH_00021[] = "e983672a03adcc9767b24584338eb378:00"; -static char ST_HASH_00022[] = "nKjiFErqK7TPcZdFZsZMNWPtw4Pv8n:26506173"; -static char ST_HASH_00023[] = "d04d74780881019341915c70d914db29:0675841"; -static char ST_HASH_00030[] = "1169500a7dfece72e1f7fc9c9410867a:687430237020"; -static char ST_HASH_00040[] = "23a8a90599fc5d0d15265d4d3b565f6e:58802707"; -static char ST_HASH_00050[] = "e28e4e37e972a945e464b5226053bac0:40"; -static char ST_HASH_00060[] = "7f51edecfa6fb401a0b5e63d33fc8c0e:84143"; -static char ST_HASH_00100[] = "b89eaac7e61417341b710b727768294d0e6a277b"; -static char ST_HASH_00101[] = "{SHA}uJ6qx+YUFzQbcQtyd2gpTQ5qJ3s="; -static char ST_HASH_00110[] = "848952984db93bdd2d0151d4ecca6ea44fcf49e3:30007548152"; -static char ST_HASH_00111[] = "{SSHA}FLzWcQqyle6Mo7NvrwXCMAmRzXQxNjYxMTYzNw=="; -static char ST_HASH_00112[] = "63ec5f6113843f5d229e2d49c068d983a9670d02:57677783202322766743"; -static char ST_HASH_00120[] = "a428863972744b16afef28e0087fc094b44bb7b1:465727565"; -static char ST_HASH_00121[] = "d27c0a627a45db487af161fcc3a4005d88eb8a1f:25551135"; -static char ST_HASH_00122[] = "86586886b8bd3c379d2e176243a7225e6aae969d293fe9a9"; -static char ST_HASH_00124[] = "sha1$fe76b$02d5916550edf7fc8c886f044887f4b1abf9b013"; -static char ST_HASH_00125[] = "83377286015bcebb857b23b94331e2b316b6ecbe9fbf26c4fc"; -static char ST_HASH_00130[] = "0a9e4591f539a77cd3af67bae207d250bc86bac6:23240710432"; -static char ST_HASH_00131[] = "0x0100778883860000000000000000000000000000000000000000eda3604e067a06f2732b05b9cb90b8a710996939"; -static char ST_HASH_00132[] = "0x010045083578bf13a6e30ca29c40e540813772754d54a5ffd325"; -static char ST_HASH_00133[] = "uXmFVrdBvv293L9kDR3VnRmx4ZM="; -static char ST_HASH_00140[] = "03b83421e2aa6d872d1f8dee001dc226ef01722b:818436"; -static char ST_HASH_00141[] = "$episerver$*0*MjEwNA==*ZUgAmuaYTqAvisD0A427FA3oaWU"; -static char ST_HASH_00150[] = "02b256705348a28b1d6c0f063907979f7e0c82f8:10323"; -static char ST_HASH_00160[] = "8d7cb4d4a27a438059bb83a34d1e6cc439669168:2134817"; -static char ST_HASH_00200[] = "7196759210defdc0"; -static char ST_HASH_00300[] = "fcf7c1b8749cf99d88e5f34271d636178fb5d130"; -static char ST_HASH_00400[] = "$P$946647711V1klyitUYhtB8Yw5DMA/w."; -static char ST_HASH_00500[] = "$1$38652870$DUjsu4TTlTsOe/xxZ05uf/"; -static char ST_HASH_00501[] = "3u+UR6n8AgABAAAAHxxdXKmiOmUoqKnZlf8lTOhlPYy93EAkbPfs5+49YLFd/B1+omSKbW7DoqNM40/EeVnwJ8kYoXv9zy9D5C5m5A=="; -static char ST_HASH_00600[] = "$BLAKE2$296c269e70ac5f0095e6fb47693480f0f7b97ccd0307f5c3bfa4df8f5ca5c9308a0e7108e80a0a9c0ebb715e8b7109b072046c6cd5e155b4cfd2f27216283b1e"; -static char ST_HASH_00900[] = "afe04867ec7a3845145579a95f72eca7"; -static char ST_HASH_01000[] = "b4b9b02e6f09a9bd760f388b67351e2b"; -static char ST_HASH_01100[] = "c896b3c6963e03c86ade3a38370bbb09:54161084332"; -static char ST_HASH_01300[] = "e4fa1555ad877bf0ec455483371867200eee89550a93eff2f95a6198"; -static char ST_HASH_01400[] = "127e6fbfe24a750e72930c220a8e138275656b8e5d8f48a98c3c92df2caba935"; -static char ST_HASH_01410[] = "5bb7456f43e3610363f68ad6de82b8b96f3fc9ad24e9d1f1f8d8bd89638db7c0:12480864321"; -static char ST_HASH_01411[] = "{SSHA256}L5Wk0zPY2lmoR5pH20zngq37KkxFwgTquEhx95rxfVk3Ng=="; -static char ST_HASH_01420[] = "816d1ded1d621873595048912ea3405d9d42afd3b57665d9f5a2db4d89720854:36176620"; -static char ST_HASH_01421[] = "8fe7ca27a17adc337cd892b1d959b4e487b8f0ef09e32214f44fb1b07e461c532e9ec3"; -static char ST_HASH_01430[] = "b2d0db162e30dfef1bfd606689a3acbc213c47ef3fd11968394191886075249d:32002"; -static char ST_HASH_01440[] = "84ebe1bc3d59919a8c4f9337d66bd163661586c828b24b8067a27a6dc4228c64:05662"; -static char ST_HASH_01441[] = "$episerver$*1*NDg1NTIz*8BFCg/YJBAuZs/wjbH3OWKe69BLr5Lao26ybpnD48Zk"; -static char ST_HASH_01450[] = "b435ffbacea34d5eb0dbc4d69a92f0152f2cf4cd364d34c2ece322ca22d8b334:21217"; -static char ST_HASH_01460[] = "8b9472281c36c3a693703de0e0f1ffab8fc0ecdd3bc5ead04c76dd74ef431e49:70108387805"; -//static char ST_HASH_01500[] = "8133vc.5rieNk"; -static char ST_HASH_01600[] = "$apr1$62722340$zGjeAwVP2KwY6MtumUI1N/"; -static char ST_HASH_01700[] = "82a9dda829eb7f8ffe9fbe49e45d47d2dad9664fbb7adf72492e3c81ebd3e29134d9bc12212bf83c6840f10e8246b9db54a4859b7ccd0123d86e5872c1e5082f"; -static char ST_HASH_01710[] = "3f749c84d00c6f94a6651b5c195c71dacae08f3cea6fed760232856cef701f7bf60d7f38a587f69f159d4e4cbe00435aeb9c8c0a4927b252d76a744e16e87e91:388026522082"; -static char ST_HASH_01711[] = "{SSHA512}Bz8w5q6qEtB1Nnc8b1jfTvTXVTwohWag33oghQGOtLChnkZTw/cuJaHQlLJEI3AWKZGCRyLA6Phujdxo+is7AjA2MDcyNjY1Mg=="; -static char ST_HASH_01720[] = "efc5dd0e4145970917abdc311e1d4e23ba0afa9426d960cb28569f4d585cb031af5c936f57fbcb0a08368a1b302573cf582100d40bd7c632f3d8aecd1a1a8eb1:812"; -static char ST_HASH_01730[] = "eefb67342d62a5d8ac84e8ae89d0f157f03749bd0427c80637003a4760feefdb36cbe11ba35ab2015b3691e2e83803178c986aa85f29e6f56938b469a31ccd7a:6576666"; -static char ST_HASH_01740[] = "ce77bf8a8ca9b9cf0ed67edde58ed7fafd4542ce1378fc8bd87b05656ebf92e5711517d5930c18de93a71990e77e1037423e5b64c2f293be7d859d7b6921622e:1512373"; -static char ST_HASH_01722[] = "07543781b07e905f6f947db8ae305c248b9e12f509b41097e852e2f450e824790e677ea7397b8a9a552b1c19ecf6a6e1dd3844fa5ee5db23976962859676f7d2fb85ca94"; -static char ST_HASH_01731[] = "0x02003788006711b2e74e7d8cb4be96b1d187c962c5591a02d5a6ae81b3a4a094b26b7877958b26733e45016d929a756ed30d0a5ee65d3ce1970f9b7bf946e705c595f07625b1"; -static char ST_HASH_01750[] = "138c00f17a1a0363f274817c91118f019aff09f937bfdaea844280a0c0e7811267cc4735d967d8640eed1218268c1c4a76fec8f7aa551491b353829f3a654270:885142"; -static char ST_HASH_01760[] = "7d02921299935179d509e6dd4f3d0f2944e3451ea9de3af16baead6a7297e5653577d2473a0fff743d9fe78a89bd49296114319989dc7e7870fc7f62bc96accb:114"; -static char ST_HASH_01800[] = "$6$72820166$U4DVzpcYxgw7MVVDGGvB2/H5lRistD5.Ah4upwENR5UtffLR4X4SxSzfREv8z6wVl0jRFX40/KnYVvK4829kD1"; -static char ST_HASH_02100[] = "$DCC2$10240#6848#e2829c8af2232fa53797e2f0e35e4626"; -static char ST_HASH_02400[] = "dRRVnUmUHXOTt9nk"; -static char ST_HASH_02500[] = "4843505804000000000235380000000000000000000000000000000000000000000000000000000000000151aecc428f182acefbd1a9e62d369a079265784da83ba4cf88375c44c830e6e5aa5d6faf352aa496a9ee129fb8292f7435df5420b823a1cd402aed449cced04f552c5b5acfebf06ae96a09c96d9a01c443a17aa62258c4f651a68aa67b0001030077fe010900200000000000000001a4cf88375c44c830e6e5aa5d6faf352aa496a9ee129fb8292f7435df5420b8230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018dd160050f20101000050f20201000050f20201000050f20200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; -static char ST_HASH_02501[] = "48435058040000000013303638353333303430353632363637323238330000000000000000000000000002aa8c03531d05376358e25a5248ba2b45e2a2c5d4cf88d71258a797ac501653bbbb4512d8f1ab32584641df9e40e098c5df48acc3baa9ba60ea99968f9377d8a596d33fd762366677b37683fc00693899edc9569c284cbe15c570f56379000103007501010a00000000000000000001d71258a797ac501653bbbb4512d8f1ab32584641df9e40e098c5df48acc3baa9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001630140100000fac040100000fac040100000fac020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; -static char ST_HASH_02410[] = "YjDBNr.A0AN7DA8s:4684"; -static char ST_HASH_02600[] = "a936af92b0ae20b1ff6c3347a72e5fbe"; -static char ST_HASH_02611[] = "28f9975808ae2bdc5847b1cda26033ea:308"; -static char ST_HASH_02612[] = "$PHPS$30353031383437363132$f02b0b2f25e5754edb04522c346ba243"; -static char ST_HASH_02711[] = "0844fbb2fdeda31884a7a45ec2010bb6:324410183853308365427804872426"; -static char ST_HASH_02811[] = "022f7e02b3314f7d0968f73c00ba759f:67588"; -static char ST_HASH_03000[] = "299bd128c1101fd6"; -static char ST_HASH_03100[] = "792FCB0AE31D8489:7284616727"; -static char ST_HASH_03200[] = "$2a$05$MBCzKhG1KhezLh.0LRa0Kuw12nLJtpHy6DIaU.JAnqJUDYspHC.Ou"; -static char ST_HASH_03710[] = "a3aa0ae2b4a102a9974cdf40edeabee0:242812778074"; -static char ST_HASH_03711[] = "$B$2152187716$8c8b39c3602b194eeeb6cac78eea2742"; -static char ST_HASH_03800[] = "78274b1105fb8a7c415b43ffe35ec4a9:6"; -static char ST_HASH_03910[] = "d8281daba5da597503d12fe31808b4a7:283053"; -static char ST_HASH_04010[] = "82422514daaa8253be0aa43f3e263af5:7530326651137"; -static char ST_HASH_04110[] = "45b1005214e2d9472a7ad681578b2438:64268771004"; -static char ST_HASH_04300[] = "b8c385461bb9f9d733d3af832cf60b27"; -static char ST_HASH_04400[] = "288496df99b33f8f75a7ce4837d1b480"; -static char ST_HASH_04500[] = "3db9184f5da4e463832b086211af8d2314919951"; -static char ST_HASH_04520[] = "59b80a295392eedb677ca377ad7bf3487928df96:136472340404074825440760227553028141804855170538"; -static char ST_HASH_04521[] = "c18e826af2a78c7b9b7261452613233417e65817:28246535720688452723483475753333"; -static char ST_HASH_04522[] = "9038129c474caa3f0de56f38db84033d0fe1d4b8:365563602032"; -static char ST_HASH_04700[] = "92d85978d884eb1d99a51652b1139c8279fa8663"; -static char ST_HASH_04800[] = "aa4aaa1d52319525023c06a4873f4c51:35343534373533343633383832343736:dc"; -static char ST_HASH_04900[] = "75d280ca9a0c2ee18729603104ead576d9ca6285:347070"; -static char ST_HASH_05000[] = "203f88777f18bb4ee1226627b547808f38d90d3e106262b5de9ca943b57137b6"; -static char ST_HASH_05100[] = "8743b52063cd8409"; -static char ST_HASH_05200[] = "50575333e4e2a590a5e5c8269f57ec04a8a1c0c03da55b311c51236dab8c6b96b0afca02000800005eaeee20c6cc10d5caa6522b3ca545c41d9133d630ca08f467b7aae8a2bbef51aa2df968d10b9c4cfb17a182c0add7acb8c153794f51337e12f472f451d10e6dcac664ed760606aabdbb6b794a80d6ce2a330100c76de0ff961a45cca21576b893d826c52f272b97cdf48aca6fbe6c74b039f81c61b7d632fb6fddd9f96162ab1effd69a4598a331e855e38792e5365272d4791bf991d248e1585a9ad20ea3d77b5d2ef9a711ef90a70ec6991cb578f1b8bdaa9efa7b0039e9ea96f777491713047bdd99fa1d78f06f23406a66046b387d3034e46b1f84129bba853cc18fa49f107dc0290547258d30566a4b1b363ff4c1c16cb2f5f400059833d4b651bfa508200cbdc7a75fc57ef90eb1d90b0deea8505753332d454f46505753332d454f466236710e2e2477878e738b60d0aa2834a96b01e97764fe980243a06ad16939d1"; -static char ST_HASH_05300[] = "50503326cac6e4bd892b8257805b5a59a285f464ad3f63dc01bd0335f8341ef52e00be0b8cb205422a3788f021e4e6e8ccbe34784bc85abe42f62545bac64888426a2f1264fa28cf384ff00b14cfa5eff562dda4fad2a31fd7a6715218cff959916deed856feea5bee2e773241c5fbebf202958f0ce0c432955e0f1f6d1259da:688a7bfa8d5819630a970ed6d27018021a15fbb3e2fdcc36ce9b563d8ff95f510c4b3236c014d1cde9c2f1a999b121bc3ab1bc8049c8ac1e8c167a84f53c867492723eb01ab4b38074b38f4297d6fea8f44e01ea828fce33c433430938b1551f60673ce8088e7d2f41e3b49315344046fefee1e3860064331417562761db3ba4:c66606d691eaade4:8bdc88a2cdb4a1cf:c3b13137fae9f66684d98709939e5c3454ee31a98c80a1c76427d805b5dea866eff045515e8fb42dd259b9448caba9d937f4b3b75ec1b092a92232b4c8c1e70a60a52076e907f887b731d0f66e19e09b535238169c74c04a4b393f9b815c54eef4558cd8a22c9018bb4f24ee6db0e32979f9a353361cdba948f9027551ee40b1c96ba81c28aa3e1a0fac105dc469efa83f6d3ee281b945c6fa8b4677bac26dda:53f757c5b08afad6:aa02d9289e1702e5d7ed1e4ebf35ab31c2688e00:aab8580015cf545ac0b7291d15a4f2c79e06defd:944a0df3939f3bd281c9d05fbc0e3d30"; -static char ST_HASH_05400[] = "266b43c54636c062b6696b71f24b30999c98bd4c3ba57e2de56a7ae50bb17ebcbca1abcd33e9ad466d4df6e6f2a407600f0c5a983f79d493b0a3694080a81143d4bac7a8b7b008ae5364a04688b3cfae44824885ca96ade1e395936567ecad519b502c3a786c72847f79c67b777feb8ba4f747303eb985709e92b3a5634f6513:60f861c6209c9c996ac0dcb49d6f6809faaaf0e8eb8041fe603a918170a801e94ab8ab10c5906d850f4282c0668029fa69dbc8576f7d86633dc2b21f0d79aa06342b02a4d2732841cd3266b84a7eb49ac489b307ba55562a17741142bac7712025f0a8cad59b11f19d9b756ce998176fd6b063df556957b257b3645549a138c2:f4dd079ed2b60e77:f1f8da1f38f76923:fd862602549f6949b33870f186d96cb8926a19d78442c02af823460740be719eba41a79388aeefb072e1ec7cb46b2f0b72e21fb30bd3a6568d2b041af7f9dc0c9cce27ed577e5aabb9ab6c405f1c4b189adbee8c9fb6abf4788b63a3ae05a02c192187b9d7246efe5e46db9b01bf8f4be05f7599ae52bf137743e41d90dceb85bd6ae07397dcc168bbc904adfebb08e6bc67e653edeee97a7e4ab9dab5e63fec:56e3f0d49ea70514:e754055008febe970053d795d26bfe609f42eda8:0c3283efd6396e7a2ecb008e1933fccb694a4ac0:8f79167724f4bdb2d76ee5d5e502b665e3445ea6"; -static char ST_HASH_05500[] = "::5V4T:ada06359242920a500000000000000000000000000000000:0556d5297b5daa70eaffde82ef99293a3f3bb59b7c9704ea:9c23f6c094853920"; -static char ST_HASH_05600[] = "0UL5G37JOI0SX::6VB1IS0KA74:ebe1afa18b7fbfa6:aab8bf8675658dd2a939458a1077ba08:010100000000000031c8aa092510945398b9f7b7dde1a9fb00000000f7876f2b04b700"; -static char ST_HASH_05700[] = "2btjjy78REtmYkkW0csHUbJZOstRXoWdX1mGrmmfeHI"; -static char ST_HASH_05800[] = "3edde1eb9e6679ccbc1ff3c417e8a475a2d2e279:7724368582277760"; -static char ST_HASH_06000[] = "012cb9b334ec1aeb71a9c8ce85586082467f7eb6"; -static char ST_HASH_06100[] = "7ca8eaaaa15eaa4c038b4c47b9313e92da827c06940e69947f85bc0fbef3eb8fd254da220ad9e208b6b28f6bb9be31dd760f1fdb26112d83f87d96b416a4d258"; -static char ST_HASH_06211[] = "87914967f14737a67fb460f27b8aeb81de2b41bf2740b3dd78784e02763951daa47c7ca235e75c22ec8d959d6b67f7eedefad61e6a0d038079d3721a8e7215e415671e8c7b3dbed6453a114e6db89a52be9a9c1698a9c698f1e37f80d7afaf0efba82b6e5f5df32bd289b95343c6775e2c7f025ef1d8bfae84042a92546e15b635b5fade3aef6ee52a7a5ab018d33ea98bc115dfc62af606187fbab8cbda6e8417402c722ca8c2b07e6ca6a33bf94b2ce2a819a9f8cfaa5af70e3af6e5350d3a306f036f13ff5ba97d5728d5f6413b482c74f528211ae77b6c169215c5487d5a3ce23736b16996b86c71b12d120df28ef322f5143d9a258d0ae7aaa8c193a6dcb5bf18e3c57b5474d24b843f8dd4e83a74109396ddb4f0c50d3657a7eacc8828568e51202de48cd2dfe5acbe3d8840ade1ce44b716d5c0008f2b21b9981353cb12b8af2592a5ab744ae83623349f551acf371c81f86d17a8422654989f078179b2386e2aa8375853a1802cd8bc5d41ce45795f78b80e69fcfa3d14cf9127c3a33fa2dc76ad73960fb7bce15dd489e0b6eca7beed3733887cd5e6f3939a015d4d449185060b2f3bbad46e46d417b8f0830e91edd5ebc17cd5a99316792a36afd83fa1edc55da25518c8e7ff61e201976fa2c5fc9969e05cbee0dce7a0ef876b7340bbe8937c9d9c8248f0e0eae705fe7e1d2da48902f4f3e27d2cf532b7021e18"; -static char ST_HASH_06212[] = "d6e1644acd373e6fdb8ccaaeab0c400d22eaa0b02e2a6649e065ad50f91e2f81fc5e1600d1cdf3b4ee72a7326a9a28d336ec65adf2d54661e1a609dd9941279fd64a9c513dfb0192734fc1e1014cdd0a399e89a0860c4077463c18609f5218254edd998adb11a02271723d1aa094550df385dd8e080cb42ed1349f69c0a6bad4b37e6dab1effbe0095471a8d640679422fe1533a21f10cb6d15e5ee8cde78e677acf3d09d008e9fbf57f09c1c57f19e51ff54631e0e2adc2ee2832425c1ec718d96a17df7e55aceffb7b23a1872f32795d4491c739e21b01e19a1b7dfcb22709c9d9302154462664a668ea635664df65804bf680ff07026d6f5b225762a3a270df832d47e7feb6277a228454a3ba9b5bbade23ecaec0eaf31ad1dbac31754c970a212bd44c9278bc6076f096a2eed602e04a70c6f7fa94ef4e75299692e5dcc6f1a7e6032b9b765e9e61faeed3f9efacc0a15b1817e74d48ec11a13d15811c7e2c4d12f36d35a04131d02f14184fc15bc20e79115dc7c980b681a19a225964469787df481b68a8f722f2bd3115dbbcb3c8ac1b07d742f78f30635dea29dfb1db83e89fc85a30b0379fc8aa69a4ea94c99052685d38c9559a1246284cdc32c5110eb8c6741352cd42e09e6389d4765c58aa84d51867cf86fba69d29eac1cd7fac2f36603d2fb2af146c5d4c2bedb4f6c6d0f387f0a8d635e33384df60f8d2415b"; -static char ST_HASH_06213[] = "3916e924d246e5ceb17b140211fff57b67150b3dee53fa475261d465b0ee3e56ee820e6ba3958d84c61508f028b2a112e9005877784e07deddcf310d01ba81710b620533790456d20d17c8fda84f9d93bbfe41509b931a417b82d68ed9b0bc9641b79a5bf8f71bcdbba979dfb7566a5b8ccc221f80722c1ce7ec81be4a8c880b1b057e681c187504eabf4eea32f7b81383defd4616618a99852d1678a6520883c8f3564e6dcf874150a060b9a44748d97f95b223b089ac847e31fb5a2db3656d7b57decff65e2c5c9af5bdece7a1845caa9df805fc1f7e56bf545d854beec27a9640bf1697c195e5f95b82c20d76c5a56ff4283219caa5a618e8caace9d0fcde0df6ee6e043ccbc78fd06a602cc638f7ae4675063b840ee08ffa9e143553bffd20126fa30f95e013aabf103f12c3ceeb284c80dc335fe2e78580d6ddfa80511aba9db7c93838cae0db40b9dbeccbf9d160032d334a9c35156721c746b51131baf6855fdfc1edee3099b8e4abc619e1c60e3ce68615e1eb42bd8d338046f7c854a60defe395e0d7168786a3035c9735cd42433dd0c46dcf8b5cb2c28905df80476561e55d6310b25f74d78b651ccd3484332c59a6ad490e29ea267db5ce4a47c9dcde39f420ba0755ea7e5583a3a562925acaa125d5056795b98135825232aa543a460137cc84235b85dd44d65e01e6eb1ade1b970f3ffe2b9762f5a7f261037e"; -static char ST_HASH_06221[] = "5ebff6b4050aaa3374f9946166a9c4134dd3ec0df1176da2fb103909d20e8b3c9b95cbbd6d1a7ad05411a1443ad6254e059e924d78bab6a0463e71cf7c3109b7ef4e837bf6d7a548dd8333c451b59d1132098f44c6ff19c6cb921b1de3bd0aa675e0478a05f90204d46a5d6ff598bfa40370ac8795928a6d2e0f1347696e3cfa329738170fe54298981d84f40c63d1a338c5db62679338e849124a28a79a8e505bb89a4673f0457b2737a00b908116310281b5b2eb66c6fda5599196b313d51ef26201335d715c18f6b128454a5601671e619bdcce8e54acb47d498c4161614a05063bff5497a4a3d99bff1fce2a163727af2fe9ae7512461b9dcebf3a4f1031d6235d8ce09b734294d0cedc04eafc6295f212b1b080e7b9745580d0dd18e99cfd95afef982762d5aabeaa2d3a928dcf36322cc06b07fd719c88e0b9a2625a94a77502d4bd40a85ba138cbd0cf9561aa395dc552801f68cce16e5484a672aa5b78665dc531ab1e3e728185929dc443b7f4c8a5cb687c6589bb3f4ddc2a8639d959b839b0813d50e7711b761622c3693a92e540e4f932c6c89bf4e1bff1d69151848c3d01b2f6aba52b58e5b393f6cd58ff0d2e040b1205b042b5a28d5b12cb0cc95fa32f1bcdebd4c82d889a5d87c45dcfd34e80b19bf7be35696e0fa0cbd9338b314de24c1ee7bbc0a3b6824f86af2aa5d127d21444985ff566e921431938f6"; -static char ST_HASH_06222[] = "9f207bec0eded18a1b2e324d4f05d2f33f0bd1aeb43db65d33242fa48ac960fad4c14d04c553e06ad47e7e394d16e0a6544d35fb0b2415bd060bc5f537e42a58b1681e991e2ec0b5773f6e8e5766e5fcc7335b19dd068d1f20260085ecda8eba366ff1521997c5654630ef09ba421b871a3dc66aa0dd5eba8a3bc7052398a7ad779506d86cbf687e76cd9dc50969e222820d2f905c0550995a9c068725bb6c8b04358c965ab77221fdfd829e57ce54cac6e2fa62db15043d720b72fa8962dd718a0b42c34577af9cb4a5ed04c1ae17b7af470c0d8b77987dc9e2d2593a52458c4acb83b628b1488371de85f78a2e25aeaebc18d20a8c3007d08949e93b80087707afd1fe4e07a0afee4244e5270f768e234b86852aa1556c53ffc0d6f60661369a484d55d063119e71e70af1ec775908466cac7b12bc22e1a9525c2bfa9f83f7901c8e0a1d56387ef65040b750656b0b75791738b5b7e453f24167eae56c057c94e1e4cf1a0d08894225f11b45bc31827cad1dfe62e148549385953aa16a0410dba231aace3a7b9fd9b1c2b930f01193377b59736d8a8959ca5b449655f79a4dbec0da566083f90caa2490b01a10c0a86dd4aaa719bdc1e4233db17217f03509cc20dab7246730e3f964944990690b6dcc84936e1dd487bd154ceefe58a838a0488cc93b854a112ea67f6802d2f409915e648ee5cf5fdc3c12e41acbfab7caa9"; -static char ST_HASH_06223[] = "721a7f40d2b88de8e11f1a203b04ffa97a1f5671623c6783f984cc7c55e04665f95a7f3fd52f402898aaaed68d048cc4c4fabf81c26832b589687dad082f3e4e0f23c7caba28118f21a4cbb8f32b25914ff4022e7c4c8cdd45411801c7c6bde4033badbdcb82f96c77b42025d13fa71415b3278138100ea58ee4476c81ce66f78e89c59ac22cf454684ea7e8c3900374662f23c9491891b60ed7ce8231a7ac5710ee87b51a3f7bd9566a60dc6e7e701c41f3810d7977314b321e8194349909f2ca458a976851d854eaeb934c8df2b5e063d416d3d7c464e28173a0bbba88ec75cf8fe68f21067739b2473bd804fd710de1e4d3ae9451b374edcfd8e3cd613b23aeae272e0923007482dac26a7532ab09af8aad57cd7f1c451bc260cc912d5830cb0d5332f792519e009ed5450171434e5f0f2ba9e003676933a86d83c766419fac98a7ee232eeb593d1686528fab576d5f393d82f9602bcd65975153df205b6d1bc50dacad2ea5bb184696f978efd2b1c1656bf87e03a28a536c48320c430d407ff6c2fc6e7d4ae7b115e79fd0a88df08eca4743178c7c216f35035596a90b0f0fe9c173c7d0e3d76c33a8fce1f5b9b37674bd12e93fb714c9cbba6768c101b5db8f8fd137144453f00dccc7b66911a0a8d87b198807f30be6619400331c5746d481df7ad47a1f867c07f7b8cd296a0c5e03a121c1a7a60b4f768bea49799d2f"; -static char ST_HASH_06231[] = "cf53d4153414b63285e701e52c2d99e148c6ccc4508132f82cb41862d0a0ac9ea16274285ac261c339c1508eec9fea54c33e382458662913678f2a88a84959a678e238973985ec670d50252677430587ee28b72bfa5edfb2f79c40b734ba8a54a3662642a6ab067e75f41154688ad4adb5d6decd891462dd537188195a51e06fa5baf22b69d0f472cfeeae77ab9a90091731863af1d8b5b380da179fa7d5227ef031732b1ae06e0fe34c0b28b7a64eac34e5a08e09d7001394b3afc804ac69bf819cdd2d383fe96a721f7c683628da8e529d84bdaa68d702573d8f7ef26f75d1bd5c91efa88cb33b1e9c006b87981c55ed3b8063ab7068f8e99b128bc56ea3e883efa55d6f340b2681e50405d91f5f6d76cdbeac404944164d329d3ee01311de0bc6547310f126b5a4c0e9fb74825f91faefa60b7ac828819d4544c1872ff5041e61d5cf093553f427358b2181046376d7b876e1bccf0774d5d251b7c922c214bb5c70c715165d028e1dca73e7adeca3396d77f6e597a10dd4c58f37fdbbdc1d04cd8890ba4c5025776a88a349bb925add13193becf1ca10fe32536db0c0b06a1ef799fb692e304b3716ca5a8a80859c4012ca3e06701b46b5a32f4d10e285a0cdaf6c24e0d98139e7f306e52503c9b503aa28f1fbbb236284907068074fcb3e267e3c4aab2bd3b79b24a7a08106bb55850fa2bb8e2f6d9919a6743cb822c164"; -static char ST_HASH_06232[] = "e9e503972b72dee996b0bfced2df003a54b42399e3586520cf1f69475ba32aff564e40e604a505af95ce15220f558ae815e94ce4953882a8299ee3fffb12e9bd62bf8e2c41c0a8337ce20d45715440cc83e394200d351c5b04be5b70fa11b8467320a091a1d703c88cc7b26fd114795c04a973b3266ba97f55d4b4e4771bb1b4a6aabc9d57e03f0ae7c8a77dfc3d37078efba45031e7d63bb514726e2f2dc6da8cce167a17e36b32c326a5bcaa2c4b445f6e10e1f899a9adcc2a698769f900b7909f7aec52fc9862d75286ffda67933f9c52e5c681d590ad0329b85f8db0f6bb6daa3b2d55b62c65da37e3e7fcb99954e0abe20c39724e8fb2c7f839ec67d35f151dfd8c4dd4bc8dc4393fab291efa08cc0099277d219a0ba4c6272af3684d8043ed3f502b98e196dc7aa0291627613179199976f28eff08649acf70aa0c0dc5896ed13eb18ea28fdd6c460a9c7cfedeab5ac80a3c195226cfca094a7590fa2ae5ed2133ba09b5466b2049b6291f8dcf345e5718a4c0ef3f9c8d8e07d0e5dddd07452b533fbf243ef063fb6d26759ae725d8ca430f8cf17b86665d23bdff1c9dbdfe601b88e87cb7c89f23abc4a8bb1f0b7375cc29b1d81c950ffe92e16e2080e1d6270bbb3ba753322d2b623caed87213e552c33e699d4010f0f61df2b7f460d7cd82e70a711388f1c0b591d424259d3de8b3628daf62c6c5b71864eb0e7d31"; -static char ST_HASH_06233[] = "de7d6725cc4c910a7e96307df69d41335e64d17b4425ca5bf1730f27820f92df9f20f3e855d8566eb5255927153f987348789666c8e563e366a09e68a8126b11c25ac817b2706dde5cec3946e64332b21b41b928985c1a637559ead5b4fecac74ff0d625ef6d8be93dea3eaca05394f23ee9e079d3504a77b4c0b22d3cfcafa9c670966bfa3a5f30539250d97267a9e56b5a1437b1fd2ce58f4ab78b52ba61d01c28d7a6b726d92c8819711c70f820690cf2b9bbef75f196ba87fb5f72a29e213096a8be3b6e6d0ff3dc22563dc9e7d95be68ad169c233289fccfdc2f5528c658cb178b4e78d54e96cb452859b01dd756ca0245bdd586fb450e84988071428c80af0a6dc5f16dea8094da3acb51ac5d2a710414256b2423e0333584437ea9a65a07f06bd241103a478d137e9a274a78a19d3ca121f1bc10e4c9e5fc277d23107db1fb447f71ba0f92b20e3ead77cffaca25f772182705a75e500d9aab3996bfda042f4bdfe35a3a477e355c76a711ad0f64848d6144073ce6ec4152c87973fc3e69626523463812061c51f51fc08487e8a4dbae1ca7965c11f222c607688b3384c5c29d4fe91d14d2cc940a6a9d94486d1823261928d88f56fe00e206d7a31734de0217afd38afa3d2cf3499c2dcff13332a369c4b1f39867f6dfc83ec32d19b931b082f07acac7e70bdd537e8432245c11662d89ec3cc97e582de5d2cc6bde7"; -static char ST_HASH_06241[] = "2b5da9924119fde5270f712ba3c3e4974460416e8465f222149499908c2fca0a4753b581f26625d11c4d3f49bdeb1c95bc3e17629d7e19ffb66175e5feab90a4fd670194f95d578266f3f54e61b82dc00efc2bb4438e19c3f6d7a92825a7625d88ec6286ab4e1761749edc83dad4340fd167544f09913fd6b03775013ff232fc4dad6f726ef82ad4bd1c5227a7796d7db35a912beeda5b0cdd798bc34d3ac24403c87dc672a983687dd64f920c991840a56105a6311797eed9976014909700366420673f6455242c71151ac75903a353538ec24b4feb967e2b46886395cf3e934e83a6a58ef2c0180273a0c33ba2bd870b1d84afb03d5558dc17bc7fb586404ad9a7e506ed859540110c6ad73f0f1d2be47829bc666e1838ec3f1dc1f610206241ce07fbf2542ecef9348b37aa460815794ca582709697cbf0c90c3dae4cb9dd97b29d3c7d82bd8d0c81d708e74c7007468c6c55a40fd4f803a4f5a75818d7da0d1ef333b8622e7de516fa62a6fa2b8d6d5d23653dfcedffec771456ee204e5c85ee88defbe195462fbe8ce0e2a5a455dab66478b877ec37dfa66f19ab5201c56cd707ba7bee1b10360965d3868c1fdf91dda124b1b0994fee75848083d19369735905bd2864b496c6e35ecf96f6dd4728570a45746bcf8d7d0ec0b9b0b112b28fdc53efcfa7d0558c132cd683a742d62b34304d9f991029c8aedc3d8767da8c"; -static char ST_HASH_06242[] = "debcc3e74a7b2acb4c7eaa4ac86fd6431da1d9579f4f76f0b31f07b3d36e65099daca9e4ae569114b3cb6e64d707b6206a2ab6b31ab0c17b356da3719d0e2fa4058f0349763970855d4c83b02a967bb2969f1b6f3e4fdbce37c6df203efbe87bfdb5ffd8fe376e9ad61862a8f659ef0db39e06ed34c4f80aa856df2219ac6a37ebb0244445db7e412b773f4e28846c5e65129cd4f4ce76979c083f08a7c4e2be30469b8363eaf8579baa870cdcb2bdca6b60e64559cb0def242576b80722bf36eb6d94640d2937b49edf9c9af67f0172f27319448425f86831c35ae35e764b9e69fcc47a42ba7a565d682366023291b1b4cbcd1b7ba6fba75c214e5849a9ba26197f7f010f01301dcbffaa7311f2ab32c2810470d3fe873334ca578adbfd04c5a39cbd53b09755e4d868dbf8a44d76cc91031f4710b8a985c70738b443572b4745ed10e6120852870b0fdb258f0a804d679eec85b5290235c9c526165b961f17ff0fe32d9f597c8f2ab9b84f3d22fef71fec67987e687590de6ab11b33f1b06f23c38ead94c3de419061b6568612c27517b0a3395e401a2c6058fc5f41f0e084e8f2157b6486624314b1f341f74cfdec9deaed7abf89ccf97b47441493e5086f1351f42a5c0929f6431753baadcd2fb347b8835d08250743bb45aaf1c6bb30eed98e911a273074b7e8ebad2174b527b1b84e1961967bf358711346482d9db1c7"; -static char ST_HASH_06243[] = "5e6628907291b0b74a4f43a23fb0693acb71c4379c3a3cc0eafbab40036bbdadfede179e04484aca0f5b6ecf7c7e8abe61d6836be6590838b8f9027da93ba77d076b9a557c958159c5dcddfb70823b7e324bd99b40a8f39410f6afd279df3493b58b9ffce41b65f3afd2fc467f4553a946b85e6ffc74b91c9c38c689d98419339a84d3c6d116274e34482d546407006ee04af03b594998127b2a9716ca4278b1f3050d015af10a9bb11db0465373f3a786c148bb20473377d8e97264b1c4d7ec4179829ce929573b26e5987b59da8591e2dc8e3934830dd0b5ac521c8637e9bb31e4bc084d53bc6a8dc6875e857a4c8c32a577eed3c6cea5beef514160982be2c7d7e2f4d65efa3f4a0e11ac1860ff3160e7cd968e18019abfd0395080a9f8e860c627fc32c63c8b7ef46b203c63cf0f12c05ea65b1f83a5f1fc6ad6cc200a9527151c2b8016a38f1e87be9c960088eaaa98a01d9db8cdacaae26c446a846042a6c0248b666eea7a1be44dc3fc35ce100c3a3eb377e898deb097cfba9246685d7ec8527cdc5e1983c154169178e3d86cd4017606ccc42d25cbdea0aca2b1ac422372cfbb1ad2b7d465449a2c1fbbae35c8e7fdaadd683a7dc991b76aaba08b8706916924407392a2aef458c2e833290dc1ff116f3f49f918e6a133b60728ac7c464e4f3521784cf32866be32877534bb014312c4301d1740781221a5e8758ea4"; -static char ST_HASH_06300[] = "{smd5}17800721$WkGka7tXcrfpUQS6WOQyw/"; -static char ST_HASH_06400[] = "{ssha256}06$2715084824104660$1s/s4RZWEcvZ5VuWPXWGUfwSoG07eVSVce8F6ANJ.g4"; -static char ST_HASH_06500[] = "{ssha512}06$4653718755856803$O04nVHL7iU9Jguy/B3Yow.veBM52irn.038Y/Ln6AMy/BG8wbU6ozSP8/W9KDZPUbhdsbl1lf8px.vKJS1S/.."; -static char ST_HASH_06600[] = "1000:d61a54f1efdfcf57:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000afdb51c887d14df6200bbde872aabfd9e12a1f163eed40e6b3ec33ba394c47e9"; -static char ST_HASH_06700[] = "{ssha1}06$5586485655847243$V5f1Ff1y4dr7AWeVSSdv6N52..Y"; -static char ST_HASH_06800[] = "82dbb8ccc9c7ead8c38a92a6b5740f94:500:pmix@trash-mail.com"; -static char ST_HASH_06900[] = "df226c2c6dcb1d995c0299a33a084b201544293c31fc3d279530121d36bbcea9"; -static char ST_HASH_07000[] = "AK1FCIhM0IUIQVFJgcDFwLCMi7GppdwtRzMyDpFOFxdpH8="; -static char ST_HASH_07100[] = "$ml$1024$2484380731132131624506271467162123576077004878124365203837706482$89a3a979ee186c0c837ca4551f32e951e6564c7ac6798aa35baf4427fbf6bd1d630642c12cfd5c236c7b0104782237db95e895f7c0e372cd81d58f0448daf958"; -static char ST_HASH_07200[] = "grub.pbkdf2.sha512.1024.03510507805003756325721848020561235456073188241051876082416068104377357018503082587026352628170170411053726157658716047762755750.aac26b18c2b0c44bcf56514d46aabd52eea097d9c95122722087829982e9dd957b2b641cb1e015d4df16a84d0571e96cf6d3de6361431bdeed4ddb0940f2425b"; -static char ST_HASH_07300[] = "3437343735333336383831353232323433383333303236303337333338363232303135383237333638363532373231343030313131333838323734373138363632343133333335353030353633373533333133313530363533303738343334313330303630343633333237373037383537333630303233303830303437323838333237313438363238343434383831363634323431333430383735323038:f4b376e25868751fc0264f573ff1fe50b65ce5a2"; -static char ST_HASH_07400[] = "$5$7777657035274252$XftMj84MW.New1/ViLY5V4CM4Y7EBvfETaZsCW9vcJ8"; -static char ST_HASH_07500[] = "$krb5pa$23$user$realm$salt$5cbb0c882a2b26956e81644edbdb746326f4f5f0e947144fb3095dffe4b4b03e854fc1d631323632303636373330383333353630"; -static char ST_HASH_07700[] = "027642760180$77EC38630C08DF8D"; -static char ST_HASH_07800[] = "604020408266$32837BA7B97672BA4E5AC74767A4E6E1AE802651"; -static char ST_HASH_07900[] = "$S$C20340258nzjDWpoQthrdNTR02f0pmev0K/5/Nx80WSkOQcPEQRh"; -static char ST_HASH_08000[] = "0xc0071808773188715731b69bd4e310b4129913aaf657356c5bdf3c46f249ed42477b5c74af6eaac4d15a"; -static char ST_HASH_08100[] = "1130725275da09ca13254957f2314a639818d44c37ef6d558"; -static char ST_HASH_08200[] = "9b6933f4a1f65baf02737545efc8c1caee4c7a5a82ce3ab637bcc19b0b51f5c5:30b952120ca9a190ac673a5e12a358e4:40000:e29b48a8cfd216701a8ced536038d0d49cf58dd25686e02d7ba3aa0463cc369062045db9e95653ac176e2192732b49073d481c26f29e1c611c84aaba93e553a6c51d1a9f7cfce0d01e099fb19f6a412bacd8034a333f7165fda1cc89df845e019c03ac9a09bc77b26c49524ade5c5a812230322f014f058b3bb790319e4a788f917aa164e56e78941f74e9c08921144e14be9b60da1a7321a0d178a1b8c1dcf83ffcadcb1599039049650577780d6913ee924e6529401e7a65b7d71c169a107e502dbd13b6b01c58e0483afb61b926313fa4273e685dd4890218bb797fab038c6a24df90883c7acd2358908edc1f7d95ef498757a3e0659aaaf6981c744ab69254267127fc806cf3cd1ced99ab455ece06479c91c892769af5db0c0f7a70dd83e4341bf86d085bbdc6a7e195ab08fc26"; -static char ST_HASH_08300[] = "pi6a89u8tca930h8mvolklmesefc5gmn:.fnmlbsik.net:35537886:1"; -static char ST_HASH_08400[] = "7f8d1951fe48ae3266980c2979c141f60e4415e5:5037864764153886517871426607441768004150"; -static char ST_HASH_08500[] = "$racf$*8481*6095E8FCA59F8E3E"; -static char ST_HASH_08600[] = "3dd2e1e5ac03e230243d58b8c5ada076"; -static char ST_HASH_08700[] = "(GDJ0nDZI8l8RJzlRbemg)"; -static char ST_HASH_08800[] = "$fde$16$ca56e82e7b5a9c2fc1e3b5a7d671c2f9$16$7c124af19ac913be0fc137b75a34b20d$eac806ae7277c8d48243d52a8644fa57a817317bd3457f94dca727964cbc27c88296954f289597a9de3314a4e9d9f28dce70cf9ce3e1c3c0c6fc041687a0ad3cb333d4449bc9da8fcc7d5f85948a7ac3bc6d34f505e9d0d91da4396e35840bde3465ad11c5086c89ee6db68d65e47a2e5413f272caa01e02224e5ff3dc3bed3953a702e85e964e562e62f5c97a2df6c47547bfb5aeeb329ff8f9c9666724d399043fe970c8b282b45e93d008333f3b4edd5eb147bd023ed18ac1f9f75a6cd33444b507694c64e1e98a964b48c0a77276e9930250d01801813c235169a7b1952891c63ce0d462abc688bd96c0337174695a957858b4c9fd277d04abe8a0c2c5def4b352ba29410f8dbec91bcb2ca2b8faf26d44f02340b3373bc94e7487ce014e6adfbf7edfdd2057225f8aeb324c9d1be877c6ae4211ae387e07bf2a056984d2ed2815149b3e9cf9fbfae852f7dd5906c2b86e7910c0d7755ef5bcc39f0e135bf546c839693dc4af3e50b8382c7c8c754d4ee218fa85d70ee0a5707a9f827209a7ddb6c2fb9431a61c9775112cc88aa2a34f97c2f53dfce082aa0758917269a5fc30049ceab67d3efd721fee021ffca979f839b4f052e27f5c382c0dd5c02fd39fbc9b26e04bf9e051d1923eff9a7cde3244902bb8538b1b9f11631def5aad7c21d2113bcdc989b771ff6bf220f94354034dd417510117b55a669e969fc3bc6c5dcd4741b8313bf7d999dc94d4949f27eec0cd06f906c17a80d09f583a5dd601854832673b78d125a2c5ad0352932be7b93c611fee8c6049670442d8c532674f3d21d45d3d009211d2a9e6568252ac4682982172cb43e7c6b05e85851787ad90e25b77cce3f7968d455f92653a1d3790bc50e5f6e1f743ac47275ffa8e81bbe832a8d7d78d5d5a7c73f95703aebb355849ae566492093bd9cb51070f39c69bb4e22b99cc0e60e96d048385bb69f1c44a3b79547fbc19a873a632f43f05fa2d8a6f9155e59d153e2851b739c42444018b8c4e09a93be43570834667d0b5a5d2a53b1572dab3e750b3f9e641e303559bace06612fbd451a5e822201442828e79168c567a85d8c024cd8ce32bf650105b1af98cc5428675f4f4bbede37a0ef98d1533a8a6dcb27d87a2b799f18706f4677edaa0411becac4c591ede83993aedba660d1dd67f6c4a5c141ad3e6e0c77730cb0ecbf4f4bd8ef6067e05ca3bc563d9e1554a893fea0050bdd1733c883f533f87eac39cceee0ccf817fc1f19bcfdd13e9f241b89bfb149b509e9a0747658438536b6705514cc6d6bb3c64c903e4710435d8bebc35297d1ebbdff8074b203f37d1910d8b4637e4d3dab997f4aa378a7a67c79e698a11e83d0d7e759d0e7969c4f5408168b282fe28d3279ec1d4cc6f85a0f8e5d01f21c7508a69773c44167ff8d467d0801f9ec54f9ee2496d4e7e470214abc1ca11355bb18cd23273aac6b05b47f9e301b42b137a2455758c24e2716dcd2e55bbeb780f592e664e7392bf6eccb80959f24c8800816c84f2575e82e1f3559c33a5be7a3a0c843c2989f486b113d5eeada007caf6b5a0f6d71e2f5c09a4def57c7057168051868317a9ec790d570d76a0d21a45ad951c475db5a66101475871147c5a5907ec4e6b14128ed6695bb73c1c97952e96826eeb6003aa13462093e4afc209627241f03b0247e110fbab983640423b7cdf112e01579fed68c80ac7df7449d9d2114b9ae5539c03c2037be45c5f74e7357b25c6a24b7bd503864437147e50d7ac4ccc4bbd0cabecdc6bac60a362285fe450e2c2d0a446578c8880dc957e6e8061e691b83eb8062d1aad476e0c7b25e4d5454f1288686eb525f37fe649637b235b7828366b0219a9c63d6ddbb696dc3585a2ebfbd5f5e4c170d6784ab9993e15142535e194d2bee3dc9477ef8b8e1b07605e0c04f49edf6d42be3a9dabbc592dde78ce8b7dd9684bfcf4ca2f5a44b1872abe18fb6fa67a79390f273a9d12f9269389629456d71b9e7ed3447462269a849ce83e1893f253c832537f850b1acce5b11d2ba6b7c2f99e8e7c8085f390c21f69e1ce4bbf85b4e1ad86c0d6706432766978076f4cada9ca6f28d395d9cc5e74b2a6b46eb9d1de79eeecff7dc97ec2a8d8870e3894e1e4e26ccb98dd2f88c0229bbd3152fa149f0cc132561f"; -static char ST_HASH_08900[] = "SCRYPT:1024:1:1:Mzg3MjYzNzYwMzE0NDE=:uM7P3Kg2X9En9KZPv3378YablKcuUoQ1mwunXdg3o1M="; -static char ST_HASH_09000[] = "0a3f352686e5eb5be173e668a4fff5cd5df420927e1da2d5d4052340160637e3e6a5a92841a188ed240e13b919f3d91694bd4c0acba79271e9c08a83ea5ad387cbb74d5884066a1cb5a8caa80d847079168f84823847c631dbe3a834f1bc496acfebac3bff1608bf1c857717f8f428e07b5e2cb12aaeddfa83d7dcb6d840234d08b84f8ca6c6e562af73eea13148f7902bcaf0220d3e36eeeff1d37283dc421483a2791182614ebb"; -static char ST_HASH_09100[] = "(HC34tD3KtDp4oCZWmCJ4qC30mC30mC3KmC30mCcA5ovrMLH9M)"; -static char ST_HASH_09200[] = "$8$84486783037343$pYNyVrtyMalQrZLxRi7ZLQS1Fl.jkYCgASUi5P8JNb2"; -static char ST_HASH_09300[] = "$9$87023684531115$phio0TBQwaO7KZ8toQFyGFyDvyOzidaypRWN0uKX0hU"; -static char ST_HASH_09400[] = "$office$*2007*20*128*16*18410007331073848057180885845227*944c70a5ee6e5ab2a6a86ff54b5f621a*e6650f1f2630c27fd8fc0f5e56e2e01f99784b9f"; -static char ST_HASH_09500[] = "$office$*2010*100000*128*16*34170046140146368675746031258762*de5bc114991bb3a5679a6e24320bdb09*1b72a4ddffba3dcd5395f6a5ff75b126cb832b733c298e86162028ca47a235a9"; -static char ST_HASH_09600[] = "$office$*2013*100000*256*16*67805436882475302087847656644837*0c392d3b9ca889656d1e615c54f9f3c9*612b79e33b96322c3253fc8a0f314463cd76bc4efe1352f7efffca0f374f7e4b"; -static char ST_HASH_09700[] = "$oldoffice$0*55045061647456688860411218030058*e7e24d163fbd743992d4b8892bf3f2f7*493410dbc832557d3fe1870ace8397e2"; -static char ST_HASH_09710[] = "$oldoffice$0*55045061647456688860411218030058*e7e24d163fbd743992d4b8892bf3f2f7*493410dbc832557d3fe1870ace8397e2"; -static char ST_HASH_09720[] = "$oldoffice$0*55045061647456688860411218030058*e7e24d163fbd743992d4b8892bf3f2f7*493410dbc832557d3fe1870ace8397e2:91b2e062b9"; -static char ST_HASH_09800[] = "$oldoffice$3*83328705222323020515404251156288*2855956a165ff6511bc7f4cd77b9e101*941861655e73a09c40f7b1e9dfd0c256ed285acd"; -static char ST_HASH_09810[] = "$oldoffice$3*83328705222323020515404251156288*2855956a165ff6511bc7f4cd77b9e101*941861655e73a09c40f7b1e9dfd0c256ed285acd"; -static char ST_HASH_09820[] = "$oldoffice$3*83328705222323020515404251156288*2855956a165ff6511bc7f4cd77b9e101*941861655e73a09c40f7b1e9dfd0c256ed285acd:b8f63619ca"; -static char ST_HASH_09900[] = "22527bee5c29ce95373c4e0f359f079b"; -static char ST_HASH_10000[] = "pbkdf2_sha256$10000$1135411628$bFYX62rfJobJ07VwrUMXfuffLfj2RDM2G6/BrTrUWkE="; -static char ST_HASH_10100[] = "583e6f51e52ba296:2:4:47356410265714355482333327356688"; -static char ST_HASH_10200[] = "$cram_md5$MTI=$dXNlciBiOGYwNjk5MTE0YjA1Nzg4OTIyM2RmMDg0ZjgyMjQ2Zg=="; -static char ST_HASH_10300[] = "{x-issha, 1024}BnjXMqcNTwa3BzdnUOf1iAu6dw02NzU4MzE2MTA="; -static char ST_HASH_10400[] = "$pdf$1*2*40*-1*0*16*01221086741440841668371056103222*32*27c3fecef6d46a78eb61b8b4dbc690f5f8a2912bbb9afc842c12d79481568b74*32*0000000000000000000000000000000000000000000000000000000000000000"; -static char ST_HASH_10410[] = "$pdf$1*2*40*-1*0*16*01221086741440841668371056103222*32*27c3fecef6d46a78eb61b8b4dbc690f5f8a2912bbb9afc842c12d79481568b74*32*0000000000000000000000000000000000000000000000000000000000000000"; -static char ST_HASH_10420[] = "$pdf$1*2*40*-1*0*16*01221086741440841668371056103222*32*27c3fecef6d46a78eb61b8b4dbc690f5f8a2912bbb9afc842c12d79481568b74*32*0000000000000000000000000000000000000000000000000000000000000000:6a8aedccb7"; -static char ST_HASH_10500[] = "$pdf$2*3*128*-4*1*16*62888255846156252261477183186121*32*6879919b1afd520bd3b7dbcc0868a0a500000000000000000000000000000000*32*0000000000000000000000000000000000000000000000000000000000000000"; -static char ST_HASH_10600[] = "$pdf$5*5*256*-1028*1*16*28562274676426582441147358074521*127*a3aab04cff2c536118870976d768f1fdd445754d6b2dd81fba10bb6e742acd7f2856227467642658244114735807452100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*127*00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*32*0000000000000000000000000000000000000000000000000000000000000000*32*0000000000000000000000000000000000000000000000000000000000000000"; -static char ST_HASH_10700[] = "$pdf$5*6*256*-1028*1*16*62137640825124540503886403748430*127*0391647179352257f7181236ba371e540c2dbb82fac1c462313eb58b772a54956213764082512454050388640374843000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*127*00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*32*0000000000000000000000000000000000000000000000000000000000000000*32*0000000000000000000000000000000000000000000000000000000000000000"; -static char ST_HASH_10800[] = "07371af1ca1fca7c6941d2399f3610f1e392c56c6d73fddffe38f18c430a2817028dae1ef09ac683b62148a2c8757f42"; -static char ST_HASH_10900[] = "sha256:1000:NjI3MDM3:vVfavLQL9ZWjg8BUMq6/FB8FtpkIGWYk"; -static char ST_HASH_11000[] = "f22cade043e7214200206dbffca49fd9:27167508161455764247627144160038845437138252877014827848"; -static char ST_HASH_11100[] = "$postgres$postgres*74402844*4e7fabaaf34d780c4a5822d28ee1c83e"; -static char ST_HASH_11200[] = "$mysqlna$2576670568531371763643101056213751754328*5e4be686a3149a12847caa9898247dcc05739601"; -static char ST_HASH_11300[] = "$bitcoin$96$c265931309b4a59307921cf054b4ec6b6e4554369be79802e94e16477645777d948ae1d375191831efc78e5acd1f0443$16$8017214013543185$200460$96$480008005625057442352316337722323437108374245623701184230273883222762730232857701607167815448714$66$014754433300175043011633205413774877455616682000536368706315333388"; -static char ST_HASH_11400[] = "$sip$*72087*1215344588738747***342210558720*737232616*1215344588738747*8867133055*65600****MD5*e9980869221f9d1182c83b0d5e56a7db"; -static char ST_HASH_11500[] = "c762de4a:00000000"; -static char ST_HASH_11600[] = "$7z$0$14$0$$11$33363437353138333138300000000000$2365089182$16$12$d00321533b483f54a523f624a5f63269"; -static char ST_HASH_11700[] = "57e9e50caec93d72e9498c211d6dc4f4d328248b48ecf46ba7abfa874f666e36"; -static char ST_HASH_11800[] = "5d5bdba48c8f89ee6c0a0e11023540424283e84902de08013aeeb626e819950bb32842903593a1d2e8f71897ff7fe72e17ac9ba8ce1d1d2f7e9c4359ea63bdc3"; -static char ST_HASH_11900[] = "md5:1000:NjAxMDY4MQ==:a00DtIW9hP9voC85fmEA5uVhgdDx67nSPSm9yADHjkI="; -static char ST_HASH_12000[] = "sha1:1000:MTYwNTM4MDU4Mzc4MzA=:aGghFQBtQ8+WVlMk5GEaMw=="; -static char ST_HASH_12001[] = "{PKCS5S2}NTczNTY0NDY2NjQyNzU1Mx8gGiRGobaZYwumctGHbn2ZOHB8LkwzH+Z1gkWfy1zD"; -static char ST_HASH_12100[] = "sha512:1000:NzY2:DNWohLbdIWIt4Npk9gpTvA=="; -static char ST_HASH_12200[] = "$ecryptfs$0$1$4207883745556753$567daa975114206c"; -static char ST_HASH_12300[] = "8F75FBD166AFDB6D7587DAB89C2F15672AAC031C5B0B5E65C0835FB130555F6FF4E0E5764976755558112246FFF306450C22F6B7746B9E9831ED97B373992F9157436180438417080374881414745255"; -static char ST_HASH_12400[] = "_GW..8841inaTltazRsQ"; -static char ST_HASH_12500[] = "$RAR3$*0*45109af8ab5f297a*adbf6c5385d7a40373e8f77d7b89d317"; -static char ST_HASH_12600[] = "3f3473a071b1fb955544e80c81853ca0f1e4f9ee4ca3bf4d2a8a10b5ef5be1f6:6058321484538505215534207835727413038041028036676832416353152201"; -static char ST_HASH_12700[] = "$blockchain$288$713253722114000682636604801283547365b7a53a802a7388d08eb7e6c32c1efb4a157fe19bca940a753d7f16e8bdaf491aa9cf6cda4035ac48d56bb025aced81455424272f3e0459ec7674df3e82abd7323bc09af4fd0869fd790b3f17f8fe424b8ec81a013e1476a5c5a6a53c4b85a055eecfbc13eccf855f905d3ddc3f0c54015b8cb177401d5942af833f655947bfc12fc00656302f31339187de2a69ab06bc61073933b3a48c9f144177ae4b330968eb919f8a22cec312f734475b28cdfe5c25b43c035bf132887f3241d86b71eb7e1cf517f99305b19c47997a1a1f89df6248749ac7f38ca7c88719cf16d6af2394307dce55600b8858f4789cf1ae8fd362ef565cd9332f32068b3c04c9282553e658b759c2e76ed092d67bd55961ae"; -static char ST_HASH_12800[] = "v1;PPH1_MD4,54188415275183448824,100,55b530f052a9af79a7ba9c466dddcb8b116f8babf6c3873a51a3898fb008e123"; -static char ST_HASH_12900[] = "15738301074686823451275227041071157383010746868234512752270410712bc4be900bf96ccf43c9852fff49b5f5874a9f6e7bf301686fa6d98286de151f15738301074686823451275227041071"; -static char ST_HASH_13000[] = "$rar5$16$38466361001011015181344360681307$15$00000000000000000000000000000000$8$cc7a30583e62676a"; -static char ST_HASH_13100[] = "$krb5tgs$23$*user$realm$test/spn*$b548e10f5694ae018d7ad63c257af7dc$35e8e45658860bc31a859b41a08989265f4ef8afd75652ab4d7a30ef151bf6350d879ae189a8cb769e01fa573c6315232b37e4bcad9105520640a781e5fd85c09615e78267e494f433f067cc6958200a82f70627ce0eebc2ac445729c2a8a0255dc3ede2c4973d2d93ac8c1a56b26444df300cb93045d05ff2326affaa3ae97f5cd866c14b78a459f0933a550e0b6507bf8af27c2391ef69fbdd649dd059a4b9ae2440edd96c82479645ccdb06bae0eead3b7f639178a90cf24d9a"; -static char ST_HASH_13200[] = "$axcrypt$*1*10467*9a7cd609bb262c738d9f0e4977039b94*ecbe0fd05a96fd2099d88a92eebb76c59d6837dfe55b3631"; -static char ST_HASH_13300[] = "$axcrypt_sha1$b89eaac7e61417341b710b727768294d"; -static char ST_HASH_13400[] = "$keepass$*2*24569*0*c40432355cce7348c48053ceea0a28e7d18859c4ea47e3a799c6300861f64b95*265dafcc42e1537ff42e97e1e283c70014133be0fe2d420b4d24c6d57c9d2207*a00e20a852694c15aabb074d61b902fa*48dd553fb96f7996635f2414bfe6a1a8429ef0ffb71a1752abbef31853172c35*a44ae659958ad7fae8c8952cb83f3cf03fec2371ce22a8bf7fac1e687af2f249*1*64*5a26ea376cc5afc955104c334571d30486acbac512a94b75ca82a9e31dd97bf7"; -static char ST_HASH_13500[] = "24eea51b53d02b4c5ff99bcb05a6847fdb2d9308:4f10a0de76e242040c28e9d3dd15c903343489c79765f9118c098c266b9ff505c95bd75bbe406ff3404849eea73930ad17937c0ba6fc3e7bb6d37362941318938b8af96d1292a310b3fd29a67e411ecb10d30247c99183a16951b3859054d4eba9dcd50709c7b21dee836d7ed195cc6b33317aeb557cc56392dc551faa8d5a0fb42212"; -static char ST_HASH_13600[] = "$zip2$*0*3*0*74705614874758221371566185145124*1605*0**75bf9be92e8ab106ff67*$/zip2$"; -static char ST_HASH_13711[] = "531aca1fa6db5118506320114cb11a9f00dade61720533fc12982b28ec71a1a3856ac6ee44b4acc207c8230352208d5f0dc37bf755bd98830279d6befcb6001cdf025f816a0aa1baf3b9b51be00fadb451ffbe9bdfc381115eeceeef778e29a8761f853b7c99e0ea9ec452ba77677f888ea40a39cf65db74d87147690684e273313dea15ff2039797e112006e5f80f2c5baf2c11eb62cb63cfb45883f8885fc7cd5bdb74ef57ec4fe3cec5c2025364582380366169d9419ac41b6f6e878429239e52538f9698e73700b920e7b58c56a4563f5aa512e334ddc56909ac2a0ad4146833f050edd78b7954e6549d0fa2e3b26ed2a769a6c029bfa4de62d49575acce078ef035e366ec13b6092cb205e481bc822f87972bfbe4a3915fad620c4b8645e96bcc468d5804208ae251a560068a09455657f4539dc7e80637fa85fbce058ffee421a98d85b2ae1118d9bd4f24e1e810627cc9893b7166e199dc91fd7f79740530a472df0948f285293478042b28cd2caef086a6ce9d5f656f97adde7d68924ef477fdf2a0c0b107671a1f94b2906d8fb58114836982e4e130e6944df8b42288512376553a1fa6526f9e46dc19b99bb568b30269d9f5d7db2d70a9aa85371b0ac71a6f6f564aaef26a0508c16bf03934973504a5188de37b18a689a020bc37a54d2863879e12902b43bc71c057fa47cbaac1e0100696af365e8226daeba346"; -static char ST_HASH_13712[] = "6efa052302d814f368ebf5274e5718cdfd3c1cd5ce8949b963cf4c376a49a033348905f9f5bef7a5a097e3d2d05b09c35c3cb26836e75b45830345bc287903b1c7e2e20c056ba015769d6f5685b8c6a609acd9927afac24f80613c929c1b582553f6637f2523367df94c9c6c0d6ae6e19430313be3f8ea738da30bd910c567222b0d21a03ebc399192453f8dd64f7ae3eeef84e04b77858e678c9dfd30080fb68a8ec532ee8effa65b674c258df29de6f6f7345ffb0ab324cfea9edbc9e1c0366effe284f92a495a9d7901d1008d83fc39a31a750d5b305683e687c69a9321adbbacf09868078147be41ef5d35805ff0f3d4430042c6390b41483d26d287ee1c00fda37588794ea7223ef08be085924ec34f6de6bbc6f79f73ca4c13e7947851a9f220307f9da45c7370306cca3be0ac8a1e555f2f4b87e6bc39b37f2863061a8a62b9df70dd9c5c2ddf9022606bc38e221b9dc0d7a1c311ff7b36cbd97c2df70e1b5c860b03a1ac0cdb5a89f40b1a155be301dc5a96698743aa01527ac1b676440a3fdd68b462c4d77ccff59afb1f9b8ec8b82e7eb9147334d180243b77930ef87c3b2deb145267e5932223b5fbc76eabdc1e44cffb1b36649409565a521c3112119232f829c6ee9408f1c030eab522ae21083d851fb9df0773ba84ea8a6668044cecb82723e7720eb0fa7c0aa13871015452ad08d8b47d7e7fe0bdfde13b21"; -static char ST_HASH_13713[] = "9c95d40f14ecd2a90f9d942f7869df881ff48bbe3b0fa6ae1d1bea56271844f00a8a40793eec1bc9240578269a1f40d825e6ad3351aa95b8b65b2b3089d8cfed07c2a3187735143f64cf55af972b045ac3fba3f744106ad1afa9bcfd9ae268ba8bca7168bb255507e2c10dff00c386ce442d898ff4db658645f65554b4b2d9d7a327402eadd6974d1dfbf7864680a514950be513dc5eea63d2e2297ff7c2dd256adc8dff9b7568e44c39150e3b2274badf28cecd27a6caed79675bbb66aa98f6a876a455d84b6190c598fa9198921a3e19ca7e00281a9789299db2b4317bc42375cd87461d0e690dea4a447228414d9452947a9a3cc30b727128c796ce1a2dfe8cc6d4a5984373e956ec7eac89412a49cd93ac5ebd1c0fe795413edd250fb7f4b63a04c54b194891a5ff8e05e8aeca0be9cca3b41182ae9634caac4647182f3d872753b8bf47a245eadcabe1e067c2783c15eaf8aa52ce8a27a14a647b6819bab62471e2a21caf69bccff414962308207141c28ac87ecab2e3bdb5d2501f8de8909ab0f585437e62b7bac42b5e157fcc7936c7d0142ca4a497710309074ae1774af8aff5975dc1061088614f36fe43c63f64d37bdee5da0a54955054a070f277176dd0dfdddbd6b61d028342204f9aba4088d90504d2940104bf40365db569b24b419ce261c5c4f15f509b98158490b8867ef6f629c1156919c5543b2639c7a4"; -static char ST_HASH_13721[] = "2be25b279d8d2694e0ad1e5049902e717f1bdf741bbd678bf307d510741b649d78c54dca46fb2c92723afd9a40769b295e66d445ec232af5bddf91481ee41256e56b77839e8bf55265077bab405901218ac7933f74073f1208f1de72aace5da4e07d5f83ca580c0216d36c200b54570a1d58e9d8e5c98a597dec23b74a465aeac572a99af70e1a1e20fd29c7c296099e4eed5b715cb470617ea4f20140b62ec4694af67d9158deac3ce846718e10518875ce8cea0286a487a295979e67159d06e871789bf5535b75c809b340f8627e18679e3dab839a1c9823ea14a07d5cc4251b777dddb408da147c70e7cc788a01c27b0ba4f4700d3248f59fa8217874ae4958ea4518522b44f7191ec19459faef7678422adecd58777487ef54a5305ff2caaa545dcb82f7e7a3eb30bd9f7ebab542d0964a367f9c710cf26bbd704e841d591428da3486db31c57f91c6167bf99e31839363cb93bc60d755031f96f2d2c964e1d85b7eaa104985ef801a21d99352c025d7415d5b2f1aa37dc513345d0ff6a1bca92ad7b8c265f322d04f2992895de32636c9b03318cf7154632d547debc1c5e0c8f8730a045efcf3d16ff956cf803716eee22168bc5a5ab72ddb5087436722cb0f59a5b7b03bc557ffb50e8757d1a5639e2bcddd8060de4ee5535fb614b4fc159c6a39040dcbe83889b9c6fac1c9364a7bea930d916ea23fafa0fde07ef609"; -static char ST_HASH_13722[] = "37e6db10454a5d74c1e75eca0bc8a70e67ac032357e4bd6a4315c0174cf9780f92210dfc0a3e977969f2890828d446aecc317dc40fb3162915998cc703e49257a950a1603342913900052011a7fa85fb0b1fd4489f17237ac1a8bbfd644e871ab95a4019f14b2b938d627646b9958b530dd0739760024ad323d36962b60ba92908e55a876fc392ac2dce6a2410bcdd30a01cba90427f02ccb96e222ab1381266a6f626aa00b0f59e743c1a77433cbb28648f04c91853bdf9b8b29917b2341bf7deb013131ad228ea0c7f9435985318431dae59faff46db3726341b97a956da4ad11766124cd06644c1ba1083b36d3f380f20c272e460b958841fc23be1820ad2e0e6db66eaf4ea171035add0ab543ce8e853e3119ceb9d7f32c0948b81604b81075bcb33efe747fec300a7c68ec383d28d560cccce713c0acf51d74c0db718ba93a9e720b657dda2409adf1ce35aa7e1c0d7ed3df98dd0b6d455a355ce02bda8bea8afc0a8341ac78214efd4372b4430270009ec65badf186e5f0d815dcf597b4703af95e3bfc03313125d2a88b9bb3788b6bbc3c7212713cd584a226b155a2e6872b33730af6fba29aa3dccdb0ec35b5d6e3d981faf39c8dd35fdcff502d14736bc6a47af6e4d7f3518f8ef5e0a4e5d521589a761757f86e2bef471d9867e9b532903c479e4966dcc99189fcdfa3d676f50ccd33fb7cc0aa3e85542ff2648c9"; -static char ST_HASH_13723[] = "d44f26d1742260f88023d825729cc5a64cf8475d887632a2fb4a84af27af138cfadc4bcbb122f6ba68339ae8427d1f72c0c4aeef041291492ae0a7d8677d8da43227ae2a26d9a433076b44458b14f52766cf0e4baeb473a789180660d62e42bbea7c042379a5a74e259463e1c18381fa13aee27141264be381de71c12f8f704913f211c45fda0295e963d90fc35272e907858c0522601f6e7a73b43ff222663f149a485fc6c464e5f3b7cc0b6508f30621385365ca8a4e0bff4061f64f5fbdb11f70f19d77e56fa6ff015ad76ecaaccd759d30da05d2a6fbf00ac9673ac3c23efd339313c2a99511e928f976bf9b2664d97685498d5931af2d453edc6fb1129e324eaba64264711fbe21d0d202b3659106e8100634f09c38cd15b1b3acba79d7f31d31fe23c166392e300db09f10550c83187566dc0fdf768b872555851b34e3c15ad7e7438a72e6126c895cf1204987df4b42cb7bc2fe03c5777867d269378c6e496df2a1a3457b907f7143a139d800868ad95e2901723c6ebb991054b4e991c67fe4c17702d9829d9dc1fe8bf4a956460721c858e31dbcbe56850a4ed31558c6ee89ba2cba2ef4bde77fed11848f9f92e0add54964a683c3686dbab4695ebc42554da922a08c6fff32cac936ea447e771aa74a689eb269ffef677294ef297600dfd73bbbb734d2968e38a98b4a8a77ff0eec8246d93b542e3521a3eb636101"; -static char ST_HASH_13731[] = "48f79476aa0aa8327a8a9056e61450f4e2883c9e9669142f2e2f022c2f85303b897d088dea03d64329f6c402a56fed05b3919715929090a25c8ae84c67dbdb364ebfa3e9ccc0b391c130a4c3dd6495a1d6eb5d2eab72f8009096f7475ecb736bb3225b6da144e1596d859dad159fae5a739beea88ea074771e9d0b2d7c48ae302606a60d7cff6db54f3e460c548c06a4f47dc1ac203a8c8349fbff6a652219a63f27bc76327543e22be4f8dab8e4f90a4283fbf1552119fe24114ce8869eb20ce87dd72300f7aad3f7b4a26a355f16517725449151cf0373dbd0b281f6ac753485a14a5361cc75d40928e241a6b4684658801774843238048cf8c7f2fd88950abac040e12b0c41fdcaca3702907e951ec11c061a91b3050a4855abe6f3b50b4bd0b17c4be1f5b50b873eadc2d8446cd72c4fcac576bbce3acea769f740c5322ee8c927ffd4dd11c8a9e66f06e58df2e5d4d85c13b44c412bab839c9512b7a0acdd97b37dcccc4b70854eda0f36de12d62dd10cc13bc6154103d083bf6540bc78e5d0aad5d063cc74dad4cbe6e060febda2a9fd79c238f99dcb0766ff4addcfd0c03e619c765f65b1c75d5d22c6536958bcda78077ff44b64c4da741bf50154df310d4e0724238a777b524237b9478277e400ad8146dc3ca1da83e3d2f1c5115a4b7fcdc71dd7d56ba86a2f9b721c9a4137aabb07c3c5fedcf5342c4fae4898c9"; -static char ST_HASH_13732[] = "1b721942019ebe8cedddbed7744a0702c0e053281a467e0ed69bf875c7406407d72eb8f2aea21270e41898c0a2c14382f86e04c15e7bc019d1d9dd813eabee0ae5173e3cb1d927859d3e6de1006335a5184ae12b4c8dc2db2b1cd785063152a776f4dc5cacc1856a919b880d704b7450f5a0e0c9521bc9b4d67213c36a50e6664a1cbcea33f997b858e654111c7e9fca74f361528e85a28880381ec2600e3c1cd508c3833dd21cc91978185cba53caefd7b3c82d219d49f0b41e536d32e8d3ce194ad7923ca742213e19dcebdbd9687979d5a594654a5c611e8b829c4019e90a3cfb14e5fd7f8ed91e0fc79eed182399f02a3e3e202d4becaa6730e1f05f99ce06ce16dba7777ccddac72e85f2d3be5ecc9c808ac273f10ceb71cad666166abc327c4061a5f47424a5b6d9d093782f34b49924342a2e8cea663446ed4232a9a415ee2dfde988fa827b06d7438fec20ad0689543c3ee4602ce3ec3806fc7d668ef7e34330edd1e077b329a7627fa3ae5c89308258a17ecefbee114c80c2ab06f8271f14de8f2d13d1d6e5a119b71a6bae88ab151f76cdb2442284bc481d0df7e2163c3acfe763d3968195450d275af9034a00184a30cefed163e636626bffe6a35df3472508a49cb2b9b4c4a95d11c5d17e4e0539e9f13112125515778bcd1c2813c62a02673663062ad60583ec6a02c8a572865829e5b8c767b285728bea4907"; -static char ST_HASH_13733[] = "5eb128daef63eff7e6db6aa10a8858f89964f47844acca68df82ebb2e73866fa75e3b7a53f9d2ff1ecdd1f4dc90e9c0fdf51f60d11b1992cd2971b4889edfc8920bbf346fd7693f675b617cb9e4e9a43e6f445021068fc13453b130f2eb1d753ee83ecc61dabec293e88b62110cf6a8fab670e171f6aba2226550b54893263f5fa086b3cc41dd3db2eae07b585e5162c7a0d9723a426d408d83266c4d6018dc1b8b456d28a224033a30bfe62b1e58c2ddf596e07f7ff31849a6f5cfcc1c977b82d8484c270d44ededb0afdb781295e92968fc8cc69766af0ce1e72f02d6b4e124ba4b1af71519dcaade857bb3f371f93a350da6e65ee46c2ac782f134c75c10fe9d653fccc08c614dc362871911af8b83bdfc479f770dfe4b3c86b5d895842c53852fe4912738f848bf7c3e10b8189d25faceab9ef30b6fa0284edaa471752ac2b65335179b8d605417709f64fded7d94383618a921660d4cdb190bbb3769a8e56d2cd1ee07078ebc3b68ebeb016893f7099018e40cb326e32b29a62806eaf1a3fd382f4f876bf721eadfc019c5545813e81fd7168995f743663b136762b07910a63b6eec5b728a4ad07a689cceecb14c2802f334401a0a4fd2ec49e2da7f3cb24d6181f01ceed93ee73dedc3378133c83c9a71155c86785ff20dd5a64323d2fd4bf076bab3c17a1bb45edf81c30a7bd7dbbb097ece0dca83fff9138d56ae668"; -static char ST_HASH_13751[] = "b8a19a544414e540172595aef79e6616f504799b40a407edfb69d40534e93f0bdb3187876f0b7a21739b3a9bb02bd4752eac4d2021e65a2a9413cc389964fad46e2cd37f337eb3fe3c75909fe9911609d084fb8c09543f949e738fc2fcfa4825ca5f1e08678e711142553f95b19ba720fa6c8ae5d325be0b36b93c1b2683b0944d2ad4e858c1d83f21a302ef721b9a570233219b9fcf95919fef9ca353af32d7ceb0b3058986c4ed9580b8058325403d45048e43d9e94a1e8fbaa0658f82f81940ea821e1bd526829ee6478a32da4095ab9e7c04dac3b6cc08f99348467a5bf068ba54d0aededdf6005c18ee37e21ee8d980cabe470be49d332661761934f5c07126001c290002587ba4b49982fefaac41b62f7e74ce943bb40a2d78094f734d1bc2aa3dedff43ee2a7b8f3525743c76194637da9ebc2794bac14601e03aa98e9118023a184970b6b8f84f546af88b81e2fde836e286b57cbcbdd7d39334860571a5cc612b77f0c51c741854abeb320bf961aea99b88798199bf826970f2b1b8027499955f68e15328080289d8cf0569057e1ed887f956ce72b14dd13a1f61134e1195d13c68d9c298ae0183107e3a93dd13ee0730f1fabe3935ee70f4c6a1923abb3e0d0c8ecf45260c1444e7e73386acf29d3239d0160e097e6193099e10cc98f61bfda49df6b0635e73a9ccc7bdcc543306b40dd12b91023f61b21418af91"; -static char ST_HASH_13752[] = "1c3197f32dc5b72b4d60474a7a43afefb0d2e856a8fc4957c3fb1188b62cb0ca002f585c125bb33c5a5e85a665afae9fce15cb127c2fd9b5ee074a48fd95b3a58364dfd645968187d546443ba234f5cc40e78c4bdcd1e0c6d0a1208dd892442bc1dfe2a45bc4821e843bb6d9f4adf742c48c432daf0d4a51d42cafdfca281f0fab0caabde8005405840383bbfd8dbf227384891ffa501531549e0b9562c2dd77f0e6552d253acb20cbee9a75d17ec283a46006ee89cd53e3b538e054952ae6db7aac9f2f190590e697a2a8e22d080e88c32f4d27b5afe100647da2a5c80cfcb69e5a3db67cb2fcd86d89c1c53fab1bf3a287bb9002d092e75eb1fe6269a1603545dbf97b9d7fcc9485b6400f7b0abaccc31642cefd83f037e7314c6990c51af24ae894cc1c49a09d18f3ad91b3ef37ae5414fef280ec776d9c0bf84b2eb312c8cb0046bedf6f29b4aab30cdb34333f613000a39bf650341cbf33bdd47ba7bd9be8108a1254390b045d82b208d21aa45de7ca399f8e91845b9ffb47d9e6eeb506965622a2e842ec6897277388cbb6ca2a50117e228e84bebd98f9aba40f38dc3bce3b576cb08596836e50ef276ee3a76b8ce76735fd172e9bae284aa83e2677dac56e4624e66604a90e2e3ae704c64a0f27b51ce9e472891bbc212b4a6055e4482b2e6963507f9ffb477224372289fcfee5764a5f4bc7307a509e7c37c69b4857"; -static char ST_HASH_13753[] = "f421bdc1087b8319c12d84a680ceab0102e8e41c9ccffe76dbe0215dcfcb7b543f3e1bbedd099e88646823dae5bad8468b72436961ea8e0449a6b92b8bda7b9ba1fe215e997ec3be2ee5eb3b4d47c41d50998df2f883404fb66270f72b5ce666e7d5ca7847c4a8b2762723da1ad088b0ad75c4fd2ccbbfa4e3adf091b6af4f44f5484ce0c89a5b0db0cbe99b3a9d43d7ff6c4ddbc9636cacfedb26b59340c6eb3e8c587db41fc01f10da2974af96531b2bee5f0b9818c3b86a3cac4ba20e08c49be84af65eb40d51626161f4eef187bf5776a89e791f3f5cbcfaa510df201fb2bf35ff03e81d0572af9abbed3cac82681925a3d1954440a6037df78f7a1e63bea81c852571a21fb550f9fe114b82bf7b94290e362cef233186f17396488c0f259c83c50ac4f8cc27d3a134ddc98f14c2fe0dd6e7d6f5eec63848314dc5984979eeb79df326f80ee0e7f671072117903cb72bbbce4f750fca3f008dadf532241e05913704df6ca03edb9641775c3b6e3e328fd078c6d70298512118312cab8316bb6ddc0b860952c621b2bb4cec1b3c7da9b1cb4c494fec382fe85aefdc56570b54845a14651535d261db519be0e860a4e20c30c86cff6f9de6e16b68d09a0e9593d271df2740950e65f1fb16e3fee034183e540e2a3b0f76156f06946b5d1bfc62fe0cab3daa14603a8d21eb03a4d266e965b010c265c9a0e093084d262a8c03"; -static char ST_HASH_13800[] = "060a4a94cb2263bcefe74705bd0efe7643d09c2bc25fc69f6a32c1b8d5a5d0d9:4647316184156410832507278642444030512402463246148636510356103432440257733102761444262383653100802140838605535187005586063548643765207865344068042278454875021452355870320020868064506248840047414683714173748364871633802572014845467035357710118327480707136422"; -static char ST_HASH_13900[] = "058c1c3773340c8563421e2b17e60eb7c916787e:827500576"; -static char ST_HASH_14000[] = "53b325182924b356:1412781058343178"; -static char ST_HASH_14100[] = "4c29eea59d8db1e7:7428288455525516"; -static char ST_HASH_14400[] = "fcdc7ec700b887e8eaebf94c2ec52aebb5521223:63038426024388230227"; -static char ST_HASH_14700[] = "$itunes_backup$*9*ebd7f9b33293b2511f0a4139d5b213feff51476968863cef60ec38d720497b6ff39a0bb63fa9f84e*10000*2202015774208421818002001652122401871832**"; -static char ST_HASH_14800[] = "$itunes_backup$*10*17a3b858e79bc273be43a9f113b71efe7ec8e7e401396b350180b4592ef45db67ffef7b2d64329a5*10000*2721336781705041205314422175267631184867*1000*99fafc983e732998adb9fadc162a2e382143f115"; -static char ST_HASH_14900[] = "7090b6b9:04223875"; -static char ST_HASH_15000[] = "bfa9fe5a404faff8b0d200385e26b783a163e475869336029d3ebaccaf02b5f16e4949279e8a33b942ab647f8f19a83dbe89a6d39dd6d8f84812de7d2e556767:6422386434050716105781561510557063652302782465168686858312232148"; -static char ST_HASH_15100[] = "$sha1$20000$75552156$HhYMDdaEHiK3eMIzTldOFPnw.s2Q"; -static char ST_HASH_15200[] = "$blockchain$v2$5000$288$324724252428471806184866704068819419467b2b32fd9593fd1a274e0b68bf2c72e5a1f5e748fd319056d1e47ca7b40767136a2d97d7133d14faaeca50986f66cdbc0faec0a3fabbd0ba5d08d5322b6b53da021aacfc439c45bec0e9fe02ad81db82f94e9bd36a7d4d76b505c2339fcd46565d3abab958fbeb1de8bfc53beb96cde8fe44128965477c9ef0762c62bbb1d66532b4888e174ea949db54374a2ed9686a63eb0b5b17ae293f7410bb4ae5106f108314a259c5fd097d558515d79350713412159103a8a174cd384a14f3da45efe18044e1146036000231f6042577d0add98fc959d265368e398dc1550b0bc693e9023cd9d51b40e701bd786e19c3a281a90465aa6ea3f9e756d430164ab2eb43be5b6796d7ac15b2fe99217410f2"; -static char ST_HASH_15300[] = "$DPAPImk$1*1*S-15-21-466364039-425773974-453930460-1925*des3*sha1*24000*b038489dee5ad04e3e3cab4d957258b5*208*cb9b5b7d96a0d2a00305ca403d3fd9c47c561e35b4b2cf3aebfd1d3199a6481d56972be7ebd6c291b199e6f1c2ffaee91978706737e9b1209e6c7d3aa3d8c3c3e38ad1ccfa39400d62c2415961c17fd0bd6b0f7bbd49cc1de1a394e64b7237f56244238da8d37d78"; -static char ST_HASH_15400[] = "$chacha20$*0400000000000003*35*0200000000000001*3961626364656667*8a152c57a7a856a8"; -static char ST_HASH_15500[] = "$jksprivk$*338BD2FBEBA7B3EF198A4CBFC6E18AFF1E229367*5225850113575146134463704406336350011656*D5253EB151EB92DC73E542D8C0A4D7A848A5B0C0E370E625E6547D4E6F23416FC85A27BC295731B8021CDFBD003551C66C434FFBC87DACAD1FDF39022320034A2F86E779F2B1B3325428A666518FA89507AD63E15FD9C57B9E36EF5B642A2F448A9A3F09B79AD93D65F46B8692CD07539FD140146F8F219DC262971AF019E18EDC16C3C240569E1673F4D98BC818CCF28298D5A7BFF038A663DD10FE5E48643C3217C237D342164E2D41EF15075431FBD5B34800E5AE7EB80FAA5AE9982A55F35379AA7B31217E7F1C5F1964A15024A305AE4B3981FE1C80C163BC38ECA5581F11867E5C34C5D124D0367B3737E5E5BB14D2CAB26A698C8DAAB755C82BA6B823BCAECDD4A89C831651ACE5A6029FD0D3515C5D1D53AD8B9062CE8C445373862035CBBF60D490CA2E4975EE6E0358EC32E871FAB15347E3032E21F30F543BAAB01D779BA833CA0B8C7591B42C7C59A8FDD46D7DECEC0E91ADBF331177605E7830ABED62FAD7D5D806D8EFD01C38765940B7F97168FC72C39BF4C98F944FFC310CA8F4EB1D0F960F352CC5E2BB23A1EB221072A5471EDA2CE81C04595B8D37088CFB5C14F6A4A881AD12125DEFBB8154EB4C130AB7FD9933FD36DF1A6A26B51AB169866788678FCED988C8E017CA84354F487A5508210181AFB8B3AD0753E3E28BE674DFBD4E4FBDFD1E30D592F4EA3A77A2F0F5CF9A175DBC590EF5D42971A39918F12B92DCD8BFD56BE9A3459856B5587603C7B53062663A4C8894BBC9894FB1663BF30F32D907664328138B7A50EAC7F8E3183D74562A5C90FE1889AC4C5FE43EBEB8974563B6682F92591ECA4FA0DA72236C3851DA102DB6BA0CC07BFD32F7E962AB0EDCF4A8DEA6525174F5BB5C021E2A9A3F7F761E9CA90B6E27FB7E55CD91DA184FAC5E534E8AD25314C56CE5796506A0CA70881782F9C5147D87705065D68BD67D2B0344205BA6445D562273690004CA5A303274FB283A75F49BA968D7947943AA98F2AF9CB8253B425B86225E7395A331AC4CB1B1700C64D4F458D5D642C54148AE6DA41D9E26657D331B157D76042C2CF3057B83997C23D8BF68FB3C7337CAFB8B324AD0DF7A80B554B4D7F9AD6ED527E7932F1741A573C152A41610F6517E3F4A3BC6B66685871A7CE3795C559BD47CDB8E34CB2C1DFE980518D79E2078C258C54F312EB38609F640E7DC013E0F2A16A25BB5971882B4308D27930CA99FEC231AE927B62215A1B56098C362B7F20593953B29428681875070E84BF5B60BEA3948127151634123DA77C814AAD54CE10905763C8C19BC191C0C40458C809402E1957C4C05C4EAE27576B2D30593F7FDCC9A248DB5DB23CF2FA22A92C016090F611690BF0AB5B8B2866ED25F345EFE85DF3311C9E91C37CEE709CF16E7CB09D01BECD2961D094C02D42EC85BF47FAB1B67A13B9A1741C15F7156D57A71BFFABB03B71E69707913A5C136B3D69CE3F71ABFE376F0A21D723FFA2E60AC180689D3E8AF4348C9F555CD897387327FC8BA2B9C51A7298547E556A11A60441EF5331A1BFB847A3D23DD9F7C50E636A2C6309BC82E1A8852F5A8569B6D93*14*78D6A2424484CF5149932B7EA8BF*test"; -static char ST_HASH_15600[] = "$ethereum$p*1024*38353131353831333338313138363430*a8b4dfe92687dbc0afeb5dae7863f18964241e96b264f09959903c8c924583fc*0a9252861d1e235994ce33dbca91c98231764d8ecb4950015a8ae20d6415b986"; -static char ST_HASH_15700[] = "$ethereum$s*1024*1*1*3033363133373132373638333437323331383637383437333631373038323434*69eaf081695cf971ef7ee5a49997c1a3922e7efef59068109e83853755ee31c3*64a1adec1750ee4416b22b81111dd2a3c2fede820d6da8bf788dca2641d5b181"; -static char ST_HASH_15900[] = "$DPAPImk$2*1*S-15-21-439882973-489230393-482956683-1522*aes256*sha512*12900*79f7ca399f2626e21aad108c3922af7c*288*c47bc8a985ca6aa708b01c97b004bff20cc52379dc2635b4acf59ce17970a2cb47ace98c7e8de977f265243c5c03d0a97e4b954b494d9e38d9158d0c1e729d16a28ba69e2e7c6c3bc0e3afc9c9b6306b83372ccb35d89b98925728fd36315b8ee95b4d4eccdcb31564769f9a4b9ee10828184e16d4af336675d5e31d987dd87233d34fbbb98880c5e1f64cbb9b043ad8"; -static char ST_HASH_16000[] = "pfaRCwDe0U"; -static char ST_HASH_99999[] = "hashcat"; - -static const char OPTI_STR_OPTIMIZED_KERNEL[] = "Optimized-Kernel"; -static const char OPTI_STR_ZERO_BYTE[] = "Zero-Byte"; -static const char OPTI_STR_PRECOMPUTE_INIT[] = "Precompute-Init"; -static const char OPTI_STR_PRECOMPUTE_MERKLE[] = "Precompute-Merkle-Demgard"; -static const char OPTI_STR_PRECOMPUTE_PERMUT[] = "Precompute-Final-Permutation"; -static const char OPTI_STR_MEET_IN_MIDDLE[] = "Meet-In-The-Middle"; -static const char OPTI_STR_EARLY_SKIP[] = "Early-Skip"; -static const char OPTI_STR_NOT_SALTED[] = "Not-Salted"; -static const char OPTI_STR_NOT_ITERATED[] = "Not-Iterated"; -static const char OPTI_STR_PREPENDED_SALT[] = "Prepended-Salt"; -static const char OPTI_STR_APPENDED_SALT[] = "Appended-Salt"; -static const char OPTI_STR_SINGLE_HASH[] = "Single-Hash"; -static const char OPTI_STR_SINGLE_SALT[] = "Single-Salt"; -static const char OPTI_STR_BRUTE_FORCE[] = "Brute-Force"; -static const char OPTI_STR_RAW_HASH[] = "Raw-Hash"; -static const char OPTI_STR_SLOW_HASH_SIMD_INIT[] = "Slow-Hash-SIMD-INIT"; -static const char OPTI_STR_SLOW_HASH_SIMD_LOOP[] = "Slow-Hash-SIMD-LOOP"; -static const char OPTI_STR_SLOW_HASH_SIMD_COMP[] = "Slow-Hash-SIMD-COMP"; -static const char OPTI_STR_USES_BITS_8[] = "Uses-8-Bit"; -static const char OPTI_STR_USES_BITS_16[] = "Uses-16-Bit"; -static const char OPTI_STR_USES_BITS_32[] = "Uses-32-Bit"; -static const char OPTI_STR_USES_BITS_64[] = "Uses-64-Bit"; - -static const char PA_000[] = "OK"; -static const char PA_001[] = "Ignored due to comment"; -static const char PA_002[] = "Ignored due to zero length"; -static const char PA_003[] = "Line-length exception"; -static const char PA_004[] = "Hash-length exception"; -static const char PA_005[] = "Hash-value exception"; -static const char PA_006[] = "Salt-length exception"; -static const char PA_007[] = "Salt-value exception"; -static const char PA_008[] = "Salt-iteration count exception"; -static const char PA_009[] = "Separator unmatched"; -static const char PA_010[] = "Signature unmatched"; -static const char PA_011[] = "Invalid hccapx file size"; -static const char PA_012[] = "Invalid hccapx eapol size"; -static const char PA_013[] = "Invalid psafe2 filesize"; -static const char PA_014[] = "Invalid psafe3 filesize"; -static const char PA_015[] = "Invalid truecrypt filesize"; -static const char PA_016[] = "Invalid veracrypt filesize"; -static const char PA_017[] = "Invalid SIP directive, only MD5 is supported"; -static const char PA_018[] = "Hash-file exception"; -static const char PA_019[] = "Hash-encoding exception"; -static const char PA_020[] = "Salt-encoding exception"; -static const char PA_021[] = "Invalid LUKS filesize"; -static const char PA_022[] = "Invalid LUKS identifier"; -static const char PA_023[] = "Invalid LUKS version"; -static const char PA_024[] = "Invalid or unsupported LUKS cipher type"; -static const char PA_025[] = "Invalid or unsupported LUKS cipher mode"; -static const char PA_026[] = "Invalid or unsupported LUKS hash type"; -static const char PA_027[] = "Invalid LUKS key size"; -static const char PA_028[] = "Disabled LUKS key detected"; -static const char PA_029[] = "Invalid LUKS key AF stripes count"; -static const char PA_030[] = "Invalid combination of LUKS hash type and cipher type"; -static const char PA_031[] = "Invalid hccapx signature"; -static const char PA_032[] = "Invalid hccapx version"; -static const char PA_033[] = "Invalid hccapx message pair"; -static const char PA_255[] = "Unknown error"; - -static const char HT_00000[] = "MD5"; -static const char HT_00010[] = "md5($pass.$salt)"; -static const char HT_00020[] = "md5($salt.$pass)"; -static const char HT_00030[] = "md5(utf16le($pass).$salt)"; -static const char HT_00040[] = "md5($salt.utf16le($pass))"; -static const char HT_00050[] = "HMAC-MD5 (key = $pass)"; -static const char HT_00060[] = "HMAC-MD5 (key = $salt)"; -static const char HT_00100[] = "SHA1"; -static const char HT_00110[] = "sha1($pass.$salt)"; -static const char HT_00120[] = "sha1($salt.$pass)"; -static const char HT_00130[] = "sha1(utf16le($pass).$salt)"; -static const char HT_00140[] = "sha1($salt.utf16le($pass))"; -static const char HT_00150[] = "HMAC-SHA1 (key = $pass)"; -static const char HT_00160[] = "HMAC-SHA1 (key = $salt)"; -static const char HT_00200[] = "MySQL323"; -static const char HT_00300[] = "MySQL4.1/MySQL5"; -static const char HT_00400[] = "phpass, WordPress (MD5), phpBB3 (MD5), Joomla (MD5)"; -static const char HT_00500[] = "md5crypt, MD5 (Unix), Cisco-IOS $1$ (MD5)"; -static const char HT_00501[] = "Juniper IVE"; -static const char HT_00600[] = "BLAKE2b"; -static const char HT_00900[] = "MD4"; -static const char HT_01000[] = "NTLM"; -static const char HT_01100[] = "Domain Cached Credentials (DCC), MS Cache"; -static const char HT_01300[] = "SHA-224"; -static const char HT_01400[] = "SHA-256"; -static const char HT_01410[] = "sha256($pass.$salt)"; -static const char HT_01420[] = "sha256($salt.$pass)"; -static const char HT_01430[] = "sha256(utf16le($pass).$salt)"; -static const char HT_01440[] = "sha256($salt.utf16le($pass))"; -static const char HT_01450[] = "HMAC-SHA256 (key = $pass)"; -static const char HT_01460[] = "HMAC-SHA256 (key = $salt)"; -static const char HT_01500[] = "descrypt, DES (Unix), Traditional DES"; -static const char HT_01600[] = "Apache $apr1$ MD5, md5apr1, MD5 (APR)"; -static const char HT_01700[] = "SHA-512"; -static const char HT_01710[] = "sha512($pass.$salt)"; -static const char HT_01720[] = "sha512($salt.$pass)"; -static const char HT_01730[] = "sha512(utf16le($pass).$salt)"; -static const char HT_01740[] = "sha512($salt.utf16le($pass))"; -static const char HT_01750[] = "HMAC-SHA512 (key = $pass)"; -static const char HT_01760[] = "HMAC-SHA512 (key = $salt)"; -static const char HT_01800[] = "sha512crypt $6$, SHA512 (Unix)"; -static const char HT_02100[] = "Domain Cached Credentials 2 (DCC2), MS Cache 2"; -static const char HT_02400[] = "Cisco-PIX MD5"; -static const char HT_02410[] = "Cisco-ASA MD5"; -static const char HT_02500[] = "WPA/WPA2"; -static const char HT_02501[] = "WPA/WPA2 PMK"; -static const char HT_02600[] = "md5(md5($pass))"; -static const char HT_03000[] = "LM"; -static const char HT_03100[] = "Oracle H: Type (Oracle 7+)"; -static const char HT_03200[] = "bcrypt $2*$, Blowfish (Unix)"; -static const char HT_03710[] = "md5($salt.md5($pass))"; -static const char HT_03711[] = "MediaWiki B type"; -static const char HT_03800[] = "md5($salt.$pass.$salt)"; -static const char HT_03910[] = "md5(md5($pass).md5($salt))"; -static const char HT_04010[] = "md5($salt.md5($salt.$pass))"; -static const char HT_04110[] = "md5($salt.md5($pass.$salt))"; -static const char HT_04300[] = "md5(strtoupper(md5($pass)))"; -static const char HT_04400[] = "md5(sha1($pass))"; -static const char HT_04500[] = "sha1(sha1($pass))"; -static const char HT_04520[] = "sha1($salt.sha1($pass))"; -static const char HT_04700[] = "sha1(md5($pass))"; -static const char HT_04800[] = "iSCSI CHAP authentication, MD5(CHAP)"; -static const char HT_04900[] = "sha1($salt.$pass.$salt)"; -static const char HT_05000[] = "SHA-3 (Keccak)"; -static const char HT_05100[] = "Half MD5"; -static const char HT_05200[] = "Password Safe v3"; -static const char HT_05300[] = "IKE-PSK MD5"; -static const char HT_05400[] = "IKE-PSK SHA1"; -static const char HT_05500[] = "NetNTLMv1 / NetNTLMv1+ESS"; -static const char HT_05600[] = "NetNTLMv2"; -static const char HT_05700[] = "Cisco-IOS type 4 (SHA256)"; -static const char HT_05800[] = "Samsung Android Password/PIN"; -static const char HT_06000[] = "RIPEMD-160"; -static const char HT_06100[] = "Whirlpool"; -static const char HT_06300[] = "AIX {smd5}"; -static const char HT_06400[] = "AIX {ssha256}"; -static const char HT_06500[] = "AIX {ssha512}"; -static const char HT_06600[] = "1Password, agilekeychain"; -static const char HT_06700[] = "AIX {ssha1}"; -static const char HT_06800[] = "LastPass + LastPass sniffed"; -static const char HT_06900[] = "GOST R 34.11-94"; -static const char HT_07000[] = "FortiGate (FortiOS)"; -static const char HT_07100[] = "macOS v10.8+ (PBKDF2-SHA512)"; -static const char HT_07200[] = "GRUB 2"; -static const char HT_07300[] = "IPMI2 RAKP HMAC-SHA1"; -static const char HT_07400[] = "sha256crypt $5$, SHA256 (Unix)"; -static const char HT_07500[] = "Kerberos 5 AS-REQ Pre-Auth etype 23"; -static const char HT_07700[] = "SAP CODVN B (BCODE)"; -static const char HT_07800[] = "SAP CODVN F/G (PASSCODE)"; -static const char HT_07900[] = "Drupal7"; -static const char HT_08000[] = "Sybase ASE"; -static const char HT_08100[] = "Citrix NetScaler"; -static const char HT_08200[] = "1Password, cloudkeychain"; -static const char HT_08300[] = "DNSSEC (NSEC3)"; -static const char HT_08400[] = "WBB3 (Woltlab Burning Board)"; -static const char HT_08500[] = "RACF"; -static const char HT_08600[] = "Lotus Notes/Domino 5"; -static const char HT_08700[] = "Lotus Notes/Domino 6"; -static const char HT_08800[] = "Android FDE <= 4.3"; -static const char HT_08900[] = "scrypt"; -static const char HT_09000[] = "Password Safe v2"; -static const char HT_09100[] = "Lotus Notes/Domino 8"; -static const char HT_09200[] = "Cisco-IOS $8$ (PBKDF2-SHA256)"; -static const char HT_09300[] = "Cisco-IOS $9$ (scrypt)"; -static const char HT_09400[] = "MS Office 2007"; -static const char HT_09500[] = "MS Office 2010"; -static const char HT_09600[] = "MS Office 2013"; -static const char HT_09700[] = "MS Office <= 2003 $0/$1, MD5 + RC4"; -static const char HT_09710[] = "MS Office <= 2003 $0/$1, MD5 + RC4, collider #1"; -static const char HT_09720[] = "MS Office <= 2003 $0/$1, MD5 + RC4, collider #2"; -static const char HT_09800[] = "MS Office <= 2003 $3/$4, SHA1 + RC4"; -static const char HT_09810[] = "MS Office <= 2003 $3, SHA1 + RC4, collider #1"; -static const char HT_09820[] = "MS Office <= 2003 $3, SHA1 + RC4, collider #2"; -static const char HT_09900[] = "Radmin2"; -static const char HT_10000[] = "Django (PBKDF2-SHA256)"; -static const char HT_10100[] = "SipHash"; -static const char HT_10200[] = "CRAM-MD5"; -static const char HT_10300[] = "SAP CODVN H (PWDSALTEDHASH) iSSHA-1"; -static const char HT_10400[] = "PDF 1.1 - 1.3 (Acrobat 2 - 4)"; -static const char HT_10410[] = "PDF 1.1 - 1.3 (Acrobat 2 - 4), collider #1"; -static const char HT_10420[] = "PDF 1.1 - 1.3 (Acrobat 2 - 4), collider #2"; -static const char HT_10500[] = "PDF 1.4 - 1.6 (Acrobat 5 - 8)"; -static const char HT_10600[] = "PDF 1.7 Level 3 (Acrobat 9)"; -static const char HT_10700[] = "PDF 1.7 Level 8 (Acrobat 10 - 11)"; -static const char HT_10800[] = "SHA-384"; -static const char HT_10900[] = "PBKDF2-HMAC-SHA256"; -static const char HT_11000[] = "PrestaShop"; -static const char HT_11100[] = "PostgreSQL CRAM (MD5)"; -static const char HT_11200[] = "MySQL CRAM (SHA1)"; -static const char HT_11300[] = "Bitcoin/Litecoin wallet.dat"; -static const char HT_11400[] = "SIP digest authentication (MD5)"; -static const char HT_11500[] = "CRC32"; -static const char HT_11600[] = "7-Zip"; -static const char HT_11700[] = "GOST R 34.11-2012 (Streebog) 256-bit"; -static const char HT_11800[] = "GOST R 34.11-2012 (Streebog) 512-bit"; -static const char HT_11900[] = "PBKDF2-HMAC-MD5"; -static const char HT_12000[] = "PBKDF2-HMAC-SHA1"; -static const char HT_12100[] = "PBKDF2-HMAC-SHA512"; -static const char HT_12200[] = "eCryptfs"; -static const char HT_12300[] = "Oracle T: Type (Oracle 12+)"; -static const char HT_12400[] = "BSDi Crypt, Extended DES"; -static const char HT_12500[] = "RAR3-hp"; -static const char HT_12600[] = "ColdFusion 10+"; -static const char HT_12700[] = "Blockchain, My Wallet"; -static const char HT_12800[] = "MS-AzureSync PBKDF2-HMAC-SHA256"; -static const char HT_12900[] = "Android FDE (Samsung DEK)"; -static const char HT_13000[] = "RAR5"; -static const char HT_13100[] = "Kerberos 5 TGS-REP etype 23"; -static const char HT_13200[] = "AxCrypt"; -static const char HT_13300[] = "AxCrypt in-memory SHA1"; -static const char HT_13400[] = "KeePass 1 (AES/Twofish) and KeePass 2 (AES)"; -static const char HT_13500[] = "PeopleSoft PS_TOKEN"; -static const char HT_13600[] = "WinZip"; -static const char HT_13800[] = "Windows Phone 8+ PIN/password"; -static const char HT_13900[] = "OpenCart"; -static const char HT_14000[] = "DES (PT = $salt, key = $pass)"; -static const char HT_14100[] = "3DES (PT = $salt, key = $pass)"; -static const char HT_14400[] = "sha1(CX)"; -static const char HT_14600[] = "LUKS"; -static const char HT_14700[] = "iTunes backup < 10.0"; -static const char HT_14800[] = "iTunes backup >= 10.0"; -static const char HT_14900[] = "Skip32 (PT = $salt, key = $pass)"; -static const char HT_15000[] = "FileZilla Server >= 0.9.55"; -static const char HT_15100[] = "Juniper/NetBSD sha1crypt"; -static const char HT_15200[] = "Blockchain, My Wallet, V2"; -static const char HT_15300[] = "DPAPI masterkey file v1"; -static const char HT_15400[] = "ChaCha20"; -static const char HT_15500[] = "JKS Java Key Store Private Keys (SHA1)"; -static const char HT_15600[] = "Ethereum Wallet, PBKDF2-HMAC-SHA256"; -static const char HT_15700[] = "Ethereum Wallet, SCRYPT"; -static const char HT_15900[] = "DPAPI masterkey file v2"; -static const char HT_16000[] = "Tripcode"; -static const char HT_99999[] = "Plaintext"; - -static const char HT_00011[] = "Joomla < 2.5.18"; -static const char HT_00012[] = "PostgreSQL"; -static const char HT_00021[] = "osCommerce, xt:Commerce"; -static const char HT_00022[] = "Juniper NetScreen/SSG (ScreenOS)"; -static const char HT_00023[] = "Skype"; -static const char HT_00101[] = "nsldap, SHA-1(Base64), Netscape LDAP SHA"; -static const char HT_00111[] = "nsldaps, SSHA-1(Base64), Netscape LDAP SSHA"; -static const char HT_00112[] = "Oracle S: Type (Oracle 11+)"; -static const char HT_00121[] = "SMF (Simple Machines Forum) > v1.1"; -static const char HT_00122[] = "macOS v10.4, macOS v10.5, MacOS v10.6"; -static const char HT_00124[] = "Django (SHA-1)"; -static const char HT_00125[] = "ArubaOS"; -static const char HT_00131[] = "MSSQL (2000)"; -static const char HT_00132[] = "MSSQL (2005)"; -static const char HT_00133[] = "PeopleSoft"; -static const char HT_00141[] = "Episerver 6.x < .NET 4"; -static const char HT_01411[] = "SSHA-256(Base64), LDAP {SSHA256}"; -static const char HT_01421[] = "hMailServer"; -static const char HT_01441[] = "Episerver 6.x >= .NET 4"; -static const char HT_01711[] = "SSHA-512(Base64), LDAP {SSHA512}"; -static const char HT_01722[] = "macOS v10.7"; -static const char HT_01731[] = "MSSQL (2012, 2014)"; -static const char HT_02611[] = "vBulletin < v3.8.5"; -static const char HT_02612[] = "PHPS"; -static const char HT_02711[] = "vBulletin >= v3.8.5"; -static const char HT_02811[] = "IPB2+ (Invision Power Board), MyBB 1.2+"; -static const char HT_04521[] = "Redmine"; -static const char HT_04522[] = "PunBB"; -static const char HT_06211[] = "TrueCrypt PBKDF2-HMAC-RIPEMD160 + XTS 512 bit"; -static const char HT_06212[] = "TrueCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1024 bit"; -static const char HT_06213[] = "TrueCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1536 bit"; -static const char HT_06221[] = "TrueCrypt PBKDF2-HMAC-SHA512 + XTS 512 bit"; -static const char HT_06222[] = "TrueCrypt PBKDF2-HMAC-SHA512 + XTS 1024 bit"; -static const char HT_06223[] = "TrueCrypt PBKDF2-HMAC-SHA512 + XTS 1536 bit"; -static const char HT_06231[] = "TrueCrypt PBKDF2-HMAC-Whirlpool + XTS 512 bit"; -static const char HT_06232[] = "TrueCrypt PBKDF2-HMAC-Whirlpool + XTS 1024 bit"; -static const char HT_06233[] = "TrueCrypt PBKDF2-HMAC-Whirlpool + XTS 1536 bit"; -static const char HT_06241[] = "TrueCrypt PBKDF2-HMAC-RIPEMD160 + XTS 512 bit + boot-mode"; -static const char HT_06242[] = "TrueCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1024 bit + boot-mode"; -static const char HT_06243[] = "TrueCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1536 bit + boot-mode"; -static const char HT_13711[] = "VeraCrypt PBKDF2-HMAC-RIPEMD160 + XTS 512 bit"; -static const char HT_13712[] = "VeraCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1024 bit"; -static const char HT_13713[] = "VeraCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1536 bit"; -static const char HT_13721[] = "VeraCrypt PBKDF2-HMAC-SHA512 + XTS 512 bit"; -static const char HT_13722[] = "VeraCrypt PBKDF2-HMAC-SHA512 + XTS 1024 bit"; -static const char HT_13723[] = "VeraCrypt PBKDF2-HMAC-SHA512 + XTS 1536 bit"; -static const char HT_13731[] = "VeraCrypt PBKDF2-HMAC-Whirlpool + XTS 512 bit"; -static const char HT_13732[] = "VeraCrypt PBKDF2-HMAC-Whirlpool + XTS 1024 bit"; -static const char HT_13733[] = "VeraCrypt PBKDF2-HMAC-Whirlpool + XTS 1536 bit"; -static const char HT_13741[] = "VeraCrypt PBKDF2-HMAC-RIPEMD160 + XTS 512 bit + boot-mode"; -static const char HT_13742[] = "VeraCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1024 bit + boot-mode"; -static const char HT_13743[] = "VeraCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1536 bit + boot-mode"; -static const char HT_13751[] = "VeraCrypt PBKDF2-HMAC-SHA256 + XTS 512 bit"; -static const char HT_13752[] = "VeraCrypt PBKDF2-HMAC-SHA256 + XTS 1024 bit"; -static const char HT_13753[] = "VeraCrypt PBKDF2-HMAC-SHA256 + XTS 1536 bit"; -static const char HT_13761[] = "VeraCrypt PBKDF2-HMAC-SHA256 + XTS 512 bit + boot-mode"; -static const char HT_13762[] = "VeraCrypt PBKDF2-HMAC-SHA256 + XTS 1024 bit + boot-mode"; -static const char HT_13763[] = "VeraCrypt PBKDF2-HMAC-SHA256 + XTS 1536 bit + boot-mode"; -static const char HT_12001[] = "Atlassian (PBKDF2-HMAC-SHA1)"; - -static const char SIGNATURE_ANDROIDFDE[] = "$fde$"; -static const char SIGNATURE_AXCRYPT[] = "$axcrypt$*1"; -static const char SIGNATURE_AXCRYPT_SHA1[] = "$axcrypt_sha1"; -static const char SIGNATURE_BCRYPT1[] = "$2a$"; -static const char SIGNATURE_BCRYPT2[] = "$2b$"; -static const char SIGNATURE_BCRYPT3[] = "$2x$"; -static const char SIGNATURE_BCRYPT4[] = "$2y$"; -static const char SIGNATURE_BITCOIN_WALLET[] = "$bitcoin$"; -static const char SIGNATURE_BSDICRYPT[] = "_"; -static const char SIGNATURE_CISCO8[] = "$8$"; -static const char SIGNATURE_CISCO9[] = "$9$"; -static const char SIGNATURE_CRAM_MD5[] = "$cram_md5$"; -static const char SIGNATURE_DCC2[] = "$DCC2$"; -static const char SIGNATURE_DJANGOPBKDF2[] = "pbkdf2_sha256$"; -static const char SIGNATURE_DJANGOSHA1[] = "sha1$"; -static const char SIGNATURE_DPAPIMK[] = "$DPAPImk$"; -static const char SIGNATURE_DRUPAL7[] = "$S$"; -static const char SIGNATURE_ECRYPTFS[] = "$ecryptfs$"; -static const char SIGNATURE_EPISERVER4[] = "$episerver$*1*"; -static const char SIGNATURE_EPISERVER[] = "$episerver$*0*"; -static const char SIGNATURE_KEEPASS[] = "$keepass$"; -static const char SIGNATURE_KRB5PA[] = "$krb5pa$23"; -static const char SIGNATURE_KRB5TGS[] = "$krb5tgs$23"; -static const char SIGNATURE_MD5AIX[] = "{smd5}"; -static const char SIGNATURE_MD5APR1[] = "$apr1$"; -static const char SIGNATURE_MD5CRYPT[] = "$1$"; -static const char SIGNATURE_MEDIAWIKI_B[] = "$B$"; -static const char SIGNATURE_MS_DRSR[] = "v1;PPH1_MD4"; -static const char SIGNATURE_MSSQL[] = "0x0100"; -static const char SIGNATURE_MSSQL2012[] = "0x0200"; -static const char SIGNATURE_MYSQL_AUTH[] = "$mysqlna$"; -static const char SIGNATURE_MYWALLET[] = "$blockchain$"; -static const char SIGNATURE_MYWALLETV2[] = "$blockchain$v2$"; -static const char SIGNATURE_NETSCALER[] = "1"; -static const char SIGNATURE_OFFICE2007[] = "$office$"; -static const char SIGNATURE_OFFICE2010[] = "$office$"; -static const char SIGNATURE_OFFICE2013[] = "$office$"; -static const char SIGNATURE_OLDOFFICE0[] = "$oldoffice$0"; -static const char SIGNATURE_OLDOFFICE1[] = "$oldoffice$1"; -static const char SIGNATURE_OLDOFFICE3[] = "$oldoffice$3"; -static const char SIGNATURE_OLDOFFICE4[] = "$oldoffice$4"; -static const char SIGNATURE_PBKDF2_MD5[] = "md5:"; -static const char SIGNATURE_PBKDF2_SHA1[] = "sha1:"; -static const char SIGNATURE_PBKDF2_SHA256[] = "sha256:"; -static const char SIGNATURE_PBKDF2_SHA512[] = "sha512:"; -static const char SIGNATURE_PDF[] = "$pdf$"; -static const char SIGNATURE_PHPASS1[] = "$P$"; -static const char SIGNATURE_PHPASS2[] = "$H$"; -static const char SIGNATURE_PHPS[] = "$PHPS$"; -static const char SIGNATURE_POSTGRESQL_AUTH[] = "$postgres$"; -static const char SIGNATURE_PSAFE3[] = "PWS3"; -static const char SIGNATURE_RACF[] = "$racf$"; -static const char SIGNATURE_RAR3[] = "$RAR3$"; -static const char SIGNATURE_RAR5[] = "$rar5$"; -static const char SIGNATURE_SAPH_SHA1[] = "{x-issha, "; -static const char SIGNATURE_SCRYPT[] = "SCRYPT"; -static const char SIGNATURE_SEVEN_ZIP[] = "$7z$"; -static const char SIGNATURE_SHA1AIX[] = "{ssha1}"; -static const char SIGNATURE_SHA1B64[] = "{SHA}"; -static const char SIGNATURE_SHA256AIX[] = "{ssha256}"; -static const char SIGNATURE_SHA256B64S[] = "{SSHA256}"; -static const char SIGNATURE_SHA256CRYPT[] = "$5$"; -static const char SIGNATURE_SHA512AIX[] = "{ssha512}"; -static const char SIGNATURE_SHA512B64S[] = "{SSHA512}"; -static const char SIGNATURE_SHA512CRYPT[] = "$6$"; -static const char SIGNATURE_SHA512GRUB[] = "grub.pbkdf2.sha512."; -static const char SIGNATURE_SHA512MACOS[] = "$ml$"; -static const char SIGNATURE_SIP_AUTH[] = "$sip$*"; -static const char SIGNATURE_SSHA1B64_lower[] = "{ssha}"; -static const char SIGNATURE_SSHA1B64_upper[] = "{SSHA}"; -static const char SIGNATURE_SYBASEASE[] = "0xc007"; -static const char SIGNATURE_ZIP2_START[] = "$zip2$"; -static const char SIGNATURE_ZIP2_STOP[] = "$/zip2$"; -static const char SIGNATURE_ITUNES_BACKUP[] = "$itunes_backup$"; -static const char SIGNATURE_FORTIGATE[] = "AK1"; -static const char SIGNATURE_ATLASSIAN[] = "{PKCS5S2}"; -static const char SIGNATURE_NETBSD_SHA1CRYPT[] = "$sha1$"; -static const char SIGNATURE_BLAKE2B[] = "$BLAKE2$"; -static const char SIGNATURE_CHACHA20[] = "$chacha20$"; -static const char SIGNATURE_JKS_SHA1[] = "$jksprivk$"; -static const char SIGNATURE_ETHEREUM_PBKDF2[] = "$ethereum$p"; -static const char SIGNATURE_ETHEREUM_SCRYPT[] = "$ethereum$s"; +static const char *ST_HASH_00000 = "8743b52063cd84097a65d1633f5c74f5"; +static const char *ST_HASH_00010 = "3d83c8e717ff0e7ecfe187f088d69954:343141"; +static const char *ST_HASH_00011 = "8368ba576d44779d4ca110c234fbfd32:22868223712338656660744185004422"; +static const char *ST_HASH_00012 = "93a8cf6a7d43e3b5bcd2dc6abb3e02c6:27032153220030464358344758762807"; +static const char *ST_HASH_00020 = "57ab8499d08c59a7211c77f557bf9425:4247"; +static const char *ST_HASH_00021 = "e983672a03adcc9767b24584338eb378:00"; +static const char *ST_HASH_00022 = "nKjiFErqK7TPcZdFZsZMNWPtw4Pv8n:26506173"; +static const char *ST_HASH_00023 = "d04d74780881019341915c70d914db29:0675841"; +static const char *ST_HASH_00030 = "1169500a7dfece72e1f7fc9c9410867a:687430237020"; +static const char *ST_HASH_00040 = "23a8a90599fc5d0d15265d4d3b565f6e:58802707"; +static const char *ST_HASH_00050 = "e28e4e37e972a945e464b5226053bac0:40"; +static const char *ST_HASH_00060 = "7f51edecfa6fb401a0b5e63d33fc8c0e:84143"; +static const char *ST_HASH_00100 = "b89eaac7e61417341b710b727768294d0e6a277b"; +static const char *ST_HASH_00101 = "{SHA}uJ6qx+YUFzQbcQtyd2gpTQ5qJ3s="; +static const char *ST_HASH_00110 = "848952984db93bdd2d0151d4ecca6ea44fcf49e3:30007548152"; +static const char *ST_HASH_00111 = "{SSHA}FLzWcQqyle6Mo7NvrwXCMAmRzXQxNjYxMTYzNw=="; +static const char *ST_HASH_00112 = "63ec5f6113843f5d229e2d49c068d983a9670d02:57677783202322766743"; +static const char *ST_HASH_00120 = "a428863972744b16afef28e0087fc094b44bb7b1:465727565"; +static const char *ST_HASH_00121 = "d27c0a627a45db487af161fcc3a4005d88eb8a1f:25551135"; +static const char *ST_HASH_00122 = "86586886b8bd3c379d2e176243a7225e6aae969d293fe9a9"; +static const char *ST_HASH_00124 = "sha1$fe76b$02d5916550edf7fc8c886f044887f4b1abf9b013"; +static const char *ST_HASH_00125 = "83377286015bcebb857b23b94331e2b316b6ecbe9fbf26c4fc"; +static const char *ST_HASH_00130 = "0a9e4591f539a77cd3af67bae207d250bc86bac6:23240710432"; +static const char *ST_HASH_00131 = "0x0100778883860000000000000000000000000000000000000000eda3604e067a06f2732b05b9cb90b8a710996939"; +static const char *ST_HASH_00132 = "0x010045083578bf13a6e30ca29c40e540813772754d54a5ffd325"; +static const char *ST_HASH_00133 = "uXmFVrdBvv293L9kDR3VnRmx4ZM="; +static const char *ST_HASH_00140 = "03b83421e2aa6d872d1f8dee001dc226ef01722b:818436"; +static const char *ST_HASH_00141 = "$episerver$*0*MjEwNA==*ZUgAmuaYTqAvisD0A427FA3oaWU"; +static const char *ST_HASH_00150 = "02b256705348a28b1d6c0f063907979f7e0c82f8:10323"; +static const char *ST_HASH_00160 = "8d7cb4d4a27a438059bb83a34d1e6cc439669168:2134817"; +static const char *ST_HASH_00200 = "7196759210defdc0"; +static const char *ST_HASH_00300 = "fcf7c1b8749cf99d88e5f34271d636178fb5d130"; +static const char *ST_HASH_00400 = "$P$946647711V1klyitUYhtB8Yw5DMA/w."; +static const char *ST_HASH_00500 = "$1$38652870$DUjsu4TTlTsOe/xxZ05uf/"; +static const char *ST_HASH_00501 = "3u+UR6n8AgABAAAAHxxdXKmiOmUoqKnZlf8lTOhlPYy93EAkbPfs5+49YLFd/B1+omSKbW7DoqNM40/EeVnwJ8kYoXv9zy9D5C5m5A=="; +static const char *ST_HASH_00600 = "$BLAKE2$296c269e70ac5f0095e6fb47693480f0f7b97ccd0307f5c3bfa4df8f5ca5c9308a0e7108e80a0a9c0ebb715e8b7109b072046c6cd5e155b4cfd2f27216283b1e"; +static const char *ST_HASH_00900 = "afe04867ec7a3845145579a95f72eca7"; +static const char *ST_HASH_01000 = "b4b9b02e6f09a9bd760f388b67351e2b"; +static const char *ST_HASH_01100 = "c896b3c6963e03c86ade3a38370bbb09:54161084332"; +static const char *ST_HASH_01300 = "e4fa1555ad877bf0ec455483371867200eee89550a93eff2f95a6198"; +static const char *ST_HASH_01400 = "127e6fbfe24a750e72930c220a8e138275656b8e5d8f48a98c3c92df2caba935"; +static const char *ST_HASH_01410 = "5bb7456f43e3610363f68ad6de82b8b96f3fc9ad24e9d1f1f8d8bd89638db7c0:12480864321"; +static const char *ST_HASH_01411 = "{SSHA256}L5Wk0zPY2lmoR5pH20zngq37KkxFwgTquEhx95rxfVk3Ng=="; +static const char *ST_HASH_01420 = "816d1ded1d621873595048912ea3405d9d42afd3b57665d9f5a2db4d89720854:36176620"; +static const char *ST_HASH_01421 = "8fe7ca27a17adc337cd892b1d959b4e487b8f0ef09e32214f44fb1b07e461c532e9ec3"; +static const char *ST_HASH_01430 = "b2d0db162e30dfef1bfd606689a3acbc213c47ef3fd11968394191886075249d:32002"; +static const char *ST_HASH_01440 = "84ebe1bc3d59919a8c4f9337d66bd163661586c828b24b8067a27a6dc4228c64:05662"; +static const char *ST_HASH_01441 = "$episerver$*1*NDg1NTIz*8BFCg/YJBAuZs/wjbH3OWKe69BLr5Lao26ybpnD48Zk"; +static const char *ST_HASH_01450 = "b435ffbacea34d5eb0dbc4d69a92f0152f2cf4cd364d34c2ece322ca22d8b334:21217"; +static const char *ST_HASH_01460 = "8b9472281c36c3a693703de0e0f1ffab8fc0ecdd3bc5ead04c76dd74ef431e49:70108387805"; +//static const char *ST_HASH_01500 = "8133vc.5rieNk"; +static const char *ST_HASH_01600 = "$apr1$62722340$zGjeAwVP2KwY6MtumUI1N/"; +static const char *ST_HASH_01700 = "82a9dda829eb7f8ffe9fbe49e45d47d2dad9664fbb7adf72492e3c81ebd3e29134d9bc12212bf83c6840f10e8246b9db54a4859b7ccd0123d86e5872c1e5082f"; +static const char *ST_HASH_01710 = "3f749c84d00c6f94a6651b5c195c71dacae08f3cea6fed760232856cef701f7bf60d7f38a587f69f159d4e4cbe00435aeb9c8c0a4927b252d76a744e16e87e91:388026522082"; +static const char *ST_HASH_01711 = "{SSHA512}Bz8w5q6qEtB1Nnc8b1jfTvTXVTwohWag33oghQGOtLChnkZTw/cuJaHQlLJEI3AWKZGCRyLA6Phujdxo+is7AjA2MDcyNjY1Mg=="; +static const char *ST_HASH_01720 = "efc5dd0e4145970917abdc311e1d4e23ba0afa9426d960cb28569f4d585cb031af5c936f57fbcb0a08368a1b302573cf582100d40bd7c632f3d8aecd1a1a8eb1:812"; +static const char *ST_HASH_01730 = "eefb67342d62a5d8ac84e8ae89d0f157f03749bd0427c80637003a4760feefdb36cbe11ba35ab2015b3691e2e83803178c986aa85f29e6f56938b469a31ccd7a:6576666"; +static const char *ST_HASH_01740 = "ce77bf8a8ca9b9cf0ed67edde58ed7fafd4542ce1378fc8bd87b05656ebf92e5711517d5930c18de93a71990e77e1037423e5b64c2f293be7d859d7b6921622e:1512373"; +static const char *ST_HASH_01722 = "07543781b07e905f6f947db8ae305c248b9e12f509b41097e852e2f450e824790e677ea7397b8a9a552b1c19ecf6a6e1dd3844fa5ee5db23976962859676f7d2fb85ca94"; +static const char *ST_HASH_01731 = "0x02003788006711b2e74e7d8cb4be96b1d187c962c5591a02d5a6ae81b3a4a094b26b7877958b26733e45016d929a756ed30d0a5ee65d3ce1970f9b7bf946e705c595f07625b1"; +static const char *ST_HASH_01750 = "138c00f17a1a0363f274817c91118f019aff09f937bfdaea844280a0c0e7811267cc4735d967d8640eed1218268c1c4a76fec8f7aa551491b353829f3a654270:885142"; +static const char *ST_HASH_01760 = "7d02921299935179d509e6dd4f3d0f2944e3451ea9de3af16baead6a7297e5653577d2473a0fff743d9fe78a89bd49296114319989dc7e7870fc7f62bc96accb:114"; +static const char *ST_HASH_01800 = "$6$72820166$U4DVzpcYxgw7MVVDGGvB2/H5lRistD5.Ah4upwENR5UtffLR4X4SxSzfREv8z6wVl0jRFX40/KnYVvK4829kD1"; +static const char *ST_HASH_02100 = "$DCC2$10240#6848#e2829c8af2232fa53797e2f0e35e4626"; +static const char *ST_HASH_02400 = "dRRVnUmUHXOTt9nk"; +static const char *ST_HASH_02500 = "4843505804000000000235380000000000000000000000000000000000000000000000000000000000000151aecc428f182acefbd1a9e62d369a079265784da83ba4cf88375c44c830e6e5aa5d6faf352aa496a9ee129fb8292f7435df5420b823a1cd402aed449cced04f552c5b5acfebf06ae96a09c96d9a01c443a17aa62258c4f651a68aa67b0001030077fe010900200000000000000001a4cf88375c44c830e6e5aa5d6faf352aa496a9ee129fb8292f7435df5420b8230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018dd160050f20101000050f20201000050f20201000050f20200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; +static const char *ST_HASH_02501 = "48435058040000000013303638353333303430353632363637323238330000000000000000000000000002aa8c03531d05376358e25a5248ba2b45e2a2c5d4cf88d71258a797ac501653bbbb4512d8f1ab32584641df9e40e098c5df48acc3baa9ba60ea99968f9377d8a596d33fd762366677b37683fc00693899edc9569c284cbe15c570f56379000103007501010a00000000000000000001d71258a797ac501653bbbb4512d8f1ab32584641df9e40e098c5df48acc3baa9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001630140100000fac040100000fac040100000fac020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; +static const char *ST_HASH_02410 = "YjDBNr.A0AN7DA8s:4684"; +static const char *ST_HASH_02600 = "a936af92b0ae20b1ff6c3347a72e5fbe"; +static const char *ST_HASH_02611 = "28f9975808ae2bdc5847b1cda26033ea:308"; +static const char *ST_HASH_02612 = "$PHPS$30353031383437363132$f02b0b2f25e5754edb04522c346ba243"; +static const char *ST_HASH_02711 = "0844fbb2fdeda31884a7a45ec2010bb6:324410183853308365427804872426"; +static const char *ST_HASH_02811 = "022f7e02b3314f7d0968f73c00ba759f:67588"; +static const char *ST_HASH_03000 = "299bd128c1101fd6"; +static const char *ST_HASH_03100 = "792FCB0AE31D8489:7284616727"; +static const char *ST_HASH_03200 = "$2a$05$MBCzKhG1KhezLh.0LRa0Kuw12nLJtpHy6DIaU.JAnqJUDYspHC.Ou"; +static const char *ST_HASH_03710 = "a3aa0ae2b4a102a9974cdf40edeabee0:242812778074"; +static const char *ST_HASH_03711 = "$B$2152187716$8c8b39c3602b194eeeb6cac78eea2742"; +static const char *ST_HASH_03800 = "78274b1105fb8a7c415b43ffe35ec4a9:6"; +static const char *ST_HASH_03910 = "d8281daba5da597503d12fe31808b4a7:283053"; +static const char *ST_HASH_04010 = "82422514daaa8253be0aa43f3e263af5:7530326651137"; +static const char *ST_HASH_04110 = "45b1005214e2d9472a7ad681578b2438:64268771004"; +static const char *ST_HASH_04300 = "b8c385461bb9f9d733d3af832cf60b27"; +static const char *ST_HASH_04400 = "288496df99b33f8f75a7ce4837d1b480"; +static const char *ST_HASH_04500 = "3db9184f5da4e463832b086211af8d2314919951"; +static const char *ST_HASH_04520 = "59b80a295392eedb677ca377ad7bf3487928df96:136472340404074825440760227553028141804855170538"; +static const char *ST_HASH_04521 = "c18e826af2a78c7b9b7261452613233417e65817:28246535720688452723483475753333"; +static const char *ST_HASH_04522 = "9038129c474caa3f0de56f38db84033d0fe1d4b8:365563602032"; +static const char *ST_HASH_04700 = "92d85978d884eb1d99a51652b1139c8279fa8663"; +static const char *ST_HASH_04800 = "aa4aaa1d52319525023c06a4873f4c51:35343534373533343633383832343736:dc"; +static const char *ST_HASH_04900 = "75d280ca9a0c2ee18729603104ead576d9ca6285:347070"; +static const char *ST_HASH_05000 = "203f88777f18bb4ee1226627b547808f38d90d3e106262b5de9ca943b57137b6"; +static const char *ST_HASH_05100 = "8743b52063cd8409"; +static const char *ST_HASH_05200 = "50575333e4e2a590a5e5c8269f57ec04a8a1c0c03da55b311c51236dab8c6b96b0afca02000800005eaeee20c6cc10d5caa6522b3ca545c41d9133d630ca08f467b7aae8a2bbef51aa2df968d10b9c4cfb17a182c0add7acb8c153794f51337e12f472f451d10e6dcac664ed760606aabdbb6b794a80d6ce2a330100c76de0ff961a45cca21576b893d826c52f272b97cdf48aca6fbe6c74b039f81c61b7d632fb6fddd9f96162ab1effd69a4598a331e855e38792e5365272d4791bf991d248e1585a9ad20ea3d77b5d2ef9a711ef90a70ec6991cb578f1b8bdaa9efa7b0039e9ea96f777491713047bdd99fa1d78f06f23406a66046b387d3034e46b1f84129bba853cc18fa49f107dc0290547258d30566a4b1b363ff4c1c16cb2f5f400059833d4b651bfa508200cbdc7a75fc57ef90eb1d90b0deea8505753332d454f46505753332d454f466236710e2e2477878e738b60d0aa2834a96b01e97764fe980243a06ad16939d1"; +static const char *ST_HASH_05300 = "50503326cac6e4bd892b8257805b5a59a285f464ad3f63dc01bd0335f8341ef52e00be0b8cb205422a3788f021e4e6e8ccbe34784bc85abe42f62545bac64888426a2f1264fa28cf384ff00b14cfa5eff562dda4fad2a31fd7a6715218cff959916deed856feea5bee2e773241c5fbebf202958f0ce0c432955e0f1f6d1259da:688a7bfa8d5819630a970ed6d27018021a15fbb3e2fdcc36ce9b563d8ff95f510c4b3236c014d1cde9c2f1a999b121bc3ab1bc8049c8ac1e8c167a84f53c867492723eb01ab4b38074b38f4297d6fea8f44e01ea828fce33c433430938b1551f60673ce8088e7d2f41e3b49315344046fefee1e3860064331417562761db3ba4:c66606d691eaade4:8bdc88a2cdb4a1cf:c3b13137fae9f66684d98709939e5c3454ee31a98c80a1c76427d805b5dea866eff045515e8fb42dd259b9448caba9d937f4b3b75ec1b092a92232b4c8c1e70a60a52076e907f887b731d0f66e19e09b535238169c74c04a4b393f9b815c54eef4558cd8a22c9018bb4f24ee6db0e32979f9a353361cdba948f9027551ee40b1c96ba81c28aa3e1a0fac105dc469efa83f6d3ee281b945c6fa8b4677bac26dda:53f757c5b08afad6:aa02d9289e1702e5d7ed1e4ebf35ab31c2688e00:aab8580015cf545ac0b7291d15a4f2c79e06defd:944a0df3939f3bd281c9d05fbc0e3d30"; +static const char *ST_HASH_05400 = "266b43c54636c062b6696b71f24b30999c98bd4c3ba57e2de56a7ae50bb17ebcbca1abcd33e9ad466d4df6e6f2a407600f0c5a983f79d493b0a3694080a81143d4bac7a8b7b008ae5364a04688b3cfae44824885ca96ade1e395936567ecad519b502c3a786c72847f79c67b777feb8ba4f747303eb985709e92b3a5634f6513:60f861c6209c9c996ac0dcb49d6f6809faaaf0e8eb8041fe603a918170a801e94ab8ab10c5906d850f4282c0668029fa69dbc8576f7d86633dc2b21f0d79aa06342b02a4d2732841cd3266b84a7eb49ac489b307ba55562a17741142bac7712025f0a8cad59b11f19d9b756ce998176fd6b063df556957b257b3645549a138c2:f4dd079ed2b60e77:f1f8da1f38f76923:fd862602549f6949b33870f186d96cb8926a19d78442c02af823460740be719eba41a79388aeefb072e1ec7cb46b2f0b72e21fb30bd3a6568d2b041af7f9dc0c9cce27ed577e5aabb9ab6c405f1c4b189adbee8c9fb6abf4788b63a3ae05a02c192187b9d7246efe5e46db9b01bf8f4be05f7599ae52bf137743e41d90dceb85bd6ae07397dcc168bbc904adfebb08e6bc67e653edeee97a7e4ab9dab5e63fec:56e3f0d49ea70514:e754055008febe970053d795d26bfe609f42eda8:0c3283efd6396e7a2ecb008e1933fccb694a4ac0:8f79167724f4bdb2d76ee5d5e502b665e3445ea6"; +static const char *ST_HASH_05500 = "::5V4T:ada06359242920a500000000000000000000000000000000:0556d5297b5daa70eaffde82ef99293a3f3bb59b7c9704ea:9c23f6c094853920"; +static const char *ST_HASH_05600 = "0UL5G37JOI0SX::6VB1IS0KA74:ebe1afa18b7fbfa6:aab8bf8675658dd2a939458a1077ba08:010100000000000031c8aa092510945398b9f7b7dde1a9fb00000000f7876f2b04b700"; +static const char *ST_HASH_05700 = "2btjjy78REtmYkkW0csHUbJZOstRXoWdX1mGrmmfeHI"; +static const char *ST_HASH_05800 = "3edde1eb9e6679ccbc1ff3c417e8a475a2d2e279:7724368582277760"; +static const char *ST_HASH_06000 = "012cb9b334ec1aeb71a9c8ce85586082467f7eb6"; +static const char *ST_HASH_06100 = "7ca8eaaaa15eaa4c038b4c47b9313e92da827c06940e69947f85bc0fbef3eb8fd254da220ad9e208b6b28f6bb9be31dd760f1fdb26112d83f87d96b416a4d258"; +static const char *ST_HASH_06211 = "87914967f14737a67fb460f27b8aeb81de2b41bf2740b3dd78784e02763951daa47c7ca235e75c22ec8d959d6b67f7eedefad61e6a0d038079d3721a8e7215e415671e8c7b3dbed6453a114e6db89a52be9a9c1698a9c698f1e37f80d7afaf0efba82b6e5f5df32bd289b95343c6775e2c7f025ef1d8bfae84042a92546e15b635b5fade3aef6ee52a7a5ab018d33ea98bc115dfc62af606187fbab8cbda6e8417402c722ca8c2b07e6ca6a33bf94b2ce2a819a9f8cfaa5af70e3af6e5350d3a306f036f13ff5ba97d5728d5f6413b482c74f528211ae77b6c169215c5487d5a3ce23736b16996b86c71b12d120df28ef322f5143d9a258d0ae7aaa8c193a6dcb5bf18e3c57b5474d24b843f8dd4e83a74109396ddb4f0c50d3657a7eacc8828568e51202de48cd2dfe5acbe3d8840ade1ce44b716d5c0008f2b21b9981353cb12b8af2592a5ab744ae83623349f551acf371c81f86d17a8422654989f078179b2386e2aa8375853a1802cd8bc5d41ce45795f78b80e69fcfa3d14cf9127c3a33fa2dc76ad73960fb7bce15dd489e0b6eca7beed3733887cd5e6f3939a015d4d449185060b2f3bbad46e46d417b8f0830e91edd5ebc17cd5a99316792a36afd83fa1edc55da25518c8e7ff61e201976fa2c5fc9969e05cbee0dce7a0ef876b7340bbe8937c9d9c8248f0e0eae705fe7e1d2da48902f4f3e27d2cf532b7021e18"; +static const char *ST_HASH_06212 = "d6e1644acd373e6fdb8ccaaeab0c400d22eaa0b02e2a6649e065ad50f91e2f81fc5e1600d1cdf3b4ee72a7326a9a28d336ec65adf2d54661e1a609dd9941279fd64a9c513dfb0192734fc1e1014cdd0a399e89a0860c4077463c18609f5218254edd998adb11a02271723d1aa094550df385dd8e080cb42ed1349f69c0a6bad4b37e6dab1effbe0095471a8d640679422fe1533a21f10cb6d15e5ee8cde78e677acf3d09d008e9fbf57f09c1c57f19e51ff54631e0e2adc2ee2832425c1ec718d96a17df7e55aceffb7b23a1872f32795d4491c739e21b01e19a1b7dfcb22709c9d9302154462664a668ea635664df65804bf680ff07026d6f5b225762a3a270df832d47e7feb6277a228454a3ba9b5bbade23ecaec0eaf31ad1dbac31754c970a212bd44c9278bc6076f096a2eed602e04a70c6f7fa94ef4e75299692e5dcc6f1a7e6032b9b765e9e61faeed3f9efacc0a15b1817e74d48ec11a13d15811c7e2c4d12f36d35a04131d02f14184fc15bc20e79115dc7c980b681a19a225964469787df481b68a8f722f2bd3115dbbcb3c8ac1b07d742f78f30635dea29dfb1db83e89fc85a30b0379fc8aa69a4ea94c99052685d38c9559a1246284cdc32c5110eb8c6741352cd42e09e6389d4765c58aa84d51867cf86fba69d29eac1cd7fac2f36603d2fb2af146c5d4c2bedb4f6c6d0f387f0a8d635e33384df60f8d2415b"; +static const char *ST_HASH_06213 = "3916e924d246e5ceb17b140211fff57b67150b3dee53fa475261d465b0ee3e56ee820e6ba3958d84c61508f028b2a112e9005877784e07deddcf310d01ba81710b620533790456d20d17c8fda84f9d93bbfe41509b931a417b82d68ed9b0bc9641b79a5bf8f71bcdbba979dfb7566a5b8ccc221f80722c1ce7ec81be4a8c880b1b057e681c187504eabf4eea32f7b81383defd4616618a99852d1678a6520883c8f3564e6dcf874150a060b9a44748d97f95b223b089ac847e31fb5a2db3656d7b57decff65e2c5c9af5bdece7a1845caa9df805fc1f7e56bf545d854beec27a9640bf1697c195e5f95b82c20d76c5a56ff4283219caa5a618e8caace9d0fcde0df6ee6e043ccbc78fd06a602cc638f7ae4675063b840ee08ffa9e143553bffd20126fa30f95e013aabf103f12c3ceeb284c80dc335fe2e78580d6ddfa80511aba9db7c93838cae0db40b9dbeccbf9d160032d334a9c35156721c746b51131baf6855fdfc1edee3099b8e4abc619e1c60e3ce68615e1eb42bd8d338046f7c854a60defe395e0d7168786a3035c9735cd42433dd0c46dcf8b5cb2c28905df80476561e55d6310b25f74d78b651ccd3484332c59a6ad490e29ea267db5ce4a47c9dcde39f420ba0755ea7e5583a3a562925acaa125d5056795b98135825232aa543a460137cc84235b85dd44d65e01e6eb1ade1b970f3ffe2b9762f5a7f261037e"; +static const char *ST_HASH_06221 = "5ebff6b4050aaa3374f9946166a9c4134dd3ec0df1176da2fb103909d20e8b3c9b95cbbd6d1a7ad05411a1443ad6254e059e924d78bab6a0463e71cf7c3109b7ef4e837bf6d7a548dd8333c451b59d1132098f44c6ff19c6cb921b1de3bd0aa675e0478a05f90204d46a5d6ff598bfa40370ac8795928a6d2e0f1347696e3cfa329738170fe54298981d84f40c63d1a338c5db62679338e849124a28a79a8e505bb89a4673f0457b2737a00b908116310281b5b2eb66c6fda5599196b313d51ef26201335d715c18f6b128454a5601671e619bdcce8e54acb47d498c4161614a05063bff5497a4a3d99bff1fce2a163727af2fe9ae7512461b9dcebf3a4f1031d6235d8ce09b734294d0cedc04eafc6295f212b1b080e7b9745580d0dd18e99cfd95afef982762d5aabeaa2d3a928dcf36322cc06b07fd719c88e0b9a2625a94a77502d4bd40a85ba138cbd0cf9561aa395dc552801f68cce16e5484a672aa5b78665dc531ab1e3e728185929dc443b7f4c8a5cb687c6589bb3f4ddc2a8639d959b839b0813d50e7711b761622c3693a92e540e4f932c6c89bf4e1bff1d69151848c3d01b2f6aba52b58e5b393f6cd58ff0d2e040b1205b042b5a28d5b12cb0cc95fa32f1bcdebd4c82d889a5d87c45dcfd34e80b19bf7be35696e0fa0cbd9338b314de24c1ee7bbc0a3b6824f86af2aa5d127d21444985ff566e921431938f6"; +static const char *ST_HASH_06222 = "9f207bec0eded18a1b2e324d4f05d2f33f0bd1aeb43db65d33242fa48ac960fad4c14d04c553e06ad47e7e394d16e0a6544d35fb0b2415bd060bc5f537e42a58b1681e991e2ec0b5773f6e8e5766e5fcc7335b19dd068d1f20260085ecda8eba366ff1521997c5654630ef09ba421b871a3dc66aa0dd5eba8a3bc7052398a7ad779506d86cbf687e76cd9dc50969e222820d2f905c0550995a9c068725bb6c8b04358c965ab77221fdfd829e57ce54cac6e2fa62db15043d720b72fa8962dd718a0b42c34577af9cb4a5ed04c1ae17b7af470c0d8b77987dc9e2d2593a52458c4acb83b628b1488371de85f78a2e25aeaebc18d20a8c3007d08949e93b80087707afd1fe4e07a0afee4244e5270f768e234b86852aa1556c53ffc0d6f60661369a484d55d063119e71e70af1ec775908466cac7b12bc22e1a9525c2bfa9f83f7901c8e0a1d56387ef65040b750656b0b75791738b5b7e453f24167eae56c057c94e1e4cf1a0d08894225f11b45bc31827cad1dfe62e148549385953aa16a0410dba231aace3a7b9fd9b1c2b930f01193377b59736d8a8959ca5b449655f79a4dbec0da566083f90caa2490b01a10c0a86dd4aaa719bdc1e4233db17217f03509cc20dab7246730e3f964944990690b6dcc84936e1dd487bd154ceefe58a838a0488cc93b854a112ea67f6802d2f409915e648ee5cf5fdc3c12e41acbfab7caa9"; +static const char *ST_HASH_06223 = "721a7f40d2b88de8e11f1a203b04ffa97a1f5671623c6783f984cc7c55e04665f95a7f3fd52f402898aaaed68d048cc4c4fabf81c26832b589687dad082f3e4e0f23c7caba28118f21a4cbb8f32b25914ff4022e7c4c8cdd45411801c7c6bde4033badbdcb82f96c77b42025d13fa71415b3278138100ea58ee4476c81ce66f78e89c59ac22cf454684ea7e8c3900374662f23c9491891b60ed7ce8231a7ac5710ee87b51a3f7bd9566a60dc6e7e701c41f3810d7977314b321e8194349909f2ca458a976851d854eaeb934c8df2b5e063d416d3d7c464e28173a0bbba88ec75cf8fe68f21067739b2473bd804fd710de1e4d3ae9451b374edcfd8e3cd613b23aeae272e0923007482dac26a7532ab09af8aad57cd7f1c451bc260cc912d5830cb0d5332f792519e009ed5450171434e5f0f2ba9e003676933a86d83c766419fac98a7ee232eeb593d1686528fab576d5f393d82f9602bcd65975153df205b6d1bc50dacad2ea5bb184696f978efd2b1c1656bf87e03a28a536c48320c430d407ff6c2fc6e7d4ae7b115e79fd0a88df08eca4743178c7c216f35035596a90b0f0fe9c173c7d0e3d76c33a8fce1f5b9b37674bd12e93fb714c9cbba6768c101b5db8f8fd137144453f00dccc7b66911a0a8d87b198807f30be6619400331c5746d481df7ad47a1f867c07f7b8cd296a0c5e03a121c1a7a60b4f768bea49799d2f"; +static const char *ST_HASH_06231 = "cf53d4153414b63285e701e52c2d99e148c6ccc4508132f82cb41862d0a0ac9ea16274285ac261c339c1508eec9fea54c33e382458662913678f2a88a84959a678e238973985ec670d50252677430587ee28b72bfa5edfb2f79c40b734ba8a54a3662642a6ab067e75f41154688ad4adb5d6decd891462dd537188195a51e06fa5baf22b69d0f472cfeeae77ab9a90091731863af1d8b5b380da179fa7d5227ef031732b1ae06e0fe34c0b28b7a64eac34e5a08e09d7001394b3afc804ac69bf819cdd2d383fe96a721f7c683628da8e529d84bdaa68d702573d8f7ef26f75d1bd5c91efa88cb33b1e9c006b87981c55ed3b8063ab7068f8e99b128bc56ea3e883efa55d6f340b2681e50405d91f5f6d76cdbeac404944164d329d3ee01311de0bc6547310f126b5a4c0e9fb74825f91faefa60b7ac828819d4544c1872ff5041e61d5cf093553f427358b2181046376d7b876e1bccf0774d5d251b7c922c214bb5c70c715165d028e1dca73e7adeca3396d77f6e597a10dd4c58f37fdbbdc1d04cd8890ba4c5025776a88a349bb925add13193becf1ca10fe32536db0c0b06a1ef799fb692e304b3716ca5a8a80859c4012ca3e06701b46b5a32f4d10e285a0cdaf6c24e0d98139e7f306e52503c9b503aa28f1fbbb236284907068074fcb3e267e3c4aab2bd3b79b24a7a08106bb55850fa2bb8e2f6d9919a6743cb822c164"; +static const char *ST_HASH_06232 = "e9e503972b72dee996b0bfced2df003a54b42399e3586520cf1f69475ba32aff564e40e604a505af95ce15220f558ae815e94ce4953882a8299ee3fffb12e9bd62bf8e2c41c0a8337ce20d45715440cc83e394200d351c5b04be5b70fa11b8467320a091a1d703c88cc7b26fd114795c04a973b3266ba97f55d4b4e4771bb1b4a6aabc9d57e03f0ae7c8a77dfc3d37078efba45031e7d63bb514726e2f2dc6da8cce167a17e36b32c326a5bcaa2c4b445f6e10e1f899a9adcc2a698769f900b7909f7aec52fc9862d75286ffda67933f9c52e5c681d590ad0329b85f8db0f6bb6daa3b2d55b62c65da37e3e7fcb99954e0abe20c39724e8fb2c7f839ec67d35f151dfd8c4dd4bc8dc4393fab291efa08cc0099277d219a0ba4c6272af3684d8043ed3f502b98e196dc7aa0291627613179199976f28eff08649acf70aa0c0dc5896ed13eb18ea28fdd6c460a9c7cfedeab5ac80a3c195226cfca094a7590fa2ae5ed2133ba09b5466b2049b6291f8dcf345e5718a4c0ef3f9c8d8e07d0e5dddd07452b533fbf243ef063fb6d26759ae725d8ca430f8cf17b86665d23bdff1c9dbdfe601b88e87cb7c89f23abc4a8bb1f0b7375cc29b1d81c950ffe92e16e2080e1d6270bbb3ba753322d2b623caed87213e552c33e699d4010f0f61df2b7f460d7cd82e70a711388f1c0b591d424259d3de8b3628daf62c6c5b71864eb0e7d31"; +static const char *ST_HASH_06233 = "de7d6725cc4c910a7e96307df69d41335e64d17b4425ca5bf1730f27820f92df9f20f3e855d8566eb5255927153f987348789666c8e563e366a09e68a8126b11c25ac817b2706dde5cec3946e64332b21b41b928985c1a637559ead5b4fecac74ff0d625ef6d8be93dea3eaca05394f23ee9e079d3504a77b4c0b22d3cfcafa9c670966bfa3a5f30539250d97267a9e56b5a1437b1fd2ce58f4ab78b52ba61d01c28d7a6b726d92c8819711c70f820690cf2b9bbef75f196ba87fb5f72a29e213096a8be3b6e6d0ff3dc22563dc9e7d95be68ad169c233289fccfdc2f5528c658cb178b4e78d54e96cb452859b01dd756ca0245bdd586fb450e84988071428c80af0a6dc5f16dea8094da3acb51ac5d2a710414256b2423e0333584437ea9a65a07f06bd241103a478d137e9a274a78a19d3ca121f1bc10e4c9e5fc277d23107db1fb447f71ba0f92b20e3ead77cffaca25f772182705a75e500d9aab3996bfda042f4bdfe35a3a477e355c76a711ad0f64848d6144073ce6ec4152c87973fc3e69626523463812061c51f51fc08487e8a4dbae1ca7965c11f222c607688b3384c5c29d4fe91d14d2cc940a6a9d94486d1823261928d88f56fe00e206d7a31734de0217afd38afa3d2cf3499c2dcff13332a369c4b1f39867f6dfc83ec32d19b931b082f07acac7e70bdd537e8432245c11662d89ec3cc97e582de5d2cc6bde7"; +static const char *ST_HASH_06241 = "2b5da9924119fde5270f712ba3c3e4974460416e8465f222149499908c2fca0a4753b581f26625d11c4d3f49bdeb1c95bc3e17629d7e19ffb66175e5feab90a4fd670194f95d578266f3f54e61b82dc00efc2bb4438e19c3f6d7a92825a7625d88ec6286ab4e1761749edc83dad4340fd167544f09913fd6b03775013ff232fc4dad6f726ef82ad4bd1c5227a7796d7db35a912beeda5b0cdd798bc34d3ac24403c87dc672a983687dd64f920c991840a56105a6311797eed9976014909700366420673f6455242c71151ac75903a353538ec24b4feb967e2b46886395cf3e934e83a6a58ef2c0180273a0c33ba2bd870b1d84afb03d5558dc17bc7fb586404ad9a7e506ed859540110c6ad73f0f1d2be47829bc666e1838ec3f1dc1f610206241ce07fbf2542ecef9348b37aa460815794ca582709697cbf0c90c3dae4cb9dd97b29d3c7d82bd8d0c81d708e74c7007468c6c55a40fd4f803a4f5a75818d7da0d1ef333b8622e7de516fa62a6fa2b8d6d5d23653dfcedffec771456ee204e5c85ee88defbe195462fbe8ce0e2a5a455dab66478b877ec37dfa66f19ab5201c56cd707ba7bee1b10360965d3868c1fdf91dda124b1b0994fee75848083d19369735905bd2864b496c6e35ecf96f6dd4728570a45746bcf8d7d0ec0b9b0b112b28fdc53efcfa7d0558c132cd683a742d62b34304d9f991029c8aedc3d8767da8c"; +static const char *ST_HASH_06242 = "debcc3e74a7b2acb4c7eaa4ac86fd6431da1d9579f4f76f0b31f07b3d36e65099daca9e4ae569114b3cb6e64d707b6206a2ab6b31ab0c17b356da3719d0e2fa4058f0349763970855d4c83b02a967bb2969f1b6f3e4fdbce37c6df203efbe87bfdb5ffd8fe376e9ad61862a8f659ef0db39e06ed34c4f80aa856df2219ac6a37ebb0244445db7e412b773f4e28846c5e65129cd4f4ce76979c083f08a7c4e2be30469b8363eaf8579baa870cdcb2bdca6b60e64559cb0def242576b80722bf36eb6d94640d2937b49edf9c9af67f0172f27319448425f86831c35ae35e764b9e69fcc47a42ba7a565d682366023291b1b4cbcd1b7ba6fba75c214e5849a9ba26197f7f010f01301dcbffaa7311f2ab32c2810470d3fe873334ca578adbfd04c5a39cbd53b09755e4d868dbf8a44d76cc91031f4710b8a985c70738b443572b4745ed10e6120852870b0fdb258f0a804d679eec85b5290235c9c526165b961f17ff0fe32d9f597c8f2ab9b84f3d22fef71fec67987e687590de6ab11b33f1b06f23c38ead94c3de419061b6568612c27517b0a3395e401a2c6058fc5f41f0e084e8f2157b6486624314b1f341f74cfdec9deaed7abf89ccf97b47441493e5086f1351f42a5c0929f6431753baadcd2fb347b8835d08250743bb45aaf1c6bb30eed98e911a273074b7e8ebad2174b527b1b84e1961967bf358711346482d9db1c7"; +static const char *ST_HASH_06243 = "5e6628907291b0b74a4f43a23fb0693acb71c4379c3a3cc0eafbab40036bbdadfede179e04484aca0f5b6ecf7c7e8abe61d6836be6590838b8f9027da93ba77d076b9a557c958159c5dcddfb70823b7e324bd99b40a8f39410f6afd279df3493b58b9ffce41b65f3afd2fc467f4553a946b85e6ffc74b91c9c38c689d98419339a84d3c6d116274e34482d546407006ee04af03b594998127b2a9716ca4278b1f3050d015af10a9bb11db0465373f3a786c148bb20473377d8e97264b1c4d7ec4179829ce929573b26e5987b59da8591e2dc8e3934830dd0b5ac521c8637e9bb31e4bc084d53bc6a8dc6875e857a4c8c32a577eed3c6cea5beef514160982be2c7d7e2f4d65efa3f4a0e11ac1860ff3160e7cd968e18019abfd0395080a9f8e860c627fc32c63c8b7ef46b203c63cf0f12c05ea65b1f83a5f1fc6ad6cc200a9527151c2b8016a38f1e87be9c960088eaaa98a01d9db8cdacaae26c446a846042a6c0248b666eea7a1be44dc3fc35ce100c3a3eb377e898deb097cfba9246685d7ec8527cdc5e1983c154169178e3d86cd4017606ccc42d25cbdea0aca2b1ac422372cfbb1ad2b7d465449a2c1fbbae35c8e7fdaadd683a7dc991b76aaba08b8706916924407392a2aef458c2e833290dc1ff116f3f49f918e6a133b60728ac7c464e4f3521784cf32866be32877534bb014312c4301d1740781221a5e8758ea4"; +static const char *ST_HASH_06300 = "{smd5}17800721$WkGka7tXcrfpUQS6WOQyw/"; +static const char *ST_HASH_06400 = "{ssha256}06$2715084824104660$1s/s4RZWEcvZ5VuWPXWGUfwSoG07eVSVce8F6ANJ.g4"; +static const char *ST_HASH_06500 = "{ssha512}06$4653718755856803$O04nVHL7iU9Jguy/B3Yow.veBM52irn.038Y/Ln6AMy/BG8wbU6ozSP8/W9KDZPUbhdsbl1lf8px.vKJS1S/.."; +static const char *ST_HASH_06600 = "1000:d61a54f1efdfcf57:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000afdb51c887d14df6200bbde872aabfd9e12a1f163eed40e6b3ec33ba394c47e9"; +static const char *ST_HASH_06700 = "{ssha1}06$5586485655847243$V5f1Ff1y4dr7AWeVSSdv6N52..Y"; +static const char *ST_HASH_06800 = "82dbb8ccc9c7ead8c38a92a6b5740f94:500:pmix@trash-mail.com"; +static const char *ST_HASH_06900 = "df226c2c6dcb1d995c0299a33a084b201544293c31fc3d279530121d36bbcea9"; +static const char *ST_HASH_07000 = "AK1FCIhM0IUIQVFJgcDFwLCMi7GppdwtRzMyDpFOFxdpH8="; +static const char *ST_HASH_07100 = "$ml$1024$2484380731132131624506271467162123576077004878124365203837706482$89a3a979ee186c0c837ca4551f32e951e6564c7ac6798aa35baf4427fbf6bd1d630642c12cfd5c236c7b0104782237db95e895f7c0e372cd81d58f0448daf958"; +static const char *ST_HASH_07200 = "grub.pbkdf2.sha512.1024.03510507805003756325721848020561235456073188241051876082416068104377357018503082587026352628170170411053726157658716047762755750.aac26b18c2b0c44bcf56514d46aabd52eea097d9c95122722087829982e9dd957b2b641cb1e015d4df16a84d0571e96cf6d3de6361431bdeed4ddb0940f2425b"; +static const char *ST_HASH_07300 = "3437343735333336383831353232323433383333303236303337333338363232303135383237333638363532373231343030313131333838323734373138363632343133333335353030353633373533333133313530363533303738343334313330303630343633333237373037383537333630303233303830303437323838333237313438363238343434383831363634323431333430383735323038:f4b376e25868751fc0264f573ff1fe50b65ce5a2"; +static const char *ST_HASH_07400 = "$5$7777657035274252$XftMj84MW.New1/ViLY5V4CM4Y7EBvfETaZsCW9vcJ8"; +static const char *ST_HASH_07500 = "$krb5pa$23$user$realm$salt$5cbb0c882a2b26956e81644edbdb746326f4f5f0e947144fb3095dffe4b4b03e854fc1d631323632303636373330383333353630"; +static const char *ST_HASH_07700 = "027642760180$77EC38630C08DF8D"; +static const char *ST_HASH_07800 = "604020408266$32837BA7B97672BA4E5AC74767A4E6E1AE802651"; +static const char *ST_HASH_07900 = "$S$C20340258nzjDWpoQthrdNTR02f0pmev0K/5/Nx80WSkOQcPEQRh"; +static const char *ST_HASH_08000 = "0xc0071808773188715731b69bd4e310b4129913aaf657356c5bdf3c46f249ed42477b5c74af6eaac4d15a"; +static const char *ST_HASH_08100 = "1130725275da09ca13254957f2314a639818d44c37ef6d558"; +static const char *ST_HASH_08200 = "9b6933f4a1f65baf02737545efc8c1caee4c7a5a82ce3ab637bcc19b0b51f5c5:30b952120ca9a190ac673a5e12a358e4:40000:e29b48a8cfd216701a8ced536038d0d49cf58dd25686e02d7ba3aa0463cc369062045db9e95653ac176e2192732b49073d481c26f29e1c611c84aaba93e553a6c51d1a9f7cfce0d01e099fb19f6a412bacd8034a333f7165fda1cc89df845e019c03ac9a09bc77b26c49524ade5c5a812230322f014f058b3bb790319e4a788f917aa164e56e78941f74e9c08921144e14be9b60da1a7321a0d178a1b8c1dcf83ffcadcb1599039049650577780d6913ee924e6529401e7a65b7d71c169a107e502dbd13b6b01c58e0483afb61b926313fa4273e685dd4890218bb797fab038c6a24df90883c7acd2358908edc1f7d95ef498757a3e0659aaaf6981c744ab69254267127fc806cf3cd1ced99ab455ece06479c91c892769af5db0c0f7a70dd83e4341bf86d085bbdc6a7e195ab08fc26"; +static const char *ST_HASH_08300 = "pi6a89u8tca930h8mvolklmesefc5gmn:.fnmlbsik.net:35537886:1"; +static const char *ST_HASH_08400 = "7f8d1951fe48ae3266980c2979c141f60e4415e5:5037864764153886517871426607441768004150"; +static const char *ST_HASH_08500 = "$racf$*8481*6095E8FCA59F8E3E"; +static const char *ST_HASH_08600 = "3dd2e1e5ac03e230243d58b8c5ada076"; +static const char *ST_HASH_08700 = "(GDJ0nDZI8l8RJzlRbemg)"; +static const char *ST_HASH_08800 = "$fde$16$ca56e82e7b5a9c2fc1e3b5a7d671c2f9$16$7c124af19ac913be0fc137b75a34b20d$eac806ae7277c8d48243d52a8644fa57a817317bd3457f94dca727964cbc27c88296954f289597a9de3314a4e9d9f28dce70cf9ce3e1c3c0c6fc041687a0ad3cb333d4449bc9da8fcc7d5f85948a7ac3bc6d34f505e9d0d91da4396e35840bde3465ad11c5086c89ee6db68d65e47a2e5413f272caa01e02224e5ff3dc3bed3953a702e85e964e562e62f5c97a2df6c47547bfb5aeeb329ff8f9c9666724d399043fe970c8b282b45e93d008333f3b4edd5eb147bd023ed18ac1f9f75a6cd33444b507694c64e1e98a964b48c0a77276e9930250d01801813c235169a7b1952891c63ce0d462abc688bd96c0337174695a957858b4c9fd277d04abe8a0c2c5def4b352ba29410f8dbec91bcb2ca2b8faf26d44f02340b3373bc94e7487ce014e6adfbf7edfdd2057225f8aeb324c9d1be877c6ae4211ae387e07bf2a056984d2ed2815149b3e9cf9fbfae852f7dd5906c2b86e7910c0d7755ef5bcc39f0e135bf546c839693dc4af3e50b8382c7c8c754d4ee218fa85d70ee0a5707a9f827209a7ddb6c2fb9431a61c9775112cc88aa2a34f97c2f53dfce082aa0758917269a5fc30049ceab67d3efd721fee021ffca979f839b4f052e27f5c382c0dd5c02fd39fbc9b26e04bf9e051d1923eff9a7cde3244902bb8538b1b9f11631def5aad7c21d2113bcdc989b771ff6bf220f94354034dd417510117b55a669e969fc3bc6c5dcd4741b8313bf7d999dc94d4949f27eec0cd06f906c17a80d09f583a5dd601854832673b78d125a2c5ad0352932be7b93c611fee8c6049670442d8c532674f3d21d45d3d009211d2a9e6568252ac4682982172cb43e7c6b05e85851787ad90e25b77cce3f7968d455f92653a1d3790bc50e5f6e1f743ac47275ffa8e81bbe832a8d7d78d5d5a7c73f95703aebb355849ae566492093bd9cb51070f39c69bb4e22b99cc0e60e96d048385bb69f1c44a3b79547fbc19a873a632f43f05fa2d8a6f9155e59d153e2851b739c42444018b8c4e09a93be43570834667d0b5a5d2a53b1572dab3e750b3f9e641e303559bace06612fbd451a5e822201442828e79168c567a85d8c024cd8ce32bf650105b1af98cc5428675f4f4bbede37a0ef98d1533a8a6dcb27d87a2b799f18706f4677edaa0411becac4c591ede83993aedba660d1dd67f6c4a5c141ad3e6e0c77730cb0ecbf4f4bd8ef6067e05ca3bc563d9e1554a893fea0050bdd1733c883f533f87eac39cceee0ccf817fc1f19bcfdd13e9f241b89bfb149b509e9a0747658438536b6705514cc6d6bb3c64c903e4710435d8bebc35297d1ebbdff8074b203f37d1910d8b4637e4d3dab997f4aa378a7a67c79e698a11e83d0d7e759d0e7969c4f5408168b282fe28d3279ec1d4cc6f85a0f8e5d01f21c7508a69773c44167ff8d467d0801f9ec54f9ee2496d4e7e470214abc1ca11355bb18cd23273aac6b05b47f9e301b42b137a2455758c24e2716dcd2e55bbeb780f592e664e7392bf6eccb80959f24c8800816c84f2575e82e1f3559c33a5be7a3a0c843c2989f486b113d5eeada007caf6b5a0f6d71e2f5c09a4def57c7057168051868317a9ec790d570d76a0d21a45ad951c475db5a66101475871147c5a5907ec4e6b14128ed6695bb73c1c97952e96826eeb6003aa13462093e4afc209627241f03b0247e110fbab983640423b7cdf112e01579fed68c80ac7df7449d9d2114b9ae5539c03c2037be45c5f74e7357b25c6a24b7bd503864437147e50d7ac4ccc4bbd0cabecdc6bac60a362285fe450e2c2d0a446578c8880dc957e6e8061e691b83eb8062d1aad476e0c7b25e4d5454f1288686eb525f37fe649637b235b7828366b0219a9c63d6ddbb696dc3585a2ebfbd5f5e4c170d6784ab9993e15142535e194d2bee3dc9477ef8b8e1b07605e0c04f49edf6d42be3a9dabbc592dde78ce8b7dd9684bfcf4ca2f5a44b1872abe18fb6fa67a79390f273a9d12f9269389629456d71b9e7ed3447462269a849ce83e1893f253c832537f850b1acce5b11d2ba6b7c2f99e8e7c8085f390c21f69e1ce4bbf85b4e1ad86c0d6706432766978076f4cada9ca6f28d395d9cc5e74b2a6b46eb9d1de79eeecff7dc97ec2a8d8870e3894e1e4e26ccb98dd2f88c0229bbd3152fa149f0cc132561f"; +//static const char *ST_HASH_08900 = "SCRYPT:1024:1:1:Mzg3MjYzNzYwMzE0NDE=:uM7P3Kg2X9En9KZPv3378YablKcuUoQ1mwunXdg3o1M="; +static const char *ST_HASH_09000 = "0a3f352686e5eb5be173e668a4fff5cd5df420927e1da2d5d4052340160637e3e6a5a92841a188ed240e13b919f3d91694bd4c0acba79271e9c08a83ea5ad387cbb74d5884066a1cb5a8caa80d847079168f84823847c631dbe3a834f1bc496acfebac3bff1608bf1c857717f8f428e07b5e2cb12aaeddfa83d7dcb6d840234d08b84f8ca6c6e562af73eea13148f7902bcaf0220d3e36eeeff1d37283dc421483a2791182614ebb"; +static const char *ST_HASH_09100 = "(HC34tD3KtDp4oCZWmCJ4qC30mC30mC3KmC30mCcA5ovrMLH9M)"; +static const char *ST_HASH_09200 = "$8$84486783037343$pYNyVrtyMalQrZLxRi7ZLQS1Fl.jkYCgASUi5P8JNb2"; +static const char *ST_HASH_09300 = "$9$87023684531115$phio0TBQwaO7KZ8toQFyGFyDvyOzidaypRWN0uKX0hU"; +static const char *ST_HASH_09400 = "$office$*2007*20*128*16*18410007331073848057180885845227*944c70a5ee6e5ab2a6a86ff54b5f621a*e6650f1f2630c27fd8fc0f5e56e2e01f99784b9f"; +static const char *ST_HASH_09500 = "$office$*2010*100000*128*16*34170046140146368675746031258762*de5bc114991bb3a5679a6e24320bdb09*1b72a4ddffba3dcd5395f6a5ff75b126cb832b733c298e86162028ca47a235a9"; +static const char *ST_HASH_09600 = "$office$*2013*100000*256*16*67805436882475302087847656644837*0c392d3b9ca889656d1e615c54f9f3c9*612b79e33b96322c3253fc8a0f314463cd76bc4efe1352f7efffca0f374f7e4b"; +static const char *ST_HASH_09700 = "$oldoffice$0*55045061647456688860411218030058*e7e24d163fbd743992d4b8892bf3f2f7*493410dbc832557d3fe1870ace8397e2"; +static const char *ST_HASH_09710 = "$oldoffice$0*55045061647456688860411218030058*e7e24d163fbd743992d4b8892bf3f2f7*493410dbc832557d3fe1870ace8397e2"; +static const char *ST_HASH_09720 = "$oldoffice$0*55045061647456688860411218030058*e7e24d163fbd743992d4b8892bf3f2f7*493410dbc832557d3fe1870ace8397e2:91b2e062b9"; +static const char *ST_HASH_09800 = "$oldoffice$3*83328705222323020515404251156288*2855956a165ff6511bc7f4cd77b9e101*941861655e73a09c40f7b1e9dfd0c256ed285acd"; +static const char *ST_HASH_09810 = "$oldoffice$3*83328705222323020515404251156288*2855956a165ff6511bc7f4cd77b9e101*941861655e73a09c40f7b1e9dfd0c256ed285acd"; +static const char *ST_HASH_09820 = "$oldoffice$3*83328705222323020515404251156288*2855956a165ff6511bc7f4cd77b9e101*941861655e73a09c40f7b1e9dfd0c256ed285acd:b8f63619ca"; +static const char *ST_HASH_09900 = "22527bee5c29ce95373c4e0f359f079b"; +static const char *ST_HASH_10000 = "pbkdf2_sha256$10000$1135411628$bFYX62rfJobJ07VwrUMXfuffLfj2RDM2G6/BrTrUWkE="; +static const char *ST_HASH_10100 = "583e6f51e52ba296:2:4:47356410265714355482333327356688"; +static const char *ST_HASH_10200 = "$cram_md5$MTI=$dXNlciBiOGYwNjk5MTE0YjA1Nzg4OTIyM2RmMDg0ZjgyMjQ2Zg=="; +static const char *ST_HASH_10300 = "{x-issha, 1024}BnjXMqcNTwa3BzdnUOf1iAu6dw02NzU4MzE2MTA="; +static const char *ST_HASH_10400 = "$pdf$1*2*40*-1*0*16*01221086741440841668371056103222*32*27c3fecef6d46a78eb61b8b4dbc690f5f8a2912bbb9afc842c12d79481568b74*32*0000000000000000000000000000000000000000000000000000000000000000"; +static const char *ST_HASH_10410 = "$pdf$1*2*40*-1*0*16*01221086741440841668371056103222*32*27c3fecef6d46a78eb61b8b4dbc690f5f8a2912bbb9afc842c12d79481568b74*32*0000000000000000000000000000000000000000000000000000000000000000"; +static const char *ST_HASH_10420 = "$pdf$1*2*40*-1*0*16*01221086741440841668371056103222*32*27c3fecef6d46a78eb61b8b4dbc690f5f8a2912bbb9afc842c12d79481568b74*32*0000000000000000000000000000000000000000000000000000000000000000:6a8aedccb7"; +static const char *ST_HASH_10500 = "$pdf$2*3*128*-4*1*16*62888255846156252261477183186121*32*6879919b1afd520bd3b7dbcc0868a0a500000000000000000000000000000000*32*0000000000000000000000000000000000000000000000000000000000000000"; +static const char *ST_HASH_10600 = "$pdf$5*5*256*-1028*1*16*28562274676426582441147358074521*127*a3aab04cff2c536118870976d768f1fdd445754d6b2dd81fba10bb6e742acd7f2856227467642658244114735807452100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*127*00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*32*0000000000000000000000000000000000000000000000000000000000000000*32*0000000000000000000000000000000000000000000000000000000000000000"; +static const char *ST_HASH_10700 = "$pdf$5*6*256*-1028*1*16*62137640825124540503886403748430*127*0391647179352257f7181236ba371e540c2dbb82fac1c462313eb58b772a54956213764082512454050388640374843000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*127*00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*32*0000000000000000000000000000000000000000000000000000000000000000*32*0000000000000000000000000000000000000000000000000000000000000000"; +static const char *ST_HASH_10800 = "07371af1ca1fca7c6941d2399f3610f1e392c56c6d73fddffe38f18c430a2817028dae1ef09ac683b62148a2c8757f42"; +static const char *ST_HASH_10900 = "sha256:1000:NjI3MDM3:vVfavLQL9ZWjg8BUMq6/FB8FtpkIGWYk"; +static const char *ST_HASH_11000 = "f22cade043e7214200206dbffca49fd9:27167508161455764247627144160038845437138252877014827848"; +static const char *ST_HASH_11100 = "$postgres$postgres*74402844*4e7fabaaf34d780c4a5822d28ee1c83e"; +static const char *ST_HASH_11200 = "$mysqlna$2576670568531371763643101056213751754328*5e4be686a3149a12847caa9898247dcc05739601"; +static const char *ST_HASH_11300 = "$bitcoin$96$c265931309b4a59307921cf054b4ec6b6e4554369be79802e94e16477645777d948ae1d375191831efc78e5acd1f0443$16$8017214013543185$200460$96$480008005625057442352316337722323437108374245623701184230273883222762730232857701607167815448714$66$014754433300175043011633205413774877455616682000536368706315333388"; +static const char *ST_HASH_11400 = "$sip$*72087*1215344588738747***342210558720*737232616*1215344588738747*8867133055*65600****MD5*e9980869221f9d1182c83b0d5e56a7db"; +static const char *ST_HASH_11500 = "c762de4a:00000000"; +static const char *ST_HASH_11600 = "$7z$0$14$0$$11$33363437353138333138300000000000$2365089182$16$12$d00321533b483f54a523f624a5f63269"; +static const char *ST_HASH_11700 = "57e9e50caec93d72e9498c211d6dc4f4d328248b48ecf46ba7abfa874f666e36"; +static const char *ST_HASH_11800 = "5d5bdba48c8f89ee6c0a0e11023540424283e84902de08013aeeb626e819950bb32842903593a1d2e8f71897ff7fe72e17ac9ba8ce1d1d2f7e9c4359ea63bdc3"; +static const char *ST_HASH_11900 = "md5:1000:NjAxMDY4MQ==:a00DtIW9hP9voC85fmEA5uVhgdDx67nSPSm9yADHjkI="; +static const char *ST_HASH_12000 = "sha1:1000:MTYwNTM4MDU4Mzc4MzA=:aGghFQBtQ8+WVlMk5GEaMw=="; +static const char *ST_HASH_12001 = "{PKCS5S2}NTczNTY0NDY2NjQyNzU1Mx8gGiRGobaZYwumctGHbn2ZOHB8LkwzH+Z1gkWfy1zD"; +static const char *ST_HASH_12100 = "sha512:1000:NzY2:DNWohLbdIWIt4Npk9gpTvA=="; +static const char *ST_HASH_12200 = "$ecryptfs$0$1$4207883745556753$567daa975114206c"; +static const char *ST_HASH_12300 = "8F75FBD166AFDB6D7587DAB89C2F15672AAC031C5B0B5E65C0835FB130555F6FF4E0E5764976755558112246FFF306450C22F6B7746B9E9831ED97B373992F9157436180438417080374881414745255"; +static const char *ST_HASH_12400 = "_GW..8841inaTltazRsQ"; +static const char *ST_HASH_12500 = "$RAR3$*0*45109af8ab5f297a*adbf6c5385d7a40373e8f77d7b89d317"; +static const char *ST_HASH_12600 = "3f3473a071b1fb955544e80c81853ca0f1e4f9ee4ca3bf4d2a8a10b5ef5be1f6:6058321484538505215534207835727413038041028036676832416353152201"; +static const char *ST_HASH_12700 = "$blockchain$288$713253722114000682636604801283547365b7a53a802a7388d08eb7e6c32c1efb4a157fe19bca940a753d7f16e8bdaf491aa9cf6cda4035ac48d56bb025aced81455424272f3e0459ec7674df3e82abd7323bc09af4fd0869fd790b3f17f8fe424b8ec81a013e1476a5c5a6a53c4b85a055eecfbc13eccf855f905d3ddc3f0c54015b8cb177401d5942af833f655947bfc12fc00656302f31339187de2a69ab06bc61073933b3a48c9f144177ae4b330968eb919f8a22cec312f734475b28cdfe5c25b43c035bf132887f3241d86b71eb7e1cf517f99305b19c47997a1a1f89df6248749ac7f38ca7c88719cf16d6af2394307dce55600b8858f4789cf1ae8fd362ef565cd9332f32068b3c04c9282553e658b759c2e76ed092d67bd55961ae"; +static const char *ST_HASH_12800 = "v1;PPH1_MD4,54188415275183448824,100,55b530f052a9af79a7ba9c466dddcb8b116f8babf6c3873a51a3898fb008e123"; +static const char *ST_HASH_12900 = "15738301074686823451275227041071157383010746868234512752270410712bc4be900bf96ccf43c9852fff49b5f5874a9f6e7bf301686fa6d98286de151f15738301074686823451275227041071"; +static const char *ST_HASH_13000 = "$rar5$16$38466361001011015181344360681307$15$00000000000000000000000000000000$8$cc7a30583e62676a"; +static const char *ST_HASH_13100 = "$krb5tgs$23$*user$realm$test/spn*$b548e10f5694ae018d7ad63c257af7dc$35e8e45658860bc31a859b41a08989265f4ef8afd75652ab4d7a30ef151bf6350d879ae189a8cb769e01fa573c6315232b37e4bcad9105520640a781e5fd85c09615e78267e494f433f067cc6958200a82f70627ce0eebc2ac445729c2a8a0255dc3ede2c4973d2d93ac8c1a56b26444df300cb93045d05ff2326affaa3ae97f5cd866c14b78a459f0933a550e0b6507bf8af27c2391ef69fbdd649dd059a4b9ae2440edd96c82479645ccdb06bae0eead3b7f639178a90cf24d9a"; +static const char *ST_HASH_13200 = "$axcrypt$*1*10467*9a7cd609bb262c738d9f0e4977039b94*ecbe0fd05a96fd2099d88a92eebb76c59d6837dfe55b3631"; +static const char *ST_HASH_13300 = "$axcrypt_sha1$b89eaac7e61417341b710b727768294d"; +static const char *ST_HASH_13400 = "$keepass$*2*24569*0*c40432355cce7348c48053ceea0a28e7d18859c4ea47e3a799c6300861f64b95*265dafcc42e1537ff42e97e1e283c70014133be0fe2d420b4d24c6d57c9d2207*a00e20a852694c15aabb074d61b902fa*48dd553fb96f7996635f2414bfe6a1a8429ef0ffb71a1752abbef31853172c35*a44ae659958ad7fae8c8952cb83f3cf03fec2371ce22a8bf7fac1e687af2f249*1*64*5a26ea376cc5afc955104c334571d30486acbac512a94b75ca82a9e31dd97bf7"; +static const char *ST_HASH_13500 = "24eea51b53d02b4c5ff99bcb05a6847fdb2d9308:4f10a0de76e242040c28e9d3dd15c903343489c79765f9118c098c266b9ff505c95bd75bbe406ff3404849eea73930ad17937c0ba6fc3e7bb6d37362941318938b8af96d1292a310b3fd29a67e411ecb10d30247c99183a16951b3859054d4eba9dcd50709c7b21dee836d7ed195cc6b33317aeb557cc56392dc551faa8d5a0fb42212"; +static const char *ST_HASH_13600 = "$zip2$*0*3*0*74705614874758221371566185145124*1605*0**75bf9be92e8ab106ff67*$/zip2$"; +static const char *ST_HASH_13711 = "531aca1fa6db5118506320114cb11a9f00dade61720533fc12982b28ec71a1a3856ac6ee44b4acc207c8230352208d5f0dc37bf755bd98830279d6befcb6001cdf025f816a0aa1baf3b9b51be00fadb451ffbe9bdfc381115eeceeef778e29a8761f853b7c99e0ea9ec452ba77677f888ea40a39cf65db74d87147690684e273313dea15ff2039797e112006e5f80f2c5baf2c11eb62cb63cfb45883f8885fc7cd5bdb74ef57ec4fe3cec5c2025364582380366169d9419ac41b6f6e878429239e52538f9698e73700b920e7b58c56a4563f5aa512e334ddc56909ac2a0ad4146833f050edd78b7954e6549d0fa2e3b26ed2a769a6c029bfa4de62d49575acce078ef035e366ec13b6092cb205e481bc822f87972bfbe4a3915fad620c4b8645e96bcc468d5804208ae251a560068a09455657f4539dc7e80637fa85fbce058ffee421a98d85b2ae1118d9bd4f24e1e810627cc9893b7166e199dc91fd7f79740530a472df0948f285293478042b28cd2caef086a6ce9d5f656f97adde7d68924ef477fdf2a0c0b107671a1f94b2906d8fb58114836982e4e130e6944df8b42288512376553a1fa6526f9e46dc19b99bb568b30269d9f5d7db2d70a9aa85371b0ac71a6f6f564aaef26a0508c16bf03934973504a5188de37b18a689a020bc37a54d2863879e12902b43bc71c057fa47cbaac1e0100696af365e8226daeba346"; +static const char *ST_HASH_13712 = "6efa052302d814f368ebf5274e5718cdfd3c1cd5ce8949b963cf4c376a49a033348905f9f5bef7a5a097e3d2d05b09c35c3cb26836e75b45830345bc287903b1c7e2e20c056ba015769d6f5685b8c6a609acd9927afac24f80613c929c1b582553f6637f2523367df94c9c6c0d6ae6e19430313be3f8ea738da30bd910c567222b0d21a03ebc399192453f8dd64f7ae3eeef84e04b77858e678c9dfd30080fb68a8ec532ee8effa65b674c258df29de6f6f7345ffb0ab324cfea9edbc9e1c0366effe284f92a495a9d7901d1008d83fc39a31a750d5b305683e687c69a9321adbbacf09868078147be41ef5d35805ff0f3d4430042c6390b41483d26d287ee1c00fda37588794ea7223ef08be085924ec34f6de6bbc6f79f73ca4c13e7947851a9f220307f9da45c7370306cca3be0ac8a1e555f2f4b87e6bc39b37f2863061a8a62b9df70dd9c5c2ddf9022606bc38e221b9dc0d7a1c311ff7b36cbd97c2df70e1b5c860b03a1ac0cdb5a89f40b1a155be301dc5a96698743aa01527ac1b676440a3fdd68b462c4d77ccff59afb1f9b8ec8b82e7eb9147334d180243b77930ef87c3b2deb145267e5932223b5fbc76eabdc1e44cffb1b36649409565a521c3112119232f829c6ee9408f1c030eab522ae21083d851fb9df0773ba84ea8a6668044cecb82723e7720eb0fa7c0aa13871015452ad08d8b47d7e7fe0bdfde13b21"; +static const char *ST_HASH_13713 = "9c95d40f14ecd2a90f9d942f7869df881ff48bbe3b0fa6ae1d1bea56271844f00a8a40793eec1bc9240578269a1f40d825e6ad3351aa95b8b65b2b3089d8cfed07c2a3187735143f64cf55af972b045ac3fba3f744106ad1afa9bcfd9ae268ba8bca7168bb255507e2c10dff00c386ce442d898ff4db658645f65554b4b2d9d7a327402eadd6974d1dfbf7864680a514950be513dc5eea63d2e2297ff7c2dd256adc8dff9b7568e44c39150e3b2274badf28cecd27a6caed79675bbb66aa98f6a876a455d84b6190c598fa9198921a3e19ca7e00281a9789299db2b4317bc42375cd87461d0e690dea4a447228414d9452947a9a3cc30b727128c796ce1a2dfe8cc6d4a5984373e956ec7eac89412a49cd93ac5ebd1c0fe795413edd250fb7f4b63a04c54b194891a5ff8e05e8aeca0be9cca3b41182ae9634caac4647182f3d872753b8bf47a245eadcabe1e067c2783c15eaf8aa52ce8a27a14a647b6819bab62471e2a21caf69bccff414962308207141c28ac87ecab2e3bdb5d2501f8de8909ab0f585437e62b7bac42b5e157fcc7936c7d0142ca4a497710309074ae1774af8aff5975dc1061088614f36fe43c63f64d37bdee5da0a54955054a070f277176dd0dfdddbd6b61d028342204f9aba4088d90504d2940104bf40365db569b24b419ce261c5c4f15f509b98158490b8867ef6f629c1156919c5543b2639c7a4"; +static const char *ST_HASH_13721 = "2be25b279d8d2694e0ad1e5049902e717f1bdf741bbd678bf307d510741b649d78c54dca46fb2c92723afd9a40769b295e66d445ec232af5bddf91481ee41256e56b77839e8bf55265077bab405901218ac7933f74073f1208f1de72aace5da4e07d5f83ca580c0216d36c200b54570a1d58e9d8e5c98a597dec23b74a465aeac572a99af70e1a1e20fd29c7c296099e4eed5b715cb470617ea4f20140b62ec4694af67d9158deac3ce846718e10518875ce8cea0286a487a295979e67159d06e871789bf5535b75c809b340f8627e18679e3dab839a1c9823ea14a07d5cc4251b777dddb408da147c70e7cc788a01c27b0ba4f4700d3248f59fa8217874ae4958ea4518522b44f7191ec19459faef7678422adecd58777487ef54a5305ff2caaa545dcb82f7e7a3eb30bd9f7ebab542d0964a367f9c710cf26bbd704e841d591428da3486db31c57f91c6167bf99e31839363cb93bc60d755031f96f2d2c964e1d85b7eaa104985ef801a21d99352c025d7415d5b2f1aa37dc513345d0ff6a1bca92ad7b8c265f322d04f2992895de32636c9b03318cf7154632d547debc1c5e0c8f8730a045efcf3d16ff956cf803716eee22168bc5a5ab72ddb5087436722cb0f59a5b7b03bc557ffb50e8757d1a5639e2bcddd8060de4ee5535fb614b4fc159c6a39040dcbe83889b9c6fac1c9364a7bea930d916ea23fafa0fde07ef609"; +static const char *ST_HASH_13722 = "37e6db10454a5d74c1e75eca0bc8a70e67ac032357e4bd6a4315c0174cf9780f92210dfc0a3e977969f2890828d446aecc317dc40fb3162915998cc703e49257a950a1603342913900052011a7fa85fb0b1fd4489f17237ac1a8bbfd644e871ab95a4019f14b2b938d627646b9958b530dd0739760024ad323d36962b60ba92908e55a876fc392ac2dce6a2410bcdd30a01cba90427f02ccb96e222ab1381266a6f626aa00b0f59e743c1a77433cbb28648f04c91853bdf9b8b29917b2341bf7deb013131ad228ea0c7f9435985318431dae59faff46db3726341b97a956da4ad11766124cd06644c1ba1083b36d3f380f20c272e460b958841fc23be1820ad2e0e6db66eaf4ea171035add0ab543ce8e853e3119ceb9d7f32c0948b81604b81075bcb33efe747fec300a7c68ec383d28d560cccce713c0acf51d74c0db718ba93a9e720b657dda2409adf1ce35aa7e1c0d7ed3df98dd0b6d455a355ce02bda8bea8afc0a8341ac78214efd4372b4430270009ec65badf186e5f0d815dcf597b4703af95e3bfc03313125d2a88b9bb3788b6bbc3c7212713cd584a226b155a2e6872b33730af6fba29aa3dccdb0ec35b5d6e3d981faf39c8dd35fdcff502d14736bc6a47af6e4d7f3518f8ef5e0a4e5d521589a761757f86e2bef471d9867e9b532903c479e4966dcc99189fcdfa3d676f50ccd33fb7cc0aa3e85542ff2648c9"; +static const char *ST_HASH_13723 = "d44f26d1742260f88023d825729cc5a64cf8475d887632a2fb4a84af27af138cfadc4bcbb122f6ba68339ae8427d1f72c0c4aeef041291492ae0a7d8677d8da43227ae2a26d9a433076b44458b14f52766cf0e4baeb473a789180660d62e42bbea7c042379a5a74e259463e1c18381fa13aee27141264be381de71c12f8f704913f211c45fda0295e963d90fc35272e907858c0522601f6e7a73b43ff222663f149a485fc6c464e5f3b7cc0b6508f30621385365ca8a4e0bff4061f64f5fbdb11f70f19d77e56fa6ff015ad76ecaaccd759d30da05d2a6fbf00ac9673ac3c23efd339313c2a99511e928f976bf9b2664d97685498d5931af2d453edc6fb1129e324eaba64264711fbe21d0d202b3659106e8100634f09c38cd15b1b3acba79d7f31d31fe23c166392e300db09f10550c83187566dc0fdf768b872555851b34e3c15ad7e7438a72e6126c895cf1204987df4b42cb7bc2fe03c5777867d269378c6e496df2a1a3457b907f7143a139d800868ad95e2901723c6ebb991054b4e991c67fe4c17702d9829d9dc1fe8bf4a956460721c858e31dbcbe56850a4ed31558c6ee89ba2cba2ef4bde77fed11848f9f92e0add54964a683c3686dbab4695ebc42554da922a08c6fff32cac936ea447e771aa74a689eb269ffef677294ef297600dfd73bbbb734d2968e38a98b4a8a77ff0eec8246d93b542e3521a3eb636101"; +static const char *ST_HASH_13731 = "48f79476aa0aa8327a8a9056e61450f4e2883c9e9669142f2e2f022c2f85303b897d088dea03d64329f6c402a56fed05b3919715929090a25c8ae84c67dbdb364ebfa3e9ccc0b391c130a4c3dd6495a1d6eb5d2eab72f8009096f7475ecb736bb3225b6da144e1596d859dad159fae5a739beea88ea074771e9d0b2d7c48ae302606a60d7cff6db54f3e460c548c06a4f47dc1ac203a8c8349fbff6a652219a63f27bc76327543e22be4f8dab8e4f90a4283fbf1552119fe24114ce8869eb20ce87dd72300f7aad3f7b4a26a355f16517725449151cf0373dbd0b281f6ac753485a14a5361cc75d40928e241a6b4684658801774843238048cf8c7f2fd88950abac040e12b0c41fdcaca3702907e951ec11c061a91b3050a4855abe6f3b50b4bd0b17c4be1f5b50b873eadc2d8446cd72c4fcac576bbce3acea769f740c5322ee8c927ffd4dd11c8a9e66f06e58df2e5d4d85c13b44c412bab839c9512b7a0acdd97b37dcccc4b70854eda0f36de12d62dd10cc13bc6154103d083bf6540bc78e5d0aad5d063cc74dad4cbe6e060febda2a9fd79c238f99dcb0766ff4addcfd0c03e619c765f65b1c75d5d22c6536958bcda78077ff44b64c4da741bf50154df310d4e0724238a777b524237b9478277e400ad8146dc3ca1da83e3d2f1c5115a4b7fcdc71dd7d56ba86a2f9b721c9a4137aabb07c3c5fedcf5342c4fae4898c9"; +static const char *ST_HASH_13732 = "1b721942019ebe8cedddbed7744a0702c0e053281a467e0ed69bf875c7406407d72eb8f2aea21270e41898c0a2c14382f86e04c15e7bc019d1d9dd813eabee0ae5173e3cb1d927859d3e6de1006335a5184ae12b4c8dc2db2b1cd785063152a776f4dc5cacc1856a919b880d704b7450f5a0e0c9521bc9b4d67213c36a50e6664a1cbcea33f997b858e654111c7e9fca74f361528e85a28880381ec2600e3c1cd508c3833dd21cc91978185cba53caefd7b3c82d219d49f0b41e536d32e8d3ce194ad7923ca742213e19dcebdbd9687979d5a594654a5c611e8b829c4019e90a3cfb14e5fd7f8ed91e0fc79eed182399f02a3e3e202d4becaa6730e1f05f99ce06ce16dba7777ccddac72e85f2d3be5ecc9c808ac273f10ceb71cad666166abc327c4061a5f47424a5b6d9d093782f34b49924342a2e8cea663446ed4232a9a415ee2dfde988fa827b06d7438fec20ad0689543c3ee4602ce3ec3806fc7d668ef7e34330edd1e077b329a7627fa3ae5c89308258a17ecefbee114c80c2ab06f8271f14de8f2d13d1d6e5a119b71a6bae88ab151f76cdb2442284bc481d0df7e2163c3acfe763d3968195450d275af9034a00184a30cefed163e636626bffe6a35df3472508a49cb2b9b4c4a95d11c5d17e4e0539e9f13112125515778bcd1c2813c62a02673663062ad60583ec6a02c8a572865829e5b8c767b285728bea4907"; +static const char *ST_HASH_13733 = "5eb128daef63eff7e6db6aa10a8858f89964f47844acca68df82ebb2e73866fa75e3b7a53f9d2ff1ecdd1f4dc90e9c0fdf51f60d11b1992cd2971b4889edfc8920bbf346fd7693f675b617cb9e4e9a43e6f445021068fc13453b130f2eb1d753ee83ecc61dabec293e88b62110cf6a8fab670e171f6aba2226550b54893263f5fa086b3cc41dd3db2eae07b585e5162c7a0d9723a426d408d83266c4d6018dc1b8b456d28a224033a30bfe62b1e58c2ddf596e07f7ff31849a6f5cfcc1c977b82d8484c270d44ededb0afdb781295e92968fc8cc69766af0ce1e72f02d6b4e124ba4b1af71519dcaade857bb3f371f93a350da6e65ee46c2ac782f134c75c10fe9d653fccc08c614dc362871911af8b83bdfc479f770dfe4b3c86b5d895842c53852fe4912738f848bf7c3e10b8189d25faceab9ef30b6fa0284edaa471752ac2b65335179b8d605417709f64fded7d94383618a921660d4cdb190bbb3769a8e56d2cd1ee07078ebc3b68ebeb016893f7099018e40cb326e32b29a62806eaf1a3fd382f4f876bf721eadfc019c5545813e81fd7168995f743663b136762b07910a63b6eec5b728a4ad07a689cceecb14c2802f334401a0a4fd2ec49e2da7f3cb24d6181f01ceed93ee73dedc3378133c83c9a71155c86785ff20dd5a64323d2fd4bf076bab3c17a1bb45edf81c30a7bd7dbbb097ece0dca83fff9138d56ae668"; +static const char *ST_HASH_13751 = "b8a19a544414e540172595aef79e6616f504799b40a407edfb69d40534e93f0bdb3187876f0b7a21739b3a9bb02bd4752eac4d2021e65a2a9413cc389964fad46e2cd37f337eb3fe3c75909fe9911609d084fb8c09543f949e738fc2fcfa4825ca5f1e08678e711142553f95b19ba720fa6c8ae5d325be0b36b93c1b2683b0944d2ad4e858c1d83f21a302ef721b9a570233219b9fcf95919fef9ca353af32d7ceb0b3058986c4ed9580b8058325403d45048e43d9e94a1e8fbaa0658f82f81940ea821e1bd526829ee6478a32da4095ab9e7c04dac3b6cc08f99348467a5bf068ba54d0aededdf6005c18ee37e21ee8d980cabe470be49d332661761934f5c07126001c290002587ba4b49982fefaac41b62f7e74ce943bb40a2d78094f734d1bc2aa3dedff43ee2a7b8f3525743c76194637da9ebc2794bac14601e03aa98e9118023a184970b6b8f84f546af88b81e2fde836e286b57cbcbdd7d39334860571a5cc612b77f0c51c741854abeb320bf961aea99b88798199bf826970f2b1b8027499955f68e15328080289d8cf0569057e1ed887f956ce72b14dd13a1f61134e1195d13c68d9c298ae0183107e3a93dd13ee0730f1fabe3935ee70f4c6a1923abb3e0d0c8ecf45260c1444e7e73386acf29d3239d0160e097e6193099e10cc98f61bfda49df6b0635e73a9ccc7bdcc543306b40dd12b91023f61b21418af91"; +static const char *ST_HASH_13752 = "1c3197f32dc5b72b4d60474a7a43afefb0d2e856a8fc4957c3fb1188b62cb0ca002f585c125bb33c5a5e85a665afae9fce15cb127c2fd9b5ee074a48fd95b3a58364dfd645968187d546443ba234f5cc40e78c4bdcd1e0c6d0a1208dd892442bc1dfe2a45bc4821e843bb6d9f4adf742c48c432daf0d4a51d42cafdfca281f0fab0caabde8005405840383bbfd8dbf227384891ffa501531549e0b9562c2dd77f0e6552d253acb20cbee9a75d17ec283a46006ee89cd53e3b538e054952ae6db7aac9f2f190590e697a2a8e22d080e88c32f4d27b5afe100647da2a5c80cfcb69e5a3db67cb2fcd86d89c1c53fab1bf3a287bb9002d092e75eb1fe6269a1603545dbf97b9d7fcc9485b6400f7b0abaccc31642cefd83f037e7314c6990c51af24ae894cc1c49a09d18f3ad91b3ef37ae5414fef280ec776d9c0bf84b2eb312c8cb0046bedf6f29b4aab30cdb34333f613000a39bf650341cbf33bdd47ba7bd9be8108a1254390b045d82b208d21aa45de7ca399f8e91845b9ffb47d9e6eeb506965622a2e842ec6897277388cbb6ca2a50117e228e84bebd98f9aba40f38dc3bce3b576cb08596836e50ef276ee3a76b8ce76735fd172e9bae284aa83e2677dac56e4624e66604a90e2e3ae704c64a0f27b51ce9e472891bbc212b4a6055e4482b2e6963507f9ffb477224372289fcfee5764a5f4bc7307a509e7c37c69b4857"; +static const char *ST_HASH_13753 = "f421bdc1087b8319c12d84a680ceab0102e8e41c9ccffe76dbe0215dcfcb7b543f3e1bbedd099e88646823dae5bad8468b72436961ea8e0449a6b92b8bda7b9ba1fe215e997ec3be2ee5eb3b4d47c41d50998df2f883404fb66270f72b5ce666e7d5ca7847c4a8b2762723da1ad088b0ad75c4fd2ccbbfa4e3adf091b6af4f44f5484ce0c89a5b0db0cbe99b3a9d43d7ff6c4ddbc9636cacfedb26b59340c6eb3e8c587db41fc01f10da2974af96531b2bee5f0b9818c3b86a3cac4ba20e08c49be84af65eb40d51626161f4eef187bf5776a89e791f3f5cbcfaa510df201fb2bf35ff03e81d0572af9abbed3cac82681925a3d1954440a6037df78f7a1e63bea81c852571a21fb550f9fe114b82bf7b94290e362cef233186f17396488c0f259c83c50ac4f8cc27d3a134ddc98f14c2fe0dd6e7d6f5eec63848314dc5984979eeb79df326f80ee0e7f671072117903cb72bbbce4f750fca3f008dadf532241e05913704df6ca03edb9641775c3b6e3e328fd078c6d70298512118312cab8316bb6ddc0b860952c621b2bb4cec1b3c7da9b1cb4c494fec382fe85aefdc56570b54845a14651535d261db519be0e860a4e20c30c86cff6f9de6e16b68d09a0e9593d271df2740950e65f1fb16e3fee034183e540e2a3b0f76156f06946b5d1bfc62fe0cab3daa14603a8d21eb03a4d266e965b010c265c9a0e093084d262a8c03"; +static const char *ST_HASH_13800 = "060a4a94cb2263bcefe74705bd0efe7643d09c2bc25fc69f6a32c1b8d5a5d0d9:4647316184156410832507278642444030512402463246148636510356103432440257733102761444262383653100802140838605535187005586063548643765207865344068042278454875021452355870320020868064506248840047414683714173748364871633802572014845467035357710118327480707136422"; +static const char *ST_HASH_13900 = "058c1c3773340c8563421e2b17e60eb7c916787e:827500576"; +static const char *ST_HASH_14000 = "53b325182924b356:1412781058343178"; +static const char *ST_HASH_14100 = "4c29eea59d8db1e7:7428288455525516"; +static const char *ST_HASH_14400 = "fcdc7ec700b887e8eaebf94c2ec52aebb5521223:63038426024388230227"; +static const char *ST_HASH_14700 = "$itunes_backup$*9*ebd7f9b33293b2511f0a4139d5b213feff51476968863cef60ec38d720497b6ff39a0bb63fa9f84e*10000*2202015774208421818002001652122401871832**"; +static const char *ST_HASH_14800 = "$itunes_backup$*10*17a3b858e79bc273be43a9f113b71efe7ec8e7e401396b350180b4592ef45db67ffef7b2d64329a5*10000*2721336781705041205314422175267631184867*1000*99fafc983e732998adb9fadc162a2e382143f115"; +static const char *ST_HASH_14900 = "7090b6b9:04223875"; +static const char *ST_HASH_15000 = "bfa9fe5a404faff8b0d200385e26b783a163e475869336029d3ebaccaf02b5f16e4949279e8a33b942ab647f8f19a83dbe89a6d39dd6d8f84812de7d2e556767:6422386434050716105781561510557063652302782465168686858312232148"; +static const char *ST_HASH_15100 = "$sha1$20000$75552156$HhYMDdaEHiK3eMIzTldOFPnw.s2Q"; +static const char *ST_HASH_15200 = "$blockchain$v2$5000$288$324724252428471806184866704068819419467b2b32fd9593fd1a274e0b68bf2c72e5a1f5e748fd319056d1e47ca7b40767136a2d97d7133d14faaeca50986f66cdbc0faec0a3fabbd0ba5d08d5322b6b53da021aacfc439c45bec0e9fe02ad81db82f94e9bd36a7d4d76b505c2339fcd46565d3abab958fbeb1de8bfc53beb96cde8fe44128965477c9ef0762c62bbb1d66532b4888e174ea949db54374a2ed9686a63eb0b5b17ae293f7410bb4ae5106f108314a259c5fd097d558515d79350713412159103a8a174cd384a14f3da45efe18044e1146036000231f6042577d0add98fc959d265368e398dc1550b0bc693e9023cd9d51b40e701bd786e19c3a281a90465aa6ea3f9e756d430164ab2eb43be5b6796d7ac15b2fe99217410f2"; +static const char *ST_HASH_15300 = "$DPAPImk$1*1*S-15-21-466364039-425773974-453930460-1925*des3*sha1*24000*b038489dee5ad04e3e3cab4d957258b5*208*cb9b5b7d96a0d2a00305ca403d3fd9c47c561e35b4b2cf3aebfd1d3199a6481d56972be7ebd6c291b199e6f1c2ffaee91978706737e9b1209e6c7d3aa3d8c3c3e38ad1ccfa39400d62c2415961c17fd0bd6b0f7bbd49cc1de1a394e64b7237f56244238da8d37d78"; +static const char *ST_HASH_15400 = "$chacha20$*0400000000000003*35*0200000000000001*3961626364656667*8a152c57a7a856a8"; +static const char *ST_HASH_15500 = "$jksprivk$*338BD2FBEBA7B3EF198A4CBFC6E18AFF1E229367*5225850113575146134463704406336350011656*D5253EB151EB92DC73E542D8C0A4D7A848A5B0C0E370E625E6547D4E6F23416FC85A27BC295731B8021CDFBD003551C66C434FFBC87DACAD1FDF39022320034A2F86E779F2B1B3325428A666518FA89507AD63E15FD9C57B9E36EF5B642A2F448A9A3F09B79AD93D65F46B8692CD07539FD140146F8F219DC262971AF019E18EDC16C3C240569E1673F4D98BC818CCF28298D5A7BFF038A663DD10FE5E48643C3217C237D342164E2D41EF15075431FBD5B34800E5AE7EB80FAA5AE9982A55F35379AA7B31217E7F1C5F1964A15024A305AE4B3981FE1C80C163BC38ECA5581F11867E5C34C5D124D0367B3737E5E5BB14D2CAB26A698C8DAAB755C82BA6B823BCAECDD4A89C831651ACE5A6029FD0D3515C5D1D53AD8B9062CE8C445373862035CBBF60D490CA2E4975EE6E0358EC32E871FAB15347E3032E21F30F543BAAB01D779BA833CA0B8C7591B42C7C59A8FDD46D7DECEC0E91ADBF331177605E7830ABED62FAD7D5D806D8EFD01C38765940B7F97168FC72C39BF4C98F944FFC310CA8F4EB1D0F960F352CC5E2BB23A1EB221072A5471EDA2CE81C04595B8D37088CFB5C14F6A4A881AD12125DEFBB8154EB4C130AB7FD9933FD36DF1A6A26B51AB169866788678FCED988C8E017CA84354F487A5508210181AFB8B3AD0753E3E28BE674DFBD4E4FBDFD1E30D592F4EA3A77A2F0F5CF9A175DBC590EF5D42971A39918F12B92DCD8BFD56BE9A3459856B5587603C7B53062663A4C8894BBC9894FB1663BF30F32D907664328138B7A50EAC7F8E3183D74562A5C90FE1889AC4C5FE43EBEB8974563B6682F92591ECA4FA0DA72236C3851DA102DB6BA0CC07BFD32F7E962AB0EDCF4A8DEA6525174F5BB5C021E2A9A3F7F761E9CA90B6E27FB7E55CD91DA184FAC5E534E8AD25314C56CE5796506A0CA70881782F9C5147D87705065D68BD67D2B0344205BA6445D562273690004CA5A303274FB283A75F49BA968D7947943AA98F2AF9CB8253B425B86225E7395A331AC4CB1B1700C64D4F458D5D642C54148AE6DA41D9E26657D331B157D76042C2CF3057B83997C23D8BF68FB3C7337CAFB8B324AD0DF7A80B554B4D7F9AD6ED527E7932F1741A573C152A41610F6517E3F4A3BC6B66685871A7CE3795C559BD47CDB8E34CB2C1DFE980518D79E2078C258C54F312EB38609F640E7DC013E0F2A16A25BB5971882B4308D27930CA99FEC231AE927B62215A1B56098C362B7F20593953B29428681875070E84BF5B60BEA3948127151634123DA77C814AAD54CE10905763C8C19BC191C0C40458C809402E1957C4C05C4EAE27576B2D30593F7FDCC9A248DB5DB23CF2FA22A92C016090F611690BF0AB5B8B2866ED25F345EFE85DF3311C9E91C37CEE709CF16E7CB09D01BECD2961D094C02D42EC85BF47FAB1B67A13B9A1741C15F7156D57A71BFFABB03B71E69707913A5C136B3D69CE3F71ABFE376F0A21D723FFA2E60AC180689D3E8AF4348C9F555CD897387327FC8BA2B9C51A7298547E556A11A60441EF5331A1BFB847A3D23DD9F7C50E636A2C6309BC82E1A8852F5A8569B6D93*14*78D6A2424484CF5149932B7EA8BF*test"; +static const char *ST_HASH_15600 = "$ethereum$p*1024*38353131353831333338313138363430*a8b4dfe92687dbc0afeb5dae7863f18964241e96b264f09959903c8c924583fc*0a9252861d1e235994ce33dbca91c98231764d8ecb4950015a8ae20d6415b986"; +//static const char *ST_HASH_15700 = "$ethereum$s*262144*8*1*3134313837333434333838303231333633373433323633373534333136363537*73da7f80ec3bd4f2a128c3a815cfb4d576ecb1a9b47024c902e62ea926f7795b*910e0f8dc1f7ba41959e1089bb769f3e919109591913cc33ba03953d7a905efd"; +static const char *ST_HASH_15900 = "$DPAPImk$2*1*S-15-21-439882973-489230393-482956683-1522*aes256*sha512*12900*79f7ca399f2626e21aad108c3922af7c*288*c47bc8a985ca6aa708b01c97b004bff20cc52379dc2635b4acf59ce17970a2cb47ace98c7e8de977f265243c5c03d0a97e4b954b494d9e38d9158d0c1e729d16a28ba69e2e7c6c3bc0e3afc9c9b6306b83372ccb35d89b98925728fd36315b8ee95b4d4eccdcb31564769f9a4b9ee10828184e16d4af336675d5e31d987dd87233d34fbbb98880c5e1f64cbb9b043ad8"; +static const char *ST_HASH_16000 = "pfaRCwDe0U"; +static const char *ST_HASH_16100 = "$tacacs-plus$0$5fde8e68$4e13e8fb33df$c006"; +static const char *ST_HASH_16200 = "$ASN$*1*20000*80771171105233481004850004085037*d04b17af7f6b184346aad3efefe8bec0987ee73418291a41"; +static const char *ST_HASH_16300 = "$ethereum$w*e94a8e49deac2d62206bf9bfb7d2aaea7eb06c1a378cfc1ac056cc599a569793c0ecc40e6a0c242dee2812f06b644d70f43331b1fa2ce4bd6cbb9f62dd25b443235bdb4c1ffb222084c9ded8c719624b338f17e0fd827b34d79801298ac75f74ed97ae16f72fccecf862d09a03498b1b8bd1d984fc43dd507ede5d4b6223a582352386407266b66c671077eefc1e07b5f42508bf926ab5616658c984968d8eec25c9d5197a4a30eed54c161595c3b4d558b17ab8a75ccca72b3d949919d197158ea5cfbc43ac7dd73cf77807dc2c8fe4ef1e942ccd11ec24fe8a410d48ef4b8a35c93ecf1a21c51a51a08f3225fbdcc338b1e7fdafd7d94b82a81d88c2e9a429acc3f8a5974eafb7af8c912597eb6fdcd80578bd12efddd99de47b44e7c8f6c38f2af3116b08796172eda89422e9ea9b99c7f98a7e331aeb4bb1b06f611e95082b629332c31dbcfd878aed77d300c9ed5c74af9cd6f5a8c4a261dd124317fb790a04481d93aec160af4ad8ec84c04d943a869f65f07f5ccf8295dc1c876f30408eac77f62192cbb25842470b4a5bdb4c8096f56da7e9ed05c21f61b94c54ef1c2e9e417cce627521a40a99e357dd9b7a7149041d589cbacbe0302db57ddc983b9a6d79ce3f2e9ae8ad45fa40b934ed6b36379b780549ae7553dbb1cab238138c05743d0103335325bd90e27d8ae1ea219eb8905503c5ad54fa12d22e9a7d296eee07c8a7b5041b8d56b8af290274d01eb0e4ad174eb26b23b5e9fb46ff7f88398e6266052292acb36554ccb9c2c03139fe72d3f5d30bd5d10bd79d7cb48d2ab24187d8efc3750d5a24980fb12122591455d14e75421a2074599f1cc9fdfc8f498c92ad8b904d3c4307f80c46921d8128*f3abede76ac15228f1b161dd9660bb9094e81b1b*d201ccd492c284484c7824c4d37b1593"; +static const char *ST_HASH_16400 = "{CRAM-MD5}5389b33b9725e5657cb631dc50017ff100000000000000000000000000000000"; +static const char *ST_HASH_16600 = "$electrum$1*44358283104603165383613672586868*c43a6632d9f59364f74c395a03d8c2ea"; +static const char *ST_HASH_99999 = "hashcat"; + +static const char *OPTI_STR_OPTIMIZED_KERNEL = "Optimized-Kernel"; +static const char *OPTI_STR_ZERO_BYTE = "Zero-Byte"; +static const char *OPTI_STR_PRECOMPUTE_INIT = "Precompute-Init"; +static const char *OPTI_STR_PRECOMPUTE_MERKLE = "Precompute-Merkle-Demgard"; +static const char *OPTI_STR_PRECOMPUTE_PERMUT = "Precompute-Final-Permutation"; +static const char *OPTI_STR_MEET_IN_MIDDLE = "Meet-In-The-Middle"; +static const char *OPTI_STR_EARLY_SKIP = "Early-Skip"; +static const char *OPTI_STR_NOT_SALTED = "Not-Salted"; +static const char *OPTI_STR_NOT_ITERATED = "Not-Iterated"; +static const char *OPTI_STR_PREPENDED_SALT = "Prepended-Salt"; +static const char *OPTI_STR_APPENDED_SALT = "Appended-Salt"; +static const char *OPTI_STR_SINGLE_HASH = "Single-Hash"; +static const char *OPTI_STR_SINGLE_SALT = "Single-Salt"; +static const char *OPTI_STR_BRUTE_FORCE = "Brute-Force"; +static const char *OPTI_STR_RAW_HASH = "Raw-Hash"; +static const char *OPTI_STR_SLOW_HASH_SIMD_INIT = "Slow-Hash-SIMD-INIT"; +static const char *OPTI_STR_SLOW_HASH_SIMD_LOOP = "Slow-Hash-SIMD-LOOP"; +static const char *OPTI_STR_SLOW_HASH_SIMD_COMP = "Slow-Hash-SIMD-COMP"; +static const char *OPTI_STR_USES_BITS_8 = "Uses-8-Bit"; +static const char *OPTI_STR_USES_BITS_16 = "Uses-16-Bit"; +static const char *OPTI_STR_USES_BITS_32 = "Uses-32-Bit"; +static const char *OPTI_STR_USES_BITS_64 = "Uses-64-Bit"; + +static const char *PA_000 = "OK"; +static const char *PA_001 = "Ignored due to comment"; +static const char *PA_002 = "Ignored due to zero length"; +static const char *PA_003 = "Line-length exception"; +static const char *PA_004 = "Hash-length exception"; +static const char *PA_005 = "Hash-value exception"; +static const char *PA_006 = "Salt-length exception"; +static const char *PA_007 = "Salt-value exception"; +static const char *PA_008 = "Salt-iteration count exception"; +static const char *PA_009 = "Separator unmatched"; +static const char *PA_010 = "Signature unmatched"; +static const char *PA_011 = "Invalid hccapx file size"; +static const char *PA_012 = "Invalid hccapx eapol size"; +static const char *PA_013 = "Invalid psafe2 filesize"; +static const char *PA_014 = "Invalid psafe3 filesize"; +static const char *PA_015 = "Invalid truecrypt filesize"; +static const char *PA_016 = "Invalid veracrypt filesize"; +static const char *PA_017 = "Invalid SIP directive, only MD5 is supported"; +static const char *PA_018 = "Hash-file exception"; +static const char *PA_019 = "Hash-encoding exception"; +static const char *PA_020 = "Salt-encoding exception"; +static const char *PA_021 = "Invalid LUKS filesize"; +static const char *PA_022 = "Invalid LUKS identifier"; +static const char *PA_023 = "Invalid LUKS version"; +static const char *PA_024 = "Invalid or unsupported LUKS cipher type"; +static const char *PA_025 = "Invalid or unsupported LUKS cipher mode"; +static const char *PA_026 = "Invalid or unsupported LUKS hash type"; +static const char *PA_027 = "Invalid LUKS key size"; +static const char *PA_028 = "Disabled LUKS key detected"; +static const char *PA_029 = "Invalid LUKS key AF stripes count"; +static const char *PA_030 = "Invalid combination of LUKS hash type and cipher type"; +static const char *PA_031 = "Invalid hccapx signature"; +static const char *PA_032 = "Invalid hccapx version"; +static const char *PA_033 = "Invalid hccapx message pair"; +static const char *PA_255 = "Unknown error"; + +static const char *HT_00000 = "MD5"; +static const char *HT_00010 = "md5($pass.$salt)"; +static const char *HT_00020 = "md5($salt.$pass)"; +static const char *HT_00030 = "md5(utf16le($pass).$salt)"; +static const char *HT_00040 = "md5($salt.utf16le($pass))"; +static const char *HT_00050 = "HMAC-MD5 (key = $pass)"; +static const char *HT_00060 = "HMAC-MD5 (key = $salt)"; +static const char *HT_00100 = "SHA1"; +static const char *HT_00110 = "sha1($pass.$salt)"; +static const char *HT_00120 = "sha1($salt.$pass)"; +static const char *HT_00130 = "sha1(utf16le($pass).$salt)"; +static const char *HT_00140 = "sha1($salt.utf16le($pass))"; +static const char *HT_00150 = "HMAC-SHA1 (key = $pass)"; +static const char *HT_00160 = "HMAC-SHA1 (key = $salt)"; +static const char *HT_00200 = "MySQL323"; +static const char *HT_00300 = "MySQL4.1/MySQL5"; +static const char *HT_00400 = "phpass, WordPress (MD5), phpBB3 (MD5), Joomla (MD5)"; +static const char *HT_00500 = "md5crypt, MD5 (Unix), Cisco-IOS $1$ (MD5)"; +static const char *HT_00501 = "Juniper IVE"; +static const char *HT_00600 = "BLAKE2b"; +static const char *HT_00900 = "MD4"; +static const char *HT_01000 = "NTLM"; +static const char *HT_01100 = "Domain Cached Credentials (DCC), MS Cache"; +static const char *HT_01300 = "SHA-224"; +static const char *HT_01400 = "SHA-256"; +static const char *HT_01410 = "sha256($pass.$salt)"; +static const char *HT_01420 = "sha256($salt.$pass)"; +static const char *HT_01430 = "sha256(utf16le($pass).$salt)"; +static const char *HT_01440 = "sha256($salt.utf16le($pass))"; +static const char *HT_01450 = "HMAC-SHA256 (key = $pass)"; +static const char *HT_01460 = "HMAC-SHA256 (key = $salt)"; +static const char *HT_01500 = "descrypt, DES (Unix), Traditional DES"; +static const char *HT_01600 = "Apache $apr1$ MD5, md5apr1, MD5 (APR)"; +static const char *HT_01700 = "SHA-512"; +static const char *HT_01710 = "sha512($pass.$salt)"; +static const char *HT_01720 = "sha512($salt.$pass)"; +static const char *HT_01730 = "sha512(utf16le($pass).$salt)"; +static const char *HT_01740 = "sha512($salt.utf16le($pass))"; +static const char *HT_01750 = "HMAC-SHA512 (key = $pass)"; +static const char *HT_01760 = "HMAC-SHA512 (key = $salt)"; +static const char *HT_01800 = "sha512crypt $6$, SHA512 (Unix)"; +static const char *HT_02100 = "Domain Cached Credentials 2 (DCC2), MS Cache 2"; +static const char *HT_02400 = "Cisco-PIX MD5"; +static const char *HT_02410 = "Cisco-ASA MD5"; +static const char *HT_02500 = "WPA/WPA2"; +static const char *HT_02501 = "WPA/WPA2 PMK"; +static const char *HT_02600 = "md5(md5($pass))"; +static const char *HT_03000 = "LM"; +static const char *HT_03100 = "Oracle H: Type (Oracle 7+)"; +static const char *HT_03200 = "bcrypt $2*$, Blowfish (Unix)"; +static const char *HT_03710 = "md5($salt.md5($pass))"; +static const char *HT_03711 = "MediaWiki B type"; +static const char *HT_03800 = "md5($salt.$pass.$salt)"; +static const char *HT_03910 = "md5(md5($pass).md5($salt))"; +static const char *HT_04010 = "md5($salt.md5($salt.$pass))"; +static const char *HT_04110 = "md5($salt.md5($pass.$salt))"; +static const char *HT_04300 = "md5(strtoupper(md5($pass)))"; +static const char *HT_04400 = "md5(sha1($pass))"; +static const char *HT_04500 = "sha1(sha1($pass))"; +static const char *HT_04520 = "sha1($salt.sha1($pass))"; +static const char *HT_04700 = "sha1(md5($pass))"; +static const char *HT_04800 = "iSCSI CHAP authentication, MD5(CHAP)"; +static const char *HT_04900 = "sha1($salt.$pass.$salt)"; +static const char *HT_05000 = "SHA-3 (Keccak)"; +static const char *HT_05100 = "Half MD5"; +static const char *HT_05200 = "Password Safe v3"; +static const char *HT_05300 = "IKE-PSK MD5"; +static const char *HT_05400 = "IKE-PSK SHA1"; +static const char *HT_05500 = "NetNTLMv1 / NetNTLMv1+ESS"; +static const char *HT_05600 = "NetNTLMv2"; +static const char *HT_05700 = "Cisco-IOS type 4 (SHA256)"; +static const char *HT_05800 = "Samsung Android Password/PIN"; +static const char *HT_06000 = "RIPEMD-160"; +static const char *HT_06100 = "Whirlpool"; +static const char *HT_06300 = "AIX {smd5}"; +static const char *HT_06400 = "AIX {ssha256}"; +static const char *HT_06500 = "AIX {ssha512}"; +static const char *HT_06600 = "1Password, agilekeychain"; +static const char *HT_06700 = "AIX {ssha1}"; +static const char *HT_06800 = "LastPass + LastPass sniffed"; +static const char *HT_06900 = "GOST R 34.11-94"; +static const char *HT_07000 = "FortiGate (FortiOS)"; +static const char *HT_07100 = "macOS v10.8+ (PBKDF2-SHA512)"; +static const char *HT_07200 = "GRUB 2"; +static const char *HT_07300 = "IPMI2 RAKP HMAC-SHA1"; +static const char *HT_07400 = "sha256crypt $5$, SHA256 (Unix)"; +static const char *HT_07500 = "Kerberos 5 AS-REQ Pre-Auth etype 23"; +static const char *HT_07700 = "SAP CODVN B (BCODE)"; +static const char *HT_07800 = "SAP CODVN F/G (PASSCODE)"; +static const char *HT_07900 = "Drupal7"; +static const char *HT_08000 = "Sybase ASE"; +static const char *HT_08100 = "Citrix NetScaler"; +static const char *HT_08200 = "1Password, cloudkeychain"; +static const char *HT_08300 = "DNSSEC (NSEC3)"; +static const char *HT_08400 = "WBB3 (Woltlab Burning Board)"; +static const char *HT_08500 = "RACF"; +static const char *HT_08600 = "Lotus Notes/Domino 5"; +static const char *HT_08700 = "Lotus Notes/Domino 6"; +static const char *HT_08800 = "Android FDE <= 4.3"; +static const char *HT_08900 = "scrypt"; +static const char *HT_09000 = "Password Safe v2"; +static const char *HT_09100 = "Lotus Notes/Domino 8"; +static const char *HT_09200 = "Cisco-IOS $8$ (PBKDF2-SHA256)"; +static const char *HT_09300 = "Cisco-IOS $9$ (scrypt)"; +static const char *HT_09400 = "MS Office 2007"; +static const char *HT_09500 = "MS Office 2010"; +static const char *HT_09600 = "MS Office 2013"; +static const char *HT_09700 = "MS Office <= 2003 $0/$1, MD5 + RC4"; +static const char *HT_09710 = "MS Office <= 2003 $0/$1, MD5 + RC4, collider #1"; +static const char *HT_09720 = "MS Office <= 2003 $0/$1, MD5 + RC4, collider #2"; +static const char *HT_09800 = "MS Office <= 2003 $3/$4, SHA1 + RC4"; +static const char *HT_09810 = "MS Office <= 2003 $3, SHA1 + RC4, collider #1"; +static const char *HT_09820 = "MS Office <= 2003 $3, SHA1 + RC4, collider #2"; +static const char *HT_09900 = "Radmin2"; +static const char *HT_10000 = "Django (PBKDF2-SHA256)"; +static const char *HT_10100 = "SipHash"; +static const char *HT_10200 = "CRAM-MD5"; +static const char *HT_10300 = "SAP CODVN H (PWDSALTEDHASH) iSSHA-1"; +static const char *HT_10400 = "PDF 1.1 - 1.3 (Acrobat 2 - 4)"; +static const char *HT_10410 = "PDF 1.1 - 1.3 (Acrobat 2 - 4), collider #1"; +static const char *HT_10420 = "PDF 1.1 - 1.3 (Acrobat 2 - 4), collider #2"; +static const char *HT_10500 = "PDF 1.4 - 1.6 (Acrobat 5 - 8)"; +static const char *HT_10600 = "PDF 1.7 Level 3 (Acrobat 9)"; +static const char *HT_10700 = "PDF 1.7 Level 8 (Acrobat 10 - 11)"; +static const char *HT_10800 = "SHA-384"; +static const char *HT_10900 = "PBKDF2-HMAC-SHA256"; +static const char *HT_11000 = "PrestaShop"; +static const char *HT_11100 = "PostgreSQL CRAM (MD5)"; +static const char *HT_11200 = "MySQL CRAM (SHA1)"; +static const char *HT_11300 = "Bitcoin/Litecoin wallet.dat"; +static const char *HT_11400 = "SIP digest authentication (MD5)"; +static const char *HT_11500 = "CRC32"; +static const char *HT_11600 = "7-Zip"; +static const char *HT_11700 = "GOST R 34.11-2012 (Streebog) 256-bit"; +static const char *HT_11800 = "GOST R 34.11-2012 (Streebog) 512-bit"; +static const char *HT_11900 = "PBKDF2-HMAC-MD5"; +static const char *HT_12000 = "PBKDF2-HMAC-SHA1"; +static const char *HT_12100 = "PBKDF2-HMAC-SHA512"; +static const char *HT_12200 = "eCryptfs"; +static const char *HT_12300 = "Oracle T: Type (Oracle 12+)"; +static const char *HT_12400 = "BSDi Crypt, Extended DES"; +static const char *HT_12500 = "RAR3-hp"; +static const char *HT_12600 = "ColdFusion 10+"; +static const char *HT_12700 = "Blockchain, My Wallet"; +static const char *HT_12800 = "MS-AzureSync PBKDF2-HMAC-SHA256"; +static const char *HT_12900 = "Android FDE (Samsung DEK)"; +static const char *HT_13000 = "RAR5"; +static const char *HT_13100 = "Kerberos 5 TGS-REP etype 23"; +static const char *HT_13200 = "AxCrypt"; +static const char *HT_13300 = "AxCrypt in-memory SHA1"; +static const char *HT_13400 = "KeePass 1 (AES/Twofish) and KeePass 2 (AES)"; +static const char *HT_13500 = "PeopleSoft PS_TOKEN"; +static const char *HT_13600 = "WinZip"; +static const char *HT_13800 = "Windows Phone 8+ PIN/password"; +static const char *HT_13900 = "OpenCart"; +static const char *HT_14000 = "DES (PT = $salt, key = $pass)"; +static const char *HT_14100 = "3DES (PT = $salt, key = $pass)"; +static const char *HT_14400 = "sha1(CX)"; +static const char *HT_14600 = "LUKS"; +static const char *HT_14700 = "iTunes backup < 10.0"; +static const char *HT_14800 = "iTunes backup >= 10.0"; +static const char *HT_14900 = "Skip32 (PT = $salt, key = $pass)"; +static const char *HT_15000 = "FileZilla Server >= 0.9.55"; +static const char *HT_15100 = "Juniper/NetBSD sha1crypt"; +static const char *HT_15200 = "Blockchain, My Wallet, V2"; +static const char *HT_15300 = "DPAPI masterkey file v1"; +static const char *HT_15400 = "ChaCha20"; +static const char *HT_15500 = "JKS Java Key Store Private Keys (SHA1)"; +static const char *HT_15600 = "Ethereum Wallet, PBKDF2-HMAC-SHA256"; +static const char *HT_15700 = "Ethereum Wallet, SCRYPT"; +static const char *HT_15900 = "DPAPI masterkey file v2"; +static const char *HT_16000 = "Tripcode"; +static const char *HT_16100 = "TACACS+"; +static const char *HT_16200 = "Apple Secure Notes"; +static const char *HT_16300 = "Ethereum Pre-Sale Wallet, PBKDF2-HMAC-SHA256"; +static const char *HT_16400 = "CRAM-MD5 Dovecot"; +static const char *HT_16500 = "JWT (JSON Web Token)"; +static const char *HT_16600 = "Electrum Wallet (Salt-Type 1-3)"; +static const char *HT_99999 = "Plaintext"; + +static const char *HT_00011 = "Joomla < 2.5.18"; +static const char *HT_00012 = "PostgreSQL"; +static const char *HT_00021 = "osCommerce, xt:Commerce"; +static const char *HT_00022 = "Juniper NetScreen/SSG (ScreenOS)"; +static const char *HT_00023 = "Skype"; +static const char *HT_00101 = "nsldap, SHA-1(Base64), Netscape LDAP SHA"; +static const char *HT_00111 = "nsldaps, SSHA-1(Base64), Netscape LDAP SSHA"; +static const char *HT_00112 = "Oracle S: Type (Oracle 11+)"; +static const char *HT_00121 = "SMF (Simple Machines Forum) > v1.1"; +static const char *HT_00122 = "macOS v10.4, macOS v10.5, MacOS v10.6"; +static const char *HT_00124 = "Django (SHA-1)"; +static const char *HT_00125 = "ArubaOS"; +static const char *HT_00131 = "MSSQL (2000)"; +static const char *HT_00132 = "MSSQL (2005)"; +static const char *HT_00133 = "PeopleSoft"; +static const char *HT_00141 = "Episerver 6.x < .NET 4"; +static const char *HT_01411 = "SSHA-256(Base64), LDAP {SSHA256}"; +static const char *HT_01421 = "hMailServer"; +static const char *HT_01441 = "Episerver 6.x >= .NET 4"; +static const char *HT_01711 = "SSHA-512(Base64), LDAP {SSHA512}"; +static const char *HT_01722 = "macOS v10.7"; +static const char *HT_01731 = "MSSQL (2012, 2014)"; +static const char *HT_02611 = "vBulletin < v3.8.5"; +static const char *HT_02612 = "PHPS"; +static const char *HT_02711 = "vBulletin >= v3.8.5"; +static const char *HT_02811 = "IPB2+ (Invision Power Board), MyBB 1.2+"; +static const char *HT_04521 = "Redmine"; +static const char *HT_04522 = "PunBB"; +static const char *HT_06211 = "TrueCrypt PBKDF2-HMAC-RIPEMD160 + XTS 512 bit"; +static const char *HT_06212 = "TrueCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1024 bit"; +static const char *HT_06213 = "TrueCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1536 bit"; +static const char *HT_06221 = "TrueCrypt PBKDF2-HMAC-SHA512 + XTS 512 bit"; +static const char *HT_06222 = "TrueCrypt PBKDF2-HMAC-SHA512 + XTS 1024 bit"; +static const char *HT_06223 = "TrueCrypt PBKDF2-HMAC-SHA512 + XTS 1536 bit"; +static const char *HT_06231 = "TrueCrypt PBKDF2-HMAC-Whirlpool + XTS 512 bit"; +static const char *HT_06232 = "TrueCrypt PBKDF2-HMAC-Whirlpool + XTS 1024 bit"; +static const char *HT_06233 = "TrueCrypt PBKDF2-HMAC-Whirlpool + XTS 1536 bit"; +static const char *HT_06241 = "TrueCrypt PBKDF2-HMAC-RIPEMD160 + XTS 512 bit + boot-mode"; +static const char *HT_06242 = "TrueCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1024 bit + boot-mode"; +static const char *HT_06243 = "TrueCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1536 bit + boot-mode"; +static const char *HT_13711 = "VeraCrypt PBKDF2-HMAC-RIPEMD160 + XTS 512 bit"; +static const char *HT_13712 = "VeraCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1024 bit"; +static const char *HT_13713 = "VeraCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1536 bit"; +static const char *HT_13721 = "VeraCrypt PBKDF2-HMAC-SHA512 + XTS 512 bit"; +static const char *HT_13722 = "VeraCrypt PBKDF2-HMAC-SHA512 + XTS 1024 bit"; +static const char *HT_13723 = "VeraCrypt PBKDF2-HMAC-SHA512 + XTS 1536 bit"; +static const char *HT_13731 = "VeraCrypt PBKDF2-HMAC-Whirlpool + XTS 512 bit"; +static const char *HT_13732 = "VeraCrypt PBKDF2-HMAC-Whirlpool + XTS 1024 bit"; +static const char *HT_13733 = "VeraCrypt PBKDF2-HMAC-Whirlpool + XTS 1536 bit"; +static const char *HT_13741 = "VeraCrypt PBKDF2-HMAC-RIPEMD160 + XTS 512 bit + boot-mode"; +static const char *HT_13742 = "VeraCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1024 bit + boot-mode"; +static const char *HT_13743 = "VeraCrypt PBKDF2-HMAC-RIPEMD160 + XTS 1536 bit + boot-mode"; +static const char *HT_13751 = "VeraCrypt PBKDF2-HMAC-SHA256 + XTS 512 bit"; +static const char *HT_13752 = "VeraCrypt PBKDF2-HMAC-SHA256 + XTS 1024 bit"; +static const char *HT_13753 = "VeraCrypt PBKDF2-HMAC-SHA256 + XTS 1536 bit"; +static const char *HT_13761 = "VeraCrypt PBKDF2-HMAC-SHA256 + XTS 512 bit + boot-mode"; +static const char *HT_13762 = "VeraCrypt PBKDF2-HMAC-SHA256 + XTS 1024 bit + boot-mode"; +static const char *HT_13763 = "VeraCrypt PBKDF2-HMAC-SHA256 + XTS 1536 bit + boot-mode"; +static const char *HT_12001 = "Atlassian (PBKDF2-HMAC-SHA1)"; + +static const char *SIGNATURE_ANDROIDFDE = "$fde$"; +static const char *SIGNATURE_AXCRYPT = "$axcrypt$*1"; +static const char *SIGNATURE_AXCRYPT_SHA1 = "$axcrypt_sha1"; +static const char *SIGNATURE_BCRYPT1 = "$2a$"; +static const char *SIGNATURE_BCRYPT2 = "$2b$"; +static const char *SIGNATURE_BCRYPT3 = "$2x$"; +static const char *SIGNATURE_BCRYPT4 = "$2y$"; +static const char *SIGNATURE_BITCOIN_WALLET = "$bitcoin$"; +static const char *SIGNATURE_BSDICRYPT = "_"; +static const char *SIGNATURE_CISCO8 = "$8$"; +static const char *SIGNATURE_CISCO9 = "$9$"; +static const char *SIGNATURE_CRAM_MD5 = "$cram_md5$"; +static const char *SIGNATURE_CRAM_MD5_DOVECOT = "{CRAM-MD5}"; +static const char *SIGNATURE_DCC2 = "$DCC2$"; +static const char *SIGNATURE_DJANGOPBKDF2 = "pbkdf2_sha256$"; +static const char *SIGNATURE_DJANGOSHA1 = "sha1$"; +static const char *SIGNATURE_DPAPIMK = "$DPAPImk$"; +static const char *SIGNATURE_DRUPAL7 = "$S$"; +static const char *SIGNATURE_ECRYPTFS = "$ecryptfs$"; +static const char *SIGNATURE_EPISERVER4 = "$episerver$*1*"; +static const char *SIGNATURE_EPISERVER = "$episerver$*0*"; +static const char *SIGNATURE_KEEPASS = "$keepass$"; +static const char *SIGNATURE_KRB5PA = "$krb5pa$23"; +static const char *SIGNATURE_KRB5TGS = "$krb5tgs$23"; +static const char *SIGNATURE_MD5AIX = "{smd5}"; +static const char *SIGNATURE_MD5APR1 = "$apr1$"; +static const char *SIGNATURE_MD5CRYPT = "$1$"; +static const char *SIGNATURE_MEDIAWIKI_B = "$B$"; +static const char *SIGNATURE_MS_DRSR = "v1;PPH1_MD4"; +static const char *SIGNATURE_MSSQL = "0x0100"; +static const char *SIGNATURE_MSSQL2012 = "0x0200"; +static const char *SIGNATURE_MYSQL_AUTH = "$mysqlna$"; +static const char *SIGNATURE_MYWALLET = "$blockchain$"; +static const char *SIGNATURE_MYWALLETV2 = "$blockchain$v2$"; +static const char *SIGNATURE_NETSCALER = "1"; +static const char *SIGNATURE_OFFICE2007 = "$office$"; +static const char *SIGNATURE_OFFICE2010 = "$office$"; +static const char *SIGNATURE_OFFICE2013 = "$office$"; +static const char *SIGNATURE_OLDOFFICE0 = "$oldoffice$0"; +static const char *SIGNATURE_OLDOFFICE1 = "$oldoffice$1"; +static const char *SIGNATURE_OLDOFFICE3 = "$oldoffice$3"; +static const char *SIGNATURE_OLDOFFICE4 = "$oldoffice$4"; +static const char *SIGNATURE_PBKDF2_MD5 = "md5:"; +static const char *SIGNATURE_PBKDF2_SHA1 = "sha1:"; +static const char *SIGNATURE_PBKDF2_SHA256 = "sha256:"; +static const char *SIGNATURE_PBKDF2_SHA512 = "sha512:"; +static const char *SIGNATURE_PDF = "$pdf$"; +static const char *SIGNATURE_PHPASS1 = "$P$"; +static const char *SIGNATURE_PHPASS2 = "$H$"; +static const char *SIGNATURE_PHPS = "$PHPS$"; +static const char *SIGNATURE_POSTGRESQL_AUTH = "$postgres$"; +static const char *SIGNATURE_PSAFE3 = "PWS3"; +static const char *SIGNATURE_RACF = "$racf$"; +static const char *SIGNATURE_RAR3 = "$RAR3$"; +static const char *SIGNATURE_RAR5 = "$rar5$"; +static const char *SIGNATURE_SAPH_SHA1 = "{x-issha, "; +static const char *SIGNATURE_SCRYPT = "SCRYPT"; +static const char *SIGNATURE_SEVEN_ZIP = "$7z$"; +static const char *SIGNATURE_SHA1AIX = "{ssha1}"; +static const char *SIGNATURE_SHA1B64 = "{SHA}"; +static const char *SIGNATURE_SHA256AIX = "{ssha256}"; +static const char *SIGNATURE_SHA256B64S = "{SSHA256}"; +static const char *SIGNATURE_SHA256CRYPT = "$5$"; +static const char *SIGNATURE_SHA512AIX = "{ssha512}"; +static const char *SIGNATURE_SHA512B64S = "{SSHA512}"; +static const char *SIGNATURE_SHA512CRYPT = "$6$"; +static const char *SIGNATURE_SHA512GRUB = "grub.pbkdf2.sha512."; +static const char *SIGNATURE_SHA512MACOS = "$ml$"; +static const char *SIGNATURE_SIP_AUTH = "$sip$*"; +static const char *SIGNATURE_SSHA1B64_lower = "{ssha}"; +static const char *SIGNATURE_SSHA1B64_upper = "{SSHA}"; +static const char *SIGNATURE_SYBASEASE = "0xc007"; +static const char *SIGNATURE_ZIP2_START = "$zip2$"; +static const char *SIGNATURE_ZIP2_STOP = "$/zip2$"; +static const char *SIGNATURE_ITUNES_BACKUP = "$itunes_backup$"; +static const char *SIGNATURE_FORTIGATE = "AK1"; +static const char *SIGNATURE_ATLASSIAN = "{PKCS5S2}"; +static const char *SIGNATURE_NETBSD_SHA1CRYPT = "$sha1$"; +static const char *SIGNATURE_BLAKE2B = "$BLAKE2$"; +static const char *SIGNATURE_CHACHA20 = "$chacha20$"; +static const char *SIGNATURE_JKS_SHA1 = "$jksprivk$"; +static const char *SIGNATURE_ETHEREUM_PBKDF2 = "$ethereum$p"; +static const char *SIGNATURE_ETHEREUM_SCRYPT = "$ethereum$s"; +static const char *SIGNATURE_TACACS_PLUS = "$tacacs-plus$0$"; +static const char *SIGNATURE_APPLE_SECURE_NOTES = "$ASN$"; +static const char *SIGNATURE_ETHEREUM_PRESALE = "$ethereum$w"; +static const char *SIGNATURE_ELECTRUM_WALLET = "$electrum$"; /** * decoder / encoder @@ -2424,7 +2443,7 @@ static void drupal7_encode (const u8 digest[64], u8 buf[43]) * parser */ -static u32 parse_and_store_salt (u8 *out, u8 *in, u32 salt_len, MAYBE_UNUSED const hashconfig_t *hashconfig) +static u32 parse_and_store_salt (u8 *out, u8 *in, u32 salt_len, MAYBE_UNUSED hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -2573,7 +2592,7 @@ static void precompute_salt_md5 (u8 *salt, u32 salt_len, u8 *salt_pc) u32_to_hex_lower (salt_pc_digest[3], salt_buf_pc_ptr + 24); } -int bcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int bcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_3200) || (input_len > DISPLAY_LEN_MAX_3200)) return (PARSER_GLOBAL_LENGTH); @@ -2632,7 +2651,7 @@ int bcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int cisco4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int cisco4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5700) || (input_len > DISPLAY_LEN_MAX_5700)) return (PARSER_GLOBAL_LENGTH); @@ -2668,7 +2687,7 @@ int cisco4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int lm_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int lm_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_3000) || (input_len > DISPLAY_LEN_MAX_3000)) return (PARSER_GLOBAL_LENGTH); @@ -2689,7 +2708,7 @@ int lm_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED return (PARSER_OK); } -int arubaos_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int arubaos_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_125) || (input_len > DISPLAY_LEN_MAX_125)) return (PARSER_GLOBAL_LENGTH); @@ -2737,7 +2756,7 @@ int arubaos_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int macos1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int macos1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_122) || (input_len > DISPLAY_LEN_MAX_122)) return (PARSER_GLOBAL_LENGTH); @@ -2783,7 +2802,7 @@ int macos1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int macos512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int macos512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1722) || (input_len > DISPLAY_LEN_MAX_1722)) return (PARSER_GLOBAL_LENGTH); @@ -2838,7 +2857,7 @@ int macos512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int osc_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int osc_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_21) || (input_len > DISPLAY_LEN_MAX_21)) return (PARSER_GLOBAL_LENGTH); @@ -2878,7 +2897,7 @@ int osc_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED return (PARSER_OK); } -int netscreen_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int netscreen_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_22) || (input_len > DISPLAY_LEN_MAX_22)) return (PARSER_GLOBAL_LENGTH); @@ -2992,7 +3011,7 @@ int netscreen_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int smf_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int smf_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_121) || (input_len > DISPLAY_LEN_MAX_121)) return (PARSER_GLOBAL_LENGTH); @@ -3040,7 +3059,7 @@ int smf_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED return (PARSER_OK); } -int dcc2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int dcc2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_2100) || (input_len > DISPLAY_LEN_MAX_2100)) return (PARSER_GLOBAL_LENGTH); @@ -3100,7 +3119,7 @@ int dcc2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int dpapimk_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int dpapimk_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { /* 15300 and 15900 share the same input format */ if ((input_len < DISPLAY_LEN_MIN_15300) || (input_len > DISPLAY_LEN_MAX_15300)) return (PARSER_GLOBAL_LENGTH); @@ -3263,7 +3282,7 @@ int dpapimk_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int wpa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int wpa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -3508,7 +3527,7 @@ int wpa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED return (PARSER_OK); } -int psafe2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int psafe2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -3545,7 +3564,7 @@ int psafe2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int psafe3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int psafe3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -3603,7 +3622,7 @@ int psafe3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int phpass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int phpass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_400) || (input_len > DISPLAY_LEN_MAX_400)) return (PARSER_GLOBAL_LENGTH); @@ -3638,7 +3657,7 @@ int phpass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int md5crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int md5crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (input_len < DISPLAY_LEN_MIN_500) return (PARSER_GLOBAL_LENGTH); @@ -3699,7 +3718,7 @@ int md5crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int md5apr1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int md5apr1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (memcmp (SIGNATURE_MD5APR1, input_buf, 6) != 0) return (PARSER_SIGNATURE_UNMATCHED); @@ -3754,7 +3773,7 @@ int md5apr1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int episerver_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int episerver_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_141) || (input_len > DISPLAY_LEN_MAX_141)) return (PARSER_GLOBAL_LENGTH); @@ -3806,7 +3825,7 @@ int episerver_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int descrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int descrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1500) || (input_len > DISPLAY_LEN_MAX_1500)) return (PARSER_GLOBAL_LENGTH); @@ -3849,7 +3868,7 @@ int descrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int md4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int md4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_900) || (input_len > DISPLAY_LEN_MAX_900)) return (PARSER_GLOBAL_LENGTH); @@ -3873,7 +3892,7 @@ int md4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED return (PARSER_OK); } -int md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_0) || (input_len > DISPLAY_LEN_MAX_0)) return (PARSER_GLOBAL_LENGTH); @@ -3897,7 +3916,7 @@ int md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED return (PARSER_OK); } -int md5half_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int md5half_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5100) || (input_len > DISPLAY_LEN_MAX_5100)) return (PARSER_GLOBAL_LENGTH); @@ -3913,7 +3932,7 @@ int md5half_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int md5s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int md5s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -3969,7 +3988,7 @@ int md5s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int md5pix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int md5pix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_2400) || (input_len > DISPLAY_LEN_MAX_2400)) return (PARSER_GLOBAL_LENGTH); @@ -4008,7 +4027,7 @@ int md5pix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int md5asa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int md5asa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_2410) || (input_len > DISPLAY_LEN_MAX_2410)) return (PARSER_GLOBAL_LENGTH); @@ -4084,7 +4103,7 @@ static void transform_netntlmv1_key (const u8 *nthash, u8 *key) key[7] |= 0x01; } -int netntlmv1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int netntlmv1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5500) || (input_len > DISPLAY_LEN_MAX_5500)) return (PARSER_GLOBAL_LENGTH); @@ -4314,7 +4333,7 @@ int netntlmv1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int netntlmv2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int netntlmv2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5600) || (input_len > DISPLAY_LEN_MAX_5600)) return (PARSER_GLOBAL_LENGTH); @@ -4489,7 +4508,7 @@ int netntlmv2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int joomla_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int joomla_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11) || (input_len > DISPLAY_LEN_MAX_11)) return (PARSER_GLOBAL_LENGTH); @@ -4529,7 +4548,7 @@ int joomla_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int postgresql_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int postgresql_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12) || (input_len > DISPLAY_LEN_MAX_12)) return (PARSER_GLOBAL_LENGTH); @@ -4569,7 +4588,7 @@ int postgresql_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int md5md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int md5md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_2600) || (input_len > DISPLAY_LEN_MAX_2600)) return (PARSER_GLOBAL_LENGTH); @@ -4609,7 +4628,7 @@ int md5md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int vb3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int vb3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_2611) || (input_len > DISPLAY_LEN_MAX_2611)) return (PARSER_GLOBAL_LENGTH); @@ -4649,7 +4668,7 @@ int vb3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED return (PARSER_OK); } -int vb30_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int vb30_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_2711) || (input_len > DISPLAY_LEN_MAX_2711)) return (PARSER_GLOBAL_LENGTH); @@ -4681,7 +4700,7 @@ int vb30_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int dcc_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int dcc_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1100) || (input_len > DISPLAY_LEN_MAX_1100)) return (PARSER_GLOBAL_LENGTH); @@ -4721,7 +4740,7 @@ int dcc_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED return (PARSER_OK); } -int ipb2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int ipb2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_2811) || (input_len > DISPLAY_LEN_MAX_2811)) return (PARSER_GLOBAL_LENGTH); @@ -4759,7 +4778,7 @@ int ipb2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_100) || (input_len > DISPLAY_LEN_MAX_100)) return (PARSER_GLOBAL_LENGTH); @@ -4791,7 +4810,7 @@ int sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int sha1axcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha1axcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13300) || (input_len > DISPLAY_LEN_MAX_13300)) return (PARSER_GLOBAL_LENGTH); @@ -4818,7 +4837,7 @@ int sha1axcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB return (PARSER_OK); } -int sha1s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha1s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -4873,7 +4892,7 @@ int sha1s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUS return (PARSER_OK); } -int sha1sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha1sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -4919,7 +4938,7 @@ int sha1sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int pstoken_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int pstoken_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13500) || (input_len > DISPLAY_LEN_MAX_13500)) return (PARSER_GLOBAL_LENGTH); @@ -5015,7 +5034,7 @@ int pstoken_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int sha1b64_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha1b64_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_101) || (input_len > DISPLAY_LEN_MAX_101)) return (PARSER_GLOBAL_LENGTH); @@ -5047,7 +5066,7 @@ int sha1b64_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int sha1b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha1b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_111) || (input_len > DISPLAY_LEN_MAX_111)) return (PARSER_GLOBAL_LENGTH); @@ -5096,7 +5115,7 @@ int sha1b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int mssql2000_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int mssql2000_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_131) || (input_len > DISPLAY_LEN_MAX_131)) return (PARSER_GLOBAL_LENGTH); @@ -5146,7 +5165,7 @@ int mssql2000_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int mssql2005_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int mssql2005_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_132) || (input_len > DISPLAY_LEN_MAX_132)) return (PARSER_GLOBAL_LENGTH); @@ -5196,7 +5215,7 @@ int mssql2005_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int mssql2012_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int mssql2012_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1731) || (input_len > DISPLAY_LEN_MAX_1731)) return (PARSER_GLOBAL_LENGTH); @@ -5255,7 +5274,7 @@ int mssql2012_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int oracleh_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int oracleh_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_3100) || (input_len > DISPLAY_LEN_MAX_3100)) return (PARSER_GLOBAL_LENGTH); @@ -5287,7 +5306,7 @@ int oracleh_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int oracles_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int oracles_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_112) || (input_len > DISPLAY_LEN_MAX_112)) return (PARSER_GLOBAL_LENGTH); @@ -5335,7 +5354,7 @@ int oracles_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int oraclet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int oraclet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12300) || (input_len > DISPLAY_LEN_MAX_12300)) return (PARSER_GLOBAL_LENGTH); @@ -5401,7 +5420,7 @@ int oraclet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int sha224_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha224_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1300) || (input_len > DISPLAY_LEN_MAX_1300)) return (PARSER_GLOBAL_LENGTH); @@ -5439,7 +5458,7 @@ int sha224_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int sha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1400) || (input_len > DISPLAY_LEN_MAX_1400)) return (PARSER_GLOBAL_LENGTH); @@ -5480,7 +5499,7 @@ int sha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int sha256s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha256s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -5544,7 +5563,7 @@ int sha256s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int sha384_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha384_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10800) || (input_len > DISPLAY_LEN_MAX_10800)) return (PARSER_GLOBAL_LENGTH); @@ -5585,7 +5604,7 @@ int sha384_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int sha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1700) || (input_len > DISPLAY_LEN_MAX_1700)) return (PARSER_GLOBAL_LENGTH); @@ -5626,7 +5645,7 @@ int sha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int sha512s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha512s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -5690,7 +5709,7 @@ int sha512s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int sha512crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha512crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (memcmp (SIGNATURE_SHA512CRYPT, input_buf, 3) != 0) return (PARSER_SIGNATURE_UNMATCHED); @@ -5745,7 +5764,7 @@ int sha512crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB return (PARSER_OK); } -int keccak_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int keccak_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5000) || (input_len > DISPLAY_LEN_MAX_5000)) return (PARSER_GLOBAL_LENGTH); @@ -5769,7 +5788,7 @@ int keccak_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int blake2b_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int blake2b_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_600) || (input_len > DISPLAY_LEN_MAX_600)) return (PARSER_GLOBAL_LENGTH); @@ -5813,7 +5832,7 @@ int blake2b_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int chacha20_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int chacha20_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_15400) || (input_len > DISPLAY_LEN_MAX_15400)) return (PARSER_GLOBAL_LENGTH); @@ -5882,7 +5901,7 @@ int chacha20_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int ikepsk_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int ikepsk_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5300) || (input_len > DISPLAY_LEN_MAX_5300)) return (PARSER_GLOBAL_LENGTH); @@ -5902,9 +5921,13 @@ int ikepsk_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE if (input_buf == NULL) return (PARSER_HASH_VALUE); - char *saveptr; + char tmp_buf[HCBUFSIZ_TINY] = { 0 }; - in_off[0] = (u8 *) strtok_r ((char *) input_buf, ":", &saveptr); + memcpy (tmp_buf, input_buf, input_len); + + char *saveptr = NULL; + + in_off[0] = (u8 *) strtok_r (tmp_buf, ":", &saveptr); if (in_off[0] == NULL) return (PARSER_SEPARATOR_UNMATCHED); @@ -5970,7 +5993,7 @@ int ikepsk_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int ikepsk_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int ikepsk_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5400) || (input_len > DISPLAY_LEN_MAX_5400)) return (PARSER_GLOBAL_LENGTH); @@ -5990,9 +6013,13 @@ int ikepsk_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB if (input_buf == NULL) return (PARSER_HASH_VALUE); - char *saveptr; + char tmp_buf[HCBUFSIZ_TINY] = { 0 }; + + memcpy (tmp_buf, input_buf, input_len); + + char *saveptr = NULL; - in_off[0] = (u8 *) strtok_r ((char *) input_buf, ":", &saveptr); + in_off[0] = (u8 *) strtok_r (tmp_buf, ":", &saveptr); if (in_off[0] == NULL) return (PARSER_SEPARATOR_UNMATCHED); @@ -6065,7 +6092,7 @@ int ikepsk_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB return (PARSER_OK); } -int ripemd160_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int ripemd160_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6000) || (input_len > DISPLAY_LEN_MAX_6000)) return (PARSER_GLOBAL_LENGTH); @@ -6082,7 +6109,7 @@ int ripemd160_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int whirlpool_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int whirlpool_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6100) || (input_len > DISPLAY_LEN_MAX_6100)) return (PARSER_GLOBAL_LENGTH); @@ -6127,7 +6154,7 @@ int whirlpool_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int androidpin_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int androidpin_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5800) || (input_len > DISPLAY_LEN_MAX_5800)) return (PARSER_GLOBAL_LENGTH); @@ -6168,7 +6195,7 @@ int androidpin_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int truecrypt_parse_hash_1k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int truecrypt_parse_hash_1k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -6207,7 +6234,7 @@ int truecrypt_parse_hash_1k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAY return (PARSER_OK); } -int truecrypt_parse_hash_2k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int truecrypt_parse_hash_2k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -6246,7 +6273,7 @@ int truecrypt_parse_hash_2k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAY return (PARSER_OK); } -int veracrypt_parse_hash_200000 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int veracrypt_parse_hash_200000 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -6285,7 +6312,7 @@ int veracrypt_parse_hash_200000 (u8 *input_buf, u32 input_len, hash_t *hash_buf, return (PARSER_OK); } -int veracrypt_parse_hash_500000 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int veracrypt_parse_hash_500000 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -6324,7 +6351,7 @@ int veracrypt_parse_hash_500000 (u8 *input_buf, u32 input_len, hash_t *hash_buf, return (PARSER_OK); } -int veracrypt_parse_hash_327661 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int veracrypt_parse_hash_327661 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -6363,7 +6390,7 @@ int veracrypt_parse_hash_327661 (u8 *input_buf, u32 input_len, hash_t *hash_buf, return (PARSER_OK); } -int veracrypt_parse_hash_655331 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int veracrypt_parse_hash_655331 (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -6402,7 +6429,7 @@ int veracrypt_parse_hash_655331 (u8 *input_buf, u32 input_len, hash_t *hash_buf, return (PARSER_OK); } -int md5aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int md5aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6300) || (input_len > DISPLAY_LEN_MAX_6300)) return (PARSER_GLOBAL_LENGTH); @@ -6435,7 +6462,7 @@ int md5aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int sha1aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha1aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6700) || (input_len > DISPLAY_LEN_MAX_6700)) return (PARSER_GLOBAL_LENGTH); @@ -6484,7 +6511,7 @@ int sha1aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int sha256aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha256aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6400) || (input_len > DISPLAY_LEN_MAX_6400)) return (PARSER_GLOBAL_LENGTH); @@ -6536,7 +6563,7 @@ int sha256aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int sha512aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha512aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6500) || (input_len > DISPLAY_LEN_MAX_6500)) return (PARSER_GLOBAL_LENGTH); @@ -6588,7 +6615,7 @@ int sha512aix_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int agilekey_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int agilekey_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6600) || (input_len > DISPLAY_LEN_MAX_6600)) return (PARSER_GLOBAL_LENGTH); @@ -6702,7 +6729,7 @@ int agilekey_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int lastpass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int lastpass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6800) || (input_len > DISPLAY_LEN_MAX_6800)) return (PARSER_GLOBAL_LENGTH); @@ -6759,7 +6786,7 @@ int lastpass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int gost_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int gost_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6900) || (input_len > DISPLAY_LEN_MAX_6900)) return (PARSER_GLOBAL_LENGTH); @@ -6779,7 +6806,7 @@ int gost_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int sha256crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha256crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (memcmp (SIGNATURE_SHA256CRYPT, input_buf, 3) != 0) return (PARSER_SIGNATURE_UNMATCHED); @@ -6834,7 +6861,7 @@ int sha256crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB return (PARSER_OK); } -int sha512macos_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha512macos_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { u32 max_len = DISPLAY_LEN_MAX_7100 + (2 * 128); @@ -6910,7 +6937,7 @@ int sha512macos_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB return (PARSER_OK); } -int episerver4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int episerver4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1441) || (input_len > DISPLAY_LEN_MAX_1441)) return (PARSER_GLOBAL_LENGTH); @@ -6968,7 +6995,7 @@ int episerver4_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int sha512grub_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha512grub_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { u32 max_len = DISPLAY_LEN_MAX_7200 + (8 * 128); @@ -7045,7 +7072,7 @@ int sha512grub_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int sha512b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha512b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1711) || (input_len > DISPLAY_LEN_MAX_1711)) return (PARSER_GLOBAL_LENGTH); @@ -7100,7 +7127,7 @@ int sha512b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int hmacmd5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int hmacmd5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -7139,7 +7166,7 @@ int hmacmd5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int hmacsha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int hmacsha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -7185,7 +7212,7 @@ int hmacsha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int hmacsha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int hmacsha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -7237,7 +7264,7 @@ int hmacsha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int hmacsha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int hmacsha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -7289,7 +7316,7 @@ int hmacsha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int krb5pa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int krb5pa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_7500) || (input_len > DISPLAY_LEN_MAX_7500)) return (PARSER_GLOBAL_LENGTH); @@ -7395,7 +7422,7 @@ int krb5pa_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int sapb_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sapb_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_7700) || (input_len > DISPLAY_LEN_MAX_7700)) return (PARSER_GLOBAL_LENGTH); @@ -7464,7 +7491,7 @@ int sapb_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int sapg_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sapg_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_7800) || (input_len > DISPLAY_LEN_MAX_7800)) return (PARSER_GLOBAL_LENGTH); @@ -7544,7 +7571,7 @@ int sapg_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int drupal7_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int drupal7_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_7900) || (input_len > DISPLAY_LEN_MAX_7900)) return (PARSER_GLOBAL_LENGTH); @@ -7596,7 +7623,7 @@ int drupal7_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int sybasease_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sybasease_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8000) || (input_len > DISPLAY_LEN_MAX_8000)) return (PARSER_GLOBAL_LENGTH); @@ -7643,7 +7670,7 @@ int sybasease_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int mysql323_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int mysql323_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_200) || (input_len > DISPLAY_LEN_MAX_200)) return (PARSER_GLOBAL_LENGTH); @@ -7664,7 +7691,7 @@ int mysql323_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int rakp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int rakp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_7300) || (input_len > DISPLAY_LEN_MAX_7300)) return (PARSER_GLOBAL_LENGTH); @@ -7743,7 +7770,7 @@ int rakp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int netscaler_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int netscaler_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8100) || (input_len > DISPLAY_LEN_MAX_8100)) return (PARSER_GLOBAL_LENGTH); @@ -7790,7 +7817,7 @@ int netscaler_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int chap_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int chap_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_4800) || (input_len > DISPLAY_LEN_MAX_4800)) return (PARSER_GLOBAL_LENGTH); @@ -7837,7 +7864,7 @@ int chap_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int cloudkey_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int cloudkey_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8200) || (input_len > DISPLAY_LEN_MAX_8200)) return (PARSER_GLOBAL_LENGTH); @@ -7958,7 +7985,7 @@ int cloudkey_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int nsec3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int nsec3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8300) || (input_len > DISPLAY_LEN_MAX_8300)) return (PARSER_GLOBAL_LENGTH); @@ -8076,7 +8103,7 @@ int nsec3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUS return (PARSER_OK); } -int wbb3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int wbb3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8400) || (input_len > DISPLAY_LEN_MAX_8400)) return (PARSER_GLOBAL_LENGTH); @@ -8115,7 +8142,7 @@ int wbb3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int opencart_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int opencart_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13900) || (input_len > DISPLAY_LEN_MAX_13900)) return (PARSER_GLOBAL_LENGTH); @@ -8156,7 +8183,7 @@ int opencart_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int racf_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int racf_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { const u8 ascii_to_ebcdic[] = { @@ -8242,7 +8269,7 @@ int racf_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int des_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int des_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_14000) || (input_len > DISPLAY_LEN_MAX_14000)) return (PARSER_GLOBAL_LENGTH); @@ -8295,7 +8322,7 @@ int des_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED return (PARSER_OK); } -int lotus5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int lotus5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8600) || (input_len > DISPLAY_LEN_MAX_8600)) return (PARSER_GLOBAL_LENGTH); @@ -8311,7 +8338,7 @@ int lotus5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int lotus6_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int lotus6_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8700) || (input_len > DISPLAY_LEN_MAX_8700)) return (PARSER_GLOBAL_LENGTH); @@ -8340,7 +8367,7 @@ int lotus6_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int lotus8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int lotus8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9100) || (input_len > DISPLAY_LEN_MAX_9100)) return (PARSER_GLOBAL_LENGTH); @@ -8396,7 +8423,7 @@ int lotus8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int hmailserver_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int hmailserver_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1421) || (input_len > DISPLAY_LEN_MAX_1421)) return (PARSER_GLOBAL_LENGTH); @@ -8451,7 +8478,7 @@ int hmailserver_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB return (PARSER_OK); } -int phps_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int phps_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_2612) || (input_len > DISPLAY_LEN_MAX_2612)) return (PARSER_GLOBAL_LENGTH); @@ -8497,7 +8524,7 @@ int phps_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int mediawiki_b_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int mediawiki_b_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_3711) || (input_len > DISPLAY_LEN_MAX_3711)) return (PARSER_GLOBAL_LENGTH); @@ -8545,7 +8572,7 @@ int mediawiki_b_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB return (PARSER_OK); } -int peoplesoft_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int peoplesoft_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_133) || (input_len > DISPLAY_LEN_MAX_133)) return (PARSER_GLOBAL_LENGTH); @@ -8581,7 +8608,7 @@ int peoplesoft_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int skype_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int skype_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_23) || (input_len > DISPLAY_LEN_MAX_23)) return (PARSER_GLOBAL_LENGTH); @@ -8629,7 +8656,7 @@ int skype_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUS return (PARSER_OK); } -int androidfde_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int androidfde_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8800) || (input_len > DISPLAY_LEN_MAX_8800)) return (PARSER_GLOBAL_LENGTH); @@ -8730,7 +8757,7 @@ int androidfde_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int scrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int scrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8900) || (input_len > DISPLAY_LEN_MAX_8900)) return (PARSER_GLOBAL_LENGTH); @@ -8820,7 +8847,7 @@ int scrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int juniper_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int juniper_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_501) || (input_len > DISPLAY_LEN_MAX_501)) return (PARSER_GLOBAL_LENGTH); @@ -8859,7 +8886,7 @@ int juniper_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int cisco8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int cisco8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9200) || (input_len > DISPLAY_LEN_MAX_9200)) return (PARSER_GLOBAL_LENGTH); @@ -8930,7 +8957,7 @@ int cisco8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int cisco9_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int cisco9_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9300) || (input_len > DISPLAY_LEN_MAX_9300)) return (PARSER_GLOBAL_LENGTH); @@ -8985,7 +9012,7 @@ int cisco9_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int office2007_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int office2007_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9400) || (input_len > DISPLAY_LEN_MAX_9400)) return (PARSER_GLOBAL_LENGTH); @@ -9135,7 +9162,7 @@ int office2007_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int office2010_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int office2010_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9500) || (input_len > DISPLAY_LEN_MAX_9500)) return (PARSER_GLOBAL_LENGTH); @@ -9289,7 +9316,7 @@ int office2010_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int office2013_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int office2013_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9600) || (input_len > DISPLAY_LEN_MAX_9600)) return (PARSER_GLOBAL_LENGTH); @@ -9443,7 +9470,7 @@ int office2013_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int oldoffice01_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int oldoffice01_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9700) || (input_len > DISPLAY_LEN_MAX_9700)) return (PARSER_GLOBAL_LENGTH); @@ -9557,12 +9584,12 @@ int oldoffice01_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB return (PARSER_OK); } -int oldoffice01cm1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int oldoffice01cm1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { return oldoffice01_parse_hash (input_buf, input_len, hash_buf, hashconfig); } -int oldoffice01cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int oldoffice01cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9720) || (input_len > DISPLAY_LEN_MAX_9720)) return (PARSER_GLOBAL_LENGTH); @@ -9700,7 +9727,7 @@ int oldoffice01cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, M return (PARSER_OK); } -int oldoffice34_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int oldoffice34_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9800) || (input_len > DISPLAY_LEN_MAX_9800)) return (PARSER_GLOBAL_LENGTH); @@ -9820,14 +9847,14 @@ int oldoffice34_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB return (PARSER_OK); } -int oldoffice34cm1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int oldoffice34cm1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (memcmp (SIGNATURE_OLDOFFICE3, input_buf, 12) != 0) return (PARSER_SIGNATURE_UNMATCHED); return oldoffice34_parse_hash (input_buf, input_len, hash_buf, hashconfig); } -int oldoffice34cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int oldoffice34cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9820) || (input_len > DISPLAY_LEN_MAX_9820)) return (PARSER_GLOBAL_LENGTH); @@ -9970,7 +9997,7 @@ int oldoffice34cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, M return (PARSER_OK); } -int radmin2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int radmin2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9900) || (input_len > DISPLAY_LEN_MAX_9900)) return (PARSER_GLOBAL_LENGTH); @@ -9986,7 +10013,7 @@ int radmin2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int djangosha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int djangosha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_124) || (input_len > DISPLAY_LEN_MAX_124)) return (PARSER_GLOBAL_LENGTH); @@ -10054,7 +10081,7 @@ int djangosha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int djangopbkdf2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int djangopbkdf2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10000) || (input_len > DISPLAY_LEN_MAX_10000)) return (PARSER_GLOBAL_LENGTH); @@ -10133,7 +10160,7 @@ int djangopbkdf2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAY return (PARSER_OK); } -int siphash_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int siphash_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10100) || (input_len > DISPLAY_LEN_MAX_10100)) return (PARSER_GLOBAL_LENGTH); @@ -10173,7 +10200,7 @@ int siphash_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int crammd5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int crammd5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10200) || (input_len > DISPLAY_LEN_MAX_10200)) return (PARSER_GLOBAL_LENGTH); @@ -10244,7 +10271,35 @@ int crammd5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int saph_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int crammd5_dovecot_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) +{ + if ((input_len < DISPLAY_LEN_MIN_16400) || (input_len > DISPLAY_LEN_MAX_16400)) return (PARSER_GLOBAL_LENGTH); + + if (memcmp (SIGNATURE_CRAM_MD5_DOVECOT, input_buf, 10) != 0) return (PARSER_SIGNATURE_UNMATCHED); + + u32 *digest = (u32 *) hash_buf->digest; + + u8 *iter_pos = input_buf + 10; + + if (is_valid_hex_string (iter_pos, 64) == false) return (PARSER_HASH_ENCODING); + + digest[0] = hex_to_u32 ((const u8 *) &iter_pos[ 0]); + digest[1] = hex_to_u32 ((const u8 *) &iter_pos[ 8]); + digest[2] = hex_to_u32 ((const u8 *) &iter_pos[16]); + digest[3] = hex_to_u32 ((const u8 *) &iter_pos[24]); + + if (hashconfig->opti_type & OPTI_TYPE_PRECOMPUTE_MERKLE) + { + digest[0] -= MD5M_A; + digest[1] -= MD5M_B; + digest[2] -= MD5M_C; + digest[3] -= MD5M_D; + } + + return (PARSER_OK); +} + +int saph_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10300) || (input_len > DISPLAY_LEN_MAX_10300)) return (PARSER_GLOBAL_LENGTH); @@ -10312,7 +10367,7 @@ int saph_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int redmine_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int redmine_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_4521) || (input_len > DISPLAY_LEN_MAX_4521)) return (PARSER_GLOBAL_LENGTH); @@ -10353,7 +10408,7 @@ int redmine_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int punbb_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int punbb_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_4522) || (input_len > DISPLAY_LEN_MAX_4522)) return (PARSER_GLOBAL_LENGTH); @@ -10394,7 +10449,7 @@ int punbb_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUS return (PARSER_OK); } -int pdf11_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int pdf11_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10400) || (input_len > DISPLAY_LEN_MAX_10400)) return (PARSER_GLOBAL_LENGTH); @@ -10581,12 +10636,12 @@ int pdf11_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUS return (PARSER_OK); } -int pdf11cm1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int pdf11cm1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { return pdf11_parse_hash (input_buf, input_len, hash_buf, hashconfig); } -int pdf11cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int pdf11cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10420) || (input_len > DISPLAY_LEN_MAX_10420)) return (PARSER_GLOBAL_LENGTH); @@ -10804,7 +10859,7 @@ int pdf11cm2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int pdf14_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int pdf14_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10500) || (input_len > DISPLAY_LEN_MAX_10500)) return (PARSER_GLOBAL_LENGTH); @@ -11046,7 +11101,7 @@ int pdf14_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUS return (PARSER_OK); } -int pdf17l3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int pdf17l3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { int ret = pdf17l8_parse_hash (input_buf, input_len, hash_buf, hashconfig); @@ -11076,7 +11131,7 @@ int pdf17l3_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int pdf17l8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int pdf17l8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10600) || (input_len > DISPLAY_LEN_MAX_10600)) return (PARSER_GLOBAL_LENGTH); @@ -11246,7 +11301,7 @@ int pdf17l8_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int pbkdf2_sha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int pbkdf2_sha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10900) || (input_len > DISPLAY_LEN_MAX_10900)) return (PARSER_GLOBAL_LENGTH); @@ -11335,7 +11390,7 @@ int pbkdf2_sha256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MA return (PARSER_OK); } -int prestashop_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int prestashop_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11000) || (input_len > DISPLAY_LEN_MAX_11000)) return (PARSER_GLOBAL_LENGTH); @@ -11367,7 +11422,7 @@ int prestashop_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int postgresql_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int postgresql_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11100) || (input_len > DISPLAY_LEN_MAX_11100)) return (PARSER_GLOBAL_LENGTH); @@ -11446,7 +11501,7 @@ int postgresql_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, return (PARSER_OK); } -int mysql_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int mysql_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11200) || (input_len > DISPLAY_LEN_MAX_11200)) return (PARSER_GLOBAL_LENGTH); @@ -11505,7 +11560,7 @@ int mysql_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int bitcoin_wallet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int bitcoin_wallet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11300) || (input_len > DISPLAY_LEN_MAX_11300)) return (PARSER_GLOBAL_LENGTH); @@ -11654,7 +11709,7 @@ int bitcoin_wallet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, M return (PARSER_OK); } -int sip_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sip_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11400) || (input_len > DISPLAY_LEN_MAX_11400)) return (PARSER_GLOBAL_LENGTH); @@ -12022,7 +12077,7 @@ int sip_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int crc32_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int crc32_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11500) || (input_len > DISPLAY_LEN_MAX_11500)) return (PARSER_GLOBAL_LENGTH); @@ -12065,7 +12120,7 @@ int crc32_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUS return (PARSER_OK); } -int seven_zip_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int seven_zip_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11600) || (input_len > DISPLAY_LEN_MAX_11600)) return (PARSER_GLOBAL_LENGTH); @@ -12226,7 +12281,7 @@ int seven_zip_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ if (is_compressed == true) { - if (crc_len_len > 5) return (PARSER_SALT_VALUE); + if (crc_len_len > 6) return (PARSER_SALT_VALUE); if (coder_attributes_len > 10) return (PARSER_SALT_VALUE); @@ -12345,7 +12400,7 @@ int seven_zip_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int gost2012sbog_256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int gost2012sbog_256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11700) || (input_len > DISPLAY_LEN_MAX_11700)) return (PARSER_GLOBAL_LENGTH); @@ -12365,7 +12420,7 @@ int gost2012sbog_256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, return (PARSER_OK); } -int gost2012sbog_512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int gost2012sbog_512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11800) || (input_len > DISPLAY_LEN_MAX_11800)) return (PARSER_GLOBAL_LENGTH); @@ -12393,7 +12448,7 @@ int gost2012sbog_512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, return (PARSER_OK); } -int pbkdf2_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int pbkdf2_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11900) || (input_len > DISPLAY_LEN_MAX_11900)) return (PARSER_GLOBAL_LENGTH); @@ -12477,7 +12532,7 @@ int pbkdf2_md5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int pbkdf2_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int pbkdf2_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12000) || (input_len > DISPLAY_LEN_MAX_12000)) return (PARSER_GLOBAL_LENGTH); @@ -12566,7 +12621,7 @@ int pbkdf2_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYB return (PARSER_OK); } -int pbkdf2_sha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int pbkdf2_sha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12100) || (input_len > DISPLAY_LEN_MAX_12100)) return (PARSER_GLOBAL_LENGTH); @@ -12659,7 +12714,7 @@ int pbkdf2_sha512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MA return (PARSER_OK); } -int ecryptfs_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int ecryptfs_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12200) || (input_len > DISPLAY_LEN_MAX_12200)) return (PARSER_GLOBAL_LENGTH); @@ -12728,7 +12783,7 @@ int ecryptfs_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int bsdicrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int bsdicrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12400) || (input_len > DISPLAY_LEN_MAX_12400)) return (PARSER_GLOBAL_LENGTH); @@ -12776,7 +12831,7 @@ int bsdicrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int rar3hp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int rar3hp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12500) || (input_len > DISPLAY_LEN_MAX_12500)) return (PARSER_GLOBAL_LENGTH); @@ -12849,7 +12904,7 @@ int rar3hp_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int rar5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int rar5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13000) || (input_len > DISPLAY_LEN_MAX_13000)) return (PARSER_GLOBAL_LENGTH); @@ -12982,7 +13037,7 @@ int rar5_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int krb5tgs_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int krb5tgs_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13100) || (input_len > DISPLAY_LEN_MAX_13100)) return (PARSER_GLOBAL_LENGTH); @@ -13082,7 +13137,7 @@ int krb5tgs_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int axcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int axcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13200) || (input_len > DISPLAY_LEN_MAX_13200)) return (PARSER_GLOBAL_LENGTH); @@ -13170,7 +13225,7 @@ int axcrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int keepass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int keepass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13400) || (input_len > DISPLAY_LEN_MAX_13400)) return (PARSER_GLOBAL_LENGTH); @@ -13566,7 +13621,7 @@ int keepass_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int cf10_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int cf10_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12600) || (input_len > DISPLAY_LEN_MAX_12600)) return (PARSER_GLOBAL_LENGTH); @@ -13656,7 +13711,7 @@ int cf10_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int mywallet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int mywallet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12700) || (input_len > DISPLAY_LEN_MAX_12700)) return (PARSER_GLOBAL_LENGTH); @@ -13739,7 +13794,7 @@ int mywallet_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int mywalletv2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int mywalletv2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_15200) || (input_len > DISPLAY_LEN_MAX_15200)) return (PARSER_GLOBAL_LENGTH); @@ -13835,7 +13890,7 @@ int mywalletv2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int ms_drsr_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int ms_drsr_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12800) || (input_len > DISPLAY_LEN_MAX_12800)) return (PARSER_GLOBAL_LENGTH); @@ -13917,7 +13972,7 @@ int ms_drsr_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UN return (PARSER_OK); } -int androidfde_samsung_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int androidfde_samsung_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12900) || (input_len > DISPLAY_LEN_MAX_12900)) return (PARSER_GLOBAL_LENGTH); @@ -13997,7 +14052,7 @@ int androidfde_samsung_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_bu return (PARSER_OK); } -int zip2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int zip2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13600) || (input_len > DISPLAY_LEN_MAX_13600)) return (PARSER_GLOBAL_LENGTH); @@ -14229,7 +14284,7 @@ int zip2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int win8phone_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int win8phone_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13800) || (input_len > DISPLAY_LEN_MAX_13800)) return (PARSER_GLOBAL_LENGTH); @@ -14288,7 +14343,7 @@ int win8phone_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int plaintext_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int plaintext_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_99999) || (input_len > DISPLAY_LEN_MAX_99999)) return (PARSER_GLOBAL_LENGTH); @@ -14337,7 +14392,7 @@ int plaintext_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int sha1cx_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha1cx_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_14400) || (input_len > DISPLAY_LEN_MAX_14400)) return (PARSER_GLOBAL_LENGTH); @@ -14528,71 +14583,145 @@ int luks_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE // find the correct kernel based on hash and cipher - if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA1) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_SHA1_AES; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA1) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_SHA1_SERPENT; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA1) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_SHA1_TWOFISH; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA256) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_SHA256_AES; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA256) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_SHA256_SERPENT; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA256) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_SHA256_TWOFISH; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA512) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_SHA512_AES; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA512) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_SHA512_SERPENT; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA512) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_SHA512_TWOFISH; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_RIPEMD160) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_RIPEMD160_AES; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_RIPEMD160) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_RIPEMD160_SERPENT; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_RIPEMD160) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_RIPEMD160_TWOFISH; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_WHIRLPOOL) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_WHIRLPOOL_AES; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_WHIRLPOOL) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) - { - hashconfig->kern_type = KERN_TYPE_LUKS_WHIRLPOOL_SERPENT; - } - else if ((luks->hash_type == HC_LUKS_HASH_TYPE_WHIRLPOOL) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) + // we need to do this kind of check, otherwise an eventual matching hash from the potfile overwrites the kern_type with an eventual invalid one + + if (hashconfig->kern_type == (u32) -1) { - hashconfig->kern_type = KERN_TYPE_LUKS_WHIRLPOOL_TWOFISH; + if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA1) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_SHA1_AES; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA1) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_SHA1_SERPENT; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA1) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_SHA1_TWOFISH; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA256) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_SHA256_AES; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA256) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_SHA256_SERPENT; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA256) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_SHA256_TWOFISH; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA512) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_SHA512_AES; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA512) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_SHA512_SERPENT; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_SHA512) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_SHA512_TWOFISH; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_RIPEMD160) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_RIPEMD160_AES; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_RIPEMD160) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_RIPEMD160_SERPENT; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_RIPEMD160) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_RIPEMD160_TWOFISH; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_WHIRLPOOL) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_WHIRLPOOL_AES; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_WHIRLPOOL) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_WHIRLPOOL_SERPENT; + } + else if ((luks->hash_type == HC_LUKS_HASH_TYPE_WHIRLPOOL) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) + { + hashconfig->kern_type = KERN_TYPE_LUKS_WHIRLPOOL_TWOFISH; + } + else + { + fclose (fp); + + return (PARSER_LUKS_HASH_CIPHER); + } } else { - fclose (fp); + if ((hashconfig->kern_type == KERN_TYPE_LUKS_SHA1_AES) && (luks->hash_type == HC_LUKS_HASH_TYPE_SHA1) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_SHA1_SERPENT) && (luks->hash_type == HC_LUKS_HASH_TYPE_SHA1) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_SHA1_TWOFISH) && (luks->hash_type == HC_LUKS_HASH_TYPE_SHA1) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_SHA256_AES) && (luks->hash_type == HC_LUKS_HASH_TYPE_SHA256) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_SHA256_SERPENT) && (luks->hash_type == HC_LUKS_HASH_TYPE_SHA256) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_SHA256_TWOFISH) && (luks->hash_type == HC_LUKS_HASH_TYPE_SHA256) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_SHA512_AES) && (luks->hash_type == HC_LUKS_HASH_TYPE_SHA512) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_SHA512_SERPENT) && (luks->hash_type == HC_LUKS_HASH_TYPE_SHA512) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_SHA512_TWOFISH) && (luks->hash_type == HC_LUKS_HASH_TYPE_SHA512) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_RIPEMD160_AES) && (luks->hash_type == HC_LUKS_HASH_TYPE_RIPEMD160) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_RIPEMD160_SERPENT) && (luks->hash_type == HC_LUKS_HASH_TYPE_RIPEMD160) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_RIPEMD160_TWOFISH) && (luks->hash_type == HC_LUKS_HASH_TYPE_RIPEMD160) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_WHIRLPOOL_AES) && (luks->hash_type == HC_LUKS_HASH_TYPE_WHIRLPOOL) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_AES)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_WHIRLPOOL_SERPENT) && (luks->hash_type == HC_LUKS_HASH_TYPE_WHIRLPOOL) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_SERPENT)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_LUKS_WHIRLPOOL_TWOFISH) && (luks->hash_type == HC_LUKS_HASH_TYPE_WHIRLPOOL) && (luks->cipher_type == HC_LUKS_CIPHER_TYPE_TWOFISH)) + { + // OK + } + else + { + fclose (fp); - return (PARSER_LUKS_HASH_CIPHER); + return (PARSER_LUKS_HASH_CIPHER); + } } // verify the selected keyslot informations @@ -14684,7 +14813,7 @@ int luks_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSE return (PARSER_OK); } -int itunes_backup_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int itunes_backup_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_14700) || (input_len > DISPLAY_LEN_MAX_14700)) return (PARSER_GLOBAL_LENGTH); @@ -14888,7 +15017,7 @@ int itunes_backup_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MA return (PARSER_OK); } -int skip32_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int skip32_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (input_len != DISPLAY_LEN_MIN_14900) return (PARSER_GLOBAL_LENGTH); @@ -14937,7 +15066,7 @@ int skip32_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNU return (PARSER_OK); } -int fortigate_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int fortigate_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if (input_len != DISPLAY_LEN_MIN_7000) return (PARSER_GLOBAL_LENGTH); @@ -14998,7 +15127,7 @@ int fortigate_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int sha256b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int sha256b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1411) || (input_len > DISPLAY_LEN_MAX_1411)) return (PARSER_GLOBAL_LENGTH); @@ -15053,7 +15182,7 @@ int sha256b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE return (PARSER_OK); } -int filezilla_server_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int filezilla_server_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_15000) || (input_len > DISPLAY_LEN_MAX_15000)) return (PARSER_GLOBAL_LENGTH); @@ -15110,7 +15239,7 @@ int filezilla_server_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, return (PARSER_OK); } -int netbsd_sha1crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int netbsd_sha1crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_15100) || (input_len > DISPLAY_LEN_MAX_15100)) return (PARSER_GLOBAL_LENGTH); @@ -15193,7 +15322,7 @@ int netbsd_sha1crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, return (PARSER_OK); } -int atlassian_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int atlassian_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12001) || (input_len > DISPLAY_LEN_MAX_12001)) return (PARSER_GLOBAL_LENGTH); @@ -15259,7 +15388,7 @@ int atlassian_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_ return (PARSER_OK); } -int jks_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int jks_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_15500) || (input_len > DISPLAY_LEN_MAX_15500)) return (PARSER_GLOBAL_LENGTH); @@ -15422,7 +15551,7 @@ int jks_sha1_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -int ethereum_pbkdf2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int ethereum_pbkdf2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_15600) || (input_len > DISPLAY_LEN_MAX_15600)) return (PARSER_GLOBAL_LENGTH); @@ -15542,7 +15671,7 @@ int ethereum_pbkdf2_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, return (PARSER_OK); } -int ethereum_scrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int ethereum_scrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_15700) || (input_len > DISPLAY_LEN_MAX_15700)) return (PARSER_GLOBAL_LENGTH); @@ -15683,7 +15812,7 @@ int ethereum_scrypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, return (PARSER_OK); } -int tripcode_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig) +int tripcode_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_16000) || (input_len > DISPLAY_LEN_MAX_16000)) return (PARSER_GLOBAL_LENGTH); @@ -15715,163 +15844,786 @@ int tripcode_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U return (PARSER_OK); } -/** - * hook functions - */ - -void seven_zip_hook_func (hc_device_param_t *device_param, void *hook_salts_buf, const u32 salt_pos, const u32 pws_cnt) +int tacacs_plus_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) { - seven_zip_hook_t *hook_items = (seven_zip_hook_t *) device_param->hooks_buf; + if ((input_len < DISPLAY_LEN_MIN_16100) || (input_len > DISPLAY_LEN_MAX_16100)) return (PARSER_GLOBAL_LENGTH); - seven_zip_hook_salt_t *seven_zips = (seven_zip_hook_salt_t *) hook_salts_buf; - seven_zip_hook_salt_t *seven_zip = &seven_zips[salt_pos]; + if (memcmp (SIGNATURE_TACACS_PLUS, input_buf, 15) != 0) return (PARSER_SIGNATURE_UNMATCHED); - u8 data_type = seven_zip->data_type; - u32 *data_buf = seven_zip->data_buf; - u32 unpack_size = seven_zip->unpack_size; + u32 *digest = (u32 *) hash_buf->digest; - for (u32 pw_pos = 0; pw_pos < pws_cnt; pw_pos++) - { - // this hook data needs to be updated (the "hook_success" variable): + salt_t *salt = hash_buf->salt; - seven_zip_hook_t *hook_item = &hook_items[pw_pos]; + tacacs_plus_t *tacacs_plus = (tacacs_plus_t *) hash_buf->esalt; - const u8 *ukey = (const u8 *) hook_item->ukey; + /** + * parse line + */ - // init AES + // session - AES_KEY aes_key; + u8 *session_pos = input_buf + 15; - memset (&aes_key, 0, sizeof (aes_key)); + // ct_buf - AES_set_decrypt_key (ukey, 256, &aes_key); + u8 *ct_buf_pos = (u8 *) strchr ((const char *) session_pos, '$'); - int aes_len = seven_zip->aes_len; + if (ct_buf_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - u32 data[4]; - u32 out [4]; - u32 iv [4]; + u32 session_len = ct_buf_pos - session_pos; - iv[0] = seven_zip->iv_buf[0]; - iv[1] = seven_zip->iv_buf[1]; - iv[2] = seven_zip->iv_buf[2]; - iv[3] = seven_zip->iv_buf[3]; + ct_buf_pos++; - u32 out_full[81882]; + // sequence - // if aes_len > 16 we need to loop + u8 *sequence_pos = (u8 *) strchr ((const char *) ct_buf_pos, '$'); - int i = 0; - int j = 0; + if (sequence_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - for (i = 0, j = 0; i < aes_len - 16; i += 16, j += 4) - { - data[0] = data_buf[j + 0]; - data[1] = data_buf[j + 1]; - data[2] = data_buf[j + 2]; - data[3] = data_buf[j + 3]; + u32 ct_buf_len = sequence_pos - ct_buf_pos; - AES_decrypt (&aes_key, (u8*) data, (u8*) out); + sequence_pos++; - out[0] ^= iv[0]; - out[1] ^= iv[1]; - out[2] ^= iv[2]; - out[3] ^= iv[3]; + u32 sequence_len = input_len - 15 - session_len - 1 - ct_buf_len - 1; - iv[0] = data[0]; - iv[1] = data[1]; - iv[2] = data[2]; - iv[3] = data[3]; + /** + * verify some data + */ - out_full[j + 0] = out[0]; - out_full[j + 1] = out[1]; - out_full[j + 2] = out[2]; - out_full[j + 3] = out[3]; - } + if (session_len != 8) return (PARSER_SALT_LENGTH); + if (ct_buf_len >= 256) return (PARSER_SALT_LENGTH); + if (sequence_len != 4) return (PARSER_SALT_LENGTH); - // we need to run it at least once: + if (is_valid_hex_string (session_pos, session_len) == false) return (PARSER_SALT_ENCODING); + if (is_valid_hex_string (ct_buf_pos, ct_buf_len) == false) return (PARSER_HASH_ENCODING); + if (is_valid_hex_string (sequence_pos, sequence_len) == false) return (PARSER_HASH_ENCODING); - data[0] = data_buf[j + 0]; - data[1] = data_buf[j + 1]; - data[2] = data_buf[j + 2]; - data[3] = data_buf[j + 3]; + /** + * store data + */ - AES_decrypt (&aes_key, (u8*) data, (u8*) out); + // ciphtertext - out[0] ^= iv[0]; - out[1] ^= iv[1]; - out[2] ^= iv[2]; - out[3] ^= iv[3]; + u8 *session_ptr = (u8 *) tacacs_plus->session_buf; - out_full[j + 0] = out[0]; - out_full[j + 1] = out[1]; - out_full[j + 2] = out[2]; - out_full[j + 3] = out[3]; + session_ptr[0] = hex_to_u8 ((const u8 *) session_pos + 0); + session_ptr[1] = hex_to_u8 ((const u8 *) session_pos + 2); + session_ptr[2] = hex_to_u8 ((const u8 *) session_pos + 4); + session_ptr[3] = hex_to_u8 ((const u8 *) session_pos + 6); - /* - * check the CRC32 "hash" - */ + u8 *sequence_ptr = (u8 *) tacacs_plus->sequence_buf; - u32 seven_zip_crc = seven_zip->crc; + sequence_ptr[0] = hex_to_u8 ((const u8 *) sequence_pos + 0); + sequence_ptr[1] = hex_to_u8 ((const u8 *) sequence_pos + 2); - u32 crc; + u8 *ct_data_ptr = (u8 *) tacacs_plus->ct_data_buf; - if (data_type == 0) // uncompressed - { - crc = cpu_crc32_buffer ((u8 *) out_full, unpack_size); - } - else - { - u32 crc_len = seven_zip->crc_len; + for (u32 i = 0, j = 0; j < ct_buf_len; i += 1, j += 2) + { + ct_data_ptr[i] = hex_to_u8 ((const u8 *) &ct_buf_pos[j]); - char *coder_attributes = seven_zip->coder_attributes; + tacacs_plus->ct_data_len++; + } - // input buffers and length + // fake salt - u8 *compressed_data = (u8 *) out_full; + salt->salt_buf[0] = tacacs_plus->session_buf[0]; + salt->salt_buf[1] = tacacs_plus->sequence_buf[0]; + salt->salt_buf[2] = tacacs_plus->ct_data_buf[0]; + salt->salt_buf[3] = tacacs_plus->ct_data_buf[1]; - SizeT compressed_data_len = aes_len; + salt->salt_len = 16; - // output buffers and length + // fake hash - unsigned char *decompressed_data; + digest[0] = tacacs_plus->ct_data_buf[2]; + digest[1] = tacacs_plus->ct_data_buf[3]; + digest[2] = tacacs_plus->ct_data_buf[4]; + digest[3] = tacacs_plus->ct_data_buf[5]; - decompressed_data = (unsigned char *) hcmalloc (crc_len); + return (PARSER_OK); +} - SizeT decompressed_data_len = crc_len; +int apple_secure_notes_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) +{ + if ((input_len < DISPLAY_LEN_MIN_16200) || (input_len > DISPLAY_LEN_MAX_16200)) return (PARSER_GLOBAL_LENGTH); - int ret; + if (memcmp (SIGNATURE_APPLE_SECURE_NOTES, input_buf, 5) != 0) return (PARSER_SIGNATURE_UNMATCHED); - if (data_type == 1) // LZMA1 - { - ret = hc_lzma1_decompress (compressed_data, &compressed_data_len, decompressed_data, &decompressed_data_len, coder_attributes); - } - else // we only support LZMA2 in addition to LZMA1 - { - ret = hc_lzma2_decompress (compressed_data, &compressed_data_len, decompressed_data, &decompressed_data_len, coder_attributes); - } + u32 *digest = (u32 *) hash_buf->digest; - if (ret != SZ_OK) - { - hook_item->hook_success = 0; + salt_t *salt = hash_buf->salt; - hcfree (decompressed_data); + apple_secure_notes_t *apple_secure_notes = (apple_secure_notes_t *) hash_buf->esalt; - continue; - } + /** + * parse line + */ - crc = cpu_crc32_buffer (decompressed_data, crc_len); + // Z_PK - hcfree (decompressed_data); - } + u8 *Z_PK_pos = input_buf + 5 + 1; - if (crc == seven_zip_crc) - { - hook_item->hook_success = 1; - } - else - { - hook_item->hook_success = 0; + // ZCRYPTOITERATIONCOUNT + + u8 *ZCRYPTOITERATIONCOUNT_pos = (u8 *) strchr ((const char *) Z_PK_pos, '*'); + + if (ZCRYPTOITERATIONCOUNT_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); + + u32 Z_PK_len = ZCRYPTOITERATIONCOUNT_pos - Z_PK_pos; + + ZCRYPTOITERATIONCOUNT_pos++; + + // ZCRYPTOSALT + + u8 *ZCRYPTOSALT_pos = (u8 *) strchr ((const char *) ZCRYPTOITERATIONCOUNT_pos, '*'); + + if (ZCRYPTOSALT_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); + + u32 ZCRYPTOITERATIONCOUNT_len = ZCRYPTOSALT_pos - ZCRYPTOITERATIONCOUNT_pos; + + ZCRYPTOSALT_pos++; + + // ZCRYPTOWRAPPEDKEY + + u8 *ZCRYPTOWRAPPEDKEY_pos = (u8 *) strchr ((const char *) ZCRYPTOSALT_pos, '*'); + + if (ZCRYPTOWRAPPEDKEY_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); + + u32 ZCRYPTOSALT_len = ZCRYPTOWRAPPEDKEY_pos - ZCRYPTOSALT_pos; + + ZCRYPTOWRAPPEDKEY_pos++; + + u32 ZCRYPTOWRAPPEDKEY_len = input_len - 5 - 1 - Z_PK_len - 1 - ZCRYPTOITERATIONCOUNT_len - 1 - ZCRYPTOSALT_len - 1; + + /** + * verify some data + */ + + const u32 Z_PK = strtoul ((const char *) Z_PK_pos, NULL, 10); + const u32 ZCRYPTOITERATIONCOUNT = strtoul ((const char *) ZCRYPTOITERATIONCOUNT_pos, NULL, 10); + + if (ZCRYPTOSALT_len != 32) return (PARSER_SALT_ENCODING); + if (ZCRYPTOWRAPPEDKEY_len != 48) return (PARSER_SALT_ENCODING); + + if (is_valid_hex_string (ZCRYPTOSALT_pos, ZCRYPTOSALT_len) == false) return (PARSER_SALT_ENCODING); + if (is_valid_hex_string (ZCRYPTOWRAPPEDKEY_pos, ZCRYPTOWRAPPEDKEY_len) == false) return (PARSER_SALT_ENCODING); + + //if (ZCRYPTOITERATIONCOUNT != 20000) return (PARSER_SALT_ENCODING); + + /** + * store data + */ + + apple_secure_notes->Z_PK = Z_PK; + + apple_secure_notes->ZCRYPTOITERATIONCOUNT = ZCRYPTOITERATIONCOUNT; + + apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 0]); + apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 8]); + apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[16]); + apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[24]); + apple_secure_notes->ZCRYPTOSALT[ 4] = 0; + apple_secure_notes->ZCRYPTOSALT[ 5] = 0; + apple_secure_notes->ZCRYPTOSALT[ 6] = 0; + apple_secure_notes->ZCRYPTOSALT[ 7] = 0; + apple_secure_notes->ZCRYPTOSALT[ 8] = 0; + apple_secure_notes->ZCRYPTOSALT[ 9] = 0; + apple_secure_notes->ZCRYPTOSALT[10] = 0; + apple_secure_notes->ZCRYPTOSALT[11] = 0; + apple_secure_notes->ZCRYPTOSALT[12] = 0; + apple_secure_notes->ZCRYPTOSALT[13] = 0; + apple_secure_notes->ZCRYPTOSALT[14] = 0; + apple_secure_notes->ZCRYPTOSALT[15] = 0; + + apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 0]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 8]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[16]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[24]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[32]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[40]); + + // fake salt + + salt->salt_buf[0] = apple_secure_notes->ZCRYPTOSALT[0]; + salt->salt_buf[1] = apple_secure_notes->ZCRYPTOSALT[1]; + salt->salt_buf[2] = apple_secure_notes->ZCRYPTOSALT[2]; + salt->salt_buf[3] = apple_secure_notes->ZCRYPTOSALT[3]; + salt->salt_buf[4] = apple_secure_notes->Z_PK; + + salt->salt_iter = apple_secure_notes->ZCRYPTOITERATIONCOUNT - 1; + salt->salt_len = 20; + + // fake hash + + digest[0] = apple_secure_notes->ZCRYPTOWRAPPEDKEY[0]; + digest[1] = apple_secure_notes->ZCRYPTOWRAPPEDKEY[1]; + digest[2] = apple_secure_notes->ZCRYPTOWRAPPEDKEY[2]; + digest[3] = apple_secure_notes->ZCRYPTOWRAPPEDKEY[3]; + + return (PARSER_OK); +} + +int ethereum_presale_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) +{ + if ((input_len < DISPLAY_LEN_MIN_16300) || (input_len > DISPLAY_LEN_MAX_16300)) return (PARSER_GLOBAL_LENGTH); + + if (memcmp (SIGNATURE_ETHEREUM_PRESALE, input_buf, 11) != 0) return (PARSER_SIGNATURE_UNMATCHED); + + u32 *digest = (u32 *) hash_buf->digest; + + salt_t *salt = hash_buf->salt; + + ethereum_presale_t *ethereum_presale = (ethereum_presale_t *) hash_buf->esalt; + + /** + * parse line + */ + + // encseed + + u8 *encseed_pos = input_buf + 11 + 1; + + // address + + u8 *ethaddr_pos = (u8 *) strchr ((const char *) encseed_pos, '*'); + + if (ethaddr_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); + + u32 encseed_len = ethaddr_pos - encseed_pos; + + ethaddr_pos++; + + // hash (bkp) + + u8 *bkp_pos = (u8 *) strchr ((const char *) ethaddr_pos, '*'); + + if (bkp_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); + + u32 ethaddr_len = bkp_pos - ethaddr_pos; + + bkp_pos++; + + u32 bkp_len = input_len - 11 - 1 - encseed_len - 1 - ethaddr_len - 1; + + /** + * verify some data + */ + + if (encseed_len < 64) return (PARSER_SALT_LENGTH); + if (encseed_len > 1248) return (PARSER_SALT_LENGTH); + if (ethaddr_len != 40) return (PARSER_SALT_LENGTH); + if (bkp_len != 32) return (PARSER_SALT_LENGTH); + + if ((encseed_len % 16) != 0) return (PARSER_SALT_LENGTH); + + if (is_valid_hex_string (encseed_pos, encseed_len) == false) return (PARSER_SALT_ENCODING); + if (is_valid_hex_string (ethaddr_pos, ethaddr_len) == false) return (PARSER_HASH_ENCODING); + if (is_valid_hex_string (bkp_pos , bkp_len ) == false) return (PARSER_HASH_ENCODING); + + /** + * store data + */ + + // iv (16 bytes) + + ethereum_presale->iv[0] = hex_to_u32 ((const u8 *) &encseed_pos[ 0]); + ethereum_presale->iv[1] = hex_to_u32 ((const u8 *) &encseed_pos[ 8]); + ethereum_presale->iv[2] = hex_to_u32 ((const u8 *) &encseed_pos[16]); + ethereum_presale->iv[3] = hex_to_u32 ((const u8 *) &encseed_pos[24]); + + ethereum_presale->iv[0] = byte_swap_32 (ethereum_presale->iv[0]); + ethereum_presale->iv[1] = byte_swap_32 (ethereum_presale->iv[1]); + ethereum_presale->iv[2] = byte_swap_32 (ethereum_presale->iv[2]); + ethereum_presale->iv[3] = byte_swap_32 (ethereum_presale->iv[3]); + + // encseed + + u32 *esalt_buf_ptr = ethereum_presale->enc_seed; + + for (u32 i = 32, j = 0; i < encseed_len; i += 8, j++) + { + esalt_buf_ptr[j] = hex_to_u32 ((const u8 *) &encseed_pos [i]); + + esalt_buf_ptr[j] = byte_swap_32 (esalt_buf_ptr[j]); + } + + ethereum_presale->enc_seed_len = (encseed_len - 32) / 2; // encseed length without IV (raw bytes, not hex) + + // salt + + u8 *salt_buf_ptr = (u8 *) salt->salt_buf; + + u32 salt_len = parse_and_store_salt (salt_buf_ptr, ethaddr_pos, 40, hashconfig); + + if (salt_len == UINT_MAX) return (PARSER_SALT_LENGTH); + + salt->salt_len = salt_len; + salt->salt_iter = ROUNDS_ETHEREUM_PRESALE; + + // hash + + digest[0] = hex_to_u32 ((const u8 *) &bkp_pos[ 0]); + digest[1] = hex_to_u32 ((const u8 *) &bkp_pos[ 8]); + digest[2] = hex_to_u32 ((const u8 *) &bkp_pos[16]); + digest[3] = hex_to_u32 ((const u8 *) &bkp_pos[24]); + + return (PARSER_OK); +} + +int jwt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) +{ + if ((input_len < DISPLAY_LEN_MIN_16500) || (input_len > DISPLAY_LEN_MAX_16500)) return (PARSER_GLOBAL_LENGTH); + + salt_t *salt = hash_buf->salt; + + jwt_t *jwt = (jwt_t *) hash_buf->esalt; + + /** + * parse line + */ + + // header + + u8 *header_pos = input_buf; + + // payload + + u8 *payload_pos = (u8 *) strchr ((const char *) header_pos, '.'); + + if (payload_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); + + const u32 header_len = payload_pos - header_pos; + + payload_pos++; + + // signature + + u8 *signature_pos = (u8 *) strchr ((const char *) payload_pos, '.'); + + if (signature_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); + + const u32 payload_len = signature_pos - payload_pos; + + signature_pos++; + + const u32 signature_len = input_len - header_len - 1 - payload_len - 1; + + const u32 esalt_len = header_len + 1 + payload_len; + + /** + * verify some data + */ + + // we need to do this kind of check, otherwise an eventual matching hash from the potfile overwrites the kern_type with an eventual invalid one + + if (hashconfig->kern_type == (u32) -1) + { + // it would be more accurate to base64 decode the header_pos buffer and then to string match HS256 - same goes for the other algorithms + + if (signature_len == 43) + { + hashconfig->kern_type = KERN_TYPE_JWT_HS256; + } + else if (signature_len == 64) + { + hashconfig->kern_type = KERN_TYPE_JWT_HS384; + } + else if (signature_len == 86) + { + hashconfig->kern_type = KERN_TYPE_JWT_HS512; + } + else + { + return (PARSER_HASH_LENGTH); + } + } + else + { + if ((hashconfig->kern_type == KERN_TYPE_JWT_HS256) && (signature_len == 43)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_JWT_HS384) && (signature_len == 64)) + { + // OK + } + else if ((hashconfig->kern_type == KERN_TYPE_JWT_HS512) && (signature_len == 86)) + { + // OK + } + else + { + return (PARSER_HASH_LENGTH); + } + } + + if (esalt_len > 4096) return (PARSER_SALT_LENGTH); + + /** + * store data + */ + + // esalt + + memcpy (jwt->salt_buf, input_buf, esalt_len); + + jwt->salt_len = esalt_len; + + // salt + // + // Create a hash of the esalt because esalt buffer can change somewhere behind salt->salt_buf size + // Not a regular MD5 but good enough + + u32 hash[4]; + + hash[0] = 0; + hash[1] = 1; + hash[2] = 2; + hash[3] = 3; + + u32 block[16]; + + memset (block, 0, sizeof (block)); + + for (int i = 0; i < 1024; i += 16) + { + for (int j = 0; j < 16; j++) + { + block[j] = jwt->salt_buf[i + j]; + + md5_64 (block, hash); + } + } + + salt->salt_buf[0] = hash[0]; + salt->salt_buf[1] = hash[1]; + salt->salt_buf[2] = hash[2]; + salt->salt_buf[3] = hash[3]; + + salt->salt_len = 16; + + // hash + + u8 tmp_buf[100] = { 0 }; + + base64_decode (base64url_to_int, signature_pos, signature_len, tmp_buf); + + if (signature_len == 43) + { + memcpy (hash_buf->digest, tmp_buf, 32); + + u32 *digest = (u32 *) hash_buf->digest; + + digest[0] = byte_swap_32 (digest[0]); + digest[1] = byte_swap_32 (digest[1]); + digest[2] = byte_swap_32 (digest[2]); + digest[3] = byte_swap_32 (digest[3]); + digest[4] = byte_swap_32 (digest[4]); + digest[5] = byte_swap_32 (digest[5]); + digest[6] = byte_swap_32 (digest[6]); + digest[7] = byte_swap_32 (digest[7]); + } + else if (signature_len == 64) + { + memcpy (hash_buf->digest, tmp_buf, 48); + + u64 *digest = (u64 *) hash_buf->digest; + + digest[0] = byte_swap_64 (digest[0]); + digest[1] = byte_swap_64 (digest[1]); + digest[2] = byte_swap_64 (digest[2]); + digest[3] = byte_swap_64 (digest[3]); + digest[4] = byte_swap_64 (digest[4]); + digest[5] = byte_swap_64 (digest[5]); + } + else if (signature_len == 86) + { + memcpy (hash_buf->digest, tmp_buf, 64); + + u64 *digest = (u64 *) hash_buf->digest; + + digest[0] = byte_swap_64 (digest[0]); + digest[1] = byte_swap_64 (digest[1]); + digest[2] = byte_swap_64 (digest[2]); + digest[3] = byte_swap_64 (digest[3]); + digest[4] = byte_swap_64 (digest[4]); + digest[5] = byte_swap_64 (digest[5]); + digest[6] = byte_swap_64 (digest[6]); + digest[7] = byte_swap_64 (digest[7]); + } + + return (PARSER_OK); +} + +int electrum_wallet13_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig) +{ + if ((input_len < DISPLAY_LEN_MIN_16600) || (input_len > DISPLAY_LEN_MAX_16600)) return (PARSER_GLOBAL_LENGTH); + + if (memcmp (SIGNATURE_ELECTRUM_WALLET, input_buf, 10) != 0) return (PARSER_SIGNATURE_UNMATCHED); + + u32 *digest = (u32 *) hash_buf->digest; + + salt_t *salt = hash_buf->salt; + + electrum_wallet_t *electrum_wallet = (electrum_wallet_t *) hash_buf->esalt; + + /** + * parse line + */ + + // type + + u8 *salt_type_pos = input_buf + 10; + + // iv + + u8 *iv_pos = (u8 *) strchr ((const char *) salt_type_pos, '*'); + + if (iv_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); + + const u32 salt_type_len = iv_pos - salt_type_pos; + + iv_pos++; + + // encrypted + + u8 *encrypted_pos = (u8 *) strchr ((const char *) iv_pos, '*'); + + if (encrypted_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); + + const u32 iv_len = encrypted_pos - iv_pos; + + encrypted_pos++; + + const u32 encrypted_len = input_len - 10 - salt_type_len - 1 - iv_len - 1; + + /** + * verify some data + */ + + const u32 salt_type = strtoul ((const char *) salt_type_pos, NULL, 10); + + if ((salt_type == 1) || (salt_type == 2) || (salt_type == 3)) + { + // all ok + } + else + { + return (PARSER_SALT_VALUE); + } + + if (iv_len != 32) return (PARSER_SALT_LENGTH); + + if (encrypted_len != 32) return (PARSER_SALT_LENGTH); + + if (is_valid_hex_string (iv_pos, iv_len) == false) return (PARSER_SALT_ENCODING); + if (is_valid_hex_string (encrypted_pos, encrypted_len) == false) return (PARSER_SALT_ENCODING); + + /** + * store data + */ + + electrum_wallet->salt_type = salt_type; + + // iv (16 bytes) + + electrum_wallet->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]); + electrum_wallet->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]); + electrum_wallet->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]); + electrum_wallet->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]); + + // encrypted (16 bytes) + + electrum_wallet->encrypted[0] = hex_to_u32 ((const u8 *) &encrypted_pos[ 0]); + electrum_wallet->encrypted[1] = hex_to_u32 ((const u8 *) &encrypted_pos[ 8]); + electrum_wallet->encrypted[2] = hex_to_u32 ((const u8 *) &encrypted_pos[16]); + electrum_wallet->encrypted[3] = hex_to_u32 ((const u8 *) &encrypted_pos[24]); + + // salt fake + + salt->salt_buf[0] = electrum_wallet->iv[0]; + salt->salt_buf[1] = electrum_wallet->iv[1]; + salt->salt_buf[2] = electrum_wallet->iv[2]; + salt->salt_buf[3] = electrum_wallet->iv[3]; + salt->salt_buf[4] = electrum_wallet->encrypted[0]; + salt->salt_buf[5] = electrum_wallet->encrypted[1]; + salt->salt_buf[6] = electrum_wallet->encrypted[2]; + salt->salt_buf[7] = electrum_wallet->encrypted[3]; + + salt->salt_len = 32; + + // hash fake + + digest[0] = electrum_wallet->iv[0]; + digest[1] = electrum_wallet->iv[1]; + digest[2] = electrum_wallet->iv[2]; + digest[3] = electrum_wallet->iv[3]; + digest[4] = electrum_wallet->encrypted[0]; + digest[5] = electrum_wallet->encrypted[1]; + digest[6] = electrum_wallet->encrypted[2]; + digest[7] = electrum_wallet->encrypted[3]; + + return (PARSER_OK); +} + +/** + * hook functions + */ + +void seven_zip_hook_func (hc_device_param_t *device_param, void *hook_salts_buf, const u32 salt_pos, const u32 pws_cnt) +{ + seven_zip_hook_t *hook_items = (seven_zip_hook_t *) device_param->hooks_buf; + + seven_zip_hook_salt_t *seven_zips = (seven_zip_hook_salt_t *) hook_salts_buf; + seven_zip_hook_salt_t *seven_zip = &seven_zips[salt_pos]; + + u8 data_type = seven_zip->data_type; + u32 *data_buf = seven_zip->data_buf; + u32 unpack_size = seven_zip->unpack_size; + + for (u32 pw_pos = 0; pw_pos < pws_cnt; pw_pos++) + { + // this hook data needs to be updated (the "hook_success" variable): + + seven_zip_hook_t *hook_item = &hook_items[pw_pos]; + + const u8 *ukey = (const u8 *) hook_item->ukey; + + // init AES + + AES_KEY aes_key; + + memset (&aes_key, 0, sizeof (aes_key)); + + AES_set_decrypt_key (ukey, 256, &aes_key); + + int aes_len = seven_zip->aes_len; + + u32 data[4]; + u32 out [4]; + u32 iv [4]; + + iv[0] = seven_zip->iv_buf[0]; + iv[1] = seven_zip->iv_buf[1]; + iv[2] = seven_zip->iv_buf[2]; + iv[3] = seven_zip->iv_buf[3]; + + u32 out_full[81882]; + + // if aes_len > 16 we need to loop + + int i = 0; + int j = 0; + + for (i = 0, j = 0; i < aes_len - 16; i += 16, j += 4) + { + data[0] = data_buf[j + 0]; + data[1] = data_buf[j + 1]; + data[2] = data_buf[j + 2]; + data[3] = data_buf[j + 3]; + + AES_decrypt (&aes_key, (u8*) data, (u8*) out); + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + iv[0] = data[0]; + iv[1] = data[1]; + iv[2] = data[2]; + iv[3] = data[3]; + + out_full[j + 0] = out[0]; + out_full[j + 1] = out[1]; + out_full[j + 2] = out[2]; + out_full[j + 3] = out[3]; + } + + // we need to run it at least once: + + data[0] = data_buf[j + 0]; + data[1] = data_buf[j + 1]; + data[2] = data_buf[j + 2]; + data[3] = data_buf[j + 3]; + + AES_decrypt (&aes_key, (u8*) data, (u8*) out); + + out[0] ^= iv[0]; + out[1] ^= iv[1]; + out[2] ^= iv[2]; + out[3] ^= iv[3]; + + out_full[j + 0] = out[0]; + out_full[j + 1] = out[1]; + out_full[j + 2] = out[2]; + out_full[j + 3] = out[3]; + + /* + * check the CRC32 "hash" + */ + + u32 seven_zip_crc = seven_zip->crc; + + u32 crc; + + if (data_type == 0) // uncompressed + { + crc = cpu_crc32_buffer ((u8 *) out_full, unpack_size); + } + else + { + u32 crc_len = seven_zip->crc_len; + + char *coder_attributes = seven_zip->coder_attributes; + + // input buffers and length + + u8 *compressed_data = (u8 *) out_full; + + SizeT compressed_data_len = aes_len; + + // output buffers and length + + unsigned char *decompressed_data; + + decompressed_data = (unsigned char *) hcmalloc (crc_len); + + SizeT decompressed_data_len = crc_len; + + int ret; + + if (data_type == 1) // LZMA1 + { + ret = hc_lzma1_decompress (compressed_data, &compressed_data_len, decompressed_data, &decompressed_data_len, coder_attributes); + } + else // we only support LZMA2 in addition to LZMA1 + { + ret = hc_lzma2_decompress (compressed_data, &compressed_data_len, decompressed_data, &decompressed_data_len, coder_attributes); + } + + if (ret != SZ_OK) + { + hook_item->hook_success = 0; + + hcfree (decompressed_data); + + continue; + } + + crc = cpu_crc32_buffer (decompressed_data, crc_len); + + hcfree (decompressed_data); + } + + if (crc == seven_zip_crc) + { + hook_item->hook_success = 1; + } + else + { + hook_item->hook_success = 0; } } } @@ -15880,319 +16632,325 @@ void seven_zip_hook_func (hc_device_param_t *device_param, void *hook_salts_buf, * output */ -char *stroptitype (const u32 opti_type) +const char *stroptitype (const u32 opti_type) { switch (opti_type) { - case OPTI_TYPE_OPTIMIZED_KERNEL: return ((char *) OPTI_STR_OPTIMIZED_KERNEL); - case OPTI_TYPE_ZERO_BYTE: return ((char *) OPTI_STR_ZERO_BYTE); - case OPTI_TYPE_PRECOMPUTE_INIT: return ((char *) OPTI_STR_PRECOMPUTE_INIT); - case OPTI_TYPE_PRECOMPUTE_MERKLE: return ((char *) OPTI_STR_PRECOMPUTE_MERKLE); - case OPTI_TYPE_PRECOMPUTE_PERMUT: return ((char *) OPTI_STR_PRECOMPUTE_PERMUT); - case OPTI_TYPE_MEET_IN_MIDDLE: return ((char *) OPTI_STR_MEET_IN_MIDDLE); - case OPTI_TYPE_EARLY_SKIP: return ((char *) OPTI_STR_EARLY_SKIP); - case OPTI_TYPE_NOT_SALTED: return ((char *) OPTI_STR_NOT_SALTED); - case OPTI_TYPE_NOT_ITERATED: return ((char *) OPTI_STR_NOT_ITERATED); - case OPTI_TYPE_PREPENDED_SALT: return ((char *) OPTI_STR_PREPENDED_SALT); - case OPTI_TYPE_APPENDED_SALT: return ((char *) OPTI_STR_APPENDED_SALT); - case OPTI_TYPE_SINGLE_HASH: return ((char *) OPTI_STR_SINGLE_HASH); - case OPTI_TYPE_SINGLE_SALT: return ((char *) OPTI_STR_SINGLE_SALT); - case OPTI_TYPE_BRUTE_FORCE: return ((char *) OPTI_STR_BRUTE_FORCE); - case OPTI_TYPE_RAW_HASH: return ((char *) OPTI_STR_RAW_HASH); - case OPTI_TYPE_SLOW_HASH_SIMD_INIT: return ((char *) OPTI_STR_SLOW_HASH_SIMD_INIT); - case OPTI_TYPE_SLOW_HASH_SIMD_LOOP: return ((char *) OPTI_STR_SLOW_HASH_SIMD_LOOP); - case OPTI_TYPE_SLOW_HASH_SIMD_COMP: return ((char *) OPTI_STR_SLOW_HASH_SIMD_COMP); - case OPTI_TYPE_USES_BITS_8: return ((char *) OPTI_STR_USES_BITS_8); - case OPTI_TYPE_USES_BITS_16: return ((char *) OPTI_STR_USES_BITS_16); - case OPTI_TYPE_USES_BITS_32: return ((char *) OPTI_STR_USES_BITS_32); - case OPTI_TYPE_USES_BITS_64: return ((char *) OPTI_STR_USES_BITS_64); - } - - return (NULL); + case OPTI_TYPE_OPTIMIZED_KERNEL: return OPTI_STR_OPTIMIZED_KERNEL; + case OPTI_TYPE_ZERO_BYTE: return OPTI_STR_ZERO_BYTE; + case OPTI_TYPE_PRECOMPUTE_INIT: return OPTI_STR_PRECOMPUTE_INIT; + case OPTI_TYPE_PRECOMPUTE_MERKLE: return OPTI_STR_PRECOMPUTE_MERKLE; + case OPTI_TYPE_PRECOMPUTE_PERMUT: return OPTI_STR_PRECOMPUTE_PERMUT; + case OPTI_TYPE_MEET_IN_MIDDLE: return OPTI_STR_MEET_IN_MIDDLE; + case OPTI_TYPE_EARLY_SKIP: return OPTI_STR_EARLY_SKIP; + case OPTI_TYPE_NOT_SALTED: return OPTI_STR_NOT_SALTED; + case OPTI_TYPE_NOT_ITERATED: return OPTI_STR_NOT_ITERATED; + case OPTI_TYPE_PREPENDED_SALT: return OPTI_STR_PREPENDED_SALT; + case OPTI_TYPE_APPENDED_SALT: return OPTI_STR_APPENDED_SALT; + case OPTI_TYPE_SINGLE_HASH: return OPTI_STR_SINGLE_HASH; + case OPTI_TYPE_SINGLE_SALT: return OPTI_STR_SINGLE_SALT; + case OPTI_TYPE_BRUTE_FORCE: return OPTI_STR_BRUTE_FORCE; + case OPTI_TYPE_RAW_HASH: return OPTI_STR_RAW_HASH; + case OPTI_TYPE_SLOW_HASH_SIMD_INIT: return OPTI_STR_SLOW_HASH_SIMD_INIT; + case OPTI_TYPE_SLOW_HASH_SIMD_LOOP: return OPTI_STR_SLOW_HASH_SIMD_LOOP; + case OPTI_TYPE_SLOW_HASH_SIMD_COMP: return OPTI_STR_SLOW_HASH_SIMD_COMP; + case OPTI_TYPE_USES_BITS_8: return OPTI_STR_USES_BITS_8; + case OPTI_TYPE_USES_BITS_16: return OPTI_STR_USES_BITS_16; + case OPTI_TYPE_USES_BITS_32: return OPTI_STR_USES_BITS_32; + case OPTI_TYPE_USES_BITS_64: return OPTI_STR_USES_BITS_64; + } + + return NULL; } -char *strhashtype (const u32 hash_mode) +const char *strhashtype (const u32 hash_mode) { switch (hash_mode) { - case 0: return ((char *) HT_00000); - case 10: return ((char *) HT_00010); - case 11: return ((char *) HT_00011); - case 12: return ((char *) HT_00012); - case 20: return ((char *) HT_00020); - case 21: return ((char *) HT_00021); - case 22: return ((char *) HT_00022); - case 23: return ((char *) HT_00023); - case 30: return ((char *) HT_00030); - case 40: return ((char *) HT_00040); - case 50: return ((char *) HT_00050); - case 60: return ((char *) HT_00060); - case 100: return ((char *) HT_00100); - case 101: return ((char *) HT_00101); - case 110: return ((char *) HT_00110); - case 111: return ((char *) HT_00111); - case 112: return ((char *) HT_00112); - case 120: return ((char *) HT_00120); - case 121: return ((char *) HT_00121); - case 122: return ((char *) HT_00122); - case 124: return ((char *) HT_00124); - case 125: return ((char *) HT_00125); - case 130: return ((char *) HT_00130); - case 131: return ((char *) HT_00131); - case 132: return ((char *) HT_00132); - case 133: return ((char *) HT_00133); - case 140: return ((char *) HT_00140); - case 141: return ((char *) HT_00141); - case 150: return ((char *) HT_00150); - case 160: return ((char *) HT_00160); - case 200: return ((char *) HT_00200); - case 300: return ((char *) HT_00300); - case 400: return ((char *) HT_00400); - case 500: return ((char *) HT_00500); - case 501: return ((char *) HT_00501); - case 600: return ((char *) HT_00600); - case 900: return ((char *) HT_00900); - case 1000: return ((char *) HT_01000); - case 1100: return ((char *) HT_01100); - case 1300: return ((char *) HT_01300); - case 1400: return ((char *) HT_01400); - case 1410: return ((char *) HT_01410); - case 1411: return ((char *) HT_01411); - case 1420: return ((char *) HT_01420); - case 1421: return ((char *) HT_01421); - case 1430: return ((char *) HT_01430); - case 1440: return ((char *) HT_01440); - case 1441: return ((char *) HT_01441); - case 1450: return ((char *) HT_01450); - case 1460: return ((char *) HT_01460); - case 1500: return ((char *) HT_01500); - case 1600: return ((char *) HT_01600); - case 1700: return ((char *) HT_01700); - case 1710: return ((char *) HT_01710); - case 1711: return ((char *) HT_01711); - case 1720: return ((char *) HT_01720); - case 1722: return ((char *) HT_01722); - case 1730: return ((char *) HT_01730); - case 1731: return ((char *) HT_01731); - case 1740: return ((char *) HT_01740); - case 1750: return ((char *) HT_01750); - case 1760: return ((char *) HT_01760); - case 1800: return ((char *) HT_01800); - case 2100: return ((char *) HT_02100); - case 2400: return ((char *) HT_02400); - case 2410: return ((char *) HT_02410); - case 2500: return ((char *) HT_02500); - case 2501: return ((char *) HT_02501); - case 2600: return ((char *) HT_02600); - case 2611: return ((char *) HT_02611); - case 2612: return ((char *) HT_02612); - case 2711: return ((char *) HT_02711); - case 2811: return ((char *) HT_02811); - case 3000: return ((char *) HT_03000); - case 3100: return ((char *) HT_03100); - case 3200: return ((char *) HT_03200); - case 3710: return ((char *) HT_03710); - case 3711: return ((char *) HT_03711); - case 3800: return ((char *) HT_03800); - case 3910: return ((char *) HT_03910); - case 4010: return ((char *) HT_04010); - case 4110: return ((char *) HT_04110); - case 4300: return ((char *) HT_04300); - case 4400: return ((char *) HT_04400); - case 4500: return ((char *) HT_04500); - case 4520: return ((char *) HT_04520); - case 4521: return ((char *) HT_04521); - case 4522: return ((char *) HT_04522); - case 4700: return ((char *) HT_04700); - case 4800: return ((char *) HT_04800); - case 4900: return ((char *) HT_04900); - case 5000: return ((char *) HT_05000); - case 5100: return ((char *) HT_05100); - case 5200: return ((char *) HT_05200); - case 5300: return ((char *) HT_05300); - case 5400: return ((char *) HT_05400); - case 5500: return ((char *) HT_05500); - case 5600: return ((char *) HT_05600); - case 5700: return ((char *) HT_05700); - case 5800: return ((char *) HT_05800); - case 6000: return ((char *) HT_06000); - case 6100: return ((char *) HT_06100); - case 6211: return ((char *) HT_06211); - case 6212: return ((char *) HT_06212); - case 6213: return ((char *) HT_06213); - case 6221: return ((char *) HT_06221); - case 6222: return ((char *) HT_06222); - case 6223: return ((char *) HT_06223); - case 6231: return ((char *) HT_06231); - case 6232: return ((char *) HT_06232); - case 6233: return ((char *) HT_06233); - case 6241: return ((char *) HT_06241); - case 6242: return ((char *) HT_06242); - case 6243: return ((char *) HT_06243); - case 6300: return ((char *) HT_06300); - case 6400: return ((char *) HT_06400); - case 6500: return ((char *) HT_06500); - case 6600: return ((char *) HT_06600); - case 6700: return ((char *) HT_06700); - case 6800: return ((char *) HT_06800); - case 6900: return ((char *) HT_06900); - case 7000: return ((char *) HT_07000); - case 7100: return ((char *) HT_07100); - case 7200: return ((char *) HT_07200); - case 7300: return ((char *) HT_07300); - case 7400: return ((char *) HT_07400); - case 7500: return ((char *) HT_07500); - case 7700: return ((char *) HT_07700); - case 7800: return ((char *) HT_07800); - case 7900: return ((char *) HT_07900); - case 8000: return ((char *) HT_08000); - case 8100: return ((char *) HT_08100); - case 8200: return ((char *) HT_08200); - case 8300: return ((char *) HT_08300); - case 8400: return ((char *) HT_08400); - case 8500: return ((char *) HT_08500); - case 8600: return ((char *) HT_08600); - case 8700: return ((char *) HT_08700); - case 8800: return ((char *) HT_08800); - case 8900: return ((char *) HT_08900); - case 9000: return ((char *) HT_09000); - case 9100: return ((char *) HT_09100); - case 9200: return ((char *) HT_09200); - case 9300: return ((char *) HT_09300); - case 9400: return ((char *) HT_09400); - case 9500: return ((char *) HT_09500); - case 9600: return ((char *) HT_09600); - case 9700: return ((char *) HT_09700); - case 9710: return ((char *) HT_09710); - case 9720: return ((char *) HT_09720); - case 9800: return ((char *) HT_09800); - case 9810: return ((char *) HT_09810); - case 9820: return ((char *) HT_09820); - case 9900: return ((char *) HT_09900); - case 10000: return ((char *) HT_10000); - case 10100: return ((char *) HT_10100); - case 10200: return ((char *) HT_10200); - case 10300: return ((char *) HT_10300); - case 10400: return ((char *) HT_10400); - case 10410: return ((char *) HT_10410); - case 10420: return ((char *) HT_10420); - case 10500: return ((char *) HT_10500); - case 10600: return ((char *) HT_10600); - case 10700: return ((char *) HT_10700); - case 10800: return ((char *) HT_10800); - case 10900: return ((char *) HT_10900); - case 11000: return ((char *) HT_11000); - case 11100: return ((char *) HT_11100); - case 11200: return ((char *) HT_11200); - case 11300: return ((char *) HT_11300); - case 11400: return ((char *) HT_11400); - case 11500: return ((char *) HT_11500); - case 11600: return ((char *) HT_11600); - case 11700: return ((char *) HT_11700); - case 11800: return ((char *) HT_11800); - case 11900: return ((char *) HT_11900); - case 12000: return ((char *) HT_12000); - case 12001: return ((char *) HT_12001); - case 12100: return ((char *) HT_12100); - case 12200: return ((char *) HT_12200); - case 12300: return ((char *) HT_12300); - case 12400: return ((char *) HT_12400); - case 12500: return ((char *) HT_12500); - case 12600: return ((char *) HT_12600); - case 12700: return ((char *) HT_12700); - case 12800: return ((char *) HT_12800); - case 12900: return ((char *) HT_12900); - case 13000: return ((char *) HT_13000); - case 13100: return ((char *) HT_13100); - case 13200: return ((char *) HT_13200); - case 13300: return ((char *) HT_13300); - case 13400: return ((char *) HT_13400); - case 13500: return ((char *) HT_13500); - case 13600: return ((char *) HT_13600); - case 13711: return ((char *) HT_13711); - case 13712: return ((char *) HT_13712); - case 13713: return ((char *) HT_13713); - case 13721: return ((char *) HT_13721); - case 13722: return ((char *) HT_13722); - case 13723: return ((char *) HT_13723); - case 13731: return ((char *) HT_13731); - case 13732: return ((char *) HT_13732); - case 13733: return ((char *) HT_13733); - case 13741: return ((char *) HT_13741); - case 13742: return ((char *) HT_13742); - case 13743: return ((char *) HT_13743); - case 13751: return ((char *) HT_13751); - case 13752: return ((char *) HT_13752); - case 13753: return ((char *) HT_13753); - case 13761: return ((char *) HT_13761); - case 13762: return ((char *) HT_13762); - case 13763: return ((char *) HT_13763); - case 13800: return ((char *) HT_13800); - case 13900: return ((char *) HT_13900); - case 14000: return ((char *) HT_14000); - case 14100: return ((char *) HT_14100); - case 14400: return ((char *) HT_14400); - case 14600: return ((char *) HT_14600); - case 14700: return ((char *) HT_14700); - case 14800: return ((char *) HT_14800); - case 14900: return ((char *) HT_14900); - case 15000: return ((char *) HT_15000); - case 15100: return ((char *) HT_15100); - case 15200: return ((char *) HT_15200); - case 15300: return ((char *) HT_15300); - case 15400: return ((char *) HT_15400); - case 15500: return ((char *) HT_15500); - case 15600: return ((char *) HT_15600); - case 15700: return ((char *) HT_15700); - case 15900: return ((char *) HT_15900); - case 16000: return ((char *) HT_16000); - case 99999: return ((char *) HT_99999); - } - - return ((char *) "Unknown"); + case 0: return HT_00000; + case 10: return HT_00010; + case 11: return HT_00011; + case 12: return HT_00012; + case 20: return HT_00020; + case 21: return HT_00021; + case 22: return HT_00022; + case 23: return HT_00023; + case 30: return HT_00030; + case 40: return HT_00040; + case 50: return HT_00050; + case 60: return HT_00060; + case 100: return HT_00100; + case 101: return HT_00101; + case 110: return HT_00110; + case 111: return HT_00111; + case 112: return HT_00112; + case 120: return HT_00120; + case 121: return HT_00121; + case 122: return HT_00122; + case 124: return HT_00124; + case 125: return HT_00125; + case 130: return HT_00130; + case 131: return HT_00131; + case 132: return HT_00132; + case 133: return HT_00133; + case 140: return HT_00140; + case 141: return HT_00141; + case 150: return HT_00150; + case 160: return HT_00160; + case 200: return HT_00200; + case 300: return HT_00300; + case 400: return HT_00400; + case 500: return HT_00500; + case 501: return HT_00501; + case 600: return HT_00600; + case 900: return HT_00900; + case 1000: return HT_01000; + case 1100: return HT_01100; + case 1300: return HT_01300; + case 1400: return HT_01400; + case 1410: return HT_01410; + case 1411: return HT_01411; + case 1420: return HT_01420; + case 1421: return HT_01421; + case 1430: return HT_01430; + case 1440: return HT_01440; + case 1441: return HT_01441; + case 1450: return HT_01450; + case 1460: return HT_01460; + case 1500: return HT_01500; + case 1600: return HT_01600; + case 1700: return HT_01700; + case 1710: return HT_01710; + case 1711: return HT_01711; + case 1720: return HT_01720; + case 1722: return HT_01722; + case 1730: return HT_01730; + case 1731: return HT_01731; + case 1740: return HT_01740; + case 1750: return HT_01750; + case 1760: return HT_01760; + case 1800: return HT_01800; + case 2100: return HT_02100; + case 2400: return HT_02400; + case 2410: return HT_02410; + case 2500: return HT_02500; + case 2501: return HT_02501; + case 2600: return HT_02600; + case 2611: return HT_02611; + case 2612: return HT_02612; + case 2711: return HT_02711; + case 2811: return HT_02811; + case 3000: return HT_03000; + case 3100: return HT_03100; + case 3200: return HT_03200; + case 3710: return HT_03710; + case 3711: return HT_03711; + case 3800: return HT_03800; + case 3910: return HT_03910; + case 4010: return HT_04010; + case 4110: return HT_04110; + case 4300: return HT_04300; + case 4400: return HT_04400; + case 4500: return HT_04500; + case 4520: return HT_04520; + case 4521: return HT_04521; + case 4522: return HT_04522; + case 4700: return HT_04700; + case 4800: return HT_04800; + case 4900: return HT_04900; + case 5000: return HT_05000; + case 5100: return HT_05100; + case 5200: return HT_05200; + case 5300: return HT_05300; + case 5400: return HT_05400; + case 5500: return HT_05500; + case 5600: return HT_05600; + case 5700: return HT_05700; + case 5800: return HT_05800; + case 6000: return HT_06000; + case 6100: return HT_06100; + case 6211: return HT_06211; + case 6212: return HT_06212; + case 6213: return HT_06213; + case 6221: return HT_06221; + case 6222: return HT_06222; + case 6223: return HT_06223; + case 6231: return HT_06231; + case 6232: return HT_06232; + case 6233: return HT_06233; + case 6241: return HT_06241; + case 6242: return HT_06242; + case 6243: return HT_06243; + case 6300: return HT_06300; + case 6400: return HT_06400; + case 6500: return HT_06500; + case 6600: return HT_06600; + case 6700: return HT_06700; + case 6800: return HT_06800; + case 6900: return HT_06900; + case 7000: return HT_07000; + case 7100: return HT_07100; + case 7200: return HT_07200; + case 7300: return HT_07300; + case 7400: return HT_07400; + case 7500: return HT_07500; + case 7700: return HT_07700; + case 7800: return HT_07800; + case 7900: return HT_07900; + case 8000: return HT_08000; + case 8100: return HT_08100; + case 8200: return HT_08200; + case 8300: return HT_08300; + case 8400: return HT_08400; + case 8500: return HT_08500; + case 8600: return HT_08600; + case 8700: return HT_08700; + case 8800: return HT_08800; + case 8900: return HT_08900; + case 9000: return HT_09000; + case 9100: return HT_09100; + case 9200: return HT_09200; + case 9300: return HT_09300; + case 9400: return HT_09400; + case 9500: return HT_09500; + case 9600: return HT_09600; + case 9700: return HT_09700; + case 9710: return HT_09710; + case 9720: return HT_09720; + case 9800: return HT_09800; + case 9810: return HT_09810; + case 9820: return HT_09820; + case 9900: return HT_09900; + case 10000: return HT_10000; + case 10100: return HT_10100; + case 10200: return HT_10200; + case 10300: return HT_10300; + case 10400: return HT_10400; + case 10410: return HT_10410; + case 10420: return HT_10420; + case 10500: return HT_10500; + case 10600: return HT_10600; + case 10700: return HT_10700; + case 10800: return HT_10800; + case 10900: return HT_10900; + case 11000: return HT_11000; + case 11100: return HT_11100; + case 11200: return HT_11200; + case 11300: return HT_11300; + case 11400: return HT_11400; + case 11500: return HT_11500; + case 11600: return HT_11600; + case 11700: return HT_11700; + case 11800: return HT_11800; + case 11900: return HT_11900; + case 12000: return HT_12000; + case 12001: return HT_12001; + case 12100: return HT_12100; + case 12200: return HT_12200; + case 12300: return HT_12300; + case 12400: return HT_12400; + case 12500: return HT_12500; + case 12600: return HT_12600; + case 12700: return HT_12700; + case 12800: return HT_12800; + case 12900: return HT_12900; + case 13000: return HT_13000; + case 13100: return HT_13100; + case 13200: return HT_13200; + case 13300: return HT_13300; + case 13400: return HT_13400; + case 13500: return HT_13500; + case 13600: return HT_13600; + case 13711: return HT_13711; + case 13712: return HT_13712; + case 13713: return HT_13713; + case 13721: return HT_13721; + case 13722: return HT_13722; + case 13723: return HT_13723; + case 13731: return HT_13731; + case 13732: return HT_13732; + case 13733: return HT_13733; + case 13741: return HT_13741; + case 13742: return HT_13742; + case 13743: return HT_13743; + case 13751: return HT_13751; + case 13752: return HT_13752; + case 13753: return HT_13753; + case 13761: return HT_13761; + case 13762: return HT_13762; + case 13763: return HT_13763; + case 13800: return HT_13800; + case 13900: return HT_13900; + case 14000: return HT_14000; + case 14100: return HT_14100; + case 14400: return HT_14400; + case 14600: return HT_14600; + case 14700: return HT_14700; + case 14800: return HT_14800; + case 14900: return HT_14900; + case 15000: return HT_15000; + case 15100: return HT_15100; + case 15200: return HT_15200; + case 15300: return HT_15300; + case 15400: return HT_15400; + case 15500: return HT_15500; + case 15600: return HT_15600; + case 15700: return HT_15700; + case 15900: return HT_15900; + case 16000: return HT_16000; + case 16100: return HT_16100; + case 16200: return HT_16200; + case 16300: return HT_16300; + case 16400: return HT_16400; + case 16500: return HT_16500; + case 16600: return HT_16600; + case 99999: return HT_99999; + } + + return NULL; } -char *strparser (const u32 parser_status) +const char *strparser (const u32 parser_status) { switch (parser_status) { - case PARSER_OK: return ((char *) PA_000); - case PARSER_COMMENT: return ((char *) PA_001); - case PARSER_GLOBAL_ZERO: return ((char *) PA_002); - case PARSER_GLOBAL_LENGTH: return ((char *) PA_003); - case PARSER_HASH_LENGTH: return ((char *) PA_004); - case PARSER_HASH_VALUE: return ((char *) PA_005); - case PARSER_SALT_LENGTH: return ((char *) PA_006); - case PARSER_SALT_VALUE: return ((char *) PA_007); - case PARSER_SALT_ITERATION: return ((char *) PA_008); - case PARSER_SEPARATOR_UNMATCHED: return ((char *) PA_009); - case PARSER_SIGNATURE_UNMATCHED: return ((char *) PA_010); - case PARSER_HCCAPX_FILE_SIZE: return ((char *) PA_011); - case PARSER_HCCAPX_EAPOL_LEN: return ((char *) PA_012); - case PARSER_PSAFE2_FILE_SIZE: return ((char *) PA_013); - case PARSER_PSAFE3_FILE_SIZE: return ((char *) PA_014); - case PARSER_TC_FILE_SIZE: return ((char *) PA_015); - case PARSER_VC_FILE_SIZE: return ((char *) PA_016); - case PARSER_SIP_AUTH_DIRECTIVE: return ((char *) PA_017); - case PARSER_HASH_FILE: return ((char *) PA_018); - case PARSER_HASH_ENCODING: return ((char *) PA_019); - case PARSER_SALT_ENCODING: return ((char *) PA_020); - case PARSER_LUKS_FILE_SIZE: return ((char *) PA_021); - case PARSER_LUKS_MAGIC: return ((char *) PA_022); - case PARSER_LUKS_VERSION: return ((char *) PA_023); - case PARSER_LUKS_CIPHER_TYPE: return ((char *) PA_024); - case PARSER_LUKS_CIPHER_MODE: return ((char *) PA_025); - case PARSER_LUKS_HASH_TYPE: return ((char *) PA_026); - case PARSER_LUKS_KEY_SIZE: return ((char *) PA_027); - case PARSER_LUKS_KEY_DISABLED: return ((char *) PA_028); - case PARSER_LUKS_KEY_STRIPES: return ((char *) PA_029); - case PARSER_LUKS_HASH_CIPHER: return ((char *) PA_030); - case PARSER_HCCAPX_SIGNATURE: return ((char *) PA_031); - case PARSER_HCCAPX_VERSION: return ((char *) PA_032); - case PARSER_HCCAPX_MESSAGE_PAIR: return ((char *) PA_033); - } - - return ((char *) PA_255); + case PARSER_OK: return PA_000; + case PARSER_COMMENT: return PA_001; + case PARSER_GLOBAL_ZERO: return PA_002; + case PARSER_GLOBAL_LENGTH: return PA_003; + case PARSER_HASH_LENGTH: return PA_004; + case PARSER_HASH_VALUE: return PA_005; + case PARSER_SALT_LENGTH: return PA_006; + case PARSER_SALT_VALUE: return PA_007; + case PARSER_SALT_ITERATION: return PA_008; + case PARSER_SEPARATOR_UNMATCHED: return PA_009; + case PARSER_SIGNATURE_UNMATCHED: return PA_010; + case PARSER_HCCAPX_FILE_SIZE: return PA_011; + case PARSER_HCCAPX_EAPOL_LEN: return PA_012; + case PARSER_PSAFE2_FILE_SIZE: return PA_013; + case PARSER_PSAFE3_FILE_SIZE: return PA_014; + case PARSER_TC_FILE_SIZE: return PA_015; + case PARSER_VC_FILE_SIZE: return PA_016; + case PARSER_SIP_AUTH_DIRECTIVE: return PA_017; + case PARSER_HASH_FILE: return PA_018; + case PARSER_HASH_ENCODING: return PA_019; + case PARSER_SALT_ENCODING: return PA_020; + case PARSER_LUKS_FILE_SIZE: return PA_021; + case PARSER_LUKS_MAGIC: return PA_022; + case PARSER_LUKS_VERSION: return PA_023; + case PARSER_LUKS_CIPHER_TYPE: return PA_024; + case PARSER_LUKS_CIPHER_MODE: return PA_025; + case PARSER_LUKS_HASH_TYPE: return PA_026; + case PARSER_LUKS_KEY_SIZE: return PA_027; + case PARSER_LUKS_KEY_DISABLED: return PA_028; + case PARSER_LUKS_KEY_STRIPES: return PA_029; + case PARSER_LUKS_HASH_CIPHER: return PA_030; + case PARSER_HCCAPX_SIGNATURE: return PA_031; + case PARSER_HCCAPX_VERSION: return PA_032; + case PARSER_HCCAPX_MESSAGE_PAIR: return PA_033; + } + + return PA_255; } int check_old_hccap (const char *hashfile) @@ -19551,6 +20309,198 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le out_buf[10] = 0; } + else if (hash_mode == 16100) + { + tacacs_plus_t *tacacs_pluss = (tacacs_plus_t *) esalts_buf; + + tacacs_plus_t *tacacs_plus = &tacacs_pluss[digest_cur]; + + char ct_data[256 + 1] = { 0 }; + + u8 *ct_data_ptr = (u8 *) tacacs_plus->ct_data_buf; + + for (u32 i = 0, j = 0; i < tacacs_plus->ct_data_len; i += 1, j += 2) + { + sprintf (ct_data + j, "%02x", ct_data_ptr[i]); + } + + u8 *session_ptr = (u8 *) tacacs_plus->session_buf; + u8 *sequence_ptr = (u8 *) tacacs_plus->sequence_buf; + + snprintf (out_buf, out_len - 1, "%s%02x%02x%02x%02x$%s$%02x%02x", + SIGNATURE_TACACS_PLUS, + session_ptr[0], + session_ptr[1], + session_ptr[2], + session_ptr[3], + ct_data, + sequence_ptr[0], + sequence_ptr[1]); + } + else if (hash_mode == 16200) + { + apple_secure_notes_t *apple_secure_notess = (apple_secure_notes_t *) esalts_buf; + + apple_secure_notes_t *apple_secure_notes = &apple_secure_notess[digest_cur]; + + snprintf (out_buf, out_len - 1, "%s*%u*%u*%08x%08x%08x%08x*%08x%08x%08x%08x%08x%08x", + SIGNATURE_APPLE_SECURE_NOTES, + apple_secure_notes->Z_PK, + apple_secure_notes->ZCRYPTOITERATIONCOUNT, + byte_swap_32 (apple_secure_notes->ZCRYPTOSALT[0]), + byte_swap_32 (apple_secure_notes->ZCRYPTOSALT[1]), + byte_swap_32 (apple_secure_notes->ZCRYPTOSALT[2]), + byte_swap_32 (apple_secure_notes->ZCRYPTOSALT[3]), + byte_swap_32 (apple_secure_notes->ZCRYPTOWRAPPEDKEY[0]), + byte_swap_32 (apple_secure_notes->ZCRYPTOWRAPPEDKEY[1]), + byte_swap_32 (apple_secure_notes->ZCRYPTOWRAPPEDKEY[2]), + byte_swap_32 (apple_secure_notes->ZCRYPTOWRAPPEDKEY[3]), + byte_swap_32 (apple_secure_notes->ZCRYPTOWRAPPEDKEY[4]), + byte_swap_32 (apple_secure_notes->ZCRYPTOWRAPPEDKEY[5])); + } + else if (hash_mode == 16300) + { + ethereum_presale_t *ethereum_presales = (ethereum_presale_t *) esalts_buf; + ethereum_presale_t *ethereum_presale = ðereum_presales[digest_cur]; + + // get the initialization vector: + + u8 encseed[1248 + 1] = { 0 }; + + u32 iv[4]; + + iv[0] = byte_swap_32 (ethereum_presale->iv[0]); + iv[1] = byte_swap_32 (ethereum_presale->iv[1]); + iv[2] = byte_swap_32 (ethereum_presale->iv[2]); + iv[3] = byte_swap_32 (ethereum_presale->iv[3]); + + u32_to_hex_lower (iv[0], encseed + 0); + u32_to_hex_lower (iv[1], encseed + 8); + u32_to_hex_lower (iv[2], encseed + 16); + u32_to_hex_lower (iv[3], encseed + 24); + + // get the raw enc_seed (without iv): + + u32 *enc_seed_ptr = ethereum_presale->enc_seed; + + for (u32 i = 0, j = 32; i < ethereum_presale->enc_seed_len / 4; i++, j += 8) + { + u32 tmp = enc_seed_ptr[i]; + + tmp = byte_swap_32 (tmp); + + u32_to_hex_lower (tmp, encseed + j); + } + + const u32 max_hex_len = (16 + ethereum_presale->enc_seed_len) * 2; // 16 bytes IV + encrypted seed (in hex) + + const u32 max_pos = MIN (sizeof (encseed) - 1, max_hex_len); + + encseed[max_pos] = 0; + + // output: + + snprintf (out_buf, out_len - 1, "%s*%s*%s*%08x%08x%08x%08x", + SIGNATURE_ETHEREUM_PRESALE, + encseed, + (char *) salt.salt_buf, + digest_buf[0], + digest_buf[1], + digest_buf[2], + digest_buf[3] + ); + } + else if (hash_mode == 16400) + { + hashinfo_t **hashinfo_ptr = hash_info; + char *hash_buf = hashinfo_ptr[digest_cur]->orighash; + + snprintf (out_buf, out_len - 1, "%s", hash_buf); + } + else if (hash_mode == 16500) + { + jwt_t *jwts = (jwt_t *) esalts_buf; + + jwt_t *jwt = &jwts[digest_cur]; + + if (hashconfig->kern_type == KERN_TYPE_JWT_HS256) + { + digest_buf[0] = byte_swap_32 (digest_buf[0]); + digest_buf[1] = byte_swap_32 (digest_buf[1]); + digest_buf[2] = byte_swap_32 (digest_buf[2]); + digest_buf[3] = byte_swap_32 (digest_buf[3]); + digest_buf[4] = byte_swap_32 (digest_buf[4]); + digest_buf[5] = byte_swap_32 (digest_buf[5]); + digest_buf[6] = byte_swap_32 (digest_buf[6]); + digest_buf[7] = byte_swap_32 (digest_buf[7]); + + memset (tmp_buf, 0, sizeof (tmp_buf)); + + memcpy (tmp_buf, digest_buf, 32); + + base64_encode (int_to_base64url, (const u8 *) tmp_buf, 32, (u8 *) ptr_plain); + + ptr_plain[43] = 0; + } + else if (hashconfig->kern_type == KERN_TYPE_JWT_HS384) + { + digest_buf64[0] = byte_swap_64 (digest_buf64[0]); + digest_buf64[1] = byte_swap_64 (digest_buf64[1]); + digest_buf64[2] = byte_swap_64 (digest_buf64[2]); + digest_buf64[3] = byte_swap_64 (digest_buf64[3]); + digest_buf64[4] = byte_swap_64 (digest_buf64[4]); + digest_buf64[5] = byte_swap_64 (digest_buf64[5]); + + memset (tmp_buf, 0, sizeof (tmp_buf)); + + memcpy (tmp_buf, digest_buf64, 48); + + base64_encode (int_to_base64url, (const u8 *) tmp_buf, 48, (u8 *) ptr_plain); + + ptr_plain[64] = 0; + } + else if (hashconfig->kern_type == KERN_TYPE_JWT_HS512) + { + digest_buf64[0] = byte_swap_64 (digest_buf64[0]); + digest_buf64[1] = byte_swap_64 (digest_buf64[1]); + digest_buf64[2] = byte_swap_64 (digest_buf64[2]); + digest_buf64[3] = byte_swap_64 (digest_buf64[3]); + digest_buf64[4] = byte_swap_64 (digest_buf64[4]); + digest_buf64[5] = byte_swap_64 (digest_buf64[5]); + digest_buf64[6] = byte_swap_64 (digest_buf64[6]); + digest_buf64[7] = byte_swap_64 (digest_buf64[7]); + + memset (tmp_buf, 0, sizeof (tmp_buf)); + + memcpy (tmp_buf, digest_buf64, 64); + + base64_encode (int_to_base64url, (const u8 *) tmp_buf, 64, (u8 *) ptr_plain); + + ptr_plain[86] = 0; + } + + snprintf (out_buf, out_len - 1, "%s.%s", + (char *) jwt->salt_buf, + (char *) ptr_plain); + } + else if (hash_mode == 16600) + { + electrum_wallet_t *electrum_wallets = (electrum_wallet_t *) esalts_buf; + + electrum_wallet_t *electrum_wallet = &electrum_wallets[digest_cur]; + + snprintf (out_buf, out_len - 1, "%s%d*%08x%08x%08x%08x*%08x%08x%08x%08x", + SIGNATURE_ELECTRUM_WALLET, + electrum_wallet->salt_type, + byte_swap_32 (electrum_wallet->iv[0]), + byte_swap_32 (electrum_wallet->iv[1]), + byte_swap_32 (electrum_wallet->iv[2]), + byte_swap_32 (electrum_wallet->iv[3]), + byte_swap_32 (electrum_wallet->encrypted[0]), + byte_swap_32 (electrum_wallet->encrypted[1]), + byte_swap_32 (electrum_wallet->encrypted[2]), + byte_swap_32 (electrum_wallet->encrypted[3])); + } else if (hash_mode == 99999) { char *ptr = (char *) digest_buf; @@ -20653,8 +21603,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) hashconfig->kern_type = KERN_TYPE_PHPASS; hashconfig->dgst_size = DGST_SIZE_4_4; hashconfig->parse_func = phpass_parse_hash; - hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE - | OPTI_TYPE_SLOW_HASH_SIMD_LOOP; + hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE; hashconfig->dgst_pos0 = 0; hashconfig->dgst_pos1 = 1; hashconfig->dgst_pos2 = 2; @@ -22833,7 +23782,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) hashconfig->dgst_pos1 = 1; hashconfig->dgst_pos2 = 2; hashconfig->dgst_pos3 = 3; - hashconfig->st_hash = ST_HASH_08900; + hashconfig->st_hash = NULL; hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; break; @@ -24258,7 +25207,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL; hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE | OPTS_TYPE_BINARY_HASHFILE; - hashconfig->kern_type = KERN_TYPE_LUKS_SHA1_AES; // this gets overwritten from within parser + hashconfig->kern_type = (u32) -1; // this gets overwritten from within parser hashconfig->dgst_size = DGST_SIZE_4_16; hashconfig->parse_func = NULL; // luks_parse_hash is kind of unconvetional hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE @@ -24473,7 +25422,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) hashconfig->dgst_pos1 = 1; hashconfig->dgst_pos2 = 2; hashconfig->dgst_pos3 = 3; - hashconfig->st_hash = ST_HASH_15700; + hashconfig->st_hash = NULL; hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; break; @@ -24511,6 +25460,119 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; break; + case 16100: hashconfig->hash_type = HASH_TYPE_TACACS_PLUS; + hashconfig->salt_type = SALT_TYPE_EMBEDDED; + hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; + hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE; + hashconfig->kern_type = KERN_TYPE_TACACS_PLUS; + hashconfig->dgst_size = DGST_SIZE_4_4; // originally DGST_SIZE_4_2 + hashconfig->parse_func = tacacs_plus_parse_hash; + hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE + | OPTI_TYPE_PRECOMPUTE_INIT + | OPTI_TYPE_NOT_ITERATED + | OPTI_TYPE_RAW_HASH; + hashconfig->dgst_pos0 = 0; + hashconfig->dgst_pos1 = 1; + hashconfig->dgst_pos2 = 2; + hashconfig->dgst_pos3 = 3; + hashconfig->st_hash = ST_HASH_16100; + hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; + break; + + case 16200: hashconfig->hash_type = HASH_TYPE_APPLE_SECURE_NOTES; + hashconfig->salt_type = SALT_TYPE_EMBEDDED; + hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL; + hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE; + hashconfig->kern_type = KERN_TYPE_APPLE_SECURE_NOTES; + hashconfig->dgst_size = DGST_SIZE_4_4; // originally DGST_SIZE_4_2 + hashconfig->parse_func = apple_secure_notes_parse_hash; + hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE + | OPTI_TYPE_SLOW_HASH_SIMD_LOOP; + hashconfig->dgst_pos0 = 0; + hashconfig->dgst_pos1 = 1; + hashconfig->dgst_pos2 = 2; + hashconfig->dgst_pos3 = 3; + hashconfig->st_hash = ST_HASH_16200; + hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; + break; + + case 16300: hashconfig->hash_type = HASH_TYPE_PBKDF2_SHA256; + hashconfig->salt_type = SALT_TYPE_EMBEDDED; + hashconfig->attack_exec = ATTACK_EXEC_OUTSIDE_KERNEL; + hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE + | OPTS_TYPE_ST_HEX; + hashconfig->kern_type = KERN_TYPE_ETHEREUM_PRESALE; + hashconfig->dgst_size = DGST_SIZE_4_8; + hashconfig->parse_func = ethereum_presale_parse_hash; + hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE + | OPTI_TYPE_SLOW_HASH_SIMD_LOOP; + hashconfig->dgst_pos0 = 0; + hashconfig->dgst_pos1 = 1; + hashconfig->dgst_pos2 = 2; + hashconfig->dgst_pos3 = 3; + hashconfig->st_hash = ST_HASH_16300; + hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; + break; + + case 16400: hashconfig->hash_type = HASH_TYPE_CRAM_MD5_DOVECOT; + hashconfig->salt_type = SALT_TYPE_NONE; + hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; + hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_LE + | OPTS_TYPE_HASH_COPY; + hashconfig->kern_type = KERN_TYPE_CRAM_MD5_DOVECOT; + hashconfig->dgst_size = DGST_SIZE_4_4; + hashconfig->parse_func = crammd5_dovecot_parse_hash; + hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE + | OPTI_TYPE_PRECOMPUTE_INIT + | OPTI_TYPE_PRECOMPUTE_MERKLE + | OPTI_TYPE_MEET_IN_MIDDLE + | OPTI_TYPE_EARLY_SKIP + | OPTI_TYPE_NOT_ITERATED + | OPTI_TYPE_RAW_HASH; + hashconfig->dgst_pos0 = 0; + hashconfig->dgst_pos1 = 3; + hashconfig->dgst_pos2 = 2; + hashconfig->dgst_pos3 = 1; + hashconfig->st_hash = ST_HASH_16400; + hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; + break; + + case 16500: hashconfig->hash_type = HASH_TYPE_JWT; + hashconfig->salt_type = SALT_TYPE_EMBEDDED; + hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; + hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE; + hashconfig->kern_type = (u32) -1; // this gets overwritten from within parser + hashconfig->dgst_size = DGST_SIZE_4_16; + hashconfig->parse_func = jwt_parse_hash; + hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE + | OPTI_TYPE_NOT_ITERATED; + hashconfig->dgst_pos0 = 0; + hashconfig->dgst_pos1 = 1; + hashconfig->dgst_pos2 = 2; + hashconfig->dgst_pos3 = 3; + hashconfig->st_hash = NULL; + hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; + break; + + case 16600: hashconfig->hash_type = HASH_TYPE_ELECTRUM_WALLET; + hashconfig->salt_type = SALT_TYPE_EMBEDDED; + hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; + hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE + | OPTS_TYPE_PT_ADD80 + | OPTS_TYPE_PT_ADDBITS15; + hashconfig->kern_type = KERN_TYPE_ELECTRUM_WALLET13; + hashconfig->dgst_size = DGST_SIZE_4_8; + hashconfig->parse_func = electrum_wallet13_parse_hash; + hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE + | OPTI_TYPE_PRECOMPUTE_INIT; + hashconfig->dgst_pos0 = 0; + hashconfig->dgst_pos1 = 1; + hashconfig->dgst_pos2 = 2; + hashconfig->dgst_pos3 = 3; + hashconfig->st_hash = ST_HASH_16600; + hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN; + break; + case 99999: hashconfig->hash_type = HASH_TYPE_PLAINTEXT; hashconfig->salt_type = SALT_TYPE_NONE; hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL; @@ -24558,43 +25620,50 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) hashconfig->opts_type |= OPTS_TYPE_PT_NEVERCRACK; } - // some kernels do not have an optimized kernel, simply because they do not need them - // or because they are not yet converted, for them we should switch off optimized mode + if (hashconfig->kern_type == (u32) -1) + { + // some hash modes tell hashcat about their exact hash-mode inside the parser (eg. luks and jwt) + } + else + { + // some kernels do not have an optimized kernel, simply because they do not need them + // or because they are not yet converted, for them we should switch off optimized mode - char source_file[256] = { 0 }; + char source_file[256] = { 0 }; - generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, false, folder_config->shared_dir, source_file); + generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, false, folder_config->shared_dir, source_file); - hashconfig->has_pure_kernel = hc_path_read (source_file); + hashconfig->has_pure_kernel = hc_path_read (source_file); - generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, true, folder_config->shared_dir, source_file); + generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, true, folder_config->shared_dir, source_file); - hashconfig->has_optimized_kernel = hc_path_read (source_file); + hashconfig->has_optimized_kernel = hc_path_read (source_file); - if (user_options->example_hashes == false) - { - if (user_options->optimized_kernel_enable == true) + if (user_options->example_hashes == false) { - if (hashconfig->has_optimized_kernel == false) + if (user_options->optimized_kernel_enable == true) { - if (user_options->quiet == false) event_log_warning (hashcat_ctx, "%s: Optimized OpenCL kernel requested but not needed - falling back to pure OpenCL kernel", source_file); + if (hashconfig->has_optimized_kernel == false) + { + if (user_options->quiet == false) event_log_warning (hashcat_ctx, "%s: Optimized OpenCL kernel requested but not needed - falling back to pure OpenCL kernel", source_file); + } + else + { + hashconfig->opti_type |= OPTI_TYPE_OPTIMIZED_KERNEL; + } } else { - hashconfig->opti_type |= OPTI_TYPE_OPTIMIZED_KERNEL; - } - } - else - { - if (hashconfig->has_pure_kernel == false) - { - if (user_options->quiet == false) event_log_warning (hashcat_ctx, "%s: Pure OpenCL kernel not found, falling back to optimized OpenCL kernel", source_file); + if (hashconfig->has_pure_kernel == false) + { + if (user_options->quiet == false) event_log_warning (hashcat_ctx, "%s: Pure OpenCL kernel not found, falling back to optimized OpenCL kernel", source_file); - hashconfig->opti_type |= OPTI_TYPE_OPTIMIZED_KERNEL; - } - else - { - // nothing to do + hashconfig->opti_type |= OPTI_TYPE_OPTIMIZED_KERNEL; + } + else + { + // nothing to do + } } } } @@ -24635,90 +25704,95 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) switch (hashconfig->hash_mode) { - case 600: hashconfig->esalt_size = sizeof (blake2_t); break; - case 2500: hashconfig->esalt_size = sizeof (wpa_t); break; - case 2501: hashconfig->esalt_size = sizeof (wpa_t); break; - case 5300: hashconfig->esalt_size = sizeof (ikepsk_t); break; - case 5400: hashconfig->esalt_size = sizeof (ikepsk_t); break; - case 5500: hashconfig->esalt_size = sizeof (netntlm_t); break; - case 5600: hashconfig->esalt_size = sizeof (netntlm_t); break; - case 6211: hashconfig->esalt_size = sizeof (tc_t); break; - case 6212: hashconfig->esalt_size = sizeof (tc_t); break; - case 6213: hashconfig->esalt_size = sizeof (tc_t); break; - case 6221: hashconfig->esalt_size = sizeof (tc_t); break; - case 6222: hashconfig->esalt_size = sizeof (tc_t); break; - case 6223: hashconfig->esalt_size = sizeof (tc_t); break; - case 6231: hashconfig->esalt_size = sizeof (tc_t); break; - case 6232: hashconfig->esalt_size = sizeof (tc_t); break; - case 6233: hashconfig->esalt_size = sizeof (tc_t); break; - case 6241: hashconfig->esalt_size = sizeof (tc_t); break; - case 6242: hashconfig->esalt_size = sizeof (tc_t); break; - case 6243: hashconfig->esalt_size = sizeof (tc_t); break; - case 6600: hashconfig->esalt_size = sizeof (agilekey_t); break; - case 7100: hashconfig->esalt_size = sizeof (pbkdf2_sha512_t); break; - case 7200: hashconfig->esalt_size = sizeof (pbkdf2_sha512_t); break; - case 7300: hashconfig->esalt_size = sizeof (rakp_t); break; - case 7500: hashconfig->esalt_size = sizeof (krb5pa_t); break; - case 8200: hashconfig->esalt_size = sizeof (cloudkey_t); break; - case 8800: hashconfig->esalt_size = sizeof (androidfde_t); break; - case 9200: hashconfig->esalt_size = sizeof (pbkdf2_sha256_t); break; - case 9400: hashconfig->esalt_size = sizeof (office2007_t); break; - case 9500: hashconfig->esalt_size = sizeof (office2010_t); break; - case 9600: hashconfig->esalt_size = sizeof (office2013_t); break; - case 9700: hashconfig->esalt_size = sizeof (oldoffice01_t); break; - case 9710: hashconfig->esalt_size = sizeof (oldoffice01_t); break; - case 9720: hashconfig->esalt_size = sizeof (oldoffice01_t); break; - case 9800: hashconfig->esalt_size = sizeof (oldoffice34_t); break; - case 9810: hashconfig->esalt_size = sizeof (oldoffice34_t); break; - case 9820: hashconfig->esalt_size = sizeof (oldoffice34_t); break; - case 10000: hashconfig->esalt_size = sizeof (pbkdf2_sha256_t); break; - case 10200: hashconfig->esalt_size = sizeof (cram_md5_t); break; - case 10400: hashconfig->esalt_size = sizeof (pdf_t); break; - case 10410: hashconfig->esalt_size = sizeof (pdf_t); break; - case 10420: hashconfig->esalt_size = sizeof (pdf_t); break; - case 10500: hashconfig->esalt_size = sizeof (pdf_t); break; - case 10600: hashconfig->esalt_size = sizeof (pdf_t); break; - case 10700: hashconfig->esalt_size = sizeof (pdf_t); break; - case 10900: hashconfig->esalt_size = sizeof (pbkdf2_sha256_t); break; - case 11300: hashconfig->esalt_size = sizeof (bitcoin_wallet_t); break; - case 11400: hashconfig->esalt_size = sizeof (sip_t); break; - case 11900: hashconfig->esalt_size = sizeof (pbkdf2_md5_t); break; - case 12000: hashconfig->esalt_size = sizeof (pbkdf2_sha1_t); break; - case 12001: hashconfig->esalt_size = sizeof (pbkdf2_sha1_t); break; - case 12100: hashconfig->esalt_size = sizeof (pbkdf2_sha512_t); break; - case 13000: hashconfig->esalt_size = sizeof (rar5_t); break; - case 13100: hashconfig->esalt_size = sizeof (krb5tgs_t); break; - case 13400: hashconfig->esalt_size = sizeof (keepass_t); break; - case 13500: hashconfig->esalt_size = sizeof (pstoken_t); break; - case 13600: hashconfig->esalt_size = sizeof (zip2_t); break; - case 13711: hashconfig->esalt_size = sizeof (tc_t); break; - case 13712: hashconfig->esalt_size = sizeof (tc_t); break; - case 13713: hashconfig->esalt_size = sizeof (tc_t); break; - case 13721: hashconfig->esalt_size = sizeof (tc_t); break; - case 13722: hashconfig->esalt_size = sizeof (tc_t); break; - case 13723: hashconfig->esalt_size = sizeof (tc_t); break; - case 13731: hashconfig->esalt_size = sizeof (tc_t); break; - case 13732: hashconfig->esalt_size = sizeof (tc_t); break; - case 13733: hashconfig->esalt_size = sizeof (tc_t); break; - case 13741: hashconfig->esalt_size = sizeof (tc_t); break; - case 13742: hashconfig->esalt_size = sizeof (tc_t); break; - case 13743: hashconfig->esalt_size = sizeof (tc_t); break; - case 13751: hashconfig->esalt_size = sizeof (tc_t); break; - case 13752: hashconfig->esalt_size = sizeof (tc_t); break; - case 13753: hashconfig->esalt_size = sizeof (tc_t); break; - case 13761: hashconfig->esalt_size = sizeof (tc_t); break; - case 13762: hashconfig->esalt_size = sizeof (tc_t); break; - case 13763: hashconfig->esalt_size = sizeof (tc_t); break; - case 13800: hashconfig->esalt_size = sizeof (win8phone_t); break; - case 14600: hashconfig->esalt_size = sizeof (luks_t); break; - case 14700: hashconfig->esalt_size = sizeof (itunes_backup_t); break; - case 14800: hashconfig->esalt_size = sizeof (itunes_backup_t); break; - case 15300: hashconfig->esalt_size = sizeof (dpapimk_t); break; - case 15400: hashconfig->esalt_size = sizeof (chacha20_t); break; - case 15500: hashconfig->esalt_size = sizeof (jks_sha1_t); break; - case 15600: hashconfig->esalt_size = sizeof (ethereum_pbkdf2_t); break; - case 15700: hashconfig->esalt_size = sizeof (ethereum_scrypt_t); break; - case 15900: hashconfig->esalt_size = sizeof (dpapimk_t); break; + case 600: hashconfig->esalt_size = sizeof (blake2_t); break; + case 2500: hashconfig->esalt_size = sizeof (wpa_t); break; + case 2501: hashconfig->esalt_size = sizeof (wpa_t); break; + case 5300: hashconfig->esalt_size = sizeof (ikepsk_t); break; + case 5400: hashconfig->esalt_size = sizeof (ikepsk_t); break; + case 5500: hashconfig->esalt_size = sizeof (netntlm_t); break; + case 5600: hashconfig->esalt_size = sizeof (netntlm_t); break; + case 6211: hashconfig->esalt_size = sizeof (tc_t); break; + case 6212: hashconfig->esalt_size = sizeof (tc_t); break; + case 6213: hashconfig->esalt_size = sizeof (tc_t); break; + case 6221: hashconfig->esalt_size = sizeof (tc_t); break; + case 6222: hashconfig->esalt_size = sizeof (tc_t); break; + case 6223: hashconfig->esalt_size = sizeof (tc_t); break; + case 6231: hashconfig->esalt_size = sizeof (tc_t); break; + case 6232: hashconfig->esalt_size = sizeof (tc_t); break; + case 6233: hashconfig->esalt_size = sizeof (tc_t); break; + case 6241: hashconfig->esalt_size = sizeof (tc_t); break; + case 6242: hashconfig->esalt_size = sizeof (tc_t); break; + case 6243: hashconfig->esalt_size = sizeof (tc_t); break; + case 6600: hashconfig->esalt_size = sizeof (agilekey_t); break; + case 7100: hashconfig->esalt_size = sizeof (pbkdf2_sha512_t); break; + case 7200: hashconfig->esalt_size = sizeof (pbkdf2_sha512_t); break; + case 7300: hashconfig->esalt_size = sizeof (rakp_t); break; + case 7500: hashconfig->esalt_size = sizeof (krb5pa_t); break; + case 8200: hashconfig->esalt_size = sizeof (cloudkey_t); break; + case 8800: hashconfig->esalt_size = sizeof (androidfde_t); break; + case 9200: hashconfig->esalt_size = sizeof (pbkdf2_sha256_t); break; + case 9400: hashconfig->esalt_size = sizeof (office2007_t); break; + case 9500: hashconfig->esalt_size = sizeof (office2010_t); break; + case 9600: hashconfig->esalt_size = sizeof (office2013_t); break; + case 9700: hashconfig->esalt_size = sizeof (oldoffice01_t); break; + case 9710: hashconfig->esalt_size = sizeof (oldoffice01_t); break; + case 9720: hashconfig->esalt_size = sizeof (oldoffice01_t); break; + case 9800: hashconfig->esalt_size = sizeof (oldoffice34_t); break; + case 9810: hashconfig->esalt_size = sizeof (oldoffice34_t); break; + case 9820: hashconfig->esalt_size = sizeof (oldoffice34_t); break; + case 10000: hashconfig->esalt_size = sizeof (pbkdf2_sha256_t); break; + case 10200: hashconfig->esalt_size = sizeof (cram_md5_t); break; + case 10400: hashconfig->esalt_size = sizeof (pdf_t); break; + case 10410: hashconfig->esalt_size = sizeof (pdf_t); break; + case 10420: hashconfig->esalt_size = sizeof (pdf_t); break; + case 10500: hashconfig->esalt_size = sizeof (pdf_t); break; + case 10600: hashconfig->esalt_size = sizeof (pdf_t); break; + case 10700: hashconfig->esalt_size = sizeof (pdf_t); break; + case 10900: hashconfig->esalt_size = sizeof (pbkdf2_sha256_t); break; + case 11300: hashconfig->esalt_size = sizeof (bitcoin_wallet_t); break; + case 11400: hashconfig->esalt_size = sizeof (sip_t); break; + case 11900: hashconfig->esalt_size = sizeof (pbkdf2_md5_t); break; + case 12000: hashconfig->esalt_size = sizeof (pbkdf2_sha1_t); break; + case 12001: hashconfig->esalt_size = sizeof (pbkdf2_sha1_t); break; + case 12100: hashconfig->esalt_size = sizeof (pbkdf2_sha512_t); break; + case 13000: hashconfig->esalt_size = sizeof (rar5_t); break; + case 13100: hashconfig->esalt_size = sizeof (krb5tgs_t); break; + case 13400: hashconfig->esalt_size = sizeof (keepass_t); break; + case 13500: hashconfig->esalt_size = sizeof (pstoken_t); break; + case 13600: hashconfig->esalt_size = sizeof (zip2_t); break; + case 13711: hashconfig->esalt_size = sizeof (tc_t); break; + case 13712: hashconfig->esalt_size = sizeof (tc_t); break; + case 13713: hashconfig->esalt_size = sizeof (tc_t); break; + case 13721: hashconfig->esalt_size = sizeof (tc_t); break; + case 13722: hashconfig->esalt_size = sizeof (tc_t); break; + case 13723: hashconfig->esalt_size = sizeof (tc_t); break; + case 13731: hashconfig->esalt_size = sizeof (tc_t); break; + case 13732: hashconfig->esalt_size = sizeof (tc_t); break; + case 13733: hashconfig->esalt_size = sizeof (tc_t); break; + case 13741: hashconfig->esalt_size = sizeof (tc_t); break; + case 13742: hashconfig->esalt_size = sizeof (tc_t); break; + case 13743: hashconfig->esalt_size = sizeof (tc_t); break; + case 13751: hashconfig->esalt_size = sizeof (tc_t); break; + case 13752: hashconfig->esalt_size = sizeof (tc_t); break; + case 13753: hashconfig->esalt_size = sizeof (tc_t); break; + case 13761: hashconfig->esalt_size = sizeof (tc_t); break; + case 13762: hashconfig->esalt_size = sizeof (tc_t); break; + case 13763: hashconfig->esalt_size = sizeof (tc_t); break; + case 13800: hashconfig->esalt_size = sizeof (win8phone_t); break; + case 14600: hashconfig->esalt_size = sizeof (luks_t); break; + case 14700: hashconfig->esalt_size = sizeof (itunes_backup_t); break; + case 14800: hashconfig->esalt_size = sizeof (itunes_backup_t); break; + case 15300: hashconfig->esalt_size = sizeof (dpapimk_t); break; + case 15400: hashconfig->esalt_size = sizeof (chacha20_t); break; + case 15500: hashconfig->esalt_size = sizeof (jks_sha1_t); break; + case 15600: hashconfig->esalt_size = sizeof (ethereum_pbkdf2_t); break; + case 15700: hashconfig->esalt_size = sizeof (ethereum_scrypt_t); break; + case 15900: hashconfig->esalt_size = sizeof (dpapimk_t); break; + case 16100: hashconfig->esalt_size = sizeof (tacacs_plus_t); break; + case 16200: hashconfig->esalt_size = sizeof (apple_secure_notes_t); break; + case 16300: hashconfig->esalt_size = sizeof (ethereum_presale_t); break; + case 16500: hashconfig->esalt_size = sizeof (jwt_t); break; + case 16600: hashconfig->esalt_size = sizeof (electrum_wallet_t); break; } // hook_salt_size @@ -24736,96 +25810,98 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) switch (hashconfig->hash_mode) { - case 400: hashconfig->tmp_size = sizeof (phpass_tmp_t); break; - case 500: hashconfig->tmp_size = sizeof (md5crypt_tmp_t); break; - case 501: hashconfig->tmp_size = sizeof (md5crypt_tmp_t); break; - case 1600: hashconfig->tmp_size = sizeof (md5crypt_tmp_t); break; - case 1800: hashconfig->tmp_size = sizeof (sha512crypt_tmp_t); break; - case 2100: hashconfig->tmp_size = sizeof (dcc2_tmp_t); break; - case 2500: hashconfig->tmp_size = sizeof (wpa_tmp_t); break; - case 2501: hashconfig->tmp_size = sizeof (wpapmk_tmp_t); break; - case 3200: hashconfig->tmp_size = sizeof (bcrypt_tmp_t); break; - case 5200: hashconfig->tmp_size = sizeof (pwsafe3_tmp_t); break; - case 5800: hashconfig->tmp_size = sizeof (androidpin_tmp_t); break; - case 6211: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 6212: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 6213: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 6221: hashconfig->tmp_size = sizeof (tc64_tmp_t); break; - case 6222: hashconfig->tmp_size = sizeof (tc64_tmp_t); break; - case 6223: hashconfig->tmp_size = sizeof (tc64_tmp_t); break; - case 6231: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 6232: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 6233: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 6241: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 6242: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 6243: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 6300: hashconfig->tmp_size = sizeof (md5crypt_tmp_t); break; - case 6400: hashconfig->tmp_size = sizeof (sha256aix_tmp_t); break; - case 6500: hashconfig->tmp_size = sizeof (sha512aix_tmp_t); break; - case 6600: hashconfig->tmp_size = sizeof (agilekey_tmp_t); break; - case 6700: hashconfig->tmp_size = sizeof (sha1aix_tmp_t); break; - case 6800: hashconfig->tmp_size = sizeof (lastpass_tmp_t); break; - case 7100: hashconfig->tmp_size = sizeof (pbkdf2_sha512_tmp_t); break; - case 7200: hashconfig->tmp_size = sizeof (pbkdf2_sha512_tmp_t); break; - case 7400: hashconfig->tmp_size = sizeof (sha256crypt_tmp_t); break; - case 7900: hashconfig->tmp_size = sizeof (drupal7_tmp_t); break; - case 8200: hashconfig->tmp_size = sizeof (pbkdf2_sha512_tmp_t); break; - case 8800: hashconfig->tmp_size = sizeof (androidfde_tmp_t); break; - case 9000: hashconfig->tmp_size = sizeof (pwsafe2_tmp_t); break; - case 9100: hashconfig->tmp_size = sizeof (lotus8_tmp_t); break; - case 9200: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; - case 9400: hashconfig->tmp_size = sizeof (office2007_tmp_t); break; - case 9500: hashconfig->tmp_size = sizeof (office2010_tmp_t); break; - case 9600: hashconfig->tmp_size = sizeof (office2013_tmp_t); break; - case 10000: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; - case 10200: hashconfig->tmp_size = sizeof (cram_md5_t); break; - case 10300: hashconfig->tmp_size = sizeof (saph_sha1_tmp_t); break; - case 10500: hashconfig->tmp_size = sizeof (pdf14_tmp_t); break; - case 10700: hashconfig->tmp_size = sizeof (pdf17l8_tmp_t); break; - case 10900: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; - case 11300: hashconfig->tmp_size = sizeof (bitcoin_wallet_tmp_t); break; - case 11600: hashconfig->tmp_size = sizeof (seven_zip_tmp_t); break; - case 11900: hashconfig->tmp_size = sizeof (pbkdf2_md5_tmp_t); break; - case 12000: hashconfig->tmp_size = sizeof (pbkdf2_sha1_tmp_t); break; - case 12001: hashconfig->tmp_size = sizeof (pbkdf2_sha1_tmp_t); break; - case 12100: hashconfig->tmp_size = sizeof (pbkdf2_sha512_tmp_t); break; - case 12200: hashconfig->tmp_size = sizeof (ecryptfs_tmp_t); break; - case 12300: hashconfig->tmp_size = sizeof (oraclet_tmp_t); break; - case 12400: hashconfig->tmp_size = sizeof (bsdicrypt_tmp_t); break; - case 12500: hashconfig->tmp_size = sizeof (rar3_tmp_t); break; - case 12700: hashconfig->tmp_size = sizeof (mywallet_tmp_t); break; - case 12800: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; - case 12900: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; - case 13000: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; - case 13200: hashconfig->tmp_size = sizeof (axcrypt_tmp_t); break; - case 13400: hashconfig->tmp_size = sizeof (keepass_tmp_t); break; - case 13600: hashconfig->tmp_size = sizeof (pbkdf2_sha1_tmp_t); break; - case 13711: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13712: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13713: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13721: hashconfig->tmp_size = sizeof (tc64_tmp_t); break; - case 13722: hashconfig->tmp_size = sizeof (tc64_tmp_t); break; - case 13723: hashconfig->tmp_size = sizeof (tc64_tmp_t); break; - case 13731: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13732: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13733: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13741: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13742: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13743: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13751: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13752: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13753: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13761: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13762: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 13763: hashconfig->tmp_size = sizeof (tc_tmp_t); break; - case 14600: hashconfig->tmp_size = sizeof (luks_tmp_t); break; - case 14700: hashconfig->tmp_size = sizeof (pbkdf2_sha1_tmp_t); break; - case 14800: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; - case 15100: hashconfig->tmp_size = sizeof (pbkdf1_sha1_tmp_t); break; - case 15200: hashconfig->tmp_size = sizeof (mywallet_tmp_t); break; - case 15300: hashconfig->tmp_size = sizeof (dpapimk_tmp_v1_t); break; - case 15600: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; - case 15900: hashconfig->tmp_size = sizeof (dpapimk_tmp_v2_t); break; + case 400: hashconfig->tmp_size = sizeof (phpass_tmp_t); break; + case 500: hashconfig->tmp_size = sizeof (md5crypt_tmp_t); break; + case 501: hashconfig->tmp_size = sizeof (md5crypt_tmp_t); break; + case 1600: hashconfig->tmp_size = sizeof (md5crypt_tmp_t); break; + case 1800: hashconfig->tmp_size = sizeof (sha512crypt_tmp_t); break; + case 2100: hashconfig->tmp_size = sizeof (dcc2_tmp_t); break; + case 2500: hashconfig->tmp_size = sizeof (wpa_tmp_t); break; + case 2501: hashconfig->tmp_size = sizeof (wpapmk_tmp_t); break; + case 3200: hashconfig->tmp_size = sizeof (bcrypt_tmp_t); break; + case 5200: hashconfig->tmp_size = sizeof (pwsafe3_tmp_t); break; + case 5800: hashconfig->tmp_size = sizeof (androidpin_tmp_t); break; + case 6211: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 6212: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 6213: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 6221: hashconfig->tmp_size = sizeof (tc64_tmp_t); break; + case 6222: hashconfig->tmp_size = sizeof (tc64_tmp_t); break; + case 6223: hashconfig->tmp_size = sizeof (tc64_tmp_t); break; + case 6231: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 6232: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 6233: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 6241: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 6242: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 6243: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 6300: hashconfig->tmp_size = sizeof (md5crypt_tmp_t); break; + case 6400: hashconfig->tmp_size = sizeof (sha256aix_tmp_t); break; + case 6500: hashconfig->tmp_size = sizeof (sha512aix_tmp_t); break; + case 6600: hashconfig->tmp_size = sizeof (agilekey_tmp_t); break; + case 6700: hashconfig->tmp_size = sizeof (sha1aix_tmp_t); break; + case 6800: hashconfig->tmp_size = sizeof (lastpass_tmp_t); break; + case 7100: hashconfig->tmp_size = sizeof (pbkdf2_sha512_tmp_t); break; + case 7200: hashconfig->tmp_size = sizeof (pbkdf2_sha512_tmp_t); break; + case 7400: hashconfig->tmp_size = sizeof (sha256crypt_tmp_t); break; + case 7900: hashconfig->tmp_size = sizeof (drupal7_tmp_t); break; + case 8200: hashconfig->tmp_size = sizeof (pbkdf2_sha512_tmp_t); break; + case 8800: hashconfig->tmp_size = sizeof (androidfde_tmp_t); break; + case 9000: hashconfig->tmp_size = sizeof (pwsafe2_tmp_t); break; + case 9100: hashconfig->tmp_size = sizeof (lotus8_tmp_t); break; + case 9200: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; + case 9400: hashconfig->tmp_size = sizeof (office2007_tmp_t); break; + case 9500: hashconfig->tmp_size = sizeof (office2010_tmp_t); break; + case 9600: hashconfig->tmp_size = sizeof (office2013_tmp_t); break; + case 10000: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; + case 10200: hashconfig->tmp_size = sizeof (cram_md5_t); break; + case 10300: hashconfig->tmp_size = sizeof (saph_sha1_tmp_t); break; + case 10500: hashconfig->tmp_size = sizeof (pdf14_tmp_t); break; + case 10700: hashconfig->tmp_size = sizeof (pdf17l8_tmp_t); break; + case 10900: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; + case 11300: hashconfig->tmp_size = sizeof (bitcoin_wallet_tmp_t); break; + case 11600: hashconfig->tmp_size = sizeof (seven_zip_tmp_t); break; + case 11900: hashconfig->tmp_size = sizeof (pbkdf2_md5_tmp_t); break; + case 12000: hashconfig->tmp_size = sizeof (pbkdf2_sha1_tmp_t); break; + case 12001: hashconfig->tmp_size = sizeof (pbkdf2_sha1_tmp_t); break; + case 12100: hashconfig->tmp_size = sizeof (pbkdf2_sha512_tmp_t); break; + case 12200: hashconfig->tmp_size = sizeof (ecryptfs_tmp_t); break; + case 12300: hashconfig->tmp_size = sizeof (oraclet_tmp_t); break; + case 12400: hashconfig->tmp_size = sizeof (bsdicrypt_tmp_t); break; + case 12500: hashconfig->tmp_size = sizeof (rar3_tmp_t); break; + case 12700: hashconfig->tmp_size = sizeof (mywallet_tmp_t); break; + case 12800: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; + case 12900: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; + case 13000: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; + case 13200: hashconfig->tmp_size = sizeof (axcrypt_tmp_t); break; + case 13400: hashconfig->tmp_size = sizeof (keepass_tmp_t); break; + case 13600: hashconfig->tmp_size = sizeof (pbkdf2_sha1_tmp_t); break; + case 13711: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13712: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13713: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13721: hashconfig->tmp_size = sizeof (tc64_tmp_t); break; + case 13722: hashconfig->tmp_size = sizeof (tc64_tmp_t); break; + case 13723: hashconfig->tmp_size = sizeof (tc64_tmp_t); break; + case 13731: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13732: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13733: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13741: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13742: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13743: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13751: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13752: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13753: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13761: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13762: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 13763: hashconfig->tmp_size = sizeof (tc_tmp_t); break; + case 14600: hashconfig->tmp_size = sizeof (luks_tmp_t); break; + case 14700: hashconfig->tmp_size = sizeof (pbkdf2_sha1_tmp_t); break; + case 14800: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; + case 15100: hashconfig->tmp_size = sizeof (pbkdf1_sha1_tmp_t); break; + case 15200: hashconfig->tmp_size = sizeof (mywallet_tmp_t); break; + case 15300: hashconfig->tmp_size = sizeof (dpapimk_tmp_v1_t); break; + case 15600: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; + case 15900: hashconfig->tmp_size = sizeof (dpapimk_tmp_v2_t); break; + case 16200: hashconfig->tmp_size = sizeof (apple_secure_notes_tmp_t); break; + case 16300: hashconfig->tmp_size = sizeof (pbkdf2_sha256_tmp_t); break; }; // hook_size @@ -24838,268 +25914,17 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) }; /** - * pw_min and pw_max + * salt_min, salt_max, pw_min and pw_max + * we have an extra argument optimized_kernel which comes in handy if we want to know about the algorithms + * real pw_max, for example, regardless if the user chooses an optimized kernel or not */ - hashconfig->pw_min = PW_MIN; - hashconfig->pw_max = PW_MAX; - - // pw_min : algo specific hard min length - - switch (hashconfig->hash_mode) - { - case 2500: hashconfig->pw_min = 8; break; // WPA min RFC - case 2501: hashconfig->pw_min = 64; break; // WPA PMK fixed - case 9710: hashconfig->pw_min = 5; break; // RC4-40 fixed - case 9810: hashconfig->pw_min = 5; break; // RC4-40 fixed - case 10410: hashconfig->pw_min = 5; break; // RC4-40 fixed - case 14000: hashconfig->pw_min = 8; break; // DES fixed - case 14100: hashconfig->pw_min = 24; break; // 3DES fixed - case 14900: hashconfig->pw_min = 10; break; // Skip32 fixed - case 15400: hashconfig->pw_min = 32; break; // ChaCha20 fixed - } - - // pw_max : some algo suffer from support for long passwords, - // the user need to add -L to enable support for them - - if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) - { - hashconfig->pw_max = PW_MAX_OLD; - - if ((hashconfig->opts_type & OPTS_TYPE_PT_UTF16LE) || (hashconfig->opts_type & OPTS_TYPE_PT_UTF16BE)) - { - hashconfig->pw_max /= 2; - } - - #define PW_DICTMAX 31 - - if ((user_options->rp_files_cnt > 0) || (user_options->rp_gen > 0)) - { - switch (user_options_extra->attack_kern) - { - case ATTACK_KERN_STRAIGHT: hashconfig->pw_max = MIN (hashconfig->pw_max, PW_DICTMAX); - break; - case ATTACK_KERN_COMBI: hashconfig->pw_max = MIN (hashconfig->pw_max, PW_DICTMAX); - break; - } - } - else - { - if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) - { - switch (user_options_extra->attack_kern) - { - case ATTACK_KERN_STRAIGHT: hashconfig->pw_max = MIN (hashconfig->pw_max, PW_DICTMAX); - break; - case ATTACK_KERN_COMBI: hashconfig->pw_max = MIN (hashconfig->pw_max, PW_DICTMAX); - break; - } - } - else - { - // If we have a NOOP rule then we can process words from wordlists > PW_DICTMAX for slow hashes - } - } - - switch (hashconfig->hash_mode) - { - case 500: hashconfig->pw_max = MIN (hashconfig->pw_max, 15); // pure kernel available - break; - case 1600: hashconfig->pw_max = MIN (hashconfig->pw_max, 15); // pure kernel available - break; - case 1800: hashconfig->pw_max = MIN (hashconfig->pw_max, 16); // pure kernel available - break; - case 5800: hashconfig->pw_max = MIN (hashconfig->pw_max, 16); // pure kernel available - break; - case 6300: hashconfig->pw_max = MIN (hashconfig->pw_max, 15); // pure kernel available - break; - case 6900: hashconfig->pw_max = MIN (hashconfig->pw_max, 32); // todo - break; - case 7000: hashconfig->pw_max = MIN (hashconfig->pw_max, 19); // pure kernel available - break; - case 7400: hashconfig->pw_max = MIN (hashconfig->pw_max, 15); // pure kernel available - break; - case 10700: hashconfig->pw_max = MIN (hashconfig->pw_max, 16); // pure kernel available - break; - case 12500: hashconfig->pw_max = MIN (hashconfig->pw_max, 20); // todo - break; - case 14400: hashconfig->pw_max = MIN (hashconfig->pw_max, 24); // todo - break; - case 15500: hashconfig->pw_max = MIN (hashconfig->pw_max, 16); // todo - break; - } - } - else - { - switch (hashconfig->hash_mode) - { - case 10700: hashconfig->pw_max = 127; // https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/ - break; - } - } - - // pw_max : all modes listed in the following switch cases are - // the maximum possible password length of the related system - // plus the opencl kernels which eventually allows cracking of passwords of up length PW_MAX for free (no speed drop). - // some modes have a self-set and some have - // underlaying algorithms specific hard maximum password length - // these limits override all previous restrictions, always - - switch (hashconfig->hash_mode) - { - case 112: hashconfig->pw_max = 30; break; // https://www.toadworld.com/platforms/oracle/b/weblog/archive/2013/11/12/oracle-12c-passwords - case 1500: hashconfig->pw_max = 8; break; // Underlaying DES max - case 2100: hashconfig->pw_max = PW_MAX; break; - case 2400: hashconfig->pw_max = 16; break; // Cisco-PIX MD5 sets w[4] = 0x80 - case 2410: hashconfig->pw_max = 12; break; // Cisco-ASA MD5 sets w[4] = 0x80 plus has a 4 byte fixed salt - case 2500: hashconfig->pw_max = 63; break; // WPA/WPA2 limits itself to 63 by RFC - case 2501: hashconfig->pw_max = 64; break; // WPA/WPA2 PMK fixed length - case 3000: hashconfig->pw_max = 7; break; // LM max - case 3100: hashconfig->pw_max = 30; break; // http://www.red-database-security.de/whitepaper/oracle_passwords.html - case 3200: hashconfig->pw_max = 72; break; // Underlaying Blowfish max - case 5200: hashconfig->pw_max = PW_MAX; break; - case 6211: hashconfig->pw_max = 64; break; // TC limits itself to 64 - case 6212: hashconfig->pw_max = 64; break; // TC limits itself to 64 - case 6213: hashconfig->pw_max = 64; break; // TC limits itself to 64 - case 6221: hashconfig->pw_max = 64; break; // TC limits itself to 64 - case 6222: hashconfig->pw_max = 64; break; // TC limits itself to 64 - case 6223: hashconfig->pw_max = 64; break; // TC limits itself to 64 - case 6231: hashconfig->pw_max = 64; break; // TC limits itself to 64 - case 6232: hashconfig->pw_max = 64; break; // TC limits itself to 64 - case 6233: hashconfig->pw_max = 64; break; // TC limits itself to 64 - case 6241: hashconfig->pw_max = 64; break; // TC limits itself to 64 - case 6242: hashconfig->pw_max = 64; break; // TC limits itself to 64 - case 6243: hashconfig->pw_max = 64; break; // TC limits itself to 64 - case 6400: hashconfig->pw_max = PW_MAX; break; - case 6500: hashconfig->pw_max = PW_MAX; break; - case 6600: hashconfig->pw_max = PW_MAX; break; - case 6700: hashconfig->pw_max = PW_MAX; break; - case 6800: hashconfig->pw_max = PW_MAX; break; - case 7100: hashconfig->pw_max = PW_MAX; break; - case 7200: hashconfig->pw_max = PW_MAX; break; - case 7700: hashconfig->pw_max = 8; break; // https://www.daniel-berlin.de/security/sap-sec/password-hash-algorithms/ - case 7800: hashconfig->pw_max = 40; break; // https://www.daniel-berlin.de/security/sap-sec/password-hash-algorithms/ - case 7900: hashconfig->pw_max = PW_MAX; break; - case 8000: hashconfig->pw_max = 30; break; // http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc31654.1570/html/sag1/CIHIBDBA.htm - case 8200: hashconfig->pw_max = PW_MAX; break; - case 8500: hashconfig->pw_max = 8; break; // Underlaying DES max - case 8600: hashconfig->pw_max = 16; break; // Lotus Notes/Domino 5 limits itself to 16 - case 8700: hashconfig->pw_max = 64; break; // https://www.ibm.com/support/knowledgecenter/en/SSKTWP_8.5.3/com.ibm.notes85.client.doc/fram_limits_of_notes_r.html - case 8800: hashconfig->pw_max = PW_MAX; break; - case 8900: hashconfig->pw_max = PW_MAX; break; - case 9100: hashconfig->pw_max = 64; break; // https://www.ibm.com/support/knowledgecenter/en/SSKTWP_8.5.3/com.ibm.notes85.client.doc/fram_limits_of_notes_r.html - case 9200: hashconfig->pw_max = PW_MAX; break; - case 9300: hashconfig->pw_max = PW_MAX; break; - case 9400: hashconfig->pw_max = PW_MAX; break; - case 9500: hashconfig->pw_max = PW_MAX; break; - case 9600: hashconfig->pw_max = PW_MAX; break; - case 9700: hashconfig->pw_max = 15; break; // https://msdn.microsoft.com/en-us/library/dd772916(v=office.12).aspx - case 9710: hashconfig->pw_max = 5; break; // Underlaying RC4-40 max - case 9720: hashconfig->pw_max = 15; break; // https://msdn.microsoft.com/en-us/library/dd772916(v=office.12).aspx - case 9800: hashconfig->pw_max = 15; break; // https://msdn.microsoft.com/en-us/library/dd772916(v=office.12).aspx - case 9810: hashconfig->pw_max = 5; break; // Underlaying RC4-40 max - case 9820: hashconfig->pw_max = 15; break; // https://msdn.microsoft.com/en-us/library/dd772916(v=office.12).aspx - case 9900: hashconfig->pw_max = 100; break; // RAdmin2 sets w[25] = 0x80 - case 10000: hashconfig->pw_max = PW_MAX; break; - case 10300: hashconfig->pw_max = 40; break; // https://www.daniel-berlin.de/security/sap-sec/password-hash-algorithms/ - case 10400: hashconfig->pw_max = 32; break; // https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/ - case 10410: hashconfig->pw_max = 5; break; // Underlaying RC4-40 max - case 10420: hashconfig->pw_max = 32; break; // https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/ - case 10500: hashconfig->pw_max = 32; break; // https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/ - case 10600: hashconfig->pw_max = 127; break; // https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/ - case 10900: hashconfig->pw_max = PW_MAX; break; - case 11300: hashconfig->pw_max = PW_MAX; break; - case 11600: hashconfig->pw_max = PW_MAX; break; - case 11900: hashconfig->pw_max = PW_MAX; break; - case 12000: hashconfig->pw_max = PW_MAX; break; - case 12001: hashconfig->pw_max = PW_MAX; break; - case 12200: hashconfig->pw_max = PW_MAX; break; - case 12300: hashconfig->pw_max = PW_MAX; break; - case 12400: hashconfig->pw_max = PW_MAX; break; - case 12700: hashconfig->pw_max = PW_MAX; break; - case 12800: hashconfig->pw_max = PW_MAX; break; - case 12900: hashconfig->pw_max = PW_MAX; break; - case 13000: hashconfig->pw_max = PW_MAX; break; - case 13200: hashconfig->pw_max = PW_MAX; break; - case 13400: hashconfig->pw_max = PW_MAX; break; - case 13600: hashconfig->pw_max = PW_MAX; break; - case 13711: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13712: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13713: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13721: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13722: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13723: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13731: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13732: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13733: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13741: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13742: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13743: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13751: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13752: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13753: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13761: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13762: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 13763: hashconfig->pw_max = 64; break; // VC limits itself to 64 - case 14000: hashconfig->pw_max = 8; break; // Underlaying DES fixed - case 14100: hashconfig->pw_max = 24; break; // Underlaying 3DES fixed - case 14611: hashconfig->pw_max = PW_MAX; break; - case 14612: hashconfig->pw_max = PW_MAX; break; - case 14613: hashconfig->pw_max = PW_MAX; break; - case 14621: hashconfig->pw_max = PW_MAX; break; - case 14622: hashconfig->pw_max = PW_MAX; break; - case 14623: hashconfig->pw_max = PW_MAX; break; - case 14631: hashconfig->pw_max = PW_MAX; break; - case 14632: hashconfig->pw_max = PW_MAX; break; - case 14633: hashconfig->pw_max = PW_MAX; break; - case 14641: hashconfig->pw_max = PW_MAX; break; - case 14642: hashconfig->pw_max = PW_MAX; break; - case 14643: hashconfig->pw_max = PW_MAX; break; - case 14700: hashconfig->pw_max = PW_MAX; break; - case 14800: hashconfig->pw_max = PW_MAX; break; - case 14900: hashconfig->pw_max = 10; break; // Underlaying Skip32 fixed - case 15100: hashconfig->pw_max = PW_MAX; break; - case 15300: hashconfig->pw_max = PW_MAX; break; - case 15400: hashconfig->pw_max = 32; break; // Underlaying ChaCha20 fixed - case 15600: hashconfig->pw_max = PW_MAX; break; - case 15700: hashconfig->pw_max = PW_MAX; break; - case 15900: hashconfig->pw_max = PW_MAX; break; - case 16000: hashconfig->pw_max = 8; break; // Underlaying DES max - } - - // salt_min and salt_max : this limit is only interessting for generic hash types that support a salt - - hashconfig->salt_min = SALT_MIN; - hashconfig->salt_max = SALT_MAX; - - if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) - { - hashconfig->salt_max = SALT_MAX_OLD; - - if ((hashconfig->opts_type & OPTS_TYPE_ST_UTF16LE) || (hashconfig->opts_type & OPTS_TYPE_ST_UTF16BE)) - { - hashconfig->salt_max /= 2; - } - } - - if (hashconfig->salt_type == SALT_TYPE_GENERIC) - { - if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) - { - hashconfig->salt_min *= 2; - hashconfig->salt_max *= 2; - } + const bool optimized_kernel = (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL); - switch (hashconfig->hash_mode) - { - case 11000: hashconfig->salt_min = 56; - hashconfig->salt_max = 56; break; - case 12600: hashconfig->salt_min = 64; - hashconfig->salt_max = 64; break; - case 15000: hashconfig->salt_min = 64; - hashconfig->salt_max = 64; break; - } - } + hashconfig->pw_min = hashconfig_get_pw_min (hashcat_ctx, optimized_kernel); + hashconfig->pw_max = hashconfig_get_pw_max (hashcat_ctx, optimized_kernel); + hashconfig->salt_min = hashconfig_get_salt_min (hashcat_ctx, optimized_kernel); + hashconfig->salt_max = hashconfig_get_salt_max (hashcat_ctx, optimized_kernel); return 0; } @@ -25113,7 +25938,7 @@ void hashconfig_destroy (hashcat_ctx_t *hashcat_ctx) u32 hashconfig_forced_kernel_threads (hashcat_ctx_t *hashcat_ctx) { - const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + hashconfig_t *hashconfig = hashcat_ctx->hashconfig; u32 kernel_threads = 0; @@ -25192,12 +26017,22 @@ u32 hashconfig_get_kernel_threads (hashcat_ctx_t *hashcat_ctx, const hc_device_p kernel_threads = MIN (kernel_threads, device_param->device_maxworkgroup_size); + // and (3) if an OpenCL device allows a very high thread count (for example 1024 on nvidia), + // the host memory required is 32 times as high with 32 (It jumps from 128MB to 4GB device memory requirement). + // since there's no device with that much device memory (because of 1/4 memory rule) it has to limit the + // kernel_accel_max to be a very low number because the pws buffer will be so large otherwise. + // therefore autotune will be unable to calculate a good kernel_accel multiplier. + // currently there's no OpenCL device known that needs result in a better performance with 1024 threads compared to 256. + // as a result, we limit the number of threads to 256, which turns out to be a general good value. + + kernel_threads = MIN (kernel_threads, 256); + return kernel_threads; } u32 hashconfig_get_kernel_loops (hashcat_ctx_t *hashcat_ctx) { - const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + hashconfig_t *hashconfig = hashcat_ctx->hashconfig; const user_options_t *user_options = hashcat_ctx->user_options; u32 kernel_loops_fixed = 0; @@ -25245,9 +26080,324 @@ u32 hashconfig_get_kernel_loops (hashcat_ctx_t *hashcat_ctx) return kernel_loops_fixed; } +int hashconfig_get_pw_min (hashcat_ctx_t *hashcat_ctx, const bool optimized_kernel) +{ + const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + + // pw_min : algo specific hard min length + + u32 pw_min = PW_MIN; + + if (optimized_kernel == true) + { + // unused case + } + + switch (hashconfig->hash_mode) + { + case 2500: pw_min = 8; break; // WPA min RFC + case 2501: pw_min = 64; break; // WPA PMK fixed + case 9710: pw_min = 5; break; // RC4-40 fixed + case 9810: pw_min = 5; break; // RC4-40 fixed + case 10410: pw_min = 5; break; // RC4-40 fixed + case 14000: pw_min = 8; break; // DES fixed + case 14100: pw_min = 24; break; // 3DES fixed + case 14900: pw_min = 10; break; // Skip32 fixed + case 15400: pw_min = 32; break; // ChaCha20 fixed + } + + return pw_min; +} + +int hashconfig_get_pw_max (hashcat_ctx_t *hashcat_ctx, const bool optimized_kernel) +{ + const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + const user_options_t *user_options = hashcat_ctx->user_options; + const user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; + + // pw_max : some algo suffer from support for long passwords, + // the user need to add -L to enable support for them + + u32 pw_max = PW_MAX; + + if (optimized_kernel == true) + { + pw_max = PW_MAX_OLD; + + if ((hashconfig->opts_type & OPTS_TYPE_PT_UTF16LE) || (hashconfig->opts_type & OPTS_TYPE_PT_UTF16BE)) + { + pw_max /= 2; + } + + #define PW_DICTMAX 31 + + if ((user_options->rp_files_cnt > 0) || (user_options->rp_gen > 0)) + { + switch (user_options_extra->attack_kern) + { + case ATTACK_KERN_STRAIGHT: pw_max = MIN (pw_max, PW_DICTMAX); + break; + case ATTACK_KERN_COMBI: pw_max = MIN (pw_max, PW_DICTMAX); + break; + } + } + else + { + if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) + { + switch (user_options_extra->attack_kern) + { + case ATTACK_KERN_STRAIGHT: pw_max = MIN (pw_max, PW_DICTMAX); + break; + case ATTACK_KERN_COMBI: pw_max = MIN (pw_max, PW_DICTMAX); + break; + } + } + else + { + // If we have a NOOP rule then we can process words from wordlists > PW_DICTMAX for slow hashes + } + } + + switch (hashconfig->hash_mode) + { + case 500: pw_max = MIN (pw_max, 15); // pure kernel available + break; + case 1600: pw_max = MIN (pw_max, 15); // pure kernel available + break; + case 1800: pw_max = MIN (pw_max, 16); // pure kernel available + break; + case 5800: pw_max = MIN (pw_max, 16); // pure kernel available + break; + case 6300: pw_max = MIN (pw_max, 15); // pure kernel available + break; + case 6900: pw_max = MIN (pw_max, 32); // todo + break; + case 7000: pw_max = MIN (pw_max, 19); // pure kernel available + break; + case 7400: pw_max = MIN (pw_max, 15); // pure kernel available + break; + case 10700: pw_max = MIN (pw_max, 16); // pure kernel available + break; + case 12500: pw_max = MIN (pw_max, 20); // todo + break; + case 14400: pw_max = MIN (pw_max, 24); // todo + break; + case 15500: pw_max = MIN (pw_max, 16); // todo + break; + } + } + else + { + switch (hashconfig->hash_mode) + { + case 10700: pw_max = 127; // https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/ + break; + case 16400: pw_max = 64; // HMAC-MD5 and `doveadm pw` are different for password more than 64 bytes + break; + } + } + + // pw_max : all modes listed in the following switch cases are + // the maximum possible password length of the related system + // plus the opencl kernels which eventually allows cracking of passwords of up length PW_MAX for free (no speed drop). + // some modes have a self-set and some have + // underlaying algorithms specific hard maximum password length + // these limits override all previous restrictions, always + + switch (hashconfig->hash_mode) + { + case 112: pw_max = 30; break; // https://www.toadworld.com/platforms/oracle/b/weblog/archive/2013/11/12/oracle-12c-passwords + case 1500: pw_max = 8; break; // Underlaying DES max + case 2100: pw_max = PW_MAX; break; + case 2500: pw_max = 63; break; // WPA/WPA2 limits itself to 63 by RFC + case 2501: pw_max = 64; break; // WPA/WPA2 PMK fixed length + case 3000: pw_max = 7; break; // LM max + case 3100: pw_max = 30; break; // http://www.red-database-security.de/whitepaper/oracle_passwords.html + case 3200: pw_max = 72; break; // Underlaying Blowfish max + case 5200: pw_max = PW_MAX; break; + case 6211: pw_max = 64; break; // TC limits itself to 64 + case 6212: pw_max = 64; break; // TC limits itself to 64 + case 6213: pw_max = 64; break; // TC limits itself to 64 + case 6221: pw_max = 64; break; // TC limits itself to 64 + case 6222: pw_max = 64; break; // TC limits itself to 64 + case 6223: pw_max = 64; break; // TC limits itself to 64 + case 6231: pw_max = 64; break; // TC limits itself to 64 + case 6232: pw_max = 64; break; // TC limits itself to 64 + case 6233: pw_max = 64; break; // TC limits itself to 64 + case 6241: pw_max = 64; break; // TC limits itself to 64 + case 6242: pw_max = 64; break; // TC limits itself to 64 + case 6243: pw_max = 64; break; // TC limits itself to 64 + case 6400: pw_max = PW_MAX; break; + case 6500: pw_max = PW_MAX; break; + case 6600: pw_max = PW_MAX; break; + case 6700: pw_max = PW_MAX; break; + case 6800: pw_max = PW_MAX; break; + case 7100: pw_max = PW_MAX; break; + case 7200: pw_max = PW_MAX; break; + case 7700: pw_max = 8; break; // https://www.daniel-berlin.de/security/sap-sec/password-hash-algorithms/ + case 7800: pw_max = 40; break; // https://www.daniel-berlin.de/security/sap-sec/password-hash-algorithms/ + case 7900: pw_max = PW_MAX; break; + case 8000: pw_max = 30; break; // http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc31654.1570/html/sag1/CIHIBDBA.htm + case 8200: pw_max = PW_MAX; break; + case 8500: pw_max = 8; break; // Underlaying DES max + case 8600: pw_max = 16; break; // Lotus Notes/Domino 5 limits itself to 16 + case 8700: pw_max = 64; break; // https://www.ibm.com/support/knowledgecenter/en/SSKTWP_8.5.3/com.ibm.notes85.client.doc/fram_limits_of_notes_r.html + case 8800: pw_max = PW_MAX; break; + case 8900: pw_max = PW_MAX; break; + case 9100: pw_max = 64; break; // https://www.ibm.com/support/knowledgecenter/en/SSKTWP_8.5.3/com.ibm.notes85.client.doc/fram_limits_of_notes_r.html + case 9200: pw_max = PW_MAX; break; + case 9300: pw_max = PW_MAX; break; + case 9400: pw_max = PW_MAX; break; + case 9500: pw_max = PW_MAX; break; + case 9600: pw_max = PW_MAX; break; + case 9700: pw_max = 15; break; // https://msdn.microsoft.com/en-us/library/dd772916(v=office.12).aspx + case 9710: pw_max = 5; break; // Underlaying RC4-40 max + case 9720: pw_max = 15; break; // https://msdn.microsoft.com/en-us/library/dd772916(v=office.12).aspx + case 9800: pw_max = 15; break; // https://msdn.microsoft.com/en-us/library/dd772916(v=office.12).aspx + case 9810: pw_max = 5; break; // Underlaying RC4-40 max + case 9820: pw_max = 15; break; // https://msdn.microsoft.com/en-us/library/dd772916(v=office.12).aspx + case 9900: pw_max = 100; break; // RAdmin2 sets w[25] = 0x80 + case 10000: pw_max = PW_MAX; break; + case 10300: pw_max = 40; break; // https://www.daniel-berlin.de/security/sap-sec/password-hash-algorithms/ + case 10400: pw_max = 32; break; // https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/ + case 10410: pw_max = 5; break; // Underlaying RC4-40 max + case 10420: pw_max = 32; break; // https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/ + case 10500: pw_max = 32; break; // https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/ + case 10600: pw_max = 127; break; // https://www.pdflib.com/knowledge-base/pdf-password-security/encryption/ + case 10900: pw_max = PW_MAX; break; + case 11300: pw_max = PW_MAX; break; + case 11600: pw_max = PW_MAX; break; + case 11900: pw_max = PW_MAX; break; + case 12000: pw_max = PW_MAX; break; + case 12001: pw_max = PW_MAX; break; + case 12200: pw_max = PW_MAX; break; + case 12300: pw_max = PW_MAX; break; + case 12400: pw_max = PW_MAX; break; + case 12700: pw_max = PW_MAX; break; + case 12800: pw_max = PW_MAX; break; + case 12900: pw_max = PW_MAX; break; + case 13000: pw_max = PW_MAX; break; + case 13200: pw_max = PW_MAX; break; + case 13400: pw_max = PW_MAX; break; + case 13600: pw_max = PW_MAX; break; + case 13711: pw_max = 64; break; // VC limits itself to 64 + case 13712: pw_max = 64; break; // VC limits itself to 64 + case 13713: pw_max = 64; break; // VC limits itself to 64 + case 13721: pw_max = 64; break; // VC limits itself to 64 + case 13722: pw_max = 64; break; // VC limits itself to 64 + case 13723: pw_max = 64; break; // VC limits itself to 64 + case 13731: pw_max = 64; break; // VC limits itself to 64 + case 13732: pw_max = 64; break; // VC limits itself to 64 + case 13733: pw_max = 64; break; // VC limits itself to 64 + case 13741: pw_max = 64; break; // VC limits itself to 64 + case 13742: pw_max = 64; break; // VC limits itself to 64 + case 13743: pw_max = 64; break; // VC limits itself to 64 + case 13751: pw_max = 64; break; // VC limits itself to 64 + case 13752: pw_max = 64; break; // VC limits itself to 64 + case 13753: pw_max = 64; break; // VC limits itself to 64 + case 13761: pw_max = 64; break; // VC limits itself to 64 + case 13762: pw_max = 64; break; // VC limits itself to 64 + case 13763: pw_max = 64; break; // VC limits itself to 64 + case 14000: pw_max = 8; break; // Underlaying DES fixed + case 14100: pw_max = 24; break; // Underlaying 3DES fixed + case 14611: pw_max = PW_MAX; break; + case 14612: pw_max = PW_MAX; break; + case 14613: pw_max = PW_MAX; break; + case 14621: pw_max = PW_MAX; break; + case 14622: pw_max = PW_MAX; break; + case 14623: pw_max = PW_MAX; break; + case 14631: pw_max = PW_MAX; break; + case 14632: pw_max = PW_MAX; break; + case 14633: pw_max = PW_MAX; break; + case 14641: pw_max = PW_MAX; break; + case 14642: pw_max = PW_MAX; break; + case 14643: pw_max = PW_MAX; break; + case 14700: pw_max = PW_MAX; break; + case 14800: pw_max = PW_MAX; break; + case 14900: pw_max = 10; break; // Underlaying Skip32 fixed + case 15100: pw_max = PW_MAX; break; + case 15300: pw_max = PW_MAX; break; + case 15400: pw_max = 32; break; // Underlaying ChaCha20 fixed + case 15600: pw_max = PW_MAX; break; + case 15700: pw_max = PW_MAX; break; + case 15900: pw_max = PW_MAX; break; + case 16000: pw_max = 8; break; // Underlaying DES max + } + + return pw_max; +} + +int hashconfig_get_salt_min (hashcat_ctx_t *hashcat_ctx, const bool optimized_kernel) +{ + const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + + // salt_min : this limit is only interessting for generic hash types that support a salt + + u32 salt_min = SALT_MIN; + + if (optimized_kernel == true) + { + // unused case + } + + if (hashconfig->salt_type == SALT_TYPE_GENERIC) + { + if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) + { + salt_min *= 2; + } + + switch (hashconfig->hash_mode) + { + case 11000: salt_min = 56; break; + case 12600: salt_min = 64; break; + case 15000: salt_min = 64; break; + } + } + + return salt_min; +} + +int hashconfig_get_salt_max (hashcat_ctx_t *hashcat_ctx, const bool optimized_kernel) +{ + const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + + // salt_max : this limit is only interessting for generic hash types that support a salt + + u32 salt_max = SALT_MAX; + + if (optimized_kernel == true) + { + salt_max = SALT_MAX_OLD; + + if ((hashconfig->opts_type & OPTS_TYPE_ST_UTF16LE) || (hashconfig->opts_type & OPTS_TYPE_ST_UTF16BE)) + { + salt_max /= 2; + } + } + + if (hashconfig->salt_type == SALT_TYPE_GENERIC) + { + if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) + { + salt_max *= 2; + } + + switch (hashconfig->hash_mode) + { + case 11000: salt_max = 56; break; + case 12600: salt_max = 64; break; + case 15000: salt_max = 64; break; + } + } + + return salt_max; +} + int hashconfig_general_defaults (hashcat_ctx_t *hashcat_ctx) { - const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + hashconfig_t *hashconfig = hashcat_ctx->hashconfig; const user_options_t *user_options = hashcat_ctx->user_options; char *optional_param1 = NULL; @@ -25269,7 +26419,7 @@ int hashconfig_general_defaults (hashcat_ctx_t *hashcat_ctx) if (keyfiles == NULL) return -1; - char *saveptr; + char *saveptr = NULL; char *keyfile = strtok_r (keyfiles, ",", &saveptr); @@ -25291,7 +26441,7 @@ int hashconfig_general_defaults (hashcat_ctx_t *hashcat_ctx) return -1; } - } while ((keyfile = strtok_r (NULL, ",", &saveptr)) != NULL); + } while ((keyfile = strtok_r ((char *) NULL, ",", &saveptr)) != NULL); free (keyfiles); } @@ -25454,72 +26604,82 @@ void hashconfig_benchmark_defaults (hashcat_ctx_t *hashcat_ctx, salt_t *salt, vo salt->scrypt_r = 1; salt->scrypt_p = 8; break; + case 16200: salt->salt_len = 16; + break; + case 16300: salt->salt_len = 20; + break; } // special esalt handling switch (hashconfig->hash_mode) { - case 2500: ((wpa_t *) esalt)->eapol_len = 128; + case 2500: ((wpa_t *) esalt)->eapol_len = 128; break; - case 2501: ((wpa_t *) esalt)->eapol_len = 128; + case 2501: ((wpa_t *) esalt)->eapol_len = 128; break; - case 5300: ((ikepsk_t *) esalt)->nr_len = 1; - ((ikepsk_t *) esalt)->msg_len = 1; + case 5300: ((ikepsk_t *) esalt)->nr_len = 1; + ((ikepsk_t *) esalt)->msg_len = 1; break; - case 5400: ((ikepsk_t *) esalt)->nr_len = 1; - ((ikepsk_t *) esalt)->msg_len = 1; + case 5400: ((ikepsk_t *) esalt)->nr_len = 1; + ((ikepsk_t *) esalt)->msg_len = 1; break; - case 5500: ((netntlm_t *) esalt)->user_len = 1; - ((netntlm_t *) esalt)->domain_len = 1; - ((netntlm_t *) esalt)->srvchall_len = 1; - ((netntlm_t *) esalt)->clichall_len = 1; + case 5500: ((netntlm_t *) esalt)->user_len = 1; + ((netntlm_t *) esalt)->domain_len = 1; + ((netntlm_t *) esalt)->srvchall_len = 1; + ((netntlm_t *) esalt)->clichall_len = 1; break; - case 5600: ((netntlm_t *) esalt)->user_len = 1; - ((netntlm_t *) esalt)->domain_len = 1; - ((netntlm_t *) esalt)->srvchall_len = 1; - ((netntlm_t *) esalt)->clichall_len = 1; + case 5600: ((netntlm_t *) esalt)->user_len = 1; + ((netntlm_t *) esalt)->domain_len = 1; + ((netntlm_t *) esalt)->srvchall_len = 1; + ((netntlm_t *) esalt)->clichall_len = 1; break; - case 7300: ((rakp_t *) esalt)->salt_len = 32; + case 7300: ((rakp_t *) esalt)->salt_len = 32; break; - case 10400: ((pdf_t *) esalt)->id_len = 16; - ((pdf_t *) esalt)->o_len = 32; - ((pdf_t *) esalt)->u_len = 32; + case 10400: ((pdf_t *) esalt)->id_len = 16; + ((pdf_t *) esalt)->o_len = 32; + ((pdf_t *) esalt)->u_len = 32; break; - case 10410: ((pdf_t *) esalt)->id_len = 16; - ((pdf_t *) esalt)->o_len = 32; - ((pdf_t *) esalt)->u_len = 32; + case 10410: ((pdf_t *) esalt)->id_len = 16; + ((pdf_t *) esalt)->o_len = 32; + ((pdf_t *) esalt)->u_len = 32; break; - case 10420: ((pdf_t *) esalt)->id_len = 16; - ((pdf_t *) esalt)->o_len = 32; - ((pdf_t *) esalt)->u_len = 32; + case 10420: ((pdf_t *) esalt)->id_len = 16; + ((pdf_t *) esalt)->o_len = 32; + ((pdf_t *) esalt)->u_len = 32; break; - case 10500: ((pdf_t *) esalt)->id_len = 16; - ((pdf_t *) esalt)->o_len = 32; - ((pdf_t *) esalt)->u_len = 32; + case 10500: ((pdf_t *) esalt)->id_len = 16; + ((pdf_t *) esalt)->o_len = 32; + ((pdf_t *) esalt)->u_len = 32; break; - case 10600: ((pdf_t *) esalt)->id_len = 16; - ((pdf_t *) esalt)->o_len = 127; - ((pdf_t *) esalt)->u_len = 127; + case 10600: ((pdf_t *) esalt)->id_len = 16; + ((pdf_t *) esalt)->o_len = 127; + ((pdf_t *) esalt)->u_len = 127; break; - case 10700: ((pdf_t *) esalt)->id_len = 16; - ((pdf_t *) esalt)->o_len = 127; - ((pdf_t *) esalt)->u_len = 127; + case 10700: ((pdf_t *) esalt)->id_len = 16; + ((pdf_t *) esalt)->o_len = 127; + ((pdf_t *) esalt)->u_len = 127; break; - case 11400: ((sip_t *) esalt)->salt_len = 2; - ((sip_t *) esalt)->esalt_len = 39; + case 11400: ((sip_t *) esalt)->salt_len = 2; + ((sip_t *) esalt)->esalt_len = 39; break; - case 13400: ((keepass_t *) esalt)->version = 2; + case 13400: ((keepass_t *) esalt)->version = 2; break; - case 13500: ((pstoken_t *) esalt)->salt_len = 113; + case 13500: ((pstoken_t *) esalt)->salt_len = 113; break; - case 13600: ((zip2_t *) esalt)->salt_len = 16; - ((zip2_t *) esalt)->data_len = 32; - ((zip2_t *) esalt)->mode = 3; + case 13600: ((zip2_t *) esalt)->salt_len = 16; + ((zip2_t *) esalt)->data_len = 32; + ((zip2_t *) esalt)->mode = 3; break; - case 14600: ((luks_t *) esalt)->key_size = HC_LUKS_KEY_SIZE_256; - ((luks_t *) esalt)->cipher_type = HC_LUKS_CIPHER_TYPE_AES; - ((luks_t *) esalt)->cipher_mode = HC_LUKS_CIPHER_MODE_XTS_PLAIN; + case 14600: hashconfig->kern_type = KERN_TYPE_LUKS_SHA1_AES; + ((luks_t *) esalt)->key_size = HC_LUKS_KEY_SIZE_256; + ((luks_t *) esalt)->cipher_type = HC_LUKS_CIPHER_TYPE_AES; + ((luks_t *) esalt)->cipher_mode = HC_LUKS_CIPHER_MODE_XTS_PLAIN; + break; + case 16300: ((ethereum_presale_t *) esalt)->enc_seed_len = 608; + break; + case 16500: hashconfig->kern_type = KERN_TYPE_JWT_HS256; + ((jwt_t *) esalt)->salt_len = 32; break; } @@ -25725,6 +26885,10 @@ void hashconfig_benchmark_defaults (hashcat_ctx_t *hashcat_ctx, salt_t *salt, vo break; case 15900: salt->salt_iter = ROUNDS_DPAPIMK_V2; break; + case 16200: salt->salt_iter = ROUNDS_APPLE_SECURE_NOTES - 1; + break; + case 16300: salt->salt_iter = ROUNDS_ETHEREUM_PRESALE; + break; } } diff --git a/src/loopback.c b/src/loopback.c index 12b8c1998..eceb213ca 100644 --- a/src/loopback.c +++ b/src/loopback.c @@ -97,9 +97,9 @@ int loopback_write_open (hashcat_ctx_t *hashcat_ctx) if (induct_ctx->enabled == false) return 0; - hc_time_t now; + time_t now; - hc_time (&now); + time (&now); const u32 random_num = get_random_num (0, 9999); diff --git a/src/main.c b/src/main.c index 1b0dc3abc..0309dc3cf 100644 --- a/src/main.c +++ b/src/main.c @@ -40,7 +40,7 @@ static void main_log_clear_line (MAYBE_UNUSED const int prev_len, MAYBE_UNUSED F #else - printf ("\033[2K\r"); + fputs ("\033[2K\r", fp); #endif } @@ -97,7 +97,7 @@ static void main_log (hashcat_ctx_t *hashcat_ctx, FILE *fp, const int loglevel) #else switch (loglevel) { - case LOGLEVEL_INFO: break; + case LOGLEVEL_INFO: break; case LOGLEVEL_WARNING: hc_fwrite ("\033[33m", 5, 1, fp); break; case LOGLEVEL_ERROR: hc_fwrite ("\033[31m", 5, 1, fp); break; case LOGLEVEL_ADVICE: hc_fwrite ("\033[33m", 5, 1, fp); break; @@ -121,7 +121,7 @@ static void main_log (hashcat_ctx_t *hashcat_ctx, FILE *fp, const int loglevel) #else switch (loglevel) { - case LOGLEVEL_INFO: break; + case LOGLEVEL_INFO: break; case LOGLEVEL_WARNING: hc_fwrite ("\033[0m", 4, 1, fp); break; case LOGLEVEL_ERROR: hc_fwrite ("\033[0m", 4, 1, fp); break; case LOGLEVEL_ADVICE: hc_fwrite ("\033[0m", 4, 1, fp); break; @@ -234,7 +234,7 @@ static void main_cracker_starting (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYB { event_log_info_nn (hashcat_ctx, NULL); - send_prompt (); + send_prompt (hashcat_ctx); } } else if (user_options_extra->wordlist_mode == WL_MODE_STDIN) @@ -261,7 +261,7 @@ static void main_cracker_finished (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYB { if ((user_options->speed_only == false) && (user_options->quiet == false)) { - clear_prompt (); + clear_prompt (hashcat_ctx); } } @@ -322,7 +322,7 @@ static void main_cracker_hash_cracked (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { - if (outfile_ctx->filename == NULL) if (user_options->quiet == false) clear_prompt (); + if (outfile_ctx->filename == NULL) if (user_options->quiet == false) clear_prompt (hashcat_ctx); } hc_fwrite (buf, len, 1, stdout); @@ -332,7 +332,7 @@ static void main_cracker_hash_cracked (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, { if (status_ctx->devices_status != STATUS_CRACKED) { - if (outfile_ctx->filename == NULL) if (user_options->quiet == false) send_prompt (); + if (outfile_ctx->filename == NULL) if (user_options->quiet == false) send_prompt (hashcat_ctx); } } } @@ -436,9 +436,17 @@ static void main_outerloop_mainscreen (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, { if (user_options->machine_readable == false) { - char *hash_type = strhashtype (hashconfig->hash_mode); // not a bug + const char *hash_type = strhashtype (hashconfig->hash_mode); // not a bug + + if ((hashconfig->attack_exec == ATTACK_EXEC_OUTSIDE_KERNEL) && (hashconfig->is_salted == true)) + { + event_log_info (hashcat_ctx, "Hashmode: %d - %s (Iterations: %d)", hashconfig->hash_mode, hash_type, hashes[0].salts_buf[0].salt_iter); + } + else + { + event_log_info (hashcat_ctx, "Hashmode: %d - %s", hashconfig->hash_mode, hash_type); + } - event_log_info (hashcat_ctx, "Hashmode: %d - %s", hashconfig->hash_mode, hash_type); event_log_info (hashcat_ctx, NULL); } } @@ -516,15 +524,6 @@ static void main_outerloop_mainscreen (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, event_log_info (hashcat_ctx, "Watchdog: Temperature abort trigger disabled."); } - if (hwmon_ctx->enabled == true && user_options->gpu_temp_retain > 0) - { - event_log_info (hashcat_ctx, "Watchdog: Temperature retain trigger set to %uc", user_options->gpu_temp_retain); - } - else - { - event_log_info (hashcat_ctx, "Watchdog: Temperature retain trigger disabled."); - } - event_log_info (hashcat_ctx, NULL); } @@ -571,12 +570,12 @@ static void main_set_kernel_power_final (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx if (user_options->quiet == true) return; - clear_prompt (); + clear_prompt (hashcat_ctx); event_log_advice (hashcat_ctx, "Approaching final keyspace - workload adjusted."); event_log_advice (hashcat_ctx, NULL); - send_prompt (); + send_prompt (hashcat_ctx); } static void main_monitor_throttle1 (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) @@ -588,16 +587,16 @@ static void main_monitor_throttle1 (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAY if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { - clear_prompt (); + clear_prompt (hashcat_ctx); } - u32 *device_id = (u32 *) buf; + const u32 *device_id = (const u32 *) buf; event_log_warning (hashcat_ctx, "Driver temperature threshold met on GPU #%u. Expect reduced performance.", *device_id + 1); if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { - send_prompt (); + send_prompt (hashcat_ctx); } } @@ -610,16 +609,16 @@ static void main_monitor_throttle2 (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAY if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { - clear_prompt (); + clear_prompt (hashcat_ctx); } - u32 *device_id = (u32 *) buf; + const u32 *device_id = (const u32 *) buf; event_log_warning (hashcat_ctx, "Driver temperature threshold met on GPU #%u. Expect reduced performance.", *device_id + 1); if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { - send_prompt (); + send_prompt (hashcat_ctx); } } @@ -632,17 +631,17 @@ static void main_monitor_throttle3 (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAY if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { - clear_prompt (); + clear_prompt (hashcat_ctx); } - u32 *device_id = (u32 *) buf; + const u32 *device_id = (const u32 *) buf; event_log_warning (hashcat_ctx, "Driver temperature threshold met on GPU #%u. Expect reduced performance.", *device_id + 1); event_log_warning (hashcat_ctx, NULL); if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { - send_prompt (); + send_prompt (hashcat_ctx); } } @@ -656,7 +655,7 @@ static void main_monitor_performance_hint (MAYBE_UNUSED hashcat_ctx_t *hashcat_c if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { - clear_prompt (); + clear_prompt (hashcat_ctx); } event_log_advice (hashcat_ctx, "Cracking performance lower than expected?"); @@ -689,7 +688,7 @@ static void main_monitor_performance_hint (MAYBE_UNUSED hashcat_ctx_t *hashcat_c if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { - send_prompt (); + send_prompt (hashcat_ctx); } } @@ -702,10 +701,10 @@ static void main_monitor_temp_abort (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MA if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { - clear_prompt (); + clear_prompt (hashcat_ctx); } - u32 *device_id = (u32 *) buf; + const u32 *device_id = (const u32 *) buf; event_log_error (hashcat_ctx, "Temperature limit on GPU #%u reached, aborting...", *device_id + 1); } @@ -719,7 +718,7 @@ static void main_monitor_runtime_limit (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { - clear_prompt (); + clear_prompt (hashcat_ctx); } event_log_warning (hashcat_ctx, "Runtime limit reached, aborting..."); @@ -737,7 +736,7 @@ static void main_monitor_status_refresh (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx { if (user_options->quiet == false) { - //clear_prompt (); + //clear_prompt (hashcat_ctx); event_log_info (hashcat_ctx, NULL); event_log_info (hashcat_ctx, NULL); @@ -752,7 +751,7 @@ static void main_monitor_status_refresh (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx { event_log_info (hashcat_ctx, NULL); - send_prompt (); + send_prompt (hashcat_ctx); } } @@ -771,7 +770,7 @@ static void main_wordlist_cache_hit (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MA if (user_options->quiet == true) return; - cache_hit_t *cache_hit = (cache_hit_t *) buf; + const cache_hit_t *cache_hit = (const cache_hit_t *) buf; event_log_info (hashcat_ctx, "Dictionary cache hit:"); event_log_info (hashcat_ctx, "* Filename..: %s", cache_hit->dictfile); @@ -787,7 +786,7 @@ static void main_wordlist_cache_generate (MAYBE_UNUSED hashcat_ctx_t *hashcat_ct if (user_options->quiet == true) return; - cache_generate_t *cache_generate = (cache_generate_t *) buf; + const cache_generate_t *cache_generate = (const cache_generate_t *) buf; if (cache_generate->percent < 100) { @@ -795,14 +794,14 @@ static void main_wordlist_cache_generate (MAYBE_UNUSED hashcat_ctx_t *hashcat_ct } else { - char *runtime = (char *) malloc (HCBUFSIZ_TINY); + char *runtime = (char *) hcmalloc (HCBUFSIZ_TINY); - const hc_time_t runtime_sec = cache_generate->runtime; + const time_t runtime_sec = cache_generate->runtime; struct tm *tmp; struct tm tm; - tmp = hc_gmtime (&runtime_sec, &tm); + tmp = gmtime_r (&runtime_sec, &tm); format_timer_display (tmp, runtime, HCBUFSIZ_TINY); @@ -824,7 +823,7 @@ static void main_hashlist_count_lines_pre (MAYBE_UNUSED hashcat_ctx_t *hashcat_c if (user_options->quiet == true) return; - char *hashfile = (char *) buf; + const char *hashfile = (const char *) buf; event_log_info_nn (hashcat_ctx, "Counting lines in %s...", hashfile); } @@ -835,7 +834,7 @@ static void main_hashlist_count_lines_post (MAYBE_UNUSED hashcat_ctx_t *hashcat_ if (user_options->quiet == true) return; - char *hashfile = (char *) buf; + const char *hashfile = (const char *) buf; event_log_info_nn (hashcat_ctx, "Counted lines in %s...", hashfile); } @@ -846,7 +845,7 @@ static void main_hashlist_parse_hash (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, M if (user_options->quiet == true) return; - hashlist_parse_t *hashlist_parse = (hashlist_parse_t *) buf; + const hashlist_parse_t *hashlist_parse = (const hashlist_parse_t *) buf; const u32 hashes_cnt = hashlist_parse->hashes_cnt; const u32 hashes_avail = hashlist_parse->hashes_avail; @@ -968,11 +967,11 @@ int main (int argc, char **argv) setup_console (); - const hc_time_t proc_start = hc_time (NULL); + const time_t proc_start = time (NULL); // hashcat main context - hashcat_ctx_t *hashcat_ctx = (hashcat_ctx_t *) malloc (sizeof (hashcat_ctx_t)); + hashcat_ctx_t *hashcat_ctx = (hashcat_ctx_t *) hcmalloc (sizeof (hashcat_ctx_t)); const int rc_hashcat_init = hashcat_init (hashcat_ctx, event); @@ -1068,7 +1067,7 @@ int main (int argc, char **argv) // finished with hashcat, clean up - const hc_time_t proc_stop = hc_time (NULL); + const time_t proc_stop = time (NULL); goodbye_screen (hashcat_ctx, proc_start, proc_stop); diff --git a/src/monitor.c b/src/monitor.c index 0446d1a15..28169dcf1 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -30,9 +30,9 @@ int get_runtime_left (const hashcat_ctx_t *hashcat_ctx) msec_paused += msec_paused_tmp; } - hc_time_t runtime_cur; + time_t runtime_cur; - hc_time (&runtime_cur); + time (&runtime_cur); const int runtime_left = (int) (status_ctx->runtime_start + user_options->runtime @@ -58,12 +58,9 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) bool hwmon_check = false; bool performance_check = false; - const int sleep_time = 1; - const int temp_threshold = 1; // degrees celcius - const int fan_speed_min = 33; // in percentage - const int fan_speed_max = 100; - const double exec_low = 50.0; // in ms - const double util_low = 90.0; // in percent + const int sleep_time = 1; + const double exec_low = 50.0; // in ms + const double util_low = 90.0; // in percent if (user_options->runtime) { @@ -100,25 +97,11 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) return 0; } - // these variables are mainly used for fan control - - int fan_speed_chgd[DEVICES_MAX]; - - memset (fan_speed_chgd, 0, sizeof (fan_speed_chgd)); - - // temperature controller "loopback" values - - int temp_diff_old[DEVICES_MAX]; - int temp_diff_sum[DEVICES_MAX]; - - memset (temp_diff_old, 0, sizeof (temp_diff_old)); - memset (temp_diff_sum, 0, sizeof (temp_diff_sum)); - // timer - hc_time_t last_temp_check_time; + time_t last_temp_check_time; - hc_time (&last_temp_check_time); + time (&last_temp_check_time); u32 slowdown_warnings = 0; u32 performance_warnings = 0; @@ -168,9 +151,9 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) { hc_thread_mutex_lock (status_ctx->mux_hwmon); - hc_time_t temp_check_time; + time_t temp_check_time; - hc_time (&temp_check_time); + time (&temp_check_time); u32 Ta = temp_check_time - last_temp_check_time; // set Ta = sleep_time; is not good enough (see --remove etc) @@ -192,84 +175,6 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) myabort (hashcat_ctx); } - - if (hwmon_ctx->hm_device[device_id].fanspeed_get_supported == false) continue; - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) continue; - - const u32 gpu_temp_retain = user_options->gpu_temp_retain; - - if (gpu_temp_retain > 0) - { - int temp_cur = temperature; - - int temp_diff_new = (int) gpu_temp_retain - temp_cur; - - temp_diff_sum[device_id] = temp_diff_sum[device_id] + temp_diff_new; - - // calculate Ta value (time difference in seconds between the last check and this check) - - last_temp_check_time = temp_check_time; - - float Kp = 1.6f; - float Ki = 0.001f; - float Kd = 10.0f; - - // PID controller (3-term controller: proportional - Kp, integral - Ki, derivative - Kd) - - int fan_diff_required = (int) (Kp * (float)temp_diff_new + Ki * Ta * (float)temp_diff_sum[device_id] + Kd * ((float)(temp_diff_new - temp_diff_old[device_id])) / Ta); - - if (abs (fan_diff_required) >= temp_threshold) - { - const int fan_speed_cur = hm_get_fanspeed_with_device_id (hashcat_ctx, device_id); - - int fan_speed_level = fan_speed_cur; - - if (fan_speed_chgd[device_id] == 0) fan_speed_level = temp_cur; - - int fan_speed_new = fan_speed_level - fan_diff_required; - - if (fan_speed_new > fan_speed_max) fan_speed_new = fan_speed_max; - if (fan_speed_new < fan_speed_min) fan_speed_new = fan_speed_min; - - if (fan_speed_new != fan_speed_cur) - { - int freely_change_fan_speed = (fan_speed_chgd[device_id] == 1); - int fan_speed_must_change = (fan_speed_new > fan_speed_cur); - - if ((freely_change_fan_speed == 1) || (fan_speed_must_change == 1)) - { - if (device_param->device_vendor_id == VENDOR_ID_AMD) - { - if (hwmon_ctx->hm_adl) - { - hm_set_fanspeed_with_device_id_adl (hashcat_ctx, device_id, fan_speed_new, 1); - } - - if (hwmon_ctx->hm_sysfs) - { - hm_set_fanspeed_with_device_id_sysfs (hashcat_ctx, device_id, fan_speed_new); - } - } - else if (device_param->device_vendor_id == VENDOR_ID_NV) - { - if (hwmon_ctx->hm_nvapi) - { - hm_set_fanspeed_with_device_id_nvapi (hashcat_ctx, device_id, fan_speed_new, 1); - } - - if (hwmon_ctx->hm_xnvctrl) - { - hm_set_fanspeed_with_device_id_xnvctrl (hashcat_ctx, device_id, fan_speed_new); - } - } - - fan_speed_chgd[device_id] = 1; - } - - temp_diff_old[device_id] = temp_diff_new; - } - } - } } hc_thread_mutex_unlock (status_ctx->mux_hwmon); diff --git a/src/mpsp.c b/src/mpsp.c index 3b128dadd..25a15fed7 100644 --- a/src/mpsp.c +++ b/src/mpsp.c @@ -17,14 +17,14 @@ #include "ext_lzma.h" #include "mpsp.h" -static const char DEF_MASK[] = "?1?2?2?2?2?2?2?3?3?3?3?d?d?d?d"; +static const char *DEF_MASK = "?1?2?2?2?2?2?2?3?3?3?3?d?d?d?d"; #define MAX_MFS 5 // 4*charset, 1*mask static int sp_comp_val (const void *p1, const void *p2) { - hcstat_table_t *b1 = (hcstat_table_t *) p1; - hcstat_table_t *b2 = (hcstat_table_t *) p2; + const hcstat_table_t *b1 = (const hcstat_table_t *) p1; + const hcstat_table_t *b2 = (const hcstat_table_t *) p2; return b2->val - b1->val; } @@ -240,7 +240,7 @@ static int mp_add_cs_buf (hashcat_ctx_t *hashcat_ctx, const u32 *in_buf, size_t return 0; } -static int mp_expand (hashcat_ctx_t *hashcat_ctx, char *in_buf, size_t in_len, cs_t *mp_sys, cs_t *mp_usr, u32 mp_usr_offset, int interpret) +static int mp_expand (hashcat_ctx_t *hashcat_ctx, const char *in_buf, size_t in_len, cs_t *mp_sys, cs_t *mp_usr, u32 mp_usr_offset, int interpret) { const user_options_t *user_options = hashcat_ctx->user_options; @@ -557,7 +557,7 @@ static void mp_setup_sys (cs_t *mp_sys) mp_sys[7].cs_len = pos; } } -static int mp_setup_usr (hashcat_ctx_t *hashcat_ctx, cs_t *mp_sys, cs_t *mp_usr, char *buf, const u32 userindex) +static int mp_setup_usr (hashcat_ctx_t *hashcat_ctx, cs_t *mp_sys, cs_t *mp_usr, const char *buf, const u32 userindex) { FILE *fp = fopen (buf, "rb"); @@ -678,9 +678,9 @@ static int sp_setup_tbl (hashcat_ctx_t *hashcat_ctx) hcstat = hcstat_tmp; } - hc_stat_t s; + struct stat s; - if (hc_stat (hcstat, &s) == -1) + if (stat (hcstat, &s) == -1) { event_log_error (hashcat_ctx, "%s: %s", hcstat, strerror (errno)); @@ -1284,18 +1284,20 @@ int mask_ctx_update_loop (hashcat_ctx_t *hashcat_ctx) if (mask_ctx->css_cnt < mask_min) { event_log_warning (hashcat_ctx, "Skipping mask '%s' because it is smaller than the minimum password length.", mask_ctx->mask); + event_log_warning (hashcat_ctx, NULL); } if (mask_ctx->css_cnt > mask_max) { event_log_warning (hashcat_ctx, "Skipping mask '%s' because it is larger than the maximum password length.", mask_ctx->mask); + event_log_warning (hashcat_ctx, NULL); } // skip to next mask logfile_sub_msg ("STOP"); - return 0; + return -1; } if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16LE) diff --git a/src/opencl.c b/src/opencl.c index 13434bcfc..c5bbd1277 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -28,10 +28,10 @@ #include "opencl.h" #if defined (__linux__) -static const char dri_card0_path[] = "/dev/dri/card0"; +static const char *dri_card0_path = "/dev/dri/card0"; -static const char drm_card0_vendor_path[] = "/sys/class/drm/card0/device/vendor"; -static const char drm_card0_driver_path[] = "/sys/class/drm/card0/device/driver"; +static const char *drm_card0_vendor_path = "/sys/class/drm/card0/device/vendor"; +static const char *drm_card0_driver_path = "/sys/class/drm/card0/device/driver"; #endif static const u32 full01 = 0x01010101; @@ -117,7 +117,7 @@ static int setup_opencl_platforms_filter (hashcat_ctx_t *hashcat_ctx, const char if (platforms == NULL) return -1; - char *saveptr; + char *saveptr = NULL; char *next = strtok_r (platforms, ",", &saveptr); @@ -136,7 +136,7 @@ static int setup_opencl_platforms_filter (hashcat_ctx_t *hashcat_ctx, const char opencl_platforms_filter |= 1u << (platform - 1); - } while ((next = strtok_r (NULL, ",", &saveptr)) != NULL); + } while ((next = strtok_r ((char *) NULL, ",", &saveptr)) != NULL); hcfree (platforms); } @@ -160,7 +160,7 @@ static int setup_devices_filter (hashcat_ctx_t *hashcat_ctx, const char *opencl_ if (devices == NULL) return -1; - char *saveptr; + char *saveptr = NULL; char *next = strtok_r (devices, ",", &saveptr); @@ -179,7 +179,7 @@ static int setup_devices_filter (hashcat_ctx_t *hashcat_ctx, const char *opencl_ devices_filter |= 1u << (device_id - 1); - } while ((next = strtok_r (NULL, ",", &saveptr)) != NULL); + } while ((next = strtok_r ((char *) NULL, ",", &saveptr)) != NULL); hcfree (devices); } @@ -203,7 +203,7 @@ static int setup_device_types_filter (hashcat_ctx_t *hashcat_ctx, const char *op if (device_types == NULL) return -1; - char *saveptr; + char *saveptr = NULL; char *next = strtok_r (device_types, ",", &saveptr); @@ -239,22 +239,24 @@ static int setup_device_types_filter (hashcat_ctx_t *hashcat_ctx, const char *op return 0; } -static int read_kernel_binary (hashcat_ctx_t *hashcat_ctx, const char *kernel_file, size_t *kernel_lengths, char **kernel_sources) +static int read_kernel_binary (hashcat_ctx_t *hashcat_ctx, const char *kernel_file, size_t *kernel_lengths, char **kernel_sources, const bool force_recompile) { FILE *fp = fopen (kernel_file, "rb"); if (fp != NULL) { - hc_stat_t st; + struct stat st; - if (hc_stat (kernel_file, &st)) + if (stat (kernel_file, &st)) { fclose (fp); return -1; } - char *buf = (char *) hcmalloc (st.st_size + 1); + #define EXTRASZ 100 + + char *buf = (char *) hcmalloc (st.st_size + 1 + EXTRASZ); size_t num_read = hc_fread (buf, sizeof (char), st.st_size, fp); @@ -271,6 +273,19 @@ static int read_kernel_binary (hashcat_ctx_t *hashcat_ctx, const char *kernel_fi buf[st.st_size] = 0; + if (force_recompile == true) + { + // this adds some hopefully unique data to the opencl kernel source + // the effect should be that opencl kernel compiler caching see this as new "uncached" source + // we have to do this since they do not check for the changes only in the #include source + + time_t tlog = time (NULL); + + const int extra_len = snprintf (buf + st.st_size, EXTRASZ, "\n//%lu\n", tlog); + + st.st_size += extra_len; + } + kernel_lengths[0] = (size_t) st.st_size; kernel_sources[0] = buf; @@ -534,6 +549,8 @@ void ocl_close (hashcat_ctx_t *hashcat_ctx) { hc_dlclose (ocl->lib); } + + hcfree (opencl_ctx->ocl); } } @@ -1727,6 +1744,44 @@ int run_kernel_amp (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, return 0; } +int run_kernel_atinit (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u64 num) +{ + u64 num_elements = num; + + device_param->kernel_params_atinit_buf64[1] = num_elements; + + const u64 kernel_threads = device_param->kernel_threads_by_wgs_kernel_atinit; + + cl_kernel kernel = device_param->kernel_atinit; + + const size_t global_work_size[3] = { num_elements, 1, 1 }; + const size_t local_work_size[3] = { kernel_threads, 1, 1 }; + + int CL_rc; + + CL_rc = hc_clSetKernelArg (hashcat_ctx, kernel, 0, sizeof (cl_mem), (void *) &buf); + + if (CL_rc == -1) return -1; + + CL_rc = hc_clSetKernelArg (hashcat_ctx, kernel, 1, sizeof (cl_ulong), device_param->kernel_params_atinit[1]); + + if (CL_rc == -1) return -1; + + CL_rc = hc_clEnqueueNDRangeKernel (hashcat_ctx, device_param->command_queue, kernel, 1, NULL, global_work_size, local_work_size, 0, NULL, NULL); + + if (CL_rc == -1) return -1; + + CL_rc = hc_clFlush (hashcat_ctx, device_param->command_queue); + + if (CL_rc == -1) return -1; + + CL_rc = hc_clFinish (hashcat_ctx, device_param->command_queue); + + if (CL_rc == -1) return -1; + + return 0; +} + int run_kernel_memset (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, cl_mem buf, const u32 value, const u64 size) { const u64 num16d = size / 16; @@ -2606,8 +2661,11 @@ void opencl_ctx_destroy (hashcat_ctx_t *hashcat_ctx) hcfree (opencl_ctx->devices_param); hcfree (opencl_ctx->platforms); - hcfree (opencl_ctx->platform_devices); + hcfree (opencl_ctx->platforms_vendor); + hcfree (opencl_ctx->platforms_name); + hcfree (opencl_ctx->platforms_version); + hcfree (opencl_ctx->platforms_skipped); memset (opencl_ctx, 0, sizeof (opencl_ctx_t)); } @@ -2631,7 +2689,6 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) bool need_adl = false; bool need_nvml = false; bool need_nvapi = false; - bool need_xnvctrl = false; bool need_sysfs = false; u32 devices_cnt = 0; @@ -3170,15 +3227,7 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) { need_nvml = true; - #if defined (__linux__) - need_xnvctrl = true; - #endif - - #if defined (_WIN) - need_nvapi = true; - #endif - - #if defined (__CYGWIN__) + #if defined (_WIN) || defined (__CYGWIN__) need_nvapi = true; #endif } @@ -3202,14 +3251,11 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) // check for AMD ROCm driver (only available on linux) - const char *t1 = strstr (device_param->driver_version, "(HSA,LC)"); - const char *t2 = strstr (device_param->driver_version, "(PAL,LC)"); - const char *t3 = strstr (device_param->driver_version, "(PAL,HSAIL)"); - const char *t4 = strstr (device_param->driver_version, "(HSA, LC)"); - const char *t5 = strstr (device_param->driver_version, "(PAL, LC)"); - const char *t6 = strstr (device_param->driver_version, "(PAL, HSAIL)"); + const char *t1 = strstr (device_param->driver_version, "HSA"); + const char *t2 = strstr (device_param->driver_version, "LC"); + const char *t3 = strstr (device_param->driver_version, "PAL"); - if ((t1 == NULL) && (t2 == NULL) && (t3 == NULL) && (t4 == NULL) && (t5 == NULL) && (t6 == NULL)) + if ((t1 == NULL) && (t2 == NULL) && (t3 == NULL)) { device_param->is_rocm = false; } @@ -3457,18 +3503,17 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) } } - opencl_ctx->target_msec = TARGET_MSEC_PROFILE[user_options->workload_profile - 1]; + opencl_ctx->target_msec = TARGET_MSEC_PROFILE[user_options->workload_profile - 1]; - opencl_ctx->devices_cnt = devices_cnt; - opencl_ctx->devices_active = devices_active; + opencl_ctx->devices_cnt = devices_cnt; + opencl_ctx->devices_active = devices_active; - opencl_ctx->need_adl = need_adl; - opencl_ctx->need_nvml = need_nvml; - opencl_ctx->need_nvapi = need_nvapi; - opencl_ctx->need_xnvctrl = need_xnvctrl; - opencl_ctx->need_sysfs = need_sysfs; + opencl_ctx->need_adl = need_adl; + opencl_ctx->need_nvml = need_nvml; + opencl_ctx->need_nvapi = need_nvapi; + opencl_ctx->need_sysfs = need_sysfs; - opencl_ctx->comptime = comptime; + opencl_ctx->comptime = comptime; return 0; } @@ -3496,16 +3541,72 @@ void opencl_ctx_devices_destroy (hashcat_ctx_t *hashcat_ctx) hcfree (device_param->device_version); hcfree (device_param->driver_version); hcfree (device_param->device_opencl_version); + hcfree (device_param->device_vendor); } opencl_ctx->devices_cnt = 0; opencl_ctx->devices_active = 0; - opencl_ctx->need_adl = false; - opencl_ctx->need_nvml = false; - opencl_ctx->need_nvapi = false; - opencl_ctx->need_xnvctrl = false; - opencl_ctx->need_sysfs = false; + opencl_ctx->need_adl = false; + opencl_ctx->need_nvml = false; + opencl_ctx->need_nvapi = false; + opencl_ctx->need_sysfs = false; +} + +static bool is_same_device_type (const hc_device_param_t *src, const hc_device_param_t *dst) +{ + if (strcmp (src->device_name, dst->device_name) != 0) return false; + if (strcmp (src->device_vendor, dst->device_vendor) != 0) return false; + if (strcmp (src->device_version, dst->device_version) != 0) return false; + if (strcmp (src->driver_version, dst->driver_version) != 0) return false; + + if (src->device_processors != dst->device_processors) return false; + if (src->device_maxclock_frequency != dst->device_maxclock_frequency) return false; + if (src->device_maxworkgroup_size != dst->device_maxworkgroup_size) return false; + + // memory size can be different, depending on which gpu has a monitor connected + // if (src->device_maxmem_alloc != dst->device_maxmem_alloc) return false; + // if (src->device_global_mem != dst->device_global_mem) return false; + + if (src->sm_major != dst->sm_major) return false; + if (src->sm_minor != dst->sm_minor) return false; + + if (src->kernel_exec_timeout != dst->kernel_exec_timeout) return false; + + return true; +} + +void opencl_ctx_devices_sync_tuning (hashcat_ctx_t *hashcat_ctx) +{ + opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; + status_ctx_t *status_ctx = hashcat_ctx->status_ctx; + user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; + user_options_t *user_options = hashcat_ctx->user_options; + + if (opencl_ctx->enabled == false) return; + + for (u32 device_id_src = 0; device_id_src < opencl_ctx->devices_cnt; device_id_src++) + { + hc_device_param_t *device_param_src = &opencl_ctx->devices_param[device_id_src]; + + if (device_param_src->skipped == true) continue; + + for (u32 device_id_dst = device_id_src; device_id_dst < opencl_ctx->devices_cnt; device_id_dst++) + { + hc_device_param_t *device_param_dst = &opencl_ctx->devices_param[device_id_dst]; + + if (device_param_dst->skipped == true) continue; + + if (is_same_device_type (device_param_src, device_param_dst) == false) continue; + + device_param_dst->kernel_accel = device_param_src->kernel_accel; + device_param_dst->kernel_loops = device_param_src->kernel_loops; + + const u32 kernel_power = device_param_dst->device_processors * device_param_dst->kernel_threads_by_user * device_param_dst->kernel_accel; + + device_param_dst->kernel_power = kernel_power; + } + } } void opencl_ctx_devices_update_power (hashcat_ctx_t *hashcat_ctx) @@ -3523,6 +3624,8 @@ void opencl_ctx_devices_update_power (hashcat_ctx_t *hashcat_ctx) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; + if (device_param->skipped == true) continue; + kernel_power_all += device_param->kernel_power; } @@ -4219,14 +4322,6 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) return -1; } - char build_opts[1024] = { 0 }; - - #if defined (_WIN) - snprintf (build_opts, sizeof (build_opts) - 1, "-I \"%s\"", folder_config->cpath_real); - #else - snprintf (build_opts, sizeof (build_opts) - 1, "-I %s", folder_config->cpath_real); - #endif - // include check // this test needs to be done manually because of macOS opencl runtime // if there's a problem with permission, its not reporting back and erroring out silently @@ -4263,6 +4358,32 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) } } + // return back to the folder we came from initially (workaround) + + #if defined (_WIN) + if (chdir ("..") == -1) + { + event_log_error (hashcat_ctx, "%s: %s", "..", strerror (errno)); + + return -1; + } + #else + if (chdir (folder_config->cwd) == -1) + { + event_log_error (hashcat_ctx, "%s: %s", folder_config->cwd, strerror (errno)); + + return -1; + } + #endif + + char build_opts[1024] = { 0 }; + + #if defined (_WIN) + snprintf (build_opts, sizeof (build_opts) - 1, "-cl-std=CL1.2 -I OpenCL -I \"%s\"", folder_config->cpath_real); + #else + snprintf (build_opts, sizeof (build_opts) - 1, "-cl-std=CL1.2 -I OpenCL -I %s", folder_config->cpath_real); + #endif + // we don't have sm_* on vendors not NV but it doesn't matter char build_opts_new[1024] = { 0 }; @@ -4380,7 +4501,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) if (user_options->quiet == false) event_log_warning (hashcat_ctx, "* Device #%u: Kernel %s not found in cache! Building may take a while...", device_id + 1, filename_from_filepath (cached_file)); #endif - const int rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, kernel_lengths, kernel_sources); + const int rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, kernel_lengths, kernel_sources, true); if (rc_read_kernel == -1) return -1; @@ -4444,7 +4565,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) } else { - const int rc_read_kernel = read_kernel_binary (hashcat_ctx, cached_file, kernel_lengths, kernel_sources); + const int rc_read_kernel = read_kernel_binary (hashcat_ctx, cached_file, kernel_lengths, kernel_sources, false); if (rc_read_kernel == -1) return -1; @@ -4459,7 +4580,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) } else { - const int rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, kernel_lengths, kernel_sources); + const int rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, kernel_lengths, kernel_sources, true); if (rc_read_kernel == -1) return -1; @@ -4583,7 +4704,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) if (user_options->quiet == false) event_log_warning (hashcat_ctx, "* Device #%u: Kernel %s not found in cache! Building may take a while...", device_id + 1, filename_from_filepath (cached_file)); #endif - const int rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, kernel_lengths, kernel_sources); + const int rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, kernel_lengths, kernel_sources, true); if (rc_read_kernel == -1) return -1; @@ -4645,7 +4766,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) } else { - const int rc_read_kernel = read_kernel_binary (hashcat_ctx, cached_file, kernel_lengths, kernel_sources); + const int rc_read_kernel = read_kernel_binary (hashcat_ctx, cached_file, kernel_lengths, kernel_sources, false); if (rc_read_kernel == -1) return -1; @@ -4724,7 +4845,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) if (user_options->quiet == false) event_log_warning (hashcat_ctx, "* Device #%u: Kernel %s not found in cache! Building may take a while...", device_id + 1, filename_from_filepath (cached_file)); #endif - const int rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, kernel_lengths, kernel_sources); + const int rc_read_kernel = read_kernel_binary (hashcat_ctx, source_file, kernel_lengths, kernel_sources, true); if (rc_read_kernel == -1) return -1; @@ -4786,7 +4907,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) } else { - const int rc_read_kernel = read_kernel_binary (hashcat_ctx, cached_file, kernel_lengths, kernel_sources); + const int rc_read_kernel = read_kernel_binary (hashcat_ctx, cached_file, kernel_lengths, kernel_sources, false); if (rc_read_kernel == -1) return -1; @@ -4805,15 +4926,6 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) hcfree (device_name_chksum); hcfree (device_name_chksum_amp_mp); - // return back to the folder we came from initially (workaround) - - if (chdir (folder_config->cwd) == -1) - { - event_log_error (hashcat_ctx, "%s: %s", folder_config->cwd, strerror (errno)); - - return -1; - } - // some algorithm collide too fast, make that impossible if (user_options->benchmark == true) @@ -5077,6 +5189,11 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) device_param->kernel_params_memset[1] = &device_param->kernel_params_memset_buf32[1]; device_param->kernel_params_memset[2] = &device_param->kernel_params_memset_buf64[2]; + device_param->kernel_params_atinit_buf64[1] = 0; // gid_max + + device_param->kernel_params_atinit[0] = NULL; + device_param->kernel_params_atinit[1] = &device_param->kernel_params_atinit_buf64[1]; + /** * kernel name */ @@ -5321,6 +5438,19 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx) CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_memset, 1, sizeof (cl_uint), device_param->kernel_params_memset[1]); if (CL_rc == -1) return -1; CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_memset, 2, sizeof (cl_ulong), device_param->kernel_params_memset[2]); if (CL_rc == -1) return -1; + // GPU autotune init + + CL_rc = hc_clCreateKernel (hashcat_ctx, device_param->program, "gpu_atinit", &device_param->kernel_atinit); + + if (CL_rc == -1) return -1; + + CL_rc = get_kernel_threads (hashcat_ctx, device_param, device_param->kernel_atinit, &device_param->kernel_threads_by_wgs_kernel_atinit); + + if (CL_rc == -1) return -1; + + CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_atinit, 0, sizeof (cl_mem), device_param->kernel_params_atinit[0]); if (CL_rc == -1) return -1; + CL_rc = hc_clSetKernelArg (hashcat_ctx, device_param->kernel_atinit, 1, sizeof (cl_ulong), device_param->kernel_params_atinit[1]); if (CL_rc == -1) return -1; + // MP start if (user_options->attack_mode == ATTACK_MODE_BF) @@ -5589,6 +5719,7 @@ void opencl_session_destroy (hashcat_ctx_t *hashcat_ctx) if (device_param->kernel_tm) hc_clReleaseKernel (hashcat_ctx, device_param->kernel_tm); if (device_param->kernel_amp) hc_clReleaseKernel (hashcat_ctx, device_param->kernel_amp); if (device_param->kernel_memset) hc_clReleaseKernel (hashcat_ctx, device_param->kernel_memset); + if (device_param->kernel_atinit) hc_clReleaseKernel (hashcat_ctx, device_param->kernel_atinit); if (device_param->program) hc_clReleaseProgram (hashcat_ctx, device_param->program); if (device_param->program_mp) hc_clReleaseProgram (hashcat_ctx, device_param->program_mp); @@ -5650,6 +5781,7 @@ void opencl_session_destroy (hashcat_ctx_t *hashcat_ctx) device_param->kernel_tm = NULL; device_param->kernel_amp = NULL; device_param->kernel_memset = NULL; + device_param->kernel_atinit = NULL; device_param->program = NULL; device_param->program_mp = NULL; device_param->program_amp = NULL; diff --git a/src/outfile.c b/src/outfile.c index 156fc0093..fa3931b6c 100644 --- a/src/outfile.c +++ b/src/outfile.c @@ -63,8 +63,6 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl plain_len = apply_rules (straight_ctx->kernel_rules_buf[off].cmds, plain_buf, pw.pw_len); } - - if (plain_len > (int) hashconfig->pw_max) plain_len = (int) hashconfig->pw_max; } else if (user_options->attack_mode == ATTACK_MODE_COMBI) { @@ -96,28 +94,6 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl } plain_len += comb_len; - - if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) - { - int pw_max_combi; - - #define PW_DICTMAX 32 - - if (hashconfig->pw_max < PW_DICTMAX) - { - pw_max_combi = hashconfig->pw_max; - } - else - { - pw_max_combi = PW_MAX_OLD; - } - - plain_len = MIN ((int) plain_len, (int) pw_max_combi); - } - else - { - plain_len = MIN ((int) plain_len, (int) hashconfig->pw_max); - } } else if (user_options->attack_mode == ATTACK_MODE_BF) { @@ -158,8 +134,6 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl sp_exec (off, (char *) plain_ptr + plain_len, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop); plain_len += start + stop; - - if (plain_len > (int) hashconfig->pw_max) plain_len = (int) hashconfig->pw_max; } else if (user_options->attack_mode == ATTACK_MODE_HYBRID2) { @@ -188,8 +162,6 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl sp_exec (off, (char *) plain_ptr, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop); plain_len += start + stop; - - if (plain_len > (int) hashconfig->pw_max) plain_len = (int) hashconfig->pw_max; } else { @@ -214,8 +186,6 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl memcpy (plain_ptr + plain_len, comb_buf, comb_len); plain_len += comb_len; - - if (plain_len > (int) hashconfig->pw_max) plain_len = (int) hashconfig->pw_max; } } @@ -252,6 +222,10 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl } } + const u32 pw_max = hashconfig_get_pw_max (hashcat_ctx, false); + + if (plain_len > (int) hashconfig->pw_max) plain_len = MIN (plain_len, (int) pw_max); + plain_ptr[plain_len] = 0; *out_len = plain_len; @@ -444,9 +418,19 @@ int outfile_write (hashcat_ctx_t *hashcat_ctx, const char *out_buf, const unsign if (outfile_ctx->outfile_format & OUTFILE_FMT_PLAIN) { - const bool always_ascii = (hashconfig->hash_type & OPTS_TYPE_PT_ALWAYS_ASCII) ? true : false; + bool convert_to_hex = false; + + if (user_options->show == false) + { + if (user_options->outfile_autohex == true) + { + const bool always_ascii = (hashconfig->hash_type & OPTS_TYPE_PT_ALWAYS_ASCII) ? true : false; + + convert_to_hex = need_hexify (plain_ptr, plain_len, hashconfig->separator, always_ascii); + } + } - if ((user_options->outfile_autohex == true) && (need_hexify (plain_ptr, plain_len, hashconfig->separator, always_ascii) == true)) + if (convert_to_hex) { tmp_buf[tmp_len++] = '$'; tmp_buf[tmp_len++] = 'H'; diff --git a/src/outfile_check.c b/src/outfile_check.c index 1e92c9ef5..be16672e9 100644 --- a/src/outfile_check.c +++ b/src/outfile_check.c @@ -51,7 +51,7 @@ static int outfile_remove (hashcat_ctx_t *hashcat_ctx) char **out_files = NULL; - hc_time_t folder_mtime = 0; + time_t folder_mtime = 0; int out_cnt = 0; @@ -73,9 +73,9 @@ static int outfile_remove (hashcat_ctx_t *hashcat_ctx) if (is_dir == true) { - hc_stat_t outfile_check_stat; + struct stat outfile_check_stat; - if (hc_stat (root_directory, &outfile_check_stat) == -1) + if (stat (root_directory, &outfile_check_stat) == -1) { event_log_error (hashcat_ctx, "%s: %s", root_directory, strerror (errno)); @@ -107,9 +107,9 @@ static int outfile_remove (hashcat_ctx_t *hashcat_ctx) { if (strcmp (out_info[j].file_name, out_info_new[i].file_name) == 0) { - hc_stat_t outfile_stat; + struct stat outfile_stat; - if (hc_stat (out_info_new[i].file_name, &outfile_stat) == 0) + if (stat (out_info_new[i].file_name, &outfile_stat) == 0) { if (outfile_stat.st_ctime == out_info[j].ctime) { @@ -140,9 +140,9 @@ static int outfile_remove (hashcat_ctx_t *hashcat_ctx) { //hc_thread_mutex_lock (status_ctx->mux_display); - hc_stat_t outfile_stat; + struct stat outfile_stat; - if (hc_fstat (fileno (fp), &outfile_stat)) + if (fstat (fileno (fp), &outfile_stat)) { fclose (fp); diff --git a/src/potfile.c b/src/potfile.c index e0ab4cf1b..17ceb2f35 100644 --- a/src/potfile.c +++ b/src/potfile.c @@ -377,7 +377,7 @@ void potfile_update_hashes (hashcat_ctx_t *hashcat_ctx, hash_t *hash_buf, char * int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx) { - const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + hashconfig_t *hashconfig = hashcat_ctx->hashconfig; const hashes_t *hashes = hashcat_ctx->hashes; const potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx; diff --git a/src/rp_cpu.c b/src/rp_cpu.c index 00c82211c..fe2b58b1c 100644 --- a/src/rp_cpu.c +++ b/src/rp_cpu.c @@ -471,7 +471,7 @@ static int mangle_title_sep (char arr[RP_PASSWORD_SIZE], int arr_len, char c) return (arr_len); } -int _old_apply_rule (char *rule, int rule_len, char in[RP_PASSWORD_SIZE], int in_len, char out[RP_PASSWORD_SIZE]) +int _old_apply_rule (const char *rule, int rule_len, char in[RP_PASSWORD_SIZE], int in_len, char out[RP_PASSWORD_SIZE]) { char mem[RP_PASSWORD_SIZE] = { 0 }; diff --git a/src/shared.c b/src/shared.c index 9041c70ad..dc532a32f 100644 --- a/src/shared.c +++ b/src/shared.c @@ -7,6 +7,10 @@ #include "types.h" #include "shared.h" +#if defined (__CYGWIN__) +#include +#endif + static inline int get_msb32 (const u32 v) { int i; @@ -151,28 +155,6 @@ void hc_asprintf (char **strp, const char *fmt, ...) va_end (args); } -#if defined (_WIN) -int hc_stat (const char *pathname, hc_stat_t *buf) -{ - return stat64 (pathname, buf); -} - -int hc_fstat (int fd, hc_stat_t *buf) -{ - return fstat64 (fd, buf); -} -#else -int hc_stat (const char *pathname, hc_stat_t *buf) -{ - return stat (pathname, buf); -} - -int hc_fstat (int fd, hc_stat_t *buf) -{ - return fstat (fd, buf); -} -#endif - #if defined (_WIN) #define __WINDOWS__ #endif @@ -194,7 +176,7 @@ void *hc_bsearch_r (const void *key, const void *base, size_t nmemb, size_t size const size_t c = l + m; - const char *next = (char *) base + (c * size); + const char *next = (const char *) base + (c * size); const int cmp = (*compar) (key, next, arg); @@ -213,9 +195,9 @@ void *hc_bsearch_r (const void *key, const void *base, size_t nmemb, size_t size bool hc_path_is_file (const char *path) { - hc_stat_t s; + struct stat s; - if (hc_stat (path, &s) == -1) return false; + if (stat (path, &s) == -1) return false; if (S_ISREG (s.st_mode)) return true; @@ -224,9 +206,9 @@ bool hc_path_is_file (const char *path) bool hc_path_is_directory (const char *path) { - hc_stat_t s; + struct stat s; - if (hc_stat (path, &s) == -1) return false; + if (stat (path, &s) == -1) return false; if (S_ISDIR (s.st_mode)) return true; @@ -235,9 +217,9 @@ bool hc_path_is_directory (const char *path) bool hc_path_is_empty (const char *path) { - hc_stat_t s; + struct stat s; - if (hc_stat (path, &s) == -1) return false; + if (stat (path, &s) == -1) return false; if (s.st_size == 0) return true; @@ -326,6 +308,10 @@ void setup_environment_variables () if (getenv ("POCL_KERNEL_CACHE") == NULL) putenv ((char *) "POCL_KERNEL_CACHE=0"); + + #if defined (__CYGWIN__) + cygwin_internal (CW_SYNC_WINENV); + #endif } void setup_umask () @@ -341,9 +327,9 @@ void setup_seeding (const bool rp_gen_seed_chgd, const u32 rp_gen_seed) } else { - hc_time_t ts; + time_t ts; - hc_time (&ts); + time (&ts); srand (ts); } @@ -426,49 +412,12 @@ void hc_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream) if (rc == 0) rc = 0; } - -hc_time_t hc_time (hc_time_t *t) -{ - #if defined (_WIN) - return _time64 (t); - #else - return time (t); - #endif -} - -struct tm *hc_gmtime (const hc_time_t *t, MAYBE_UNUSED struct tm *result) -{ - #if defined (_WIN) - return _gmtime64 (t); - #else - return gmtime_r (t, result); - #endif -} - -char *hc_ctime (const hc_time_t *t, char *buf, MAYBE_UNUSED const size_t buf_size) -{ - char *etc = NULL; - - #if defined (_WIN) - etc = _ctime64 (t); - - if (etc != NULL) - { - snprintf (buf, buf_size, "%s", etc); - } - #else - etc = ctime_r (t, buf); // buf should have room for at least 26 bytes - #endif - - return etc; -} - bool hc_same_files (char *file1, char *file2) { if ((file1 != NULL) && (file2 != NULL)) { - hc_stat_t tmpstat_file1; - hc_stat_t tmpstat_file2; + struct stat tmpstat_file1; + struct stat tmpstat_file2; int do_check = 0; @@ -478,7 +427,7 @@ bool hc_same_files (char *file1, char *file2) if (fp) { - if (hc_fstat (fileno (fp), &tmpstat_file1)) + if (fstat (fileno (fp), &tmpstat_file1)) { fclose (fp); @@ -494,7 +443,7 @@ bool hc_same_files (char *file1, char *file2) if (fp) { - if (hc_fstat (fileno (fp), &tmpstat_file2)) + if (fstat (fileno (fp), &tmpstat_file2)) { fclose (fp); @@ -540,7 +489,7 @@ bool hc_same_files (char *file1, char *file2) tmpstat_file2.st_blocks = 0; #endif - if (memcmp (&tmpstat_file1, &tmpstat_file2, sizeof (hc_stat_t)) == 0) + if (memcmp (&tmpstat_file1, &tmpstat_file2, sizeof (struct stat)) == 0) { return true; } diff --git a/src/status.c b/src/status.c index e8fc01504..b16ae32ba 100644 --- a/src/status.c +++ b/src/status.c @@ -20,25 +20,25 @@ #include "status.h" #include "shared.h" -static const char ST_0000[] = "Initializing"; -static const char ST_0001[] = "Autotuning"; -static const char ST_0002[] = "Selftest"; -static const char ST_0003[] = "Running"; -static const char ST_0004[] = "Paused"; -static const char ST_0005[] = "Exhausted"; -static const char ST_0006[] = "Cracked"; -static const char ST_0007[] = "Aborted"; -static const char ST_0008[] = "Quit"; -static const char ST_0009[] = "Bypass"; -static const char ST_0010[] = "Aborted (Checkpoint)"; -static const char ST_0011[] = "Aborted (Runtime)"; -static const char ST_0012[] = "Running (Checkpoint Quit requested)"; -static const char ST_9999[] = "Unknown! Bug!"; +static const char *ST_0000 = "Initializing"; +static const char *ST_0001 = "Autotuning"; +static const char *ST_0002 = "Selftest"; +static const char *ST_0003 = "Running"; +static const char *ST_0004 = "Paused"; +static const char *ST_0005 = "Exhausted"; +static const char *ST_0006 = "Cracked"; +static const char *ST_0007 = "Aborted"; +static const char *ST_0008 = "Quit"; +static const char *ST_0009 = "Bypass"; +static const char *ST_0010 = "Aborted (Checkpoint)"; +static const char *ST_0011 = "Aborted (Runtime)"; +static const char *ST_0012 = "Running (Checkpoint Quit requested)"; +static const char *ST_9999 = "Unknown! Bug!"; static const char UNITS[7] = { ' ', 'k', 'M', 'G', 'T', 'P', 'E' }; -static const char ETA_ABSOLUTE_MAX_EXCEEDED[] = "Next Big Bang"; // in honor of ighashgpu -static const char ETA_RELATIVE_MAX_EXCEEDED[] = "> 10 years"; +static const char *ETA_ABSOLUTE_MAX_EXCEEDED = "Next Big Bang"; // in honor of ighashgpu +static const char *ETA_RELATIVE_MAX_EXCEEDED = "> 10 years"; static char *status_get_rules_file (const hashcat_ctx_t *hashcat_ctx) { @@ -46,7 +46,7 @@ static char *status_get_rules_file (const hashcat_ctx_t *hashcat_ctx) if (user_options->rp_files_cnt > 0) { - char *tmp_buf = (char *) malloc (HCBUFSIZ_TINY); + char *tmp_buf = (char *) hcmalloc (HCBUFSIZ_TINY); int tmp_len = 0; @@ -69,40 +69,40 @@ static char *status_get_rules_file (const hashcat_ctx_t *hashcat_ctx) void format_timer_display (struct tm *tm, char *buf, size_t len) { - const char *time_entities_s[] = { "year", "day", "hour", "min", "sec" }; - const char *time_entities_m[] = { "years", "days", "hours", "mins", "secs" }; + const char *const time_entities_s[] = { "year", "day", "hour", "min", "sec" }; + const char *const time_entities_m[] = { "years", "days", "hours", "mins", "secs" }; if (tm->tm_year - 70) { - char *time_entity1 = ((tm->tm_year - 70) == 1) ? (char *) time_entities_s[0] : (char *) time_entities_m[0]; - char *time_entity2 = ( tm->tm_yday == 1) ? (char *) time_entities_s[1] : (char *) time_entities_m[1]; + const char *time_entity1 = ((tm->tm_year - 70) == 1) ? time_entities_s[0] : time_entities_m[0]; + const char *time_entity2 = ( tm->tm_yday == 1) ? time_entities_s[1] : time_entities_m[1]; snprintf (buf, len - 1, "%d %s, %d %s", tm->tm_year - 70, time_entity1, tm->tm_yday, time_entity2); } else if (tm->tm_yday) { - char *time_entity1 = (tm->tm_yday == 1) ? (char *) time_entities_s[1] : (char *) time_entities_m[1]; - char *time_entity2 = (tm->tm_hour == 1) ? (char *) time_entities_s[2] : (char *) time_entities_m[2]; + const char *time_entity1 = (tm->tm_yday == 1) ? time_entities_s[1] : time_entities_m[1]; + const char *time_entity2 = (tm->tm_hour == 1) ? time_entities_s[2] : time_entities_m[2]; snprintf (buf, len - 1, "%d %s, %d %s", tm->tm_yday, time_entity1, tm->tm_hour, time_entity2); } else if (tm->tm_hour) { - char *time_entity1 = (tm->tm_hour == 1) ? (char *) time_entities_s[2] : (char *) time_entities_m[2]; - char *time_entity2 = (tm->tm_min == 1) ? (char *) time_entities_s[3] : (char *) time_entities_m[3]; + const char *time_entity1 = (tm->tm_hour == 1) ? time_entities_s[2] : time_entities_m[2]; + const char *time_entity2 = (tm->tm_min == 1) ? time_entities_s[3] : time_entities_m[3]; snprintf (buf, len - 1, "%d %s, %d %s", tm->tm_hour, time_entity1, tm->tm_min, time_entity2); } else if (tm->tm_min) { - char *time_entity1 = (tm->tm_min == 1) ? (char *) time_entities_s[3] : (char *) time_entities_m[3]; - char *time_entity2 = (tm->tm_sec == 1) ? (char *) time_entities_s[4] : (char *) time_entities_m[4]; + const char *time_entity1 = (tm->tm_min == 1) ? time_entities_s[3] : time_entities_m[3]; + const char *time_entity2 = (tm->tm_sec == 1) ? time_entities_s[4] : time_entities_m[4]; snprintf (buf, len - 1, "%d %s, %d %s", tm->tm_min, time_entity1, tm->tm_sec, time_entity2); } else { - char *time_entity1 = (tm->tm_sec == 1) ? (char *) time_entities_s[4] : (char *) time_entities_m[4]; + const char *time_entity1 = (tm->tm_sec == 1) ? time_entities_s[4] : time_entities_m[4]; snprintf (buf, len - 1, "%d %s", tm->tm_sec, time_entity1); } @@ -197,7 +197,7 @@ char *status_get_session (const hashcat_ctx_t *hashcat_ctx) return strdup (user_options->session); } -char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx) +const char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx) { const status_ctx_t *status_ctx = hashcat_ctx->status_ctx; @@ -209,27 +209,27 @@ char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx) { if (status_ctx->checkpoint_shutdown == true) { - return ((char *) ST_0012); + return ST_0012; } } switch (devices_status) { - case STATUS_INIT: return ((char *) ST_0000); - case STATUS_AUTOTUNE: return ((char *) ST_0001); - case STATUS_SELFTEST: return ((char *) ST_0002); - case STATUS_RUNNING: return ((char *) ST_0003); - case STATUS_PAUSED: return ((char *) ST_0004); - case STATUS_EXHAUSTED: return ((char *) ST_0005); - case STATUS_CRACKED: return ((char *) ST_0006); - case STATUS_ABORTED: return ((char *) ST_0007); - case STATUS_QUIT: return ((char *) ST_0008); - case STATUS_BYPASS: return ((char *) ST_0009); - case STATUS_ABORTED_CHECKPOINT: return ((char *) ST_0010); - case STATUS_ABORTED_RUNTIME: return ((char *) ST_0011); + case STATUS_INIT: return ST_0000; + case STATUS_AUTOTUNE: return ST_0001; + case STATUS_SELFTEST: return ST_0002; + case STATUS_RUNNING: return ST_0003; + case STATUS_PAUSED: return ST_0004; + case STATUS_EXHAUSTED: return ST_0005; + case STATUS_CRACKED: return ST_0006; + case STATUS_ABORTED: return ST_0007; + case STATUS_QUIT: return ST_0008; + case STATUS_BYPASS: return ST_0009; + case STATUS_ABORTED_CHECKPOINT: return ST_0010; + case STATUS_ABORTED_RUNTIME: return ST_0011; } - return ((char *) ST_9999); + return ST_9999; } int status_get_status_number (const hashcat_ctx_t *hashcat_ctx) @@ -239,7 +239,7 @@ int status_get_status_number (const hashcat_ctx_t *hashcat_ctx) return status_ctx->devices_status; } -char *status_get_hash_type (const hashcat_ctx_t *hashcat_ctx) +const char *status_get_hash_type (const hashcat_ctx_t *hashcat_ctx) { const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; @@ -294,7 +294,7 @@ const char *status_get_hash_target (const hashcat_ctx_t *hashcat_ctx) } else { - char *tmp_buf = (char *) malloc (HCBUFSIZ_LARGE); + char *tmp_buf = (char *) hcmalloc (HCBUFSIZ_LARGE); tmp_buf[0] = 0; @@ -819,7 +819,7 @@ char *status_get_guess_candidates_dev (const hashcat_ctx_t *hashcat_ctx, const i hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; - char *display = (char *) malloc (HCBUFSIZ_TINY); + char *display = (char *) hcmalloc (HCBUFSIZ_TINY); if (user_options_extra->attack_kern == ATTACK_KERN_BF) { @@ -966,11 +966,11 @@ char *status_get_time_started_absolute (const hashcat_ctx_t *hashcat_ctx) { const status_ctx_t *status_ctx = hashcat_ctx->status_ctx; - const hc_time_t time_start = status_ctx->runtime_start; + const time_t time_start = status_ctx->runtime_start; char buf[32] = { 0 }; - char *start = hc_ctime (&time_start, buf, 32); + char *start = ctime_r (&time_start, buf); const size_t start_len = strlen (start); @@ -984,32 +984,32 @@ char *status_get_time_started_relative (const hashcat_ctx_t *hashcat_ctx) { const status_ctx_t *status_ctx = hashcat_ctx->status_ctx; - hc_time_t time_now; + time_t time_now; - hc_time (&time_now); + time (&time_now); - const hc_time_t time_start = status_ctx->runtime_start; + const time_t time_start = status_ctx->runtime_start; - hc_time_t sec_run = time_now - time_start; + time_t sec_run = time_now - time_start; struct tm *tmp; struct tm tm; - tmp = hc_gmtime (&sec_run, &tm); + tmp = gmtime_r (&sec_run, &tm); - char *display_run = (char *) malloc (HCBUFSIZ_TINY); + char *display_run = (char *) hcmalloc (HCBUFSIZ_TINY); format_timer_display (tmp, display_run, HCBUFSIZ_TINY); return display_run; } -hc_time_t status_get_sec_etc (const hashcat_ctx_t *hashcat_ctx) +time_t status_get_sec_etc (const hashcat_ctx_t *hashcat_ctx) { const status_ctx_t *status_ctx = hashcat_ctx->status_ctx; const user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; - hc_time_t sec_etc = 0; + time_t sec_etc = 0; if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { @@ -1038,10 +1038,10 @@ hc_time_t status_get_sec_etc (const hashcat_ctx_t *hashcat_ctx) char *status_get_time_estimated_absolute (const hashcat_ctx_t *hashcat_ctx) { - hc_time_t sec_etc = status_get_sec_etc (hashcat_ctx); + time_t sec_etc = status_get_sec_etc (hashcat_ctx); - hc_time_t now; - hc_time (&now); + time_t now; + time (&now); char buf[32] = { 0 }; @@ -1054,9 +1054,9 @@ char *status_get_time_estimated_absolute (const hashcat_ctx_t *hashcat_ctx) } else { - hc_time_t end = now + sec_etc; + time_t end = now + sec_etc; - etc = hc_ctime (&end, buf, sizeof (buf)); + etc = ctime_r (&end, buf); if (etc == NULL) etc = (char *) ETA_ABSOLUTE_MAX_EXCEEDED; } @@ -1073,14 +1073,14 @@ char *status_get_time_estimated_relative (const hashcat_ctx_t *hashcat_ctx) { const user_options_t *user_options = hashcat_ctx->user_options; - char *display = (char *) malloc (HCBUFSIZ_TINY); + char *display = (char *) hcmalloc (HCBUFSIZ_TINY); - hc_time_t sec_etc = status_get_sec_etc (hashcat_ctx); + time_t sec_etc = status_get_sec_etc (hashcat_ctx); struct tm *tmp; struct tm tm; - tmp = hc_gmtime (&sec_etc, &tm); + tmp = gmtime_r (&sec_etc, &tm); if (tmp == NULL) { @@ -1099,14 +1099,14 @@ char *status_get_time_estimated_relative (const hashcat_ctx_t *hashcat_ctx) if (runtime_left > 0) { - hc_time_t sec_left = runtime_left; + time_t sec_left = runtime_left; struct tm *tmp_left; struct tm tm_left; - tmp_left = hc_gmtime (&sec_left, &tm_left); + tmp_left = gmtime_r (&sec_left, &tm_left); - char *display_left = (char *) malloc (HCBUFSIZ_TINY); + char *display_left = (char *) hcmalloc (HCBUFSIZ_TINY); format_timer_display (tmp_left, display_left, HCBUFSIZ_TINY); @@ -1470,7 +1470,7 @@ char *status_get_speed_sec_all (const hashcat_ctx_t *hashcat_ctx) { const double hashes_msec_all = status_get_hashes_msec_all (hashcat_ctx); - char *display = (char *) malloc (HCBUFSIZ_TINY); + char *display = (char *) hcmalloc (HCBUFSIZ_TINY); format_speed_display (hashes_msec_all * 1000, display, HCBUFSIZ_TINY); @@ -1481,7 +1481,7 @@ char *status_get_speed_sec_dev (const hashcat_ctx_t *hashcat_ctx, const int devi { const double hashes_msec_dev = status_get_hashes_msec_dev (hashcat_ctx, device_id); - char *display = (char *) malloc (HCBUFSIZ_TINY); + char *display = (char *) hcmalloc (HCBUFSIZ_TINY); format_speed_display (hashes_msec_dev * 1000, display, HCBUFSIZ_TINY); @@ -1495,14 +1495,14 @@ int status_get_cpt_cur_min (const hashcat_ctx_t *hashcat_ctx) if (status_ctx->accessible == false) return 0; - const hc_time_t now = hc_time (NULL); + const time_t now = time (NULL); int cpt_cur_min = 0; for (int i = 0; i < CPT_CACHE; i++) { const u32 cracked = cpt_ctx->cpt_buf[i].cracked; - const hc_time_t timestamp = cpt_ctx->cpt_buf[i].timestamp; + const time_t timestamp = cpt_ctx->cpt_buf[i].timestamp; if ((timestamp + 60) > now) { @@ -1520,14 +1520,14 @@ int status_get_cpt_cur_hour (const hashcat_ctx_t *hashcat_ctx) if (status_ctx->accessible == false) return 0; - const hc_time_t now = hc_time (NULL); + const time_t now = time (NULL); int cpt_cur_hour = 0; for (int i = 0; i < CPT_CACHE; i++) { const u32 cracked = cpt_ctx->cpt_buf[i].cracked; - const hc_time_t timestamp = cpt_ctx->cpt_buf[i].timestamp; + const time_t timestamp = cpt_ctx->cpt_buf[i].timestamp; if ((timestamp + 3600) > now) { @@ -1545,14 +1545,14 @@ int status_get_cpt_cur_day (const hashcat_ctx_t *hashcat_ctx) if (status_ctx->accessible == false) return 0; - const hc_time_t now = hc_time (NULL); + const time_t now = time (NULL); int cpt_cur_day = 0; for (int i = 0; i < CPT_CACHE; i++) { const u32 cracked = cpt_ctx->cpt_buf[i].cracked; - const hc_time_t timestamp = cpt_ctx->cpt_buf[i].timestamp; + const time_t timestamp = cpt_ctx->cpt_buf[i].timestamp; if ((timestamp + 86400) > now) { @@ -1600,7 +1600,7 @@ char *status_get_cpt (const hashcat_ctx_t *hashcat_ctx) { const cpt_ctx_t *cpt_ctx = hashcat_ctx->cpt_ctx; - const hc_time_t now = hc_time (NULL); + const time_t now = time (NULL); char *cpt; @@ -1656,7 +1656,7 @@ char *status_get_hwmon_dev (const hashcat_ctx_t *hashcat_ctx, const int device_i hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; - char *output_buf = (char *) malloc (HCBUFSIZ_TINY); + char *output_buf = (char *) hcmalloc (HCBUFSIZ_TINY); snprintf (output_buf, HCBUFSIZ_TINY - 1, "N/A"); @@ -1781,6 +1781,54 @@ double status_get_runtime_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int return device_param->outerloop_msec; } +int status_get_kernel_accel_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id) +{ + const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; + + hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; + + if (device_param->skipped == true) return 0; + + if (device_param->kernel_accel_prev) return device_param->kernel_accel_prev; + + return device_param->kernel_accel; +} + +int status_get_kernel_loops_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id) +{ + const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; + + hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; + + if (device_param->skipped == true) return 0; + + if (device_param->kernel_loops_prev) return device_param->kernel_loops_prev; + + return device_param->kernel_loops; +} + +int status_get_kernel_threads_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id) +{ + const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; + + hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; + + if (device_param->skipped == true) return 0; + + return device_param->kernel_threads_by_user; +} + +int status_get_vector_width_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id) +{ + const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; + + hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; + + if (device_param->skipped == true) return 0; + + return device_param->vector_width; +} + int status_progress_init (hashcat_ctx_t *hashcat_ctx) { status_ctx_t *status_ctx = hashcat_ctx->status_ctx; @@ -1857,7 +1905,6 @@ void status_ctx_destroy (hashcat_ctx_t *hashcat_ctx) memset (status_ctx, 0, sizeof (status_ctx_t)); } - void status_status_destroy (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_status) { const status_ctx_t *status_ctx = hashcat_ctx->status_ctx; diff --git a/src/terminal.c b/src/terminal.c index ea3ed6b2e..479dca77b 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -21,7 +21,8 @@ static const size_t TERMINAL_LINE_LENGTH = 79; -static const char *PROMPT = "[s]tatus [p]ause [r]esume [b]ypass [c]heckpoint [q]uit => "; +static const char *PROMPT_ACTIVE = "[s]tatus [p]ause [b]ypass [c]heckpoint [q]uit => "; +static const char *PROMPT_PAUSED = "[s]tatus [r]esume [b]ypass [c]heckpoint [q]uit => "; void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag) { @@ -77,7 +78,7 @@ void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag) } } -void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const hc_time_t proc_start, const hc_time_t proc_stop) +void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const time_t proc_stop) { const user_options_t *user_options = hashcat_ctx->user_options; @@ -90,8 +91,8 @@ void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const hc_time_t proc_start, con char start_buf[32]; memset (start_buf, 0, sizeof (start_buf)); char stop_buf[32]; memset (start_buf, 0, sizeof (stop_buf)); - event_log_info_nn (hashcat_ctx, "Started: %s", hc_ctime (&proc_start, start_buf, 32)); - event_log_info_nn (hashcat_ctx, "Stopped: %s", hc_ctime (&proc_stop, stop_buf, 32)); + event_log_info_nn (hashcat_ctx, "Started: %s", ctime_r (&proc_start, start_buf)); + event_log_info_nn (hashcat_ctx, "Stopped: %s", ctime_r (&proc_stop, stop_buf)); } int setup_console () @@ -124,18 +125,40 @@ int setup_console () return 0; } -void send_prompt () +void send_prompt (hashcat_ctx_t *hashcat_ctx) { - fprintf (stdout, "%s", PROMPT); + const status_ctx_t *status_ctx = hashcat_ctx->status_ctx; + + if (status_ctx->devices_status == STATUS_PAUSED) + { + fprintf (stdout, "%s", PROMPT_PAUSED); + } + else + { + fprintf (stdout, "%s", PROMPT_ACTIVE); + } fflush (stdout); } -void clear_prompt () +void clear_prompt (hashcat_ctx_t *hashcat_ctx) { + const status_ctx_t *status_ctx = hashcat_ctx->status_ctx; + + size_t prompt_sz = 0; + + if (status_ctx->devices_status == STATUS_PAUSED) + { + prompt_sz = strlen (PROMPT_PAUSED); + } + else + { + prompt_sz = strlen (PROMPT_ACTIVE); + } + fputc ('\r', stdout); - for (size_t i = 0; i < strlen (PROMPT); i++) + for (size_t i = 0; i < prompt_sz; i++) { fputc (' ', stdout); } @@ -186,7 +209,7 @@ static void keypress (hashcat_ctx_t *hashcat_ctx) event_log_info (hashcat_ctx, NULL); - if (quiet == false) send_prompt (); + if (quiet == false) send_prompt (hashcat_ctx); break; @@ -200,41 +223,47 @@ static void keypress (hashcat_ctx_t *hashcat_ctx) event_log_info (hashcat_ctx, NULL); - if (quiet == false) send_prompt (); + if (quiet == false) send_prompt (hashcat_ctx); break; case 'p': - event_log_info (hashcat_ctx, NULL); + if (status_ctx->devices_status != STATUS_PAUSED) + { + event_log_info (hashcat_ctx, NULL); - SuspendThreads (hashcat_ctx); + SuspendThreads (hashcat_ctx); - if (status_ctx->devices_status == STATUS_PAUSED) - { - event_log_info (hashcat_ctx, "Paused"); - } + if (status_ctx->devices_status == STATUS_PAUSED) + { + event_log_info (hashcat_ctx, "Paused"); + } - event_log_info (hashcat_ctx, NULL); + event_log_info (hashcat_ctx, NULL); + } - if (quiet == false) send_prompt (); + if (quiet == false) send_prompt (hashcat_ctx); break; case 'r': - event_log_info (hashcat_ctx, NULL); + if (status_ctx->devices_status == STATUS_PAUSED) + { + event_log_info (hashcat_ctx, NULL); - ResumeThreads (hashcat_ctx); + ResumeThreads (hashcat_ctx); - if (status_ctx->devices_status == STATUS_RUNNING) - { - event_log_info (hashcat_ctx, "Resumed"); - } + if (status_ctx->devices_status != STATUS_PAUSED) + { + event_log_info (hashcat_ctx, "Resumed"); + } - event_log_info (hashcat_ctx, NULL); + event_log_info (hashcat_ctx, NULL); + } - if (quiet == false) send_prompt (); + if (quiet == false) send_prompt (hashcat_ctx); break; @@ -255,7 +284,7 @@ static void keypress (hashcat_ctx_t *hashcat_ctx) event_log_info (hashcat_ctx, NULL); - if (quiet == false) send_prompt (); + if (quiet == false) send_prompt (hashcat_ctx); break; @@ -265,6 +294,12 @@ static void keypress (hashcat_ctx_t *hashcat_ctx) myquit (hashcat_ctx); + break; + + default: + + if (quiet == false) send_prompt (hashcat_ctx); + break; } @@ -1167,9 +1202,13 @@ void status_display (hashcat_ctx_t *hashcat_ctx) if (device_info->skipped_dev == true) continue; event_log_info (hashcat_ctx, - "Speed.Dev.#%d.....: %9sH/s (%0.2fms)", device_id + 1, + "Speed.Dev.#%d.....: %9sH/s (%0.2fms) @ Accel:%d Loops:%d Thr:%d Vec:%d", device_id + 1, device_info->speed_sec_dev, - device_info->exec_msec_dev); + device_info->exec_msec_dev, + device_info->kernel_accel_dev, + device_info->kernel_loops_dev, + device_info->kernel_threads_dev, + device_info->vector_width_dev); } if (hashcat_status->device_info_active > 1) @@ -1330,9 +1369,13 @@ void status_benchmark (hashcat_ctx_t *hashcat_ctx) if (device_info->skipped_dev == true) continue; event_log_info (hashcat_ctx, - "Speed.Dev.#%d.....: %9sH/s (%0.2fms)", device_id + 1, + "Speed.Dev.#%d.....: %9sH/s (%0.2fms) @ Accel:%d Loops:%d Thr:%d Vec:%d", device_id + 1, device_info->speed_sec_dev, - device_info->exec_msec_dev); + device_info->exec_msec_dev, + device_info->kernel_accel_dev, + device_info->kernel_loops_dev, + device_info->kernel_threads_dev, + device_info->vector_width_dev); } if (hashcat_status->device_info_active > 1) diff --git a/src/timer.c b/src/timer.c index c3511d079..415514456 100644 --- a/src/timer.c +++ b/src/timer.c @@ -24,14 +24,20 @@ inline double hc_timer_get (hc_timer_t a) hc_timer_set (&hr_tmp); - return (double) ((double) (hr_tmp.QuadPart - a.QuadPart) / (double) (hr_freq.QuadPart / 1000)); + double r = ((double) hr_tmp.QuadPart - (double) a.QuadPart) / ((double) hr_freq.QuadPart / 1000); + + return r; } #else inline void hc_timer_set (hc_timer_t* a) { + #if defined(__APPLE__) && defined(MISSING_CLOCK_GETTIME) gettimeofday (a, NULL); + #else + clock_gettime (CLOCK_MONOTONIC, a); + #endif } inline double hc_timer_get (hc_timer_t a) @@ -40,7 +46,24 @@ inline double hc_timer_get (hc_timer_t a) hc_timer_set (&hr_tmp); + #if defined(__APPLE__) && defined(MISSING_CLOCK_GETTIME) return (double) (((hr_tmp.tv_sec - (a).tv_sec) * 1000) + ((double) (hr_tmp.tv_usec - (a).tv_usec) / 1000)); + #else + hc_timer_t s; + + s.tv_sec = hr_tmp.tv_sec - a.tv_sec; + s.tv_nsec = hr_tmp.tv_nsec - a.tv_nsec; + + if (s.tv_nsec < 0) + { + s.tv_sec -= 1; + s.tv_nsec += 1000000000; + } + + double r = ((double) s.tv_sec * 1000) + ((double) s.tv_nsec / 1000000); + + return r; + #endif } #endif diff --git a/src/tuningdb.c b/src/tuningdb.c index 40d9bc474..b1a9823b9 100644 --- a/src/tuningdb.c +++ b/src/tuningdb.c @@ -121,7 +121,7 @@ int tuning_db_init (hashcat_ctx_t *hashcat_ctx) int token_cnt = 0; - char *saveptr; + char *saveptr = NULL; char *next = strtok_r (line_buf, "\t ", &saveptr); @@ -129,7 +129,7 @@ int tuning_db_init (hashcat_ctx_t *hashcat_ctx) token_cnt++; - while ((next = strtok_r (NULL, "\t ", &saveptr)) != NULL) + while ((next = strtok_r ((char *) NULL, "\t ", &saveptr)) != NULL) { token_ptr[token_cnt] = next; diff --git a/src/usage.c b/src/usage.c index 69a14dd5c..34f938e0f 100644 --- a/src/usage.c +++ b/src/usage.c @@ -8,7 +8,7 @@ #include "shared.h" #include "usage.h" -static const char *USAGE_MINI[] = +static const char *const USAGE_MINI[] = { "Usage: %s [options]... hash|hashfile|hccapxfile [dictionary|mask|directory]...", "", @@ -16,7 +16,7 @@ static const char *USAGE_MINI[] = NULL }; -static const char *USAGE_BIG[] = +static const char *const USAGE_BIG[] = { "%s - advanced password recovery", "", @@ -76,7 +76,8 @@ static const char *USAGE_BIG[] = " --truecrypt-keyfiles | File | Keyfiles to use, separated with commas | --truecrypt-key=x.png", " --veracrypt-keyfiles | File | Keyfiles to use, separated with commas | --veracrypt-key=x.txt", " --veracrypt-pim | Num | VeraCrypt personal iterations multiplier | --veracrypt-pim=1000", - " -b, --benchmark | | Run benchmark |", + " -b, --benchmark | | Run benchmark of selected hash-modes |", + " --benchmark-all | | Run benchmark of all hash-modes (requires -b) |", " --speed-only | | Return expected speed of the attack, then quit |", " --progress-only | | Return ideal progress step size and time to process |", " -c, --segment-size | Num | Sets size in MB to cache from the wordfile to X | -c 32", @@ -96,8 +97,6 @@ static const char *USAGE_BIG[] = " --nvidia-spin-damp | Num | Workaround NVIDIAs CPU burning loop bug, in percent | --nvidia-spin-damp=50", " --gpu-temp-disable | | Disable temperature and fanspeed reads and triggers |", " --gpu-temp-abort | Num | Abort if GPU temperature reaches X degrees Celsius | --gpu-temp-abort=100", - " --gpu-temp-retain | Num | Try to retain GPU temperature at X degrees Celsius | --gpu-temp-retain=95", - " --powertune-enable | | Enable power tuning. Restores settings when finished |", " --scrypt-tmto | Num | Manually override TMTO value for scrypt to X | --scrypt-tmto=3", " -s, --skip | Num | Skip X words from the start | -s 1000000", " -l, --limit | Num | Limit X words from the start + skipped words | -l 1000000", @@ -201,6 +200,8 @@ static const char *USAGE_BIG[] = " 11200 | MySQL CRAM (SHA1) | Network Protocols", " 11400 | SIP digest authentication (MD5) | Network Protocols", " 13100 | Kerberos 5 TGS-REP etype 23 | Network Protocols", + " 16100 | TACACS+ | Network Protocols", + " 16500 | JWT (JSON Web Token) | Network Protocols", " 121 | SMF (Simple Machines Forum) > v1.1 | Forums, CMS, E-Commerce, Frameworks", " 400 | phpBB3 (MD5) | Forums, CMS, E-Commerce, Frameworks", " 2611 | vBulletin < v3.8.5 | Forums, CMS, E-Commerce, Frameworks", @@ -243,6 +244,7 @@ static const char *USAGE_BIG[] = " 111 | nsldaps, SSHA-1(Base64), Netscape LDAP SSHA | HTTP, SMTP, LDAP Server", " 1411 | SSHA-256(Base64), LDAP {SSHA256} | HTTP, SMTP, LDAP Server", " 1711 | SSHA-512(Base64), LDAP {SSHA512} | HTTP, SMTP, LDAP Server", + " 16400 | CRAM-MD5 Dovecot | HTTP, SMTP, LDAP Server", " 15000 | FileZilla Server >= 0.9.55 | FTP Server", " 11500 | CRC32 | Checksums", " 3000 | LM | Operating Systems", @@ -349,6 +351,7 @@ static const char *USAGE_BIG[] = " 10500 | PDF 1.4 - 1.6 (Acrobat 5 - 8) | Documents", " 10600 | PDF 1.7 Level 3 (Acrobat 9) | Documents", " 10700 | PDF 1.7 Level 8 (Acrobat 10 - 11) | Documents", + " 16200 | Apple Secure Notes | Documents", " 9000 | Password Safe v2 | Password Managers", " 5200 | Password Safe v3 | Password Managers", " 6800 | LastPass + LastPass sniffed | Password Managers", @@ -357,10 +360,12 @@ static const char *USAGE_BIG[] = " 11300 | Bitcoin/Litecoin wallet.dat | Password Managers", " 12700 | Blockchain, My Wallet | Password Managers", " 15200 | Blockchain, My Wallet, V2 | Password Managers", + " 16600 | Electrum Wallet (Salt-Type 1-3) | Password Managers", " 13400 | KeePass 1 (AES/Twofish) and KeePass 2 (AES) | Password Managers", " 15500 | JKS Java Key Store Private Keys (SHA1) | Password Managers", " 15600 | Ethereum Wallet, PBKDF2-HMAC-SHA256 | Password Managers", " 15700 | Ethereum Wallet, SCRYPT | Password Managers", + " 16300 | Ethereum Pre-Sale Wallet, PBKDF2-HMAC-SHA256 | Password Managers", " 99999 | Plaintext | Plaintext", "", "- [ Outfile Formats ] -", diff --git a/src/user_options.c b/src/user_options.c index 519201ef5..373716fae 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -14,114 +14,113 @@ #include "outfile.h" #include "user_options.h" -static const char short_options[] = "hVvm:a:r:j:k:g:o:t:d:D:n:u:c:p:s:l:1:2:3:4:iIbw:O"; +static const char *short_options = "hVvm:a:r:j:k:g:o:t:d:D:n:u:c:p:s:l:1:2:3:4:iIbw:O"; static const struct option long_options[] = { - {"advice-disable", no_argument, 0, IDX_ADVICE_DISABLE}, - {"attack-mode", required_argument, 0, IDX_ATTACK_MODE}, - {"benchmark", no_argument, 0, IDX_BENCHMARK}, - {"bitmap-max", required_argument, 0, IDX_BITMAP_MAX}, - {"bitmap-min", required_argument, 0, IDX_BITMAP_MIN}, - {"cpu-affinity", required_argument, 0, IDX_CPU_AFFINITY}, - {"custom-charset1", required_argument, 0, IDX_CUSTOM_CHARSET_1}, - {"custom-charset2", required_argument, 0, IDX_CUSTOM_CHARSET_2}, - {"custom-charset3", required_argument, 0, IDX_CUSTOM_CHARSET_3}, - {"custom-charset4", required_argument, 0, IDX_CUSTOM_CHARSET_4}, - {"debug-file", required_argument, 0, IDX_DEBUG_FILE}, - {"debug-mode", required_argument, 0, IDX_DEBUG_MODE}, - {"encoding-from", required_argument, 0, IDX_ENCODING_FROM}, - {"encoding-to", required_argument, 0, IDX_ENCODING_TO}, - {"example-hashes", no_argument, 0, IDX_EXAMPLE_HASHES}, - {"force", no_argument, 0, IDX_FORCE}, - {"generate-rules-func-max", required_argument, 0, IDX_RP_GEN_FUNC_MAX}, - {"generate-rules-func-min", required_argument, 0, IDX_RP_GEN_FUNC_MIN}, - {"generate-rules", required_argument, 0, IDX_RP_GEN}, - {"generate-rules-seed", required_argument, 0, IDX_RP_GEN_SEED}, - {"gpu-temp-abort", required_argument, 0, IDX_GPU_TEMP_ABORT}, - {"gpu-temp-disable", no_argument, 0, IDX_GPU_TEMP_DISABLE}, - {"gpu-temp-retain", required_argument, 0, IDX_GPU_TEMP_RETAIN}, - {"hash-type", required_argument, 0, IDX_HASH_MODE}, - {"hccapx-message-pair", required_argument, 0, IDX_HCCAPX_MESSAGE_PAIR}, - {"help", no_argument, 0, IDX_HELP}, - {"hex-charset", no_argument, 0, IDX_HEX_CHARSET}, - {"hex-salt", no_argument, 0, IDX_HEX_SALT}, - {"hex-wordlist", no_argument, 0, IDX_HEX_WORDLIST}, - {"increment-max", required_argument, 0, IDX_INCREMENT_MAX}, - {"increment-min", required_argument, 0, IDX_INCREMENT_MIN}, - {"increment", no_argument, 0, IDX_INCREMENT}, - {"induction-dir", required_argument, 0, IDX_INDUCTION_DIR}, - {"keep-guessing", no_argument, 0, IDX_KEEP_GUESSING}, - {"kernel-accel", required_argument, 0, IDX_KERNEL_ACCEL}, - {"kernel-loops", required_argument, 0, IDX_KERNEL_LOOPS}, - {"keyspace", no_argument, 0, IDX_KEYSPACE}, - {"left", no_argument, 0, IDX_LEFT}, - {"limit", required_argument, 0, IDX_LIMIT}, - {"logfile-disable", no_argument, 0, IDX_LOGFILE_DISABLE}, - {"loopback", no_argument, 0, IDX_LOOPBACK}, - {"machine-readable", no_argument, 0, IDX_MACHINE_READABLE}, - {"markov-classic", no_argument, 0, IDX_MARKOV_CLASSIC}, - {"markov-disable", no_argument, 0, IDX_MARKOV_DISABLE}, - {"markov-hcstat", required_argument, 0, IDX_MARKOV_HCSTAT}, - {"markov-threshold", required_argument, 0, IDX_MARKOV_THRESHOLD}, - {"nonce-error-corrections", required_argument, 0, IDX_NONCE_ERROR_CORRECTIONS}, - {"nvidia-spin-damp", required_argument, 0, IDX_NVIDIA_SPIN_DAMP}, - {"opencl-devices", required_argument, 0, IDX_OPENCL_DEVICES}, - {"opencl-device-types", required_argument, 0, IDX_OPENCL_DEVICE_TYPES}, - {"opencl-info", no_argument, 0, IDX_OPENCL_INFO}, - {"opencl-platforms", required_argument, 0, IDX_OPENCL_PLATFORMS}, - {"opencl-vector-width", required_argument, 0, IDX_OPENCL_VECTOR_WIDTH}, - {"optimized-kernel-enable", no_argument, 0, IDX_OPTIMIZED_KERNEL_ENABLE}, - {"outfile-autohex-disable", no_argument, 0, IDX_OUTFILE_AUTOHEX_DISABLE}, - {"outfile-check-dir", required_argument, 0, IDX_OUTFILE_CHECK_DIR}, - {"outfile-check-timer", required_argument, 0, IDX_OUTFILE_CHECK_TIMER}, - {"outfile-format", required_argument, 0, IDX_OUTFILE_FORMAT}, - {"outfile", required_argument, 0, IDX_OUTFILE}, - {"wordlist-autohex-disable", no_argument, 0, IDX_WORDLIST_AUTOHEX_DISABLE}, - {"potfile-disable", no_argument, 0, IDX_POTFILE_DISABLE}, - {"potfile-path", required_argument, 0, IDX_POTFILE_PATH}, - {"powertune-enable", no_argument, 0, IDX_POWERTUNE_ENABLE}, - {"quiet", no_argument, 0, IDX_QUIET}, - {"remove", no_argument, 0, IDX_REMOVE}, - {"remove-timer", required_argument, 0, IDX_REMOVE_TIMER}, - {"restore-disable", no_argument, 0, IDX_RESTORE_DISABLE}, - {"restore-file-path", required_argument, 0, IDX_RESTORE_FILE_PATH}, - {"restore", no_argument, 0, IDX_RESTORE}, - {"rule-left", required_argument, 0, IDX_RULE_BUF_L}, - {"rule-right", required_argument, 0, IDX_RULE_BUF_R}, - {"rules-file", required_argument, 0, IDX_RP_FILE}, - {"runtime", required_argument, 0, IDX_RUNTIME}, - {"scrypt-tmto", required_argument, 0, IDX_SCRYPT_TMTO}, - {"self-test-disable", no_argument, 0, IDX_SELF_TEST_DISABLE}, - {"segment-size", required_argument, 0, IDX_SEGMENT_SIZE}, - {"separator", required_argument, 0, IDX_SEPARATOR}, - {"seperator", required_argument, 0, IDX_SEPARATOR}, - {"session", required_argument, 0, IDX_SESSION}, - {"show", no_argument, 0, IDX_SHOW}, - {"skip", required_argument, 0, IDX_SKIP}, - {"status", no_argument, 0, IDX_STATUS}, - {"status-timer", required_argument, 0, IDX_STATUS_TIMER}, - {"stdout", no_argument, 0, IDX_STDOUT_FLAG}, - {"speed-only", no_argument, 0, IDX_SPEED_ONLY}, - {"progress-only", no_argument, 0, IDX_PROGRESS_ONLY}, - {"truecrypt-keyfiles", required_argument, 0, IDX_TRUECRYPT_KEYFILES}, - {"username", no_argument, 0, IDX_USERNAME}, - {"veracrypt-keyfiles", required_argument, 0, IDX_VERACRYPT_KEYFILES}, - {"veracrypt-pim", required_argument, 0, IDX_VERACRYPT_PIM}, - {"version", no_argument, 0, IDX_VERSION}, - {"workload-profile", required_argument, 0, IDX_WORKLOAD_PROFILE}, - {} + {"advice-disable", no_argument, NULL, IDX_ADVICE_DISABLE}, + {"attack-mode", required_argument, NULL, IDX_ATTACK_MODE}, + {"benchmark", no_argument, NULL, IDX_BENCHMARK}, + {"benchmark-all", no_argument, NULL, IDX_BENCHMARK_ALL}, + {"bitmap-max", required_argument, NULL, IDX_BITMAP_MAX}, + {"bitmap-min", required_argument, NULL, IDX_BITMAP_MIN}, + {"cpu-affinity", required_argument, NULL, IDX_CPU_AFFINITY}, + {"custom-charset1", required_argument, NULL, IDX_CUSTOM_CHARSET_1}, + {"custom-charset2", required_argument, NULL, IDX_CUSTOM_CHARSET_2}, + {"custom-charset3", required_argument, NULL, IDX_CUSTOM_CHARSET_3}, + {"custom-charset4", required_argument, NULL, IDX_CUSTOM_CHARSET_4}, + {"debug-file", required_argument, NULL, IDX_DEBUG_FILE}, + {"debug-mode", required_argument, NULL, IDX_DEBUG_MODE}, + {"encoding-from", required_argument, NULL, IDX_ENCODING_FROM}, + {"encoding-to", required_argument, NULL, IDX_ENCODING_TO}, + {"example-hashes", no_argument, NULL, IDX_EXAMPLE_HASHES}, + {"force", no_argument, NULL, IDX_FORCE}, + {"generate-rules-func-max", required_argument, NULL, IDX_RP_GEN_FUNC_MAX}, + {"generate-rules-func-min", required_argument, NULL, IDX_RP_GEN_FUNC_MIN}, + {"generate-rules", required_argument, NULL, IDX_RP_GEN}, + {"generate-rules-seed", required_argument, NULL, IDX_RP_GEN_SEED}, + {"gpu-temp-abort", required_argument, NULL, IDX_GPU_TEMP_ABORT}, + {"gpu-temp-disable", no_argument, NULL, IDX_GPU_TEMP_DISABLE}, + {"hash-type", required_argument, NULL, IDX_HASH_MODE}, + {"hccapx-message-pair", required_argument, NULL, IDX_HCCAPX_MESSAGE_PAIR}, + {"help", no_argument, NULL, IDX_HELP}, + {"hex-charset", no_argument, NULL, IDX_HEX_CHARSET}, + {"hex-salt", no_argument, NULL, IDX_HEX_SALT}, + {"hex-wordlist", no_argument, NULL, IDX_HEX_WORDLIST}, + {"increment-max", required_argument, NULL, IDX_INCREMENT_MAX}, + {"increment-min", required_argument, NULL, IDX_INCREMENT_MIN}, + {"increment", no_argument, NULL, IDX_INCREMENT}, + {"induction-dir", required_argument, NULL, IDX_INDUCTION_DIR}, + {"keep-guessing", no_argument, NULL, IDX_KEEP_GUESSING}, + {"kernel-accel", required_argument, NULL, IDX_KERNEL_ACCEL}, + {"kernel-loops", required_argument, NULL, IDX_KERNEL_LOOPS}, + {"keyspace", no_argument, NULL, IDX_KEYSPACE}, + {"left", no_argument, NULL, IDX_LEFT}, + {"limit", required_argument, NULL, IDX_LIMIT}, + {"logfile-disable", no_argument, NULL, IDX_LOGFILE_DISABLE}, + {"loopback", no_argument, NULL, IDX_LOOPBACK}, + {"machine-readable", no_argument, NULL, IDX_MACHINE_READABLE}, + {"markov-classic", no_argument, NULL, IDX_MARKOV_CLASSIC}, + {"markov-disable", no_argument, NULL, IDX_MARKOV_DISABLE}, + {"markov-hcstat", required_argument, NULL, IDX_MARKOV_HCSTAT}, + {"markov-threshold", required_argument, NULL, IDX_MARKOV_THRESHOLD}, + {"nonce-error-corrections", required_argument, NULL, IDX_NONCE_ERROR_CORRECTIONS}, + {"nvidia-spin-damp", required_argument, NULL, IDX_NVIDIA_SPIN_DAMP}, + {"opencl-devices", required_argument, NULL, IDX_OPENCL_DEVICES}, + {"opencl-device-types", required_argument, NULL, IDX_OPENCL_DEVICE_TYPES}, + {"opencl-info", no_argument, NULL, IDX_OPENCL_INFO}, + {"opencl-platforms", required_argument, NULL, IDX_OPENCL_PLATFORMS}, + {"opencl-vector-width", required_argument, NULL, IDX_OPENCL_VECTOR_WIDTH}, + {"optimized-kernel-enable", no_argument, NULL, IDX_OPTIMIZED_KERNEL_ENABLE}, + {"outfile-autohex-disable", no_argument, NULL, IDX_OUTFILE_AUTOHEX_DISABLE}, + {"outfile-check-dir", required_argument, NULL, IDX_OUTFILE_CHECK_DIR}, + {"outfile-check-timer", required_argument, NULL, IDX_OUTFILE_CHECK_TIMER}, + {"outfile-format", required_argument, NULL, IDX_OUTFILE_FORMAT}, + {"outfile", required_argument, NULL, IDX_OUTFILE}, + {"wordlist-autohex-disable", no_argument, NULL, IDX_WORDLIST_AUTOHEX_DISABLE}, + {"potfile-disable", no_argument, NULL, IDX_POTFILE_DISABLE}, + {"potfile-path", required_argument, NULL, IDX_POTFILE_PATH}, + {"quiet", no_argument, NULL, IDX_QUIET}, + {"remove", no_argument, NULL, IDX_REMOVE}, + {"remove-timer", required_argument, NULL, IDX_REMOVE_TIMER}, + {"restore-disable", no_argument, NULL, IDX_RESTORE_DISABLE}, + {"restore-file-path", required_argument, NULL, IDX_RESTORE_FILE_PATH}, + {"restore", no_argument, NULL, IDX_RESTORE}, + {"rule-left", required_argument, NULL, IDX_RULE_BUF_L}, + {"rule-right", required_argument, NULL, IDX_RULE_BUF_R}, + {"rules-file", required_argument, NULL, IDX_RP_FILE}, + {"runtime", required_argument, NULL, IDX_RUNTIME}, + {"scrypt-tmto", required_argument, NULL, IDX_SCRYPT_TMTO}, + {"self-test-disable", no_argument, NULL, IDX_SELF_TEST_DISABLE}, + {"segment-size", required_argument, NULL, IDX_SEGMENT_SIZE}, + {"separator", required_argument, NULL, IDX_SEPARATOR}, + {"seperator", required_argument, NULL, IDX_SEPARATOR}, + {"session", required_argument, NULL, IDX_SESSION}, + {"show", no_argument, NULL, IDX_SHOW}, + {"skip", required_argument, NULL, IDX_SKIP}, + {"status", no_argument, NULL, IDX_STATUS}, + {"status-timer", required_argument, NULL, IDX_STATUS_TIMER}, + {"stdout", no_argument, NULL, IDX_STDOUT_FLAG}, + {"speed-only", no_argument, NULL, IDX_SPEED_ONLY}, + {"progress-only", no_argument, NULL, IDX_PROGRESS_ONLY}, + {"truecrypt-keyfiles", required_argument, NULL, IDX_TRUECRYPT_KEYFILES}, + {"username", no_argument, NULL, IDX_USERNAME}, + {"veracrypt-keyfiles", required_argument, NULL, IDX_VERACRYPT_KEYFILES}, + {"veracrypt-pim", required_argument, NULL, IDX_VERACRYPT_PIM}, + {"version", no_argument, NULL, IDX_VERSION}, + {"workload-profile", required_argument, NULL, IDX_WORKLOAD_PROFILE}, + {NULL, 0, NULL, 0 } }; -static char ENCODING_FROM[] = "utf-8"; -static char ENCODING_TO[] = "utf-8"; +static const char *ENCODING_FROM = "utf-8"; +static const char *ENCODING_TO = "utf-8"; -static char RULE_BUF_R[] = ":"; -static char RULE_BUF_L[] = ":"; +static const char *RULE_BUF_R = ":"; +static const char *RULE_BUF_L = ":"; -static char DEF_MASK_CS_1[] = "?l?d?u"; -static char DEF_MASK_CS_2[] = "?l?d"; -static char DEF_MASK_CS_3[] = "?l?d*!$@_"; +static const char *DEF_MASK_CS_1 = "?l?d?u"; +static const char *DEF_MASK_CS_2 = "?l?d"; +static const char *DEF_MASK_CS_3 = "?l?d*!$@_"; int user_options_init (hashcat_ctx_t *hashcat_ctx) { @@ -130,6 +129,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx) user_options->advice_disable = ADVICE_DISABLE; user_options->attack_mode = ATTACK_MODE; user_options->benchmark = BENCHMARK; + user_options->benchmark_all = BENCHMARK_ALL; user_options->bitmap_max = BITMAP_MAX; user_options->bitmap_min = BITMAP_MIN; user_options->cpu_affinity = NULL; @@ -145,7 +145,6 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx) user_options->force = FORCE; user_options->gpu_temp_abort = GPU_TEMP_ABORT; user_options->gpu_temp_disable = GPU_TEMP_DISABLE; - user_options->gpu_temp_retain = GPU_TEMP_RETAIN; user_options->hash_mode = HASH_MODE; user_options->hccapx_message_pair = HCCAPX_MESSAGE_PAIR; user_options->hex_charset = HEX_CHARSET; @@ -184,7 +183,6 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx) user_options->outfile = NULL; user_options->potfile_disable = POTFILE_DISABLE; user_options->potfile_path = NULL; - user_options->powertune_enable = POWERTUNE_ENABLE; user_options->quiet = QUIET; user_options->remove = REMOVE; user_options->remove_timer = REMOVE_TIMER; @@ -275,7 +273,6 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv) case IDX_KERNEL_LOOPS: case IDX_NVIDIA_SPIN_DAMP: case IDX_GPU_TEMP_ABORT: - case IDX_GPU_TEMP_RETAIN: case IDX_HCCAPX_MESSAGE_PAIR: case IDX_NONCE_ERROR_CORRECTIONS: case IDX_VERACRYPT_PIM: @@ -313,113 +310,111 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv) { switch (c) { - case IDX_HELP: user_options->usage = true; break; - case IDX_VERSION: user_options->version = true; break; - case IDX_RESTORE: user_options->restore = true; break; - case IDX_QUIET: user_options->quiet = true; break; - case IDX_SHOW: user_options->show = true; break; - case IDX_LEFT: user_options->left = true; break; - case IDX_ADVICE_DISABLE: user_options->advice_disable = true; break; - case IDX_USERNAME: user_options->username = true; break; - case IDX_REMOVE: user_options->remove = true; break; - case IDX_REMOVE_TIMER: user_options->remove_timer = atoi (optarg); - user_options->remove_timer_chgd = true; break; - case IDX_POTFILE_DISABLE: user_options->potfile_disable = true; break; - case IDX_POTFILE_PATH: user_options->potfile_path = optarg; break; - case IDX_DEBUG_MODE: user_options->debug_mode = atoi (optarg); break; - case IDX_DEBUG_FILE: user_options->debug_file = optarg; break; - case IDX_ENCODING_FROM: user_options->encoding_from = optarg; break; - case IDX_ENCODING_TO: user_options->encoding_to = optarg; break; - case IDX_INDUCTION_DIR: user_options->induction_dir = optarg; break; - case IDX_OUTFILE_CHECK_DIR: user_options->outfile_check_dir = optarg; break; - case IDX_EXAMPLE_HASHES: user_options->example_hashes = true; break; - case IDX_FORCE: user_options->force = true; break; - case IDX_SELF_TEST_DISABLE: user_options->self_test_disable = true; break; - case IDX_SKIP: user_options->skip = atoll (optarg); break; - case IDX_LIMIT: user_options->limit = atoll (optarg); break; - case IDX_KEEP_GUESSING: user_options->keep_guessing = true; break; - case IDX_KEYSPACE: user_options->keyspace = true; break; - case IDX_BENCHMARK: user_options->benchmark = true; break; - case IDX_STDOUT_FLAG: user_options->stdout_flag = true; break; - case IDX_SPEED_ONLY: user_options->speed_only = true; break; - case IDX_PROGRESS_ONLY: user_options->progress_only = true; break; - case IDX_RESTORE_DISABLE: user_options->restore_disable = true; break; - case IDX_RESTORE_FILE_PATH: user_options->restore_file_path = optarg; break; - case IDX_STATUS: user_options->status = true; break; - case IDX_STATUS_TIMER: user_options->status_timer = atoi (optarg); break; - case IDX_MACHINE_READABLE: user_options->machine_readable = true; break; - case IDX_LOOPBACK: user_options->loopback = true; break; - case IDX_SESSION: user_options->session = optarg; break; - case IDX_HASH_MODE: user_options->hash_mode = atoi (optarg); - user_options->hash_mode_chgd = true; break; - case IDX_RUNTIME: user_options->runtime = atoi (optarg); - user_options->runtime_chgd = true; break; - case IDX_ATTACK_MODE: user_options->attack_mode = atoi (optarg); - user_options->attack_mode_chgd = true; break; - case IDX_RP_FILE: user_options->rp_files[user_options->rp_files_cnt++] - = optarg; break; - case IDX_RP_GEN: user_options->rp_gen = atoi (optarg); break; - case IDX_RP_GEN_FUNC_MIN: user_options->rp_gen_func_min = atoi (optarg); break; - case IDX_RP_GEN_FUNC_MAX: user_options->rp_gen_func_max = atoi (optarg); break; - case IDX_RP_GEN_SEED: user_options->rp_gen_seed = atoi (optarg); - user_options->rp_gen_seed_chgd = true; break; - case IDX_RULE_BUF_L: user_options->rule_buf_l = optarg; break; - case IDX_RULE_BUF_R: user_options->rule_buf_r = optarg; break; - case IDX_MARKOV_DISABLE: user_options->markov_disable = true; break; - case IDX_MARKOV_CLASSIC: user_options->markov_classic = true; break; - case IDX_MARKOV_THRESHOLD: user_options->markov_threshold = atoi (optarg); break; - case IDX_MARKOV_HCSTAT: user_options->markov_hcstat = optarg; break; - case IDX_OUTFILE: user_options->outfile = optarg; break; - case IDX_OUTFILE_FORMAT: user_options->outfile_format = atoi (optarg); - user_options->outfile_format_chgd = true; break; - case IDX_OUTFILE_AUTOHEX_DISABLE: user_options->outfile_autohex = false; break; - case IDX_OUTFILE_CHECK_TIMER: user_options->outfile_check_timer = atoi (optarg); break; - case IDX_WORDLIST_AUTOHEX_DISABLE: user_options->wordlist_autohex_disable = true; break; - case IDX_HEX_CHARSET: user_options->hex_charset = true; break; - case IDX_HEX_SALT: user_options->hex_salt = true; break; - case IDX_HEX_WORDLIST: user_options->hex_wordlist = true; break; - case IDX_CPU_AFFINITY: user_options->cpu_affinity = optarg; break; - case IDX_OPENCL_INFO: user_options->opencl_info = true; break; - case IDX_OPENCL_DEVICES: user_options->opencl_devices = optarg; break; - case IDX_OPENCL_PLATFORMS: user_options->opencl_platforms = optarg; break; - case IDX_OPENCL_DEVICE_TYPES: user_options->opencl_device_types = optarg; break; - case IDX_OPENCL_VECTOR_WIDTH: user_options->opencl_vector_width = atoi (optarg); - user_options->opencl_vector_width_chgd = true; break; - case IDX_OPTIMIZED_KERNEL_ENABLE: user_options->optimized_kernel_enable = true; break; - case IDX_WORKLOAD_PROFILE: user_options->workload_profile = atoi (optarg); - user_options->workload_profile_chgd = true; break; - case IDX_KERNEL_ACCEL: user_options->kernel_accel = atoi (optarg); - user_options->kernel_accel_chgd = true; break; - case IDX_KERNEL_LOOPS: user_options->kernel_loops = atoi (optarg); - user_options->kernel_loops_chgd = true; break; - case IDX_NVIDIA_SPIN_DAMP: user_options->nvidia_spin_damp = atoi (optarg); - user_options->nvidia_spin_damp_chgd = true; break; - case IDX_GPU_TEMP_DISABLE: user_options->gpu_temp_disable = true; break; - case IDX_GPU_TEMP_ABORT: user_options->gpu_temp_abort = atoi (optarg); break; - case IDX_GPU_TEMP_RETAIN: user_options->gpu_temp_retain = atoi (optarg); break; - case IDX_POWERTUNE_ENABLE: user_options->powertune_enable = true; break; - case IDX_LOGFILE_DISABLE: user_options->logfile_disable = true; break; - case IDX_HCCAPX_MESSAGE_PAIR: user_options->hccapx_message_pair = atoi (optarg); - user_options->hccapx_message_pair_chgd = true; break; - case IDX_NONCE_ERROR_CORRECTIONS: user_options->nonce_error_corrections = atoi (optarg); break; - case IDX_TRUECRYPT_KEYFILES: user_options->truecrypt_keyfiles = optarg; break; - case IDX_VERACRYPT_KEYFILES: user_options->veracrypt_keyfiles = optarg; break; - case IDX_VERACRYPT_PIM: user_options->veracrypt_pim = atoi (optarg); break; - case IDX_SEGMENT_SIZE: user_options->segment_size = atoi (optarg); - user_options->segment_size_chgd = true; break; - case IDX_SCRYPT_TMTO: user_options->scrypt_tmto = atoi (optarg); break; - case IDX_SEPARATOR: user_options->separator = optarg[0]; break; - case IDX_BITMAP_MIN: user_options->bitmap_min = atoi (optarg); break; - case IDX_BITMAP_MAX: user_options->bitmap_max = atoi (optarg); break; - case IDX_INCREMENT: user_options->increment = true; break; - case IDX_INCREMENT_MIN: user_options->increment_min = atoi (optarg); - user_options->increment_min_chgd = true; break; - case IDX_INCREMENT_MAX: user_options->increment_max = atoi (optarg); - user_options->increment_max_chgd = true; break; - case IDX_CUSTOM_CHARSET_1: user_options->custom_charset_1 = optarg; break; - case IDX_CUSTOM_CHARSET_2: user_options->custom_charset_2 = optarg; break; - case IDX_CUSTOM_CHARSET_3: user_options->custom_charset_3 = optarg; break; - case IDX_CUSTOM_CHARSET_4: user_options->custom_charset_4 = optarg; break; + case IDX_HELP: user_options->usage = true; break; + case IDX_VERSION: user_options->version = true; break; + case IDX_RESTORE: user_options->restore = true; break; + case IDX_QUIET: user_options->quiet = true; break; + case IDX_SHOW: user_options->show = true; break; + case IDX_LEFT: user_options->left = true; break; + case IDX_ADVICE_DISABLE: user_options->advice_disable = true; break; + case IDX_USERNAME: user_options->username = true; break; + case IDX_REMOVE: user_options->remove = true; break; + case IDX_REMOVE_TIMER: user_options->remove_timer = strtoul (optarg, NULL, 10); + user_options->remove_timer_chgd = true; break; + case IDX_POTFILE_DISABLE: user_options->potfile_disable = true; break; + case IDX_POTFILE_PATH: user_options->potfile_path = optarg; break; + case IDX_DEBUG_MODE: user_options->debug_mode = strtoul (optarg, NULL, 10); break; + case IDX_DEBUG_FILE: user_options->debug_file = optarg; break; + case IDX_ENCODING_FROM: user_options->encoding_from = optarg; break; + case IDX_ENCODING_TO: user_options->encoding_to = optarg; break; + case IDX_INDUCTION_DIR: user_options->induction_dir = optarg; break; + case IDX_OUTFILE_CHECK_DIR: user_options->outfile_check_dir = optarg; break; + case IDX_EXAMPLE_HASHES: user_options->example_hashes = true; break; + case IDX_FORCE: user_options->force = true; break; + case IDX_SELF_TEST_DISABLE: user_options->self_test_disable = true; break; + case IDX_SKIP: user_options->skip = strtoull (optarg, NULL, 10); break; + case IDX_LIMIT: user_options->limit = strtoull (optarg, NULL, 10); break; + case IDX_KEEP_GUESSING: user_options->keep_guessing = true; break; + case IDX_KEYSPACE: user_options->keyspace = true; break; + case IDX_BENCHMARK: user_options->benchmark = true; break; + case IDX_BENCHMARK_ALL: user_options->benchmark_all = true; break; + case IDX_STDOUT_FLAG: user_options->stdout_flag = true; break; + case IDX_SPEED_ONLY: user_options->speed_only = true; break; + case IDX_PROGRESS_ONLY: user_options->progress_only = true; break; + case IDX_RESTORE_DISABLE: user_options->restore_disable = true; break; + case IDX_RESTORE_FILE_PATH: user_options->restore_file_path = optarg; break; + case IDX_STATUS: user_options->status = true; break; + case IDX_STATUS_TIMER: user_options->status_timer = strtoul (optarg, NULL, 10); break; + case IDX_MACHINE_READABLE: user_options->machine_readable = true; break; + case IDX_LOOPBACK: user_options->loopback = true; break; + case IDX_SESSION: user_options->session = optarg; break; + case IDX_HASH_MODE: user_options->hash_mode = strtoul (optarg, NULL, 10); + user_options->hash_mode_chgd = true; break; + case IDX_RUNTIME: user_options->runtime = strtoul (optarg, NULL, 10); + user_options->runtime_chgd = true; break; + case IDX_ATTACK_MODE: user_options->attack_mode = strtoul (optarg, NULL, 10); + user_options->attack_mode_chgd = true; break; + case IDX_RP_FILE: user_options->rp_files[user_options->rp_files_cnt++] = optarg; break; + case IDX_RP_GEN: user_options->rp_gen = strtoul (optarg, NULL, 10); break; + case IDX_RP_GEN_FUNC_MIN: user_options->rp_gen_func_min = strtoul (optarg, NULL, 10); break; + case IDX_RP_GEN_FUNC_MAX: user_options->rp_gen_func_max = strtoul (optarg, NULL, 10); break; + case IDX_RP_GEN_SEED: user_options->rp_gen_seed = strtoul (optarg, NULL, 10); + user_options->rp_gen_seed_chgd = true; break; + case IDX_RULE_BUF_L: user_options->rule_buf_l = optarg; break; + case IDX_RULE_BUF_R: user_options->rule_buf_r = optarg; break; + case IDX_MARKOV_DISABLE: user_options->markov_disable = true; break; + case IDX_MARKOV_CLASSIC: user_options->markov_classic = true; break; + case IDX_MARKOV_THRESHOLD: user_options->markov_threshold = strtoul (optarg, NULL, 10); break; + case IDX_MARKOV_HCSTAT: user_options->markov_hcstat = optarg; break; + case IDX_OUTFILE: user_options->outfile = optarg; break; + case IDX_OUTFILE_FORMAT: user_options->outfile_format = strtoul (optarg, NULL, 10); + user_options->outfile_format_chgd = true; break; + case IDX_OUTFILE_AUTOHEX_DISABLE: user_options->outfile_autohex = false; break; + case IDX_OUTFILE_CHECK_TIMER: user_options->outfile_check_timer = strtoul (optarg, NULL, 10); break; + case IDX_WORDLIST_AUTOHEX_DISABLE: user_options->wordlist_autohex_disable = true; break; + case IDX_HEX_CHARSET: user_options->hex_charset = true; break; + case IDX_HEX_SALT: user_options->hex_salt = true; break; + case IDX_HEX_WORDLIST: user_options->hex_wordlist = true; break; + case IDX_CPU_AFFINITY: user_options->cpu_affinity = optarg; break; + case IDX_OPENCL_INFO: user_options->opencl_info = true; break; + case IDX_OPENCL_DEVICES: user_options->opencl_devices = optarg; break; + case IDX_OPENCL_PLATFORMS: user_options->opencl_platforms = optarg; break; + case IDX_OPENCL_DEVICE_TYPES: user_options->opencl_device_types = optarg; break; + case IDX_OPENCL_VECTOR_WIDTH: user_options->opencl_vector_width = strtoul (optarg, NULL, 10); + user_options->opencl_vector_width_chgd = true; break; + case IDX_OPTIMIZED_KERNEL_ENABLE: user_options->optimized_kernel_enable = true; break; + case IDX_WORKLOAD_PROFILE: user_options->workload_profile = strtoul (optarg, NULL, 10); + user_options->workload_profile_chgd = true; break; + case IDX_KERNEL_ACCEL: user_options->kernel_accel = strtoul (optarg, NULL, 10); + user_options->kernel_accel_chgd = true; break; + case IDX_KERNEL_LOOPS: user_options->kernel_loops = strtoul (optarg, NULL, 10); + user_options->kernel_loops_chgd = true; break; + case IDX_NVIDIA_SPIN_DAMP: user_options->nvidia_spin_damp = strtoul (optarg, NULL, 10); + user_options->nvidia_spin_damp_chgd = true; break; + case IDX_GPU_TEMP_DISABLE: user_options->gpu_temp_disable = true; break; + case IDX_GPU_TEMP_ABORT: user_options->gpu_temp_abort = strtoul (optarg, NULL, 10); break; + case IDX_LOGFILE_DISABLE: user_options->logfile_disable = true; break; + case IDX_HCCAPX_MESSAGE_PAIR: user_options->hccapx_message_pair = strtoul (optarg, NULL, 10); + user_options->hccapx_message_pair_chgd = true; break; + case IDX_NONCE_ERROR_CORRECTIONS: user_options->nonce_error_corrections = strtoul (optarg, NULL, 10); break; + case IDX_TRUECRYPT_KEYFILES: user_options->truecrypt_keyfiles = optarg; break; + case IDX_VERACRYPT_KEYFILES: user_options->veracrypt_keyfiles = optarg; break; + case IDX_VERACRYPT_PIM: user_options->veracrypt_pim = strtoul (optarg, NULL, 10); break; + case IDX_SEGMENT_SIZE: user_options->segment_size = strtoul (optarg, NULL, 10); + user_options->segment_size_chgd = true; break; + case IDX_SCRYPT_TMTO: user_options->scrypt_tmto = strtoul (optarg, NULL, 10); break; + case IDX_SEPARATOR: user_options->separator = optarg[0]; break; + case IDX_BITMAP_MIN: user_options->bitmap_min = strtoul (optarg, NULL, 10); break; + case IDX_BITMAP_MAX: user_options->bitmap_max = strtoul (optarg, NULL, 10); break; + case IDX_INCREMENT: user_options->increment = true; break; + case IDX_INCREMENT_MIN: user_options->increment_min = strtoul (optarg, NULL, 10); + user_options->increment_min_chgd = true; break; + case IDX_INCREMENT_MAX: user_options->increment_max = strtoul (optarg, NULL, 10); + user_options->increment_max_chgd = true; break; + case IDX_CUSTOM_CHARSET_1: user_options->custom_charset_1 = optarg; break; + case IDX_CUSTOM_CHARSET_2: user_options->custom_charset_2 = optarg; break; + case IDX_CUSTOM_CHARSET_3: user_options->custom_charset_3 = optarg; break; + case IDX_CUSTOM_CHARSET_4: user_options->custom_charset_4 = optarg; break; } } @@ -845,16 +840,6 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx) return -1; } - if ((user_options->gpu_temp_abort != 0) && (user_options->gpu_temp_retain != 0)) - { - if (user_options->gpu_temp_abort < user_options->gpu_temp_retain) - { - event_log_error (hashcat_ctx, "Value for --gpu-temp-abort must not be less than --gpu-temp-retain value."); - - return -1; - } - } - if (user_options->benchmark == true) { if (user_options->attack_mode_chgd == true) @@ -1226,10 +1211,8 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx) user_options_t *user_options = hashcat_ctx->user_options; #if !defined (WITH_HWMON) - user_options->powertune_enable = false; user_options->gpu_temp_disable = true; user_options->gpu_temp_abort = 0; - user_options->gpu_temp_retain = 0; #endif // WITH_HWMON // some options can influence or overwrite other options @@ -1247,7 +1230,6 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx) user_options->nvidia_spin_damp = 0; user_options->outfile_check_timer = 0; user_options->potfile_disable = true; - user_options->powertune_enable = false; user_options->restore_disable = true; user_options->restore = false; user_options->restore_timer = 0; @@ -1260,13 +1242,11 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx) { user_options->attack_mode = ATTACK_MODE_BF; user_options->gpu_temp_disable = false; - user_options->gpu_temp_retain = 0; user_options->increment = false; user_options->left = false; user_options->logfile_disable = true; user_options->nvidia_spin_damp = 0; user_options->potfile_disable = true; - user_options->powertune_enable = true; user_options->progress_only = false; user_options->restore_disable = true; user_options->restore = false; @@ -1392,7 +1372,6 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx) if (user_options->gpu_temp_disable == true) { user_options->gpu_temp_abort = 0; - user_options->gpu_temp_retain = 0; } // default mask @@ -1473,6 +1452,11 @@ void user_options_info (hashcat_ctx_t *hashcat_ctx) event_log_info (hashcat_ctx, "Benchmark relevant options:"); event_log_info (hashcat_ctx, "==========================="); + if (user_options->benchmark_all == true) + { + event_log_info (hashcat_ctx, "* --benchmark-all"); + } + if (user_options->force == true) { event_log_info (hashcat_ctx, "* --force"); @@ -1520,6 +1504,11 @@ void user_options_info (hashcat_ctx_t *hashcat_ctx) } else { + if (user_options->benchmark_all == true) + { + event_log_info (hashcat_ctx, "# option: --benchmark-all"); + } + if (user_options->force == true) { event_log_info (hashcat_ctx, "# option: --force"); @@ -1694,12 +1683,21 @@ int user_options_check_files (hashcat_ctx_t *hashcat_ctx) // common folders + #if defined (_WIN) + if (hc_path_read (".") == false) + { + event_log_error (hashcat_ctx, "%s: %s", ".", strerror (errno)); + + return -1; + } + #else if (hc_path_read (folder_config->cwd) == false) { event_log_error (hashcat_ctx, "%s: %s", folder_config->cwd, strerror (errno)); return -1; } + #endif if (hc_path_read (folder_config->install_dir) == false) { @@ -2238,6 +2236,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx) logfile_top_uint64 (user_options->skip); logfile_top_uint (user_options->attack_mode); logfile_top_uint (user_options->benchmark); + logfile_top_uint (user_options->benchmark_all); logfile_top_uint (user_options->bitmap_max); logfile_top_uint (user_options->bitmap_min); logfile_top_uint (user_options->debug_mode); @@ -2245,7 +2244,6 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx) logfile_top_uint (user_options->force); logfile_top_uint (user_options->gpu_temp_abort); logfile_top_uint (user_options->gpu_temp_disable); - logfile_top_uint (user_options->gpu_temp_retain); logfile_top_uint (user_options->hash_mode); logfile_top_uint (user_options->hex_charset); logfile_top_uint (user_options->hex_salt); @@ -2273,7 +2271,6 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx) logfile_top_uint (user_options->outfile_format); logfile_top_uint (user_options->wordlist_autohex_disable); logfile_top_uint (user_options->potfile_disable); - logfile_top_uint (user_options->powertune_enable); logfile_top_uint (user_options->progress_only); logfile_top_uint (user_options->quiet); logfile_top_uint (user_options->remove); diff --git a/src/wordlist.c b/src/wordlist.c index a9bf67402..4bea6a45d 100644 --- a/src/wordlist.c +++ b/src/wordlist.c @@ -279,7 +279,7 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64 d.cnt = 0; - if (hc_fstat (fileno (fd), &d.stat)) + if (fstat (fileno (fd), &d.stat)) { *result = 0; @@ -347,7 +347,7 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64 cache_hit_t cache_hit; - cache_hit.dictfile = (char *) dictfile; + cache_hit.dictfile = dictfile; cache_hit.stat.st_size = d.stat.st_size; cache_hit.cached_cnt = cached_cnt; cache_hit.keyspace = keyspace; @@ -360,12 +360,12 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64 } } - hc_time_t rt_start; + time_t rt_start; - hc_time (&rt_start); + time (&rt_start); - hc_time_t now = 0; - hc_time_t prev = 0; + time_t now = 0; + time_t prev = 0; u64 comp = 0; u64 cnt = 0; @@ -449,11 +449,11 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64 } } - hc_time (&now); + time (&now); if ((now - prev) == 0) continue; - hc_time (&prev); + time (&prev); double percent = ((double) comp / (double) d.stat.st_size) * 100; @@ -461,7 +461,7 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64 { cache_generate_t cache_generate; - cache_generate.dictfile = (char *) dictfile; + cache_generate.dictfile = dictfile; cache_generate.comp = comp; cache_generate.percent = percent; cache_generate.cnt = cnt; @@ -471,13 +471,13 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64 } } - hc_time_t rt_stop; + time_t rt_stop; - hc_time (&rt_stop); + time (&rt_stop); cache_generate_t cache_generate; - cache_generate.dictfile = (char *) dictfile; + cache_generate.dictfile = dictfile; cache_generate.comp = comp; cache_generate.percent = 100; cache_generate.cnt = cnt; diff --git a/tools/package_bin.sh b/tools/package_bin.sh index 49de4b7b1..b507aec6f 100755 --- a/tools/package_bin.sh +++ b/tools/package_bin.sh @@ -6,7 +6,7 @@ ## export IN=$HOME/hashcat -export OUT=$HOME/xy/hashcat-4.0.1 +export OUT=$HOME/xy/hashcat-4.1.0 rm -rf $OUT rm -rf $OUT.7z diff --git a/tools/securenotes2hashcat.pl b/tools/securenotes2hashcat.pl new file mode 100644 index 000000000..43d638c5f --- /dev/null +++ b/tools/securenotes2hashcat.pl @@ -0,0 +1,35 @@ +#!/usr/bin/env perl + +## +## Author......: See docs/credits.txt +## License.....: MIT +## + +use strict; +use warnings; +use DBI; +use DBD::SQLite; + +die "usage: $0 NoteStore.sqlite\n" unless (scalar @ARGV == 1); + +my $database = shift @ARGV; +my $dsn = "DBI:SQLite:dbname=$database"; +my $userid = ""; +my $password = ""; + +my $dbh = DBI->connect ($dsn, $userid, $password, { RaiseError => 1 }) or die $DBI::errstr; + +my $sth = $dbh->prepare ("SELECT Z_PK,ZCRYPTOITERATIONCOUNT,ZCRYPTOSALT,ZCRYPTOWRAPPEDKEY FROM ZICCLOUDSYNCINGOBJECT WHERE ZISPASSWORDPROTECTED=1"); + +$sth->execute () or die $DBI::errstr; + +while (my $row = $sth->fetchrow_arrayref ()) +{ + printf ("\$ASN\$*%d*%d*%s*%s\n", $row->[0], $row->[1], unpack ("H*", $row->[2]), unpack ("H*", $row->[3])); +} + +$sth->finish; + +$dbh->disconnect (); + +exit (0); diff --git a/tools/test.pl b/tools/test.pl index 180d520c7..970e3b824 100755 --- a/tools/test.pl +++ b/tools/test.pl @@ -5,6 +5,11 @@ ## License.....: MIT ## +## install help: +## +## cpan install Authen::Passphrase::LANManager Authen::Passphrase::MySQL323 Authen::Passphrase::NTHash Authen::Passphrase::PHPass Crypt::CBC Crypt::DES Crypt::Digest::RIPEMD160 Crypt::Digest::Whirlpool Crypt::ECB Crypt::Eksblowfish::Bcrypt Crypt::Mode::ECB Crypt::MySQL Crypt::OpenSSH::ChachaPoly Crypt::PBKDF2 Crypt::RC4 Crypt::Rijndael Crypt::ScryptKDF Crypt::Skip32 Crypt::Twofish Crypt::UnixCrypt_XS Digest::BLAKE2 Digest::CMAC Digest::CRC Digest::GOST Digest::HMAC Digest::HMAC_MD5 Digest::Keccak Digest::MD4 Digest::MD5 Digest::Perl::MD5 Digest::SHA Digest::SipHash JSON Net::DNS::RR::NSEC3 Net::DNS::SEC Convert::EBCDIC +## + use strict; use warnings; use Digest::MD4 qw (md4 md4_hex); @@ -33,24 +38,26 @@ use Crypt::Mode::ECB; use Crypt::UnixCrypt_XS qw (crypt_rounds fold_password base64_to_int24 block_to_base64 int24_to_base64); use Crypt::Skip32; use Crypt::OpenSSH::ChachaPoly; -use MIME::Base64; +use JSON; +use MIME::Base64 qw (encode_base64 decode_base64 encode_base64url decode_base64url); use Authen::Passphrase::NTHash; use Authen::Passphrase::MySQL323; use Authen::Passphrase::PHPass; use Authen::Passphrase::LANManager; use Encode; -use POSIX qw (strftime); +use POSIX qw (strftime ceil); use Net::DNS::SEC; use Net::DNS::RR::NSEC3; use Convert::EBCDIC qw (ascii2ebcdic); use Digest::SipHash qw/siphash/; use Text::Iconv; +use Digest::Perl::MD5; my $hashcat = "./hashcat"; my $MAX_LEN = 55; -my @modes = (0, 10, 11, 12, 20, 21, 22, 23, 30, 40, 50, 60, 100, 101, 110, 111, 112, 120, 121, 122, 125, 130, 131, 132, 133, 140, 141, 150, 160, 200, 300, 400, 500, 600, 900, 1000, 1100, 1300, 1400, 1410, 1411, 1420, 1430, 1440, 1441, 1450, 1460, 1500, 1600, 1700, 1710, 1711, 1720, 1730, 1740, 1722, 1731, 1750, 1760, 1800, 2100, 2400, 2410, 2500, 2600, 2611, 2612, 2711, 2811, 3000, 3100, 3200, 3710, 3711, 3300, 3500, 3610, 3720, 3800, 3910, 4010, 4110, 4210, 4300, 4400, 4500, 4520, 4521, 4522, 4600, 4700, 4800, 4900, 5000, 5100, 5300, 5400, 5500, 5600, 5700, 5800, 6000, 6100, 6300, 6400, 6500, 6600, 6700, 6800, 6900, 7000, 7100, 7200, 7300, 7400, 7500, 7700, 7800, 7900, 8000, 8100, 8200, 8300, 8400, 8500, 8600, 8700, 8900, 9100, 9200, 9300, 9400, 9500, 9600, 9700, 9800, 9900, 10000, 10100, 10200, 10300, 10400, 10500, 10600, 10700, 10800, 10900, 11000, 11100, 11200, 11300, 11400, 11500, 11600, 11900, 12000, 12001, 12100, 12200, 12300, 12400, 12600, 12700, 12800, 12900, 13000, 13100, 13200, 13300, 13400, 13500, 13600, 13800, 13900, 14000, 14100, 14400, 14700, 14800, 14900, 15000, 15100, 15200, 15300, 15400, 15500, 15600, 15700, 15900, 16000, 99999); +my @modes = (0, 10, 11, 12, 20, 21, 22, 23, 30, 40, 50, 60, 100, 101, 110, 111, 112, 120, 121, 122, 125, 130, 131, 132, 133, 140, 141, 150, 160, 200, 300, 400, 500, 600, 900, 1000, 1100, 1300, 1400, 1410, 1411, 1420, 1430, 1440, 1441, 1450, 1460, 1500, 1600, 1700, 1710, 1711, 1720, 1730, 1740, 1722, 1731, 1750, 1760, 1800, 2100, 2400, 2410, 2500, 2600, 2611, 2612, 2711, 2811, 3000, 3100, 3200, 3710, 3711, 3300, 3500, 3610, 3720, 3800, 3910, 4010, 4110, 4210, 4300, 4400, 4500, 4520, 4521, 4522, 4600, 4700, 4800, 4900, 5000, 5100, 5300, 5400, 5500, 5600, 5700, 5800, 6000, 6100, 6300, 6400, 6500, 6600, 6700, 6800, 6900, 7000, 7100, 7200, 7300, 7400, 7500, 7700, 7800, 7900, 8000, 8100, 8200, 8300, 8400, 8500, 8600, 8700, 8900, 9100, 9200, 9300, 9400, 9500, 9600, 9700, 9800, 9900, 10000, 10100, 10200, 10300, 10400, 10500, 10600, 10700, 10800, 10900, 11000, 11100, 11200, 11300, 11400, 11500, 11600, 11900, 12000, 12001, 12100, 12200, 12300, 12400, 12600, 12700, 12800, 12900, 13000, 13100, 13200, 13300, 13400, 13500, 13600, 13800, 13900, 14000, 14100, 14400, 14700, 14800, 14900, 15000, 15100, 15200, 15300, 15400, 15500, 15600, 15700, 15900, 16000, 16100, 16200, 16300, 16400, 16500, 16600, 99999); my %is_utf16le = map { $_ => 1 } qw (30 40 130 131 132 133 140 141 1000 1100 1430 1440 1441 1730 1740 1731 5500 5600 8000 9400 9500 9600 9700 9800 11600 13500 13800); my %less_fifteen = map { $_ => 1 } qw (500 1600 1800 3200 6300 7400 10500 10700); @@ -218,7 +225,7 @@ sub verify # remember always do "exists ($db->{$hash_in})" checks as soon as possible and don't forget it # unsalted - if ($mode == 0 || $mode == 100 || $mode == 101 || $mode == 133 || $mode == 200 || $mode == 300 || $mode == 600 || $mode == 900 || $mode == 1000 || $mode == 1300 || $mode == 1400 || $mode == 1700 || $mode == 2400 || $mode == 2600 || $mode == 3000 || $mode == 3500 || $mode == 4300 || $mode == 4400 || $mode == 4500 || $mode == 4600 || $mode == 4700 || $mode == 5000 || $mode == 5100 || $mode == 5700 || $mode == 6000 || $mode == 6100 || $mode == 6900 || $mode == 8600 || $mode == 9900 || $mode == 10800 || $mode == 11500 || $mode == 16000 || $mode == 99999) + if ($mode == 0 || $mode == 100 || $mode == 101 || $mode == 133 || $mode == 200 || $mode == 300 || $mode == 600 || $mode == 900 || $mode == 1000 || $mode == 1300 || $mode == 1400 || $mode == 1700 || $mode == 2400 || $mode == 2600 || $mode == 3000 || $mode == 3500 || $mode == 4300 || $mode == 4400 || $mode == 4500 || $mode == 4600 || $mode == 4700 || $mode == 5000 || $mode == 5100 || $mode == 5700 || $mode == 6000 || $mode == 6100 || $mode == 6900 || $mode == 8600 || $mode == 9900 || $mode == 10800 || $mode == 11500 || $mode == 16000 || $mode == 16400 || $mode == 99999) { my $index = index ($line, ":"); @@ -2785,6 +2792,132 @@ sub verify next unless (exists ($db->{$hash_in}) and (! defined ($db->{$hash_in}))); } + # tacacs-plus + elsif ($mode == 16100) + { + ($hash_in, $word) = split ":", $line; + + next unless defined $hash_in; + next unless defined $word; + + my @data = split ('\$', $hash_in); + + next unless scalar @data == 6; + + shift @data; + + my $signature = shift @data; + + next unless ($signature eq "tacacs-plus"); + + my $auth_version = shift @data; + + next unless ($auth_version eq "0"); + + my $session_id = shift @data; + my $encrypted_data = shift @data; + my $sequence = shift @data; + + $param = $session_id; + $param2 = $encrypted_data; + $param3 = $sequence; + + next unless (exists ($db->{$hash_in}) and (! defined ($db->{$hash_in}))); + } + # apple secure notes + elsif ($mode == 16200) + { + ($hash_in, $word) = split ":", $line; + + next unless defined $hash_in; + next unless defined $word; + + my @data = split ('\*', $hash_in); + + next unless scalar @data == 5; + + my $signature = shift @data; + + next unless ($signature eq '$ASN$'); + + my ($Z_PK, $ZCRYPTOITERATIONCOUNT, $ZCRYPTOSALT, $ZCRYPTOWRAPPEDKEY) = @data; + + $salt = $ZCRYPTOSALT; + $iter = $ZCRYPTOITERATIONCOUNT; + + $param = $Z_PK; + $param2 = $ZCRYPTOWRAPPEDKEY; + + next unless (exists ($db->{$hash_in}) and (! defined ($db->{$hash_in}))); + } + # Ethereum Pre-Sale - PBKDF2 + elsif ($mode == 16300) + { + my $index1 = index ($line, ':'); + + next if ($index1 < 0); + + $hash_in = substr ($line, 0, $index1); + $word = substr ($line, $index1 + 1); + + next if (length ($hash_in) < 12); + + next unless (substr ($hash_in, 0, 12) eq "\$ethereum\$w\*"); + + my @data = split ('\*', $hash_in); + + next unless (scalar (@data) == 4); + + $param = pack ("H*", $data[1]); # encseed + + $salt = $data[2]; # ethaddr + + $param2 = pack ("H*", $data[3]); # bpk (the iv + keccak digest) + + next unless (exists ($db->{$hash_in}) and (! defined ($db->{$hash_in}))); + } + # JWT + elsif ($mode == 16500) + { + ($hash_in, $word) = split ":", $line; + + next unless defined $hash_in; + next unless defined $word; + + my @data = split (/\./, $hash_in); + + next unless scalar @data == 3; + + my ($header, $payload, $signature) = @data; + + $salt = $header . "." . $payload; + + next unless (exists ($db->{$hash_in}) and (! defined ($db->{$hash_in}))); + } + # Electrum Wallet (Salt-Type 1-3) + elsif ($mode == 16600) + { + ($hash_in, $word) = split ":", $line; + + next unless defined $hash_in; + next unless defined $word; + + my @data = split (/\*/, $hash_in); + + next unless scalar @data == 3; + + my ($mode, $iv, $encrypted) = @data; + + my (undef, $signature, $salt_type) = split ('\$', $mode); + + next unless ($signature eq "electrum"); + + $param = $salt_type; + $param2 = $iv; + $param3 = $encrypted; + + next unless (exists ($db->{$hash_in}) and (! defined ($db->{$hash_in}))); + } else { print "ERROR: hash mode is not supported\n"; @@ -3200,6 +3333,38 @@ sub verify return unless (substr ($line, 0, $len) eq $hash_out); } + elsif ($mode == 16100) + { + $hash_out = gen_hash ($mode, $word, undef, 0, $param, $param2, $param3); + + $len = length $hash_out; + + return unless (substr ($line, 0, $len) eq $hash_out); + } + elsif ($mode == 16200) + { + $hash_out = gen_hash ($mode, $word, $salt, $iter, $param, $param2); + + $len = length $hash_out; + + return unless (substr ($line, 0, $len) eq $hash_out); + } + elsif ($mode == 16300) + { + $hash_out = gen_hash ($mode, $word, $salt, 0, $param, $param2); + + $len = length $hash_out; + + return unless (substr ($line, 0, $len) eq $hash_out); + } + elsif ($mode == 16600) + { + $hash_out = gen_hash ($mode, $word, undef, 0, $param, $param2, $param3); + + $len = length $hash_out; + + return unless (substr ($line, 0, $len) eq $hash_out); + } else { $hash_out = gen_hash ($mode, $word, $salt, $iter); @@ -3279,7 +3444,7 @@ sub passthrough my $tmp_hash; - if ($mode == 0 || $mode == 100 || $mode == 101 || $mode == 133 || $mode == 200 || $mode == 300 || $mode == 600 || $mode == 900 || $mode == 1000 || $mode == 1300 || $mode == 1400 || $mode == 1700 || $mode == 2400 || $mode == 2600 || $mode == 3500 || $mode == 4300 || $mode == 4400 || $mode == 4500 || $mode == 4600 || $mode == 4700 || $mode == 5000 || $mode == 5100 || $mode == 6000 || $mode == 6100 || $mode == 6900 || $mode == 5700 || $mode == 9900 || $mode == 10800 || $mode == 11500 || $mode == 13300 || $mode == 99999) + if ($mode == 0 || $mode == 100 || $mode == 101 || $mode == 133 || $mode == 200 || $mode == 300 || $mode == 600 || $mode == 900 || $mode == 1000 || $mode == 1300 || $mode == 1400 || $mode == 1700 || $mode == 2400 || $mode == 2600 || $mode == 3500 || $mode == 4300 || $mode == 4400 || $mode == 4500 || $mode == 4600 || $mode == 4700 || $mode == 5000 || $mode == 5100 || $mode == 6000 || $mode == 6100 || $mode == 6900 || $mode == 5700 || $mode == 9900 || $mode == 10800 || $mode == 11500 || $mode == 13300 || $mode == 16400 || $mode == 99999) { $tmp_hash = gen_hash ($mode, $word_buf, ""); } @@ -3351,8 +3516,6 @@ sub passthrough } elsif ($mode == 2410) { - next if length ($word_buf) > 12; - my $salt_len = get_random_num (1, 4); $tmp_hash = gen_hash ($mode, $word_buf, substr ($salt_buf, 0, $salt_len)); @@ -3518,7 +3681,7 @@ sub passthrough $tmp_hash = gen_hash ($mode, $word_buf, $salt_buf); } - elsif ($mode == 8400 || $mode == 11200) + elsif ($mode == 8400 || $mode == 11200 || $mode == 16300) { $tmp_hash = gen_hash ($mode, $word_buf, substr ($salt_buf, 0, 40)); } @@ -3755,6 +3918,24 @@ sub passthrough $tmp_hash = gen_hash ($mode, $word_buf, ""); } + elsif ($mode == 16100) + { + $tmp_hash = gen_hash ($mode, $word_buf, undef); + } + elsif ($mode == 16200) + { + $tmp_hash = gen_hash ($mode, $word_buf, substr ($salt_buf, 0, 32)); + } + elsif ($mode == 16500) + { + $salt_buf = get_random_jwt_salt (); + + $tmp_hash = gen_hash ($mode, $word_buf, $salt_buf); + } + elsif ($mode == 16600) + { + $tmp_hash = gen_hash ($mode, $word_buf, substr ($salt_buf, 0, 32)); + } else { print "ERROR: Unsupported hash type\n"; @@ -3779,7 +3960,7 @@ sub single { my $mode = $modes[$j]; - if ($mode == 0 || $mode == 100 || $mode == 101 || $mode == 133 || $mode == 200 || $mode == 300 || $mode == 600 || $mode == 900 || $mode == 1000 || $mode == 1300 || $mode == 1400 || $mode == 1700 || $mode == 2600 || $mode == 3500 || $mode == 4300 || $mode == 4400 || $mode == 4500 || $mode == 4600 || $mode == 4700 || $mode == 5000 || $mode == 5100 || $mode == 5300 || $mode == 5400 || $mode == 6000 || $mode == 6100 || $mode == 6600 || $mode == 6900 || $mode == 5700 || $mode == 8200 || $mode == 8300 || $mode == 9900 || $mode == 10800 || $mode == 11500 || $mode == 13300 || $mode == 99999) + if ($mode == 0 || $mode == 100 || $mode == 101 || $mode == 133 || $mode == 200 || $mode == 300 || $mode == 600 || $mode == 900 || $mode == 1000 || $mode == 1300 || $mode == 1400 || $mode == 1700 || $mode == 2600 || $mode == 3500 || $mode == 4300 || $mode == 4400 || $mode == 4500 || $mode == 4600 || $mode == 4700 || $mode == 5000 || $mode == 5100 || $mode == 5300 || $mode == 5400 || $mode == 6000 || $mode == 6100 || $mode == 6600 || $mode == 6900 || $mode == 5700 || $mode == 8200 || $mode == 8300 || $mode == 9900 || $mode == 10800 || $mode == 11500 || $mode == 13300 || $mode == 16400 || $mode == 99999) { for (my $i = 1; $i < 32; $i++) { @@ -3793,7 +3974,7 @@ sub single } } } - elsif ($mode == 10 || $mode == 20 || $mode == 23 || $mode == 30 || $mode == 40 || $mode == 50 || $mode == 60 || $mode == 110 || $mode == 120 || $mode == 121 || $mode == 130 || $mode == 140 || $mode == 150 || $mode == 160 || $mode == 1410 || $mode == 1411 || $mode == 1420 || $mode == 1430 || $mode == 1440 || $mode == 1450 || $mode == 1460 || $mode == 1710 || $mode == 1711 || $mode == 1720 || $mode == 1730 || $mode == 1740 || $mode == 1750 || $mode == 1760 || $mode == 3610 || $mode == 3710 || $mode == 3711 || $mode == 3720 || $mode == 3910 || $mode == 4010 || $mode == 4110 || $mode == 4210 || $mode == 8900 || $mode == 10000 || $mode == 10200 || $mode == 10900 || $mode == 11900 || $mode == 12000 || $mode == 12100) + elsif ($mode == 10 || $mode == 20 || $mode == 23 || $mode == 30 || $mode == 40 || $mode == 50 || $mode == 60 || $mode == 110 || $mode == 120 || $mode == 121 || $mode == 130 || $mode == 140 || $mode == 150 || $mode == 160 || $mode == 1410 || $mode == 1411 || $mode == 1420 || $mode == 1430 || $mode == 1440 || $mode == 1450 || $mode == 1460 || $mode == 1710 || $mode == 1711 || $mode == 1720 || $mode == 1730 || $mode == 1740 || $mode == 1750 || $mode == 1760 || $mode == 3610 || $mode == 3710 || $mode == 3711 || $mode == 3720 || $mode == 3910 || $mode == 4010 || $mode == 4110 || $mode == 4210 || $mode == 8900 || $mode == 10000 || $mode == 10200 || $mode == 10900 || $mode == 11900 || $mode == 12000 || $mode == 12100 || $mode == 16500) { my $salt_len = get_random_num (1, 15); @@ -3927,7 +4108,7 @@ sub single } elsif ($mode == 2400) { - for (my $i = 1; $i < 16; $i++) + for (my $i = 1; $i < 32; $i++) { if ($len != 0) { @@ -3941,9 +4122,9 @@ sub single } elsif ($mode == 2410) { - my $salt_len = get_random_num (1, 4); + my $salt_len = get_random_num (3, 4); - for (my $i = 1; $i < 13; $i++) + for (my $i = 1; $i < 32; $i++) { if ($len != 0) { @@ -4274,7 +4455,7 @@ sub single } } } - elsif ($mode == 8400 || $mode == 11200 || $mode == 14700 || $mode == 14800) + elsif ($mode == 8400 || $mode == 11200 || $mode == 14700 || $mode == 14800 || $mode == 16300) { for (my $i = 1; $i < 32; $i++) { @@ -4796,6 +4977,48 @@ sub single } } } + elsif ($mode == 16100) + { + for (my $i = 1; $i < 32; $i++) + { + if ($len != 0) + { + rnd ($mode, $len, 0); + } + else + { + rnd ($mode, $i, 0); + } + } + } + elsif ($mode == 16200) + { + for (my $i = 1; $i < 32; $i++) + { + if ($len != 0) + { + rnd ($mode, $len, 32); + } + else + { + rnd ($mode, $i, 32); + } + } + } + elsif ($mode == 16600) + { + for (my $i = 1; $i < 32; $i++) + { + if ($len != 0) + { + rnd ($mode, $len, 32); + } + else + { + rnd ($mode, $i, 32); + } + } + } } } @@ -5343,13 +5566,23 @@ sub gen_hash } elsif ($mode == 2400) { - my $hash_buf = Digest::MD5::md5 ($word_buf . "\0" x (16 - length ($word_buf))); + my $word_len = length ($word_buf); + + my $pad_len = ceil ($word_len / 16) * 16; + + my $hash_buf = Digest::MD5::md5 ($word_buf . "\0" x ($pad_len - $word_len)); $tmp_hash = sprintf ("%s", pseudo_base64 ($hash_buf)); } elsif ($mode == 2410) { - my $hash_buf = Digest::MD5::md5 ($word_buf . $salt_buf . "\0" x (16 - length ($word_buf) - length ($salt_buf))); + my $word_salt_buf = $word_buf . $salt_buf; + + my $word_salt_len = length ($word_salt_buf); + + my $pad_len = ceil ($word_salt_len / 16) * 16; + + my $hash_buf = Digest::MD5::md5 ($word_buf . $salt_buf . "\0" x ($pad_len - $word_salt_len)); $tmp_hash = sprintf ("%s:%s", pseudo_base64 ($hash_buf), $salt_buf); } @@ -8938,6 +9171,371 @@ END_CODE $tmp_hash = sprintf ("%s", $hash_buf); } + elsif ($mode == 16100) + { + my $session_id; + my $encrypted_data; + my $sequence; + + if (defined $additional_param) + { + $session_id = pack ("H*", $additional_param); + } + else + { + $session_id = pack ("H*", randbytes (8)); + } + + if (defined $additional_param2) + { + $encrypted_data = pack ("H*", $additional_param2); + } + + if (defined $additional_param3) + { + $sequence = pack ("H*", $additional_param3); + } + else + { + $sequence = pack ("H*", "c006"); + } + + my $key = md5 ($session_id . $word_buf . $sequence); + + if (defined $encrypted_data) + { + ## verify case + + my $encrypted_data_len = length $encrypted_data; + + my $plain_data = substr ($encrypted_data, 0, 6) ^ substr ($key, 0, 6); + + my ($status, $flags, $server_msg_len, $data_len) = unpack ("CCnn", $plain_data); + + if ((($status >= 0x01 && $status <= 0x07) || $status == 0x21) + && ($flags == 0x01 || $flags == 0x00) + && (6 + $server_msg_len + $data_len == $encrypted_data_len)) + { + ## ok + } + else + { + $encrypted_data = ""; # some invalid data + } + } + else + { + my $plain_data = "\x01\x00\x00\x00\x00\x00"; + + my $plain_data_len = length $plain_data; + + my $shortest = ($plain_data_len > 16) ? 16 : $plain_data_len; + + $encrypted_data = substr ($plain_data, 0, $shortest) ^ substr ($key, 0, $shortest); + } + + $tmp_hash = sprintf ('$tacacs-plus$0$%s$%s$%s', unpack ("H*", $session_id), unpack ("H*", $encrypted_data), unpack ("H*", $sequence)); + } + elsif ($mode == 16200) + { + my $salt_bin = pack ("H*", $salt_buf); + + my $iterations = 20000; + + if (defined ($iter)) + { + $iterations = $iter; + } + + my $Z_PK = 1; + + if (defined $additional_param) + { + $Z_PK = $additional_param; + } + + my $pbkdf2 = Crypt::PBKDF2->new + ( + hasher => Crypt::PBKDF2->hasher_from_algorithm ('HMACSHA2', 256), + iterations => $iterations, + output_len => 16, + ); + + my $KEK = $pbkdf2->PBKDF2 ($salt_bin, $word_buf); + + my $aes = Crypt::Mode::ECB->new ('AES', 0); + + my $blob_bin; + + my $A; + my $B; + my $P1; + my $P2; + + if (defined $additional_param2) + { + $blob_bin = pack ("H*", $additional_param2); + + $A = substr ($blob_bin, 0, 8); + $P1 = substr ($blob_bin, 8, 8); + $P2 = substr ($blob_bin, 16, 8); + + for (my $j = 5; $j >= 0; $j--) + { + # N = 2 + + $B = $A; + $B ^= pack ("Q>", (2 * $j + 2)); + $B .= $P2; + $B = $aes->decrypt ($B, $KEK); + $A = substr ($B, 0, 8); + $P2 = substr ($B, 8, 8); + + # N = 1 + + $B = $A; + $B ^= pack ("Q>", (2 * $j + 1)); + $B .= $P1; + $B = $aes->decrypt ($B, $KEK); + $A = substr ($B, 0, 8); + $P1 = substr ($B, 8, 8); + } + + if ($A eq "\xa6" x 8) + { + for (my $j = 0; $j <= 5; $j++) + { + # N = 1 + + $B = $A; + $B .= $P1; + $B = $aes->encrypt ($B, $KEK); + $A = substr ($B, 0, 8); + $A ^= pack ("Q>", (2 * $j + 1)); + $P1 = substr ($B, 8, 8); + + # N = 2 + + $B = $A; + $B .= $P2; + $B = $aes->encrypt ($B, $KEK); + $A = substr ($B, 0, 8); + $A ^= pack ("Q>", (2 * $j + 2)); + $P2 = substr ($B, 8, 8); + } + + $blob_bin = $A . $P1 . $P2; + } + else + { + $blob_bin = "\xff" x 24; + } + } + else + { + $A = "\xa6" x 8; + $P1 = "\xff" x 8; + $P2 = "\xff" x 8; + + for (my $j = 0; $j <= 5; $j++) + { + # N = 1 + + $B = $A; + $B .= $P1; + $B = $aes->encrypt ($B, $KEK); + $A = substr ($B, 0, 8); + $A ^= pack ("Q>", (2 * $j + 1)); + $P1 = substr ($B, 8, 8); + + # N = 2 + + $B = $A; + $B .= $P2; + $B = $aes->encrypt ($B, $KEK); + $A = substr ($B, 0, 8); + $A ^= pack ("Q>", (2 * $j + 2)); + $P2 = substr ($B, 8, 8); + } + + $blob_bin = $A . $P1 . $P2; + } + + $tmp_hash = sprintf ('$ASN$*%d*%d*%s*%s', $Z_PK, $iterations, unpack ("H*", $salt_bin), unpack ("H*", $blob_bin)); + } + elsif ($mode == 16300) + { + my $ethaddr = $salt_buf; + + my $iv = ""; + my $seed = ""; + my $encseed = ""; + + # setup pbkdf2 params: + + my $pbkdf2 = Crypt::PBKDF2->new + ( + hasher => Crypt::PBKDF2->hasher_from_algorithm ('HMACSHA2', 256), + iterations => 2000, + output_len => 16 + ); + + my $key = $pbkdf2->PBKDF2 ($word_buf, $word_buf); + + if (defined $additional_param) + { + $iv = substr ($additional_param, 0, 16); + $encseed = substr ($additional_param, 16); + + # AES-128-CBC decrypt: + + my $aes_cbc = Crypt::CBC->new ({ + key => $key, + cipher => "Crypt::Rijndael", + iv => $iv, + literal_key => 1, + header => "none", + keysize => 16 + }); + + $seed = $aes_cbc->decrypt ($encseed); + } + else + { + $iv = randbytes (16); + $seed = randbytes (592); + + # AES-128-CBC encrypt: + + my $aes_cbc = Crypt::CBC->new ({ + key => $key, + cipher => "Crypt::Rijndael", + iv => $iv, + literal_key => 1, + header => "none", + keysize => 16 + }); + + $encseed = $aes_cbc->encrypt ($seed); + } + + $hash_buf = keccak_256_hex ($seed . "\x02"); + + $tmp_hash = sprintf ("\$ethereum\$w*%s*%s*%s", unpack ("H*", $iv . $encseed), $ethaddr, substr ($hash_buf, 0, 32)); + } + elsif ($mode == 16400) + { + my $md5 = Digest::Perl::MD5->new; + my $length = length($word_buf); + + $md5->{_data} = $word_buf ^ ("\x5c" x $length); + $md5->{_data} .= "\x5c" x (64 - $length); + $md5->add(); + + $hash_buf = unpack("H*", pack('V4', @{$md5->{_state}})); + $tmp_hash = sprintf ("{CRAM-MD5}%s00000000000000000000000000000000", $hash_buf); + } + elsif ($mode == 16500) + { + my ($header_base64) = split (/\./, $salt_buf); + + my $header_jwt = decode_base64url ($header_base64); + + my $header = decode_json ($header_jwt); + + my $alg = $header->{"alg"}; + + if ($alg eq "HS256") + { + $hash_buf = hmac ($salt_buf, $word_buf, \&sha256, 64); + } + elsif ($alg eq "HS384") + { + $hash_buf = hmac ($salt_buf, $word_buf, \&sha384, 128); + } + elsif ($alg eq "HS512") + { + $hash_buf = hmac ($salt_buf, $word_buf, \&sha512, 128); + } + else + { + die "not supported hash\n"; + } + + $tmp_hash = sprintf ("%s.%s", $salt_buf, encode_base64url ($hash_buf, "")); + } + elsif ($mode == 16600) + { + my $key_bin = sha256 (sha256 ($word_buf)); + + my $salt_type; + + if (defined $additional_param) + { + $salt_type = $additional_param; + + if ($salt_type ne "1") { die "currently only salt_type 1 supported\n"; } + } + else + { + $salt_type = 1; + } + + my $iv; + + if (defined $additional_param2) + { + $iv = $additional_param2; + } + else + { + $iv = substr ($salt_buf, 0, 32); + } + + my $iv_bin = pack ("H*", $iv); + + my $cipher = Crypt::CBC->new ({ + key => $key_bin, + cipher => "Crypt::Rijndael", + iv => $iv_bin, + literal_key => 1, + header => "none", + keysize => 32, + padding => "null", + }); + + my $plain_bin; + + if (defined $additional_param3) + { + my $encrypted_bin = pack ("H*", $additional_param3); + + my $test_bin = $cipher->decrypt ($encrypted_bin); + + my $test = unpack ("H*", $test_bin); + + if ($test =~ /^[0-9a-f]+$/) + { + $plain_bin = $test_bin; + } + else + { + $plain_bin = "\xff" x 16; + } + } + else + { + my $plain = "30313233343536373839616263646566"; + + $plain_bin = pack ("H*", $plain); + } + + my $encrypted_bin = $cipher->encrypt ($plain_bin); + + my $encrypted = unpack ("H*", $encrypted_bin); + + $tmp_hash = sprintf ("\$electrum\$%d*%s*%s", $salt_type, $iv, $encrypted); + } elsif ($mode == 99999) { $tmp_hash = sprintf ("%s", $word_buf); @@ -8979,13 +9577,8 @@ sub rnd my $max = $MAX_LEN; - if ($mode == 2400) + if ($mode == 2410) { - $word_len = min ($word_len, 16); - } - elsif ($mode == 2410) - { - $word_len = min ($word_len, 12); $salt_len = min ($salt_len, 4); } @@ -9089,6 +9682,10 @@ sub rnd $salt_buf = get_random_dpapimk_salt ($version); } + elsif ($mode == 16500) + { + $salt_buf = get_random_jwt_salt (); + } else { my @salt_arr; @@ -10587,6 +11184,50 @@ sub get_random_dpapimk_salt return $salt_buf; } +sub get_random_jwt_salt +{ + my @hashes = + ( + "HS256", + #"HS384", #this is support in hashcat, but commented out here to prevent mixed hash output files in single mode + #"HS512", #this is support in hashcat, but commented out here to prevent mixed hash output files in single mode + #"RS256", #not supported by hashcat + #"RS384", + #"RS512", + #"PS256", + #"PS384", + #"PS512", + #"ES256", + #"ES384", + #"ES512", + ); + + my $rnd = get_random_num (0, scalar @hashes); + + my $hash = $hashes[$rnd]; + + my $header = + { + "alg" => $hash + }; + + my $random_key = get_random_num (1, 100000000); + my $random_val = get_random_num (1, 100000000); + + my $payload = + { + $random_key => $random_val + }; + + my $header_json = encode_json ($header); + my $payload_json = encode_json ($payload); + + my $header_base64 = encode_base64url ($header_json, ""); + my $payload_base64 = encode_base64url ($payload_json, ""); + + return $header_base64 . "." . $payload_base64; +} + sub md5bit { my $digest = shift; diff --git a/tools/test.sh b/tools/test.sh index 0dab0d2ac..a44651a20 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -9,7 +9,7 @@ TDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # missing hash types: 5200,6251,6261,6271,6281 -HASH_TYPES="0 10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 125 130 131 132 133 140 141 150 160 200 300 400 500 600 900 1000 1100 1300 1400 1410 1411 1420 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 3910 4010 4110 4300 4400 4500 4520 4521 4522 4700 4800 4900 5000 5100 5300 5400 5500 5600 5700 5800 6000 6100 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8900 9100 9200 9300 9400 9500 9600 9700 9800 9900 10000 10100 10200 10300 10400 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11900 12000 12001 12100 12200 12300 12400 12600 12700 12800 12900 13000 13100 13200 13300 13400 13500 13600 13800 13900 14000 14100 14400 14600 14700 14800 14900 15000 15100 15200 15300 15400 15500 15600 15700 15900 16000 99999" +HASH_TYPES="0 10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 125 130 131 132 133 140 141 150 160 200 300 400 500 600 900 1000 1100 1300 1400 1410 1411 1420 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 3910 4010 4110 4300 4400 4500 4520 4521 4522 4700 4800 4900 5000 5100 5300 5400 5500 5600 5700 5800 6000 6100 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8900 9100 9200 9300 9400 9500 9600 9700 9800 9900 10000 10100 10200 10300 10400 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11900 12000 12001 12100 12200 12300 12400 12600 12700 12800 12900 13000 13100 13200 13300 13400 13500 13600 13800 13900 14000 14100 14400 14600 14700 14800 14900 15000 15100 15200 15300 15400 15500 15600 15700 15900 16000 16100 16200 16300 16400 16500 16600 99999" #ATTACK_MODES="0 1 3 6 7" ATTACK_MODES="0 1 3 7"