Prepare fix for datatypes, not final

This commit is contained in:
Jens Steube
2016-01-15 17:16:43 +01:00
parent 2e61685f48
commit 63e06f582b
15 changed files with 2367 additions and 2372 deletions
+10 -3
View File
@@ -45,7 +45,7 @@
#include <sys/ioctl.h>
#endif
typedef void *HM_LIB;
typedef void *HM_LIB;
#endif
#ifdef _WIN
@@ -76,6 +76,13 @@ typedef HINSTANCE HM_LIB;
#endif
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef uint32_t uint; // we need to get rid of this sooner or later, for consistency
#define SPEED_CACHE 128
#define SPEED_MAXAGE 4096
@@ -94,7 +101,7 @@ void log_out (FILE *fp, const char *fmt, ...);
void log_info (const char *fmt, ...);
void log_error (const char *fmt, ...);
typedef uint32_t uint; // we should rename to u32, sooner or later, for consistency
typedef uint64_t u64;
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif
+75 -75
View File
@@ -3,7 +3,7 @@
* License.....: MIT
*/
static const uint te0[256] =
static const u32 te0[256] =
{
0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d,
0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554,
@@ -71,7 +71,7 @@ static const uint te0[256] =
0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a,
};
static const uint te1[256] =
static const u32 te1[256] =
{
0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b,
0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5,
@@ -139,7 +139,7 @@ static const uint te1[256] =
0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616,
};
static const uint te2[256] =
static const u32 te2[256] =
{
0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b,
0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5,
@@ -207,7 +207,7 @@ static const uint te2[256] =
0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16,
};
static const uint te3[256] =
static const u32 te3[256] =
{
0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6,
0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491,
@@ -275,7 +275,7 @@ static const uint te3[256] =
0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c,
};
static const uint te4[256] =
static const u32 te4[256] =
{
0x63636363, 0x7c7c7c7c, 0x77777777, 0x7b7b7b7b,
0xf2f2f2f2, 0x6b6b6b6b, 0x6f6f6f6f, 0xc5c5c5c5,
@@ -343,7 +343,7 @@ static const uint te4[256] =
0xb0b0b0b0, 0x54545454, 0xbbbbbbbb, 0x16161616,
};
static const uint td0[256] =
static const u32 td0[256] =
{
0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96,
0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393,
@@ -411,7 +411,7 @@ static const uint td0[256] =
0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742,
};
static const uint td1[256] =
static const u32 td1[256] =
{
0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e,
0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303,
@@ -479,7 +479,7 @@ static const uint td1[256] =
0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857,
};
static const uint td2[256] =
static const u32 td2[256] =
{
0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27,
0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3,
@@ -547,7 +547,7 @@ static const uint td2[256] =
0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8,
};
static const uint td3[256] =
static const u32 td3[256] =
{
0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a,
0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b,
@@ -615,7 +615,7 @@ static const uint td3[256] =
0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0,
};
static const uint td4[256] =
static const u32 td4[256] =
{
0x52525252, 0x09090909, 0x6a6a6a6a, 0xd5d5d5d5,
0x30303030, 0x36363636, 0xa5a5a5a5, 0x38383838,
@@ -683,7 +683,7 @@ static const uint td4[256] =
0x55555555, 0x21212121, 0x0c0c0c0c, 0x7d7d7d7d,
};
static const uint rcon[] =
static const u32 rcon[] =
{
0x01000000, 0x02000000, 0x04000000, 0x08000000,
0x10000000, 0x20000000, 0x40000000, 0x80000000,
@@ -692,9 +692,9 @@ static const uint rcon[] =
// 128 bit
static void AES128_ExpandKey (const uint *userkey, uint *rek)
static void AES128_ExpandKey (const u32 *userkey, u32 *rek)
{
uint userkey_s[4];
u32 userkey_s[4];
userkey_s[0] = byte_swap_32 (userkey[0]);
userkey_s[1] = byte_swap_32 (userkey[1]);
@@ -711,7 +711,7 @@ static void AES128_ExpandKey (const uint *userkey, uint *rek)
for (i = 0, j = 0; i < 10; i += 1, j += 4)
{
uint temp = rek[j + 3];
u32 temp = rek[j + 3];
temp = (te2[(temp >> 16) & 0xff] & 0xff000000)
^ (te3[(temp >> 8) & 0xff] & 0x00ff0000)
@@ -728,14 +728,14 @@ static void AES128_ExpandKey (const uint *userkey, uint *rek)
}
}
static void AES128_InvertKey (uint *rdk)
static void AES128_InvertKey (u32 *rdk)
{
int i;
int j;
for (i = 0, j = 40; i < j; i += 4, j -= 4)
{
uint temp;
u32 temp;
temp = rdk[i + 0]; rdk[i + 0] = rdk[j + 0]; rdk[j + 0] = temp;
temp = rdk[i + 1]; rdk[i + 1] = rdk[j + 1]; rdk[j + 1] = temp;
@@ -771,24 +771,24 @@ static void AES128_InvertKey (uint *rdk)
}
}
static void AES128_encrypt (const uint *in, uint *out, const uint *rek)
static void AES128_encrypt (const u32 *in, u32 *out, const u32 *rek)
{
uint in_s[4];
u32 in_s[4];
in_s[0] = byte_swap_32 (in[0]);
in_s[1] = byte_swap_32 (in[1]);
in_s[2] = byte_swap_32 (in[2]);
in_s[3] = byte_swap_32 (in[3]);
uint s0 = in_s[0] ^ rek[0];
uint s1 = in_s[1] ^ rek[1];
uint s2 = in_s[2] ^ rek[2];
uint s3 = in_s[3] ^ rek[3];
u32 s0 = in_s[0] ^ rek[0];
u32 s1 = in_s[1] ^ rek[1];
u32 s2 = in_s[2] ^ rek[2];
u32 s3 = in_s[3] ^ rek[3];
uint t0;
uint t1;
uint t2;
uint t3;
u32 t0;
u32 t1;
u32 t2;
u32 t3;
t0 = te0[s0 >> 24] ^ te1[(s1 >> 16) & 0xff] ^ te2[(s2 >> 8) & 0xff] ^ te3[s3 & 0xff] ^ rek[ 4];
t1 = te0[s1 >> 24] ^ te1[(s2 >> 16) & 0xff] ^ te2[(s3 >> 8) & 0xff] ^ te3[s0 & 0xff] ^ rek[ 5];
@@ -857,24 +857,24 @@ static void AES128_encrypt (const uint *in, uint *out, const uint *rek)
out[3] = byte_swap_32 (out[3]);
}
static void AES128_decrypt (const uint *in, uint *out, const uint *rdk)
static void AES128_decrypt (const u32 *in, u32 *out, const u32 *rdk)
{
uint in_s[4];
u32 in_s[4];
in_s[0] = byte_swap_32 (in[0]);
in_s[1] = byte_swap_32 (in[1]);
in_s[2] = byte_swap_32 (in[2]);
in_s[3] = byte_swap_32 (in[3]);
uint s0 = in_s[0] ^ rdk[0];
uint s1 = in_s[1] ^ rdk[1];
uint s2 = in_s[2] ^ rdk[2];
uint s3 = in_s[3] ^ rdk[3];
u32 s0 = in_s[0] ^ rdk[0];
u32 s1 = in_s[1] ^ rdk[1];
u32 s2 = in_s[2] ^ rdk[2];
u32 s3 = in_s[3] ^ rdk[3];
uint t0;
uint t1;
uint t2;
uint t3;
u32 t0;
u32 t1;
u32 t2;
u32 t3;
t0 = td0[s0 >> 24] ^ td1[(s3 >> 16) & 0xff] ^ td2[(s2 >> 8) & 0xff] ^ td3[s1 & 0xff] ^ rdk[ 4];
t1 = td0[s1 >> 24] ^ td1[(s0 >> 16) & 0xff] ^ td2[(s3 >> 8) & 0xff] ^ td3[s2 & 0xff] ^ rdk[ 5];
@@ -945,9 +945,9 @@ static void AES128_decrypt (const uint *in, uint *out, const uint *rdk)
// 256 bit
static void AES256_ExpandKey (const uint *userkey, uint *rek)
static void AES256_ExpandKey (const u32 *userkey, u32 *rek)
{
uint userkey_s[8];
u32 userkey_s[8];
userkey_s[0] = byte_swap_32 (userkey[0]);
userkey_s[1] = byte_swap_32 (userkey[1]);
@@ -975,7 +975,7 @@ static void AES256_ExpandKey (const uint *userkey, uint *rek)
while (1)
{
uint temp = rek[j + 7];
u32 temp = rek[j + 7];
rek[j + 8] = rek[j + 0]
^ (te2[(temp >> 16) & 0xff] & 0xff000000)
@@ -1006,11 +1006,11 @@ static void AES256_ExpandKey (const uint *userkey, uint *rek)
}
}
static void AES256_InvertKey (uint *rdk)
static void AES256_InvertKey (u32 *rdk)
{
for (uint i = 0, j = 56; i < j; i += 4, j -= 4)
for (u32 i = 0, j = 56; i < j; i += 4, j -= 4)
{
uint temp;
u32 temp;
temp = rdk[i + 0]; rdk[i + 0] = rdk[j + 0]; rdk[j + 0] = temp;
temp = rdk[i + 1]; rdk[i + 1] = rdk[j + 1]; rdk[j + 1] = temp;
@@ -1018,7 +1018,7 @@ static void AES256_InvertKey (uint *rdk)
temp = rdk[i + 3]; rdk[i + 3] = rdk[j + 3]; rdk[j + 3] = temp;
}
for (uint i = 1, j = 4; i < 14; i += 1, j += 4)
for (u32 i = 1, j = 4; i < 14; i += 1, j += 4)
{
rdk[j + 0] =
td0[te1[(rdk[j + 0] >> 24) & 0xff] & 0xff] ^
@@ -1046,24 +1046,24 @@ static void AES256_InvertKey (uint *rdk)
}
}
static void AES256_encrypt (const uint *in, uint *out, const uint *rek)
static void AES256_encrypt (const u32 *in, u32 *out, const u32 *rek)
{
uint in_s[4];
u32 in_s[4];
in_s[0] = byte_swap_32 (in[0]);
in_s[1] = byte_swap_32 (in[1]);
in_s[2] = byte_swap_32 (in[2]);
in_s[3] = byte_swap_32 (in[3]);
uint s0 = in_s[0] ^ rek[0];
uint s1 = in_s[1] ^ rek[1];
uint s2 = in_s[2] ^ rek[2];
uint s3 = in_s[3] ^ rek[3];
u32 s0 = in_s[0] ^ rek[0];
u32 s1 = in_s[1] ^ rek[1];
u32 s2 = in_s[2] ^ rek[2];
u32 s3 = in_s[3] ^ rek[3];
uint t0;
uint t1;
uint t2;
uint t3;
u32 t0;
u32 t1;
u32 t2;
u32 t3;
t0 = te0[s0 >> 24] ^ te1[(s1 >> 16) & 0xff] ^ te2[(s2 >> 8) & 0xff] ^ te3[s3 & 0xff] ^ rek[ 4];
t1 = te0[s1 >> 24] ^ te1[(s2 >> 16) & 0xff] ^ te2[(s3 >> 8) & 0xff] ^ te3[s0 & 0xff] ^ rek[ 5];
@@ -1148,24 +1148,24 @@ static void AES256_encrypt (const uint *in, uint *out, const uint *rek)
out[3] = byte_swap_32 (out[3]);
}
static void AES256_decrypt (const uint *in, uint *out, const uint *rdk)
static void AES256_decrypt (const u32 *in, u32 *out, const u32 *rdk)
{
uint in_s[4];
u32 in_s[4];
in_s[0] = byte_swap_32 (in[0]);
in_s[1] = byte_swap_32 (in[1]);
in_s[2] = byte_swap_32 (in[2]);
in_s[3] = byte_swap_32 (in[3]);
uint s0 = in_s[0] ^ rdk[0];
uint s1 = in_s[1] ^ rdk[1];
uint s2 = in_s[2] ^ rdk[2];
uint s3 = in_s[3] ^ rdk[3];
u32 s0 = in_s[0] ^ rdk[0];
u32 s1 = in_s[1] ^ rdk[1];
u32 s2 = in_s[2] ^ rdk[2];
u32 s3 = in_s[3] ^ rdk[3];
uint t0;
uint t1;
uint t2;
uint t3;
u32 t0;
u32 t1;
u32 t2;
u32 t3;
t0 = td0[s0 >> 24] ^ td1[(s3 >> 16) & 0xff] ^ td2[(s2 >> 8) & 0xff] ^ td3[s1 & 0xff] ^ rdk[ 4];
t1 = td0[s1 >> 24] ^ td1[(s0 >> 16) & 0xff] ^ td2[(s3 >> 8) & 0xff] ^ td3[s2 & 0xff] ^ rdk[ 5];
@@ -1252,58 +1252,58 @@ static void AES256_decrypt (const uint *in, uint *out, const uint *rdk)
// wrappers
void AES_set_encrypt_key (unsigned char *key, int keysize, AES_KEY *aes_key)
void AES_set_encrypt_key (const u8 *key, int keysize, AES_KEY *aes_key)
{
aes_key->bits = keysize;
if (aes_key->bits == 128)
{
AES128_ExpandKey ((const uint *) key, aes_key->rek);
AES128_ExpandKey ((const u32 *) key, aes_key->rek);
}
else if (aes_key->bits == 256)
{
AES256_ExpandKey ((const uint *) key, aes_key->rek);
AES256_ExpandKey ((const u32 *) key, aes_key->rek);
}
}
void AES_set_decrypt_key (unsigned char *key, int keysize, AES_KEY *aes_key)
void AES_set_decrypt_key (const u8 *key, int keysize, AES_KEY *aes_key)
{
aes_key->bits = keysize;
if (aes_key->bits == 128)
{
AES128_ExpandKey ((const uint *) key, aes_key->rdk);
AES128_ExpandKey ((const u32 *) key, aes_key->rdk);
AES128_InvertKey (aes_key->rdk);
}
else if (aes_key->bits == 256)
{
AES256_ExpandKey ((const uint *) key, aes_key->rdk);
AES256_ExpandKey ((const u32 *) key, aes_key->rdk);
AES256_InvertKey (aes_key->rdk);
}
}
void AES_encrypt (AES_KEY *aes_key, char *input, char *output)
void AES_encrypt (AES_KEY *aes_key, const u8 *input, u8 *output)
{
if (aes_key->bits == 128)
{
AES128_encrypt ((const uint *) input, (uint *) output, aes_key->rek);
AES128_encrypt ((const u32 *) input, (u32 *) output, aes_key->rek);
}
else if (aes_key->bits == 256)
{
AES256_encrypt ((const uint *) input, (uint *) output, aes_key->rek);
AES256_encrypt ((const u32 *) input, (u32 *) output, aes_key->rek);
}
}
void AES_decrypt (AES_KEY *aes_key, char *input, char *output)
void AES_decrypt (AES_KEY *aes_key, const u8 *input, u8 *output)
{
if (aes_key->bits == 128)
{
AES128_decrypt ((const uint *) input, (uint *) output, aes_key->rdk);
AES128_decrypt ((const u32 *) input, (u32 *) output, aes_key->rdk);
}
else if (aes_key->bits == 256)
{
AES256_decrypt ((const uint *) input, (uint *) output, aes_key->rdk);
AES256_decrypt ((const u32 *) input, (u32 *) output, aes_key->rdk);
}
}
+7 -7
View File
@@ -9,19 +9,19 @@
/* AES context. */
typedef struct aes_context
{
uint bits;
u32 bits;
uint rek[60];
uint rdk[60];
u32 rek[60];
u32 rdk[60];
} aes_context_t;
typedef aes_context_t aes_ctx;
#define AES_KEY aes_ctx
void AES_set_encrypt_key (unsigned char *key, int keysize, AES_KEY *aes_key);
void AES_set_decrypt_key (unsigned char *key, int keysize, AES_KEY *aes_key);
void AES_encrypt (AES_KEY *aes_key, char *input, char *output);
void AES_decrypt (AES_KEY *aes_key, char *input, char *output);
void AES_set_encrypt_key (const u8 *key, int keysize, AES_KEY *aes_key);
void AES_set_decrypt_key (const u8 *key, int keysize, AES_KEY *aes_key);
void AES_encrypt (AES_KEY *aes_key, const u8 *input, u8 *output);
void AES_decrypt (AES_KEY *aes_key, const u8 *input, u8 *output);
#endif
+34 -34
View File
@@ -3,7 +3,7 @@
* License.....: MIT
*/
static const uint c_SPtrans[8][64] =
static const u32 c_SPtrans[8][64] =
{
{
/* nibble 0 */
@@ -159,7 +159,7 @@ static const uint c_SPtrans[8][64] =
},
};
static const uint c_skb[8][64] =
static const u32 c_skb[8][64] =
{
{
/* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
@@ -353,12 +353,12 @@ static const uint c_skb[8][64] =
PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \
}
void _des_keysetup (uint data[2], uint Kc[16], uint Kd[16], const uint s_skb[8][64])
void _des_keysetup (u32 data[2], u32 Kc[16], u32 Kd[16], const u32 s_skb[8][64])
{
uint c = data[0];
uint d = data[1];
u32 c = data[0];
u32 d = data[1];
uint tt;
u32 tt;
PERM_OP (d, c, tt, 4, 0x0f0f0f0f);
HPERM_OP (c, tt, 2, 0xcccc0000);
@@ -378,8 +378,8 @@ void _des_keysetup (uint data[2], uint Kc[16], uint Kd[16], const uint s_skb[8][
for (i = 0; i < 16; i++)
{
const uint shifts3s0[16] = { 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 };
const uint shifts3s1[16] = { 27, 27, 26, 26, 26, 26, 26, 26, 27, 26, 26, 26, 26, 26, 26, 27 };
const u32 shifts3s0[16] = { 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 };
const u32 shifts3s1[16] = { 27, 27, 26, 26, 26, 26, 26, 26, 27, 26, 26, 26, 26, 26, 26, 27 };
c = c >> shifts3s0[i] | c << shifts3s1[i];
d = d >> shifts3s0[i] | d << shifts3s1[i];
@@ -389,48 +389,48 @@ void _des_keysetup (uint data[2], uint Kc[16], uint Kd[16], const uint s_skb[8][
#define BOX(v,i,S) (S)[(i)][(v)]
uint s = BOX ((( c >> 0) & 0x3f), 0, s_skb)
| BOX ((((c >> 6) & 0x03)
| ((c >> 7) & 0x3c)), 1, s_skb)
| BOX ((((c >> 13) & 0x0f)
| ((c >> 14) & 0x30)), 2, s_skb)
| BOX ((((c >> 20) & 0x01)
| ((c >> 21) & 0x06)
| ((c >> 22) & 0x38)), 3, s_skb);
u32 s = BOX ((( c >> 0) & 0x3f), 0, s_skb)
| BOX ((((c >> 6) & 0x03)
| ((c >> 7) & 0x3c)), 1, s_skb)
| BOX ((((c >> 13) & 0x0f)
| ((c >> 14) & 0x30)), 2, s_skb)
| BOX ((((c >> 20) & 0x01)
| ((c >> 21) & 0x06)
| ((c >> 22) & 0x38)), 3, s_skb);
uint t = BOX ((( d >> 0) & 0x3f), 4, s_skb)
| BOX ((((d >> 7) & 0x03)
| ((d >> 8) & 0x3c)), 5, s_skb)
| BOX ((((d >> 15) & 0x3f)), 6, s_skb)
| BOX ((((d >> 21) & 0x0f)
| ((d >> 22) & 0x30)), 7, s_skb);
u32 t = BOX ((( d >> 0) & 0x3f), 4, s_skb)
| BOX ((((d >> 7) & 0x03)
| ((d >> 8) & 0x3c)), 5, s_skb)
| BOX ((((d >> 15) & 0x3f)), 6, s_skb)
| BOX ((((d >> 21) & 0x0f)
| ((d >> 22) & 0x30)), 7, s_skb);
Kc[i] = ((t << 16) | (s & 0x0000ffff));
Kd[i] = ((s >> 16) | (t & 0xffff0000));
Kc[i] = ROTATE_LEFT (Kc[i], 2u);
Kd[i] = ROTATE_LEFT (Kd[i], 2u);
Kc[i] = rotl32 (Kc[i], 2u);
Kd[i] = rotl32 (Kd[i], 2u);
}
}
void _des_encrypt (uint data[2], uint Kc[16], uint Kd[16], const uint s_SPtrans[8][64])
void _des_encrypt (u32 data[2], u32 Kc[16], u32 Kd[16], const u32 s_SPtrans[8][64])
{
uint r = data[0];
uint l = data[1];
u32 r = data[0];
u32 l = data[1];
uint tt;
u32 tt;
IP (r, l, tt);
r = ROTATE_LEFT (r, 3u);
l = ROTATE_LEFT (l, 3u);
r = rotl32 (r, 3u);
l = rotl32 (l, 3u);
int i;
for (i = 0; i < 16; i++)
{
uint u = Kc[i] ^ r;
uint t = Kd[i] ^ ROTATE_LEFT (r, 28u);
u32 u = Kc[i] ^ r;
u32 t = Kd[i] ^ rotl32 (r, 28u);
l ^= BOX (((u >> 2) & 0x3f), 0, s_SPtrans)
| BOX (((u >> 10) & 0x3f), 2, s_SPtrans)
@@ -446,8 +446,8 @@ void _des_encrypt (uint data[2], uint Kc[16], uint Kd[16], const uint s_SPtrans[
r = tt;
}
l = ROTATE_LEFT (l, 29u);
r = ROTATE_LEFT (r, 29u);
l = rotl32 (l, 29u);
r = rotl32 (r, 29u);
FP (r, l, tt);
+2 -2
View File
@@ -11,7 +11,7 @@
#include "common.h"
#include "rp_kernel.h"
uint apply_rule (const uint name, const uint p0, const uint p1, uint32_t buf0[4], uint32_t buf1[4], const uint in_len);
uint apply_rules (uint *cmds, uint32_t buf0[4], uint32_t buf1[4], const uint len);
u32 apply_rule (const u32 name, const u32 p0, const u32 p1, u32 buf0[4], u32 buf1[4], const u32 in_len);
u32 apply_rules (u32 *cmds, u32 buf0[4], u32 buf1[4], const u32 len);
#endif
+388 -398
View File
@@ -137,7 +137,6 @@ extern const char *VERSION_TXT;
extern const uint VERSION_BIN;
extern const uint RESTORE_MIN;
extern const char *EULA_TXT[];
extern const char *USAGE_MINI[];
extern const char *USAGE_BIG[];
@@ -1126,75 +1125,75 @@ extern hc_thread_mutex_t mux_display;
#define HASH_TYPE_BSDICRYPT 48
#define HASH_TYPE_RAR3HP 49
#define KERN_TYPE_MD5 0
#define KERN_TYPE_MD5_PWSLT 10
#define KERN_TYPE_MD5_SLTPW 20
#define KERN_TYPE_MD5_PWUSLT 30
#define KERN_TYPE_MD5_SLTPWU 40
#define KERN_TYPE_HMACMD5_PW 50
#define KERN_TYPE_HMACMD5_SLT 60
#define KERN_TYPE_SHA1 100
#define KERN_TYPE_SHA1_PWSLT 110
#define KERN_TYPE_SHA1_SLTPW 120
#define KERN_TYPE_SHA1_PWUSLT 130
#define KERN_TYPE_SHA1_SLTPWU 140
#define KERN_TYPE_HMACSHA1_PW 150
#define KERN_TYPE_HMACSHA1_SLT 160
#define KERN_TYPE_SHA1_LINKEDIN 190
#define KERN_TYPE_MYSQL 200
#define KERN_TYPE_MYSQL41 300
#define KERN_TYPE_PHPASS 400
#define KERN_TYPE_MD5CRYPT 500
#define KERN_TYPE_MD4 900
#define KERN_TYPE_MD4_PWU 1000
#define KERN_TYPE_MD44_PWUSLT 1100
#define KERN_TYPE_SHA256 1400
#define KERN_TYPE_SHA256_PWSLT 1410
#define KERN_TYPE_SHA256_SLTPW 1420
#define KERN_TYPE_SHA256_PWUSLT 1430
#define KERN_TYPE_SHA256_SLTPWU 1440
#define KERN_TYPE_HMACSHA256_PW 1450
#define KERN_TYPE_HMACSHA256_SLT 1460
#define KERN_TYPE_DESCRYPT 1500
#define KERN_TYPE_APR1CRYPT 1600
#define KERN_TYPE_SHA512 1700
#define KERN_TYPE_SHA512_PWSLT 1710
#define KERN_TYPE_SHA512_SLTPW 1720
#define KERN_TYPE_SHA512_PWSLTU 1730
#define KERN_TYPE_SHA512_SLTPWU 1740
#define KERN_TYPE_HMACSHA512_PW 1750
#define KERN_TYPE_HMACSHA512_SLT 1760
#define KERN_TYPE_SHA512CRYPT 1800
#define KERN_TYPE_DCC2 2100
#define KERN_TYPE_MD5PIX 2400
#define KERN_TYPE_MD5ASA 2410
#define KERN_TYPE_WPA 2500
#define KERN_TYPE_MD55 2600
#define KERN_TYPE_MD55_PWSLT1 2610
#define KERN_TYPE_MD55_PWSLT2 2710
#define KERN_TYPE_MD55_SLTPW 2810
#define KERN_TYPE_LM 3000
#define KERN_TYPE_ORACLEH 3100
#define KERN_TYPE_BCRYPT 3200
#define KERN_TYPE_MD5_SLT_MD5_PW 3710
#define KERN_TYPE_MD5_SLT_PW_SLT 3800
#define KERN_TYPE_MD5U5 4300
#define KERN_TYPE_MD5U5_PWSLT1 4310
#define KERN_TYPE_MD5_SHA1 4400
#define KERN_TYPE_SHA11 4500
#define KERN_TYPE_SHA1_MD5 4700
#define KERN_TYPE_MD5_CHAP 4800
#define KERN_TYPE_SHA1_SLT_PW_SLT 4900
#define KERN_TYPE_KECCAK 5000
#define KERN_TYPE_MD5H 5100
#define KERN_TYPE_PSAFE3 5200
#define KERN_TYPE_IKEPSK_MD5 5300
#define KERN_TYPE_IKEPSK_SHA1 5400
#define KERN_TYPE_NETNTLMv1 5500
#define KERN_TYPE_NETNTLMv2 5600
#define KERN_TYPE_ANDROIDPIN 5800
#define KERN_TYPE_RIPEMD160 6000
#define KERN_TYPE_WHIRLPOOL 6100
#define KERN_TYPE_MD5 0
#define KERN_TYPE_MD5_PWSLT 10
#define KERN_TYPE_MD5_SLTPW 20
#define KERN_TYPE_MD5_PWUSLT 30
#define KERN_TYPE_MD5_SLTPWU 40
#define KERN_TYPE_HMACMD5_PW 50
#define KERN_TYPE_HMACMD5_SLT 60
#define KERN_TYPE_SHA1 100
#define KERN_TYPE_SHA1_PWSLT 110
#define KERN_TYPE_SHA1_SLTPW 120
#define KERN_TYPE_SHA1_PWUSLT 130
#define KERN_TYPE_SHA1_SLTPWU 140
#define KERN_TYPE_HMACSHA1_PW 150
#define KERN_TYPE_HMACSHA1_SLT 160
#define KERN_TYPE_SHA1_LINKEDIN 190
#define KERN_TYPE_MYSQL 200
#define KERN_TYPE_MYSQL41 300
#define KERN_TYPE_PHPASS 400
#define KERN_TYPE_MD5CRYPT 500
#define KERN_TYPE_MD4 900
#define KERN_TYPE_MD4_PWU 1000
#define KERN_TYPE_MD44_PWUSLT 1100
#define KERN_TYPE_SHA256 1400
#define KERN_TYPE_SHA256_PWSLT 1410
#define KERN_TYPE_SHA256_SLTPW 1420
#define KERN_TYPE_SHA256_PWUSLT 1430
#define KERN_TYPE_SHA256_SLTPWU 1440
#define KERN_TYPE_HMACSHA256_PW 1450
#define KERN_TYPE_HMACSHA256_SLT 1460
#define KERN_TYPE_DESCRYPT 1500
#define KERN_TYPE_APR1CRYPT 1600
#define KERN_TYPE_SHA512 1700
#define KERN_TYPE_SHA512_PWSLT 1710
#define KERN_TYPE_SHA512_SLTPW 1720
#define KERN_TYPE_SHA512_PWSLTU 1730
#define KERN_TYPE_SHA512_SLTPWU 1740
#define KERN_TYPE_HMACSHA512_PW 1750
#define KERN_TYPE_HMACSHA512_SLT 1760
#define KERN_TYPE_SHA512CRYPT 1800
#define KERN_TYPE_DCC2 2100
#define KERN_TYPE_MD5PIX 2400
#define KERN_TYPE_MD5ASA 2410
#define KERN_TYPE_WPA 2500
#define KERN_TYPE_MD55 2600
#define KERN_TYPE_MD55_PWSLT1 2610
#define KERN_TYPE_MD55_PWSLT2 2710
#define KERN_TYPE_MD55_SLTPW 2810
#define KERN_TYPE_LM 3000
#define KERN_TYPE_ORACLEH 3100
#define KERN_TYPE_BCRYPT 3200
#define KERN_TYPE_MD5_SLT_MD5_PW 3710
#define KERN_TYPE_MD5_SLT_PW_SLT 3800
#define KERN_TYPE_MD5U5 4300
#define KERN_TYPE_MD5U5_PWSLT1 4310
#define KERN_TYPE_MD5_SHA1 4400
#define KERN_TYPE_SHA11 4500
#define KERN_TYPE_SHA1_MD5 4700
#define KERN_TYPE_MD5_CHAP 4800
#define KERN_TYPE_SHA1_SLT_PW_SLT 4900
#define KERN_TYPE_KECCAK 5000
#define KERN_TYPE_MD5H 5100
#define KERN_TYPE_PSAFE3 5200
#define KERN_TYPE_IKEPSK_MD5 5300
#define KERN_TYPE_IKEPSK_SHA1 5400
#define KERN_TYPE_NETNTLMv1 5500
#define KERN_TYPE_NETNTLMv2 5600
#define KERN_TYPE_ANDROIDPIN 5800
#define KERN_TYPE_RIPEMD160 6000
#define KERN_TYPE_WHIRLPOOL 6100
#define KERN_TYPE_TCRIPEMD160_XTS512 6211
#define KERN_TYPE_TCRIPEMD160_XTS1024 6212
#define KERN_TYPE_TCRIPEMD160_XTS1536 6213
@@ -1204,72 +1203,72 @@ extern hc_thread_mutex_t mux_display;
#define KERN_TYPE_TCWHIRLPOOL_XTS512 6231
#define KERN_TYPE_TCWHIRLPOOL_XTS1024 6232
#define KERN_TYPE_TCWHIRLPOOL_XTS1536 6233
#define KERN_TYPE_MD5AIX 6300
#define KERN_TYPE_SHA256AIX 6400
#define KERN_TYPE_SHA512AIX 6500
#define KERN_TYPE_AGILEKEY 6600
#define KERN_TYPE_SHA1AIX 6700
#define KERN_TYPE_LASTPASS 6800
#define KERN_TYPE_GOST 6900
#define KERN_TYPE_PBKDF2_SHA512 7100
#define KERN_TYPE_RAKP 7300
#define KERN_TYPE_SHA256CRYPT 7400
#define KERN_TYPE_KRB5PA 7500
#define KERN_TYPE_SHA1_SLT_SHA1_PW 7600
#define KERN_TYPE_SAPB 7700
#define KERN_TYPE_SAPG 7800
#define KERN_TYPE_DRUPAL7 7900
#define KERN_TYPE_SYBASEASE 8000
#define KERN_TYPE_NETSCALER 8100
#define KERN_TYPE_CLOUDKEY 8200
#define KERN_TYPE_NSEC3 8300
#define KERN_TYPE_WBB3 8400
#define KERN_TYPE_RACF 8500
#define KERN_TYPE_LOTUS5 8600
#define KERN_TYPE_LOTUS6 8700
#define KERN_TYPE_ANDROIDFDE 8800
#define KERN_TYPE_SCRYPT 8900
#define KERN_TYPE_PSAFE2 9000
#define KERN_TYPE_LOTUS8 9100
#define KERN_TYPE_OFFICE2007 9400
#define KERN_TYPE_OFFICE2010 9500
#define KERN_TYPE_OFFICE2013 9600
#define KERN_TYPE_OLDOFFICE01 9700
#define KERN_TYPE_OLDOFFICE01CM1 9710
#define KERN_TYPE_OLDOFFICE01CM2 9720
#define KERN_TYPE_OLDOFFICE34 9800
#define KERN_TYPE_OLDOFFICE34CM1 9810
#define KERN_TYPE_OLDOFFICE34CM2 9820
#define KERN_TYPE_RADMIN2 9900
#define KERN_TYPE_SIPHASH 10100
#define KERN_TYPE_SAPH_SHA1 10300
#define KERN_TYPE_PDF11 10400
#define KERN_TYPE_PDF11CM1 10410
#define KERN_TYPE_PDF11CM2 10420
#define KERN_TYPE_PDF14 10500
#define KERN_TYPE_PDF17L8 10700
#define KERN_TYPE_SHA384 10800
#define KERN_TYPE_PBKDF2_SHA256 10900
#define KERN_TYPE_PRESTASHOP 11000
#define KERN_TYPE_POSTGRESQL_AUTH 11100
#define KERN_TYPE_MYSQL_AUTH 11200
#define KERN_TYPE_BITCOIN_WALLET 11300
#define KERN_TYPE_SIP_AUTH 11400
#define KERN_TYPE_CRC32 11500
#define KERN_TYPE_SEVEN_ZIP 11600
#define KERN_TYPE_MD5AIX 6300
#define KERN_TYPE_SHA256AIX 6400
#define KERN_TYPE_SHA512AIX 6500
#define KERN_TYPE_AGILEKEY 6600
#define KERN_TYPE_SHA1AIX 6700
#define KERN_TYPE_LASTPASS 6800
#define KERN_TYPE_GOST 6900
#define KERN_TYPE_PBKDF2_SHA512 7100
#define KERN_TYPE_RAKP 7300
#define KERN_TYPE_SHA256CRYPT 7400
#define KERN_TYPE_KRB5PA 7500
#define KERN_TYPE_SHA1_SLT_SHA1_PW 7600
#define KERN_TYPE_SAPB 7700
#define KERN_TYPE_SAPG 7800
#define KERN_TYPE_DRUPAL7 7900
#define KERN_TYPE_SYBASEASE 8000
#define KERN_TYPE_NETSCALER 8100
#define KERN_TYPE_CLOUDKEY 8200
#define KERN_TYPE_NSEC3 8300
#define KERN_TYPE_WBB3 8400
#define KERN_TYPE_RACF 8500
#define KERN_TYPE_LOTUS5 8600
#define KERN_TYPE_LOTUS6 8700
#define KERN_TYPE_ANDROIDFDE 8800
#define KERN_TYPE_SCRYPT 8900
#define KERN_TYPE_PSAFE2 9000
#define KERN_TYPE_LOTUS8 9100
#define KERN_TYPE_OFFICE2007 9400
#define KERN_TYPE_OFFICE2010 9500
#define KERN_TYPE_OFFICE2013 9600
#define KERN_TYPE_OLDOFFICE01 9700
#define KERN_TYPE_OLDOFFICE01CM1 9710
#define KERN_TYPE_OLDOFFICE01CM2 9720
#define KERN_TYPE_OLDOFFICE34 9800
#define KERN_TYPE_OLDOFFICE34CM1 9810
#define KERN_TYPE_OLDOFFICE34CM2 9820
#define KERN_TYPE_RADMIN2 9900
#define KERN_TYPE_SIPHASH 10100
#define KERN_TYPE_SAPH_SHA1 10300
#define KERN_TYPE_PDF11 10400
#define KERN_TYPE_PDF11CM1 10410
#define KERN_TYPE_PDF11CM2 10420
#define KERN_TYPE_PDF14 10500
#define KERN_TYPE_PDF17L8 10700
#define KERN_TYPE_SHA384 10800
#define KERN_TYPE_PBKDF2_SHA256 10900
#define KERN_TYPE_PRESTASHOP 11000
#define KERN_TYPE_POSTGRESQL_AUTH 11100
#define KERN_TYPE_MYSQL_AUTH 11200
#define KERN_TYPE_BITCOIN_WALLET 11300
#define KERN_TYPE_SIP_AUTH 11400
#define KERN_TYPE_CRC32 11500
#define KERN_TYPE_SEVEN_ZIP 11600
#define KERN_TYPE_GOST_2012SBOG_256 11700
#define KERN_TYPE_GOST_2012SBOG_512 11800
#define KERN_TYPE_PBKDF2_MD5 11900
#define KERN_TYPE_PBKDF2_SHA1 12000
#define KERN_TYPE_ECRYPTFS 12200
#define KERN_TYPE_ORACLET 12300
#define KERN_TYPE_BSDICRYPT 12400
#define KERN_TYPE_RAR3 12500
#define KERN_TYPE_CF10 12600
#define KERN_TYPE_MYWALLET 12700
#define KERN_TYPE_MS_DRSR 12800
#define KERN_TYPE_PBKDF2_MD5 11900
#define KERN_TYPE_PBKDF2_SHA1 12000
#define KERN_TYPE_ECRYPTFS 12200
#define KERN_TYPE_ORACLET 12300
#define KERN_TYPE_BSDICRYPT 12400
#define KERN_TYPE_RAR3 12500
#define KERN_TYPE_CF10 12600
#define KERN_TYPE_MYWALLET 12700
#define KERN_TYPE_MS_DRSR 12800
#define KERN_TYPE_ANDROIDFDE_SAMSUNG 12900
#define KERN_TYPE_RAR5 13000
#define KERN_TYPE_RAR5 13000
/**
* signatures
@@ -1344,52 +1343,52 @@ extern hc_thread_mutex_t mux_display;
* Default iteration numbers
*/
#define ROUNDS_PHPASS (1 << 11) // $P$B
#define ROUNDS_DCC2 10240
#define ROUNDS_WPA2 4096
#define ROUNDS_BCRYPT (1 << 5)
#define ROUNDS_PSAFE3 2048
#define ROUNDS_ANDROIDPIN 1024
#define ROUNDS_TRUECRYPT_1K 1000
#define ROUNDS_TRUECRYPT_2K 2000
#define ROUNDS_SHA1AIX (1 << 6)
#define ROUNDS_SHA256AIX (1 << 6)
#define ROUNDS_SHA512AIX (1 << 6)
#define ROUNDS_MD5CRYPT 1000
#define ROUNDS_SHA256CRYPT 5000
#define ROUNDS_SHA512CRYPT 5000
#define ROUNDS_GRUB 10000
#define ROUNDS_SHA512OSX 35000
#define ROUNDS_AGILEKEY 1000
#define ROUNDS_LASTPASS 500
#define ROUNDS_DRUPAL7 (1 << 14) // $S$C
#define ROUNDS_CLOUDKEY 40000
#define ROUNDS_NSEC3 1
#define ROUNDS_ANDROIDFDE 2000
#define ROUNDS_PSAFE2 1000
#define ROUNDS_LOTUS8 5000
#define ROUNDS_CISCO8 20000
#define ROUNDS_OFFICE2007 50000
#define ROUNDS_OFFICE2010 100000
#define ROUNDS_OFFICE2013 100000
#define ROUNDS_DJANGOPBKDF2 20000
#define ROUNDS_SAPH_SHA1 1024
#define ROUNDS_PDF14 (50 + 20)
#define ROUNDS_PDF17L8 64
#define ROUNDS_PBKDF2_SHA256 1000
#define ROUNDS_BITCOIN_WALLET 200000
#define ROUNDS_SEVEN_ZIP (1 << 19)
#define ROUNDS_PBKDF2_MD5 1000
#define ROUNDS_PBKDF2_SHA1 1000
#define ROUNDS_PBKDF2_SHA512 1000
#define ROUNDS_ECRYPTFS 65536
#define ROUNDS_ORACLET 4096
#define ROUNDS_BSDICRYPT 2900
#define ROUNDS_RAR3 262144
#define ROUNDS_MYWALLET 10
#define ROUNDS_MS_DRSR 100
#define ROUNDS_PHPASS (1 << 11) // $P$B
#define ROUNDS_DCC2 10240
#define ROUNDS_WPA2 4096
#define ROUNDS_BCRYPT (1 << 5)
#define ROUNDS_PSAFE3 2048
#define ROUNDS_ANDROIDPIN 1024
#define ROUNDS_TRUECRYPT_1K 1000
#define ROUNDS_TRUECRYPT_2K 2000
#define ROUNDS_SHA1AIX (1 << 6)
#define ROUNDS_SHA256AIX (1 << 6)
#define ROUNDS_SHA512AIX (1 << 6)
#define ROUNDS_MD5CRYPT 1000
#define ROUNDS_SHA256CRYPT 5000
#define ROUNDS_SHA512CRYPT 5000
#define ROUNDS_GRUB 10000
#define ROUNDS_SHA512OSX 35000
#define ROUNDS_AGILEKEY 1000
#define ROUNDS_LASTPASS 500
#define ROUNDS_DRUPAL7 (1 << 14) // $S$C
#define ROUNDS_CLOUDKEY 40000
#define ROUNDS_NSEC3 1
#define ROUNDS_ANDROIDFDE 2000
#define ROUNDS_PSAFE2 1000
#define ROUNDS_LOTUS8 5000
#define ROUNDS_CISCO8 20000
#define ROUNDS_OFFICE2007 50000
#define ROUNDS_OFFICE2010 100000
#define ROUNDS_OFFICE2013 100000
#define ROUNDS_DJANGOPBKDF2 20000
#define ROUNDS_SAPH_SHA1 1024
#define ROUNDS_PDF14 (50 + 20)
#define ROUNDS_PDF17L8 64
#define ROUNDS_PBKDF2_SHA256 1000
#define ROUNDS_BITCOIN_WALLET 200000
#define ROUNDS_SEVEN_ZIP (1 << 19)
#define ROUNDS_PBKDF2_MD5 1000
#define ROUNDS_PBKDF2_SHA1 1000
#define ROUNDS_PBKDF2_SHA512 1000
#define ROUNDS_ECRYPTFS 65536
#define ROUNDS_ORACLET 4096
#define ROUNDS_BSDICRYPT 2900
#define ROUNDS_RAR3 262144
#define ROUNDS_MYWALLET 10
#define ROUNDS_MS_DRSR 100
#define ROUNDS_ANDROIDFDE_SAMSUNG 4096
#define ROUNDS_RAR5 (1 << 15)
#define ROUNDS_RAR5 (1 << 15)
/**
* salt types
@@ -1480,9 +1479,9 @@ extern hc_thread_mutex_t mux_display;
#define DGST_SIZE_4_16 (16 * sizeof (uint)) // 64 !!!
#define DGST_SIZE_4_32 (32 * sizeof (uint)) // 128 !!!
#define DGST_SIZE_4_64 (64 * sizeof (uint)) // 256
#define DGST_SIZE_8_8 (8 * sizeof (uint64_t)) // 64 !!!
#define DGST_SIZE_8_16 (16 * sizeof (uint64_t)) // 128 !!!
#define DGST_SIZE_8_25 (25 * sizeof (uint64_t)) // 200
#define DGST_SIZE_8_8 (8 * sizeof (u64)) // 64 !!!
#define DGST_SIZE_8_16 (16 * sizeof (u64)) // 128 !!!
#define DGST_SIZE_8_25 (25 * sizeof (u64)) // 200
/**
* parser
@@ -1570,65 +1569,62 @@ extern hc_thread_mutex_t mux_display;
* functions
*/
#define ROTATE_LEFT(a,n) rotl32 ((a), (n))
#define ROTATE_RIGHT(a,n) rotr32 ((a), (n))
u32 rotl32 (const u32 a, const u32 n);
u32 rotr32 (const u32 a, const u32 n);
u64 rotl64 (const u64 a, const u64 n);
u64 rotr64 (const u64 a, const u64 n);
uint32_t rotl32 (const uint32_t a, const uint n);
uint32_t rotr32 (const uint32_t a, const uint n);
uint64_t rotl64 (const uint64_t a, const uint n);
uint64_t rotr64 (const uint64_t a, const uint n);
u32 byte_swap_32 (const u32 n);
u64 byte_swap_64 (const u64 n);
void dump_hex (const char *s, size_t size);
u8 hex_convert (const u8 c);
u8 hex_to_u8 (const u8 hex[2]);
u32 hex_to_u32 (const u8 hex[8]);
u64 hex_to_u64 (const u8 hex[16]);
void truecrypt_crc32 (char *file, unsigned char keytab[64]);
void dump_hex (const u8 *s, const int sz);
void truecrypt_crc32 (const char *filename, u8 keytab[64]);
char *get_exec_path ();
char *get_install_dir (const char *progname);
char *get_profile_dir (const char *homedir);
char *get_session_dir (const char *profile_dir);
uint get_vliw_by_compute_capability (const uint major, const uint minor);
uint get_vliw_by_device_name (const char *device_name);
void *rulefind (const void *key, void *base, int nmemb, size_t size, int (*compar) (const void *, const void *));
int sort_by_mtime (const void *p1, const void *p2);
int sort_by_cpu_rule (const void *p1, const void *p2);
int sort_by_kernel_rule (const void *p1, const void *p2);
int sort_by_stringptr (const void *p1, const void *p2);
int sort_by_dictstat (const void *s1, const void *s2);
int sort_by_bitmap (const void *s1, const void *s2);
int sort_by_mtime (const void *p1, const void *p2);
int sort_by_cpu_rule (const void *p1, const void *p2);
int sort_by_kernel_rule (const void *p1, const void *p2);
int sort_by_stringptr (const void *p1, const void *p2);
int sort_by_dictstat (const void *s1, const void *s2);
int sort_by_bitmap (const void *s1, const void *s2);
int sort_by_pot (const void *v1, const void *v2);
int sort_by_hash (const void *v1, const void *v2);
int sort_by_hash_no_salt(const void *v1, const void *v2);
int sort_by_salt (const void *v1, const void *v2);
int sort_by_salt_buf (const void *v1, const void *v2);
int sort_by_hash_t_salt (const void *v1, const void *v2);
int sort_by_digest_4_2 (const void *v1, const void *v2);
int sort_by_digest_4_4 (const void *v1, const void *v2);
int sort_by_digest_4_5 (const void *v1, const void *v2);
int sort_by_digest_4_6 (const void *v1, const void *v2);
int sort_by_digest_4_8 (const void *v1, const void *v2);
int sort_by_digest_4_16 (const void *v1, const void *v2);
int sort_by_digest_4_32 (const void *v1, const void *v2);
int sort_by_digest_4_64 (const void *v1, const void *v2);
int sort_by_digest_8_8 (const void *v1, const void *v2);
int sort_by_digest_8_16 (const void *v1, const void *v2);
int sort_by_digest_8_25 (const void *v1, const void *v2);
int sort_by_digest_p0p1 (const void *v1, const void *v2);
int sort_by_pot (const void *v1, const void *v2);
int sort_by_hash (const void *v1, const void *v2);
int sort_by_hash_no_salt (const void *v1, const void *v2);
int sort_by_salt (const void *v1, const void *v2);
int sort_by_salt_buf (const void *v1, const void *v2);
int sort_by_hash_t_salt (const void *v1, const void *v2);
int sort_by_digest_4_2 (const void *v1, const void *v2);
int sort_by_digest_4_4 (const void *v1, const void *v2);
int sort_by_digest_4_5 (const void *v1, const void *v2);
int sort_by_digest_4_6 (const void *v1, const void *v2);
int sort_by_digest_4_8 (const void *v1, const void *v2);
int sort_by_digest_4_16 (const void *v1, const void *v2);
int sort_by_digest_4_32 (const void *v1, const void *v2);
int sort_by_digest_4_64 (const void *v1, const void *v2);
int sort_by_digest_8_8 (const void *v1, const void *v2);
int sort_by_digest_8_16 (const void *v1, const void *v2);
int sort_by_digest_8_25 (const void *v1, const void *v2);
int sort_by_digest_p0p1 (const void *v1, const void *v2);
// special version for hccap (last 2 uints should be skipped where the digest is located)
int sort_by_hash_t_salt_hccap (const void *v1, const void *v2);
char hex_convert (const char c);
char hex_to_char (const char hex[2]);
uint hex_to_uint (const char hex[8]);
uint64_t hex_to_uint64_t (const char hex[16]);
void format_debug (char * debug_file, uint debug_mode, unsigned char *orig_plain_ptr, uint orig_plain_len, unsigned char *mod_plain_ptr, uint mod_plain_len, char *rule_buf, int rule_len);
void format_plain (FILE *fp, unsigned char *plain_ptr, uint plain_len, uint outfile_autohex);
void format_output (FILE *out_fp, char *out_buf, unsigned char *plain_ptr, const uint plain_len, const uint64_t crackpos, unsigned char *username, const uint user_len);
void format_output (FILE *out_fp, char *out_buf, unsigned char *plain_ptr, const uint plain_len, const u64 crackpos, unsigned char *username, const uint user_len);
void handle_show_request (pot_t *pot, uint pot_cnt, char *input_buf, int input_len, hash_t *hashes_buf, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
void handle_left_request (pot_t *pot, uint pot_cnt, char *input_buf, int input_len, hash_t *hashes_buf, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
void handle_show_request_lm (pot_t *pot, uint pot_cnt, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
@@ -1638,18 +1634,18 @@ uint setup_opencl_platforms_filter (char *opencl_platforms);
uint devices_to_devicemask (char *opencl_devices);
cl_device_type setup_device_types_filter (char *opencl_device_types);
uint get_random_num (uint min, uint max);
u32 get_random_num (const u32 min, const u32 max);
uint32_t mydivc32 (const uint32_t dividend, const uint32_t divisor);
uint64_t mydivc64 (const uint64_t dividend, const uint64_t divisor);
u32 mydivc32 (const u32 dividend, const u32 divisor);
u64 mydivc64 (const u64 dividend, const u64 divisor);
void ascii_digest (char out_buf[1024], uint salt_pos, uint digest_pos);
void to_hccap_t (hccap_t *hccap, uint salt_pos, uint digest_pos);
void format_speed_display (float val, char *buf, size_t len);
void format_timer_display (struct tm *tm, char *buf, size_t len);
void lowercase (char *buf, int len);
void uppercase (char *buf, int len);
void lowercase (u8 *buf, int len);
void uppercase (u8 *buf, int len);
int fgetl (FILE *fp, char *line_buf);
int in_superchop (char *buf);
char **scan_directory (const char *path);
@@ -1682,14 +1678,14 @@ int hm_get_device_num (HM_LIB hm_dll_amd, HM_ADAPTER_AMD hm_adapter_index, int *
// void hm_get_opencl_busid_devid (hm_attrs_t *hm_device, uint opencl_num_devices, cl_device_id *devices);
int hm_get_adapter_index_amd (hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
int hm_get_adapter_index_amd (hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
LPAdapterInfo hm_get_adapter_info_amd (HM_LIB hm_dll_amd, int iNumberAdapters);
uint32_t *hm_get_list_valid_adl_adapters (int iNumberAdapters, int *num_adl_adapters, LPAdapterInfo lpAdapterInfo);
u32 *hm_get_list_valid_adl_adapters (int iNumberAdapters, int *num_adl_adapters, LPAdapterInfo lpAdapterInfo);
int hm_get_overdrive_version (HM_LIB hm_dll_amd, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
int hm_check_fanspeed_control (HM_LIB hm_dll_amd, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
int hm_get_overdrive_version (HM_LIB hm_dll_amd, hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
int hm_check_fanspeed_control (HM_LIB hm_dll_amd, hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
void hm_close (HM_LIB hm_dll);
@@ -1710,181 +1706,175 @@ uint set_kernel_accel (uint hash_mode);
uint set_kernel_loops (uint hash_mode);
void set_cpu_affinity (char *cpu_affinity);
void eula_print (const char *progname);
void usage_mini_print (const char *progname);
void usage_big_print (const char *progname);
void usage_big_print (const char *progname);
void mp_css_to_uniq_tbl (uint css_cnt, cs_t *css, uint uniq_tbls[SP_PW_MAX][CHARSIZ]);
void mp_cut_at (char *mask, uint max);
void mp_exec (uint64_t val, char *buf, cs_t *css, int css_cnt);
void mp_exec (u64 val, char *buf, cs_t *css, int css_cnt);
cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, uint *css_cnt);
uint64_t mp_get_sum (uint css_cnt, cs_t *css);
u64 mp_get_sum (uint css_cnt, cs_t *css);
void mp_setup_sys (cs_t *mp_sys);
void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, uint index);
void mp_reset_usr (cs_t *mp_usr, uint index);
char *mp_get_truncated_mask (char *mask_buf, size_t mask_len, uint len);
uint64_t sp_get_sum (uint start, uint stop, cs_t *root_css_buf);
void sp_exec (uint64_t ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, uint start, uint stop);
u64 sp_get_sum (uint start, uint stop, cs_t *root_css_buf);
void sp_exec (u64 ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, uint start, uint stop);
int sp_comp_val (const void *p1, const void *p2);
void sp_setup_tbl (const char *install_dir, char *hcstat, uint disable, uint classic, hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf);
void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf, cs_t *root_css_buf, cs_t *markov_css_buf, uint threshold, uint uniq_tbls[SP_PW_MAX][CHARSIZ]);
void sp_stretch_markov (hcstat_table_t *in, hcstat_table_t *out);
void sp_stretch_root (hcstat_table_t *in, hcstat_table_t *out);
uint byte_swap_32 (const uint n);
uint64_t byte_swap_64 (const uint64_t n);
char hex_convert (const char c);
int bcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cisco4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int dcc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int dcc2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int descrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int episerver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ipb2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int joomla_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int postgresql_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int netscreen_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int keccak_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lm_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md4s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5half_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5pix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5asa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5apr1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mssql2000_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mssql2005_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oracleh_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oracles_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oraclet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int osc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int osx1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int osx512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int phpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1linkedin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1b64_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha256s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha384_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int smf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int vb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int vb30_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int wpa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int psafe2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int psafe3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ikepsk_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ikepsk_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int androidpin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ripemd160_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int whirlpool_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int truecrypt_parse_hash_1k (char *input_buf, uint input_len, hash_t *hash_buf);
int truecrypt_parse_hash_2k (char *input_buf, uint input_len, hash_t *hash_buf);
int md5aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha256aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lastpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int gost_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha256crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mssql2012_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512osx_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int episerver4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512grub_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmacsha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmacsha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmacsha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmacmd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sapb_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sapg_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int drupal7_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sybasease_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mysql323_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int rakp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int netscaler_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int chap_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int wbb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int racf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lotus5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lotus6_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lotus8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmailserver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int phps_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mediawiki_b_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int peoplesoft_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int skype_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int scrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int juniper_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cisco8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cisco9_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int office2007_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int office2010_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int office2013_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice01_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice01cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice01cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice34_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice34cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice34cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int radmin2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int djangosha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int djangopbkdf2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int siphash_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int crammd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int saph_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int redmine_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf11_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf11cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf11cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf14_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf17l3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf17l8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pbkdf2_sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int prestashop_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int postgresql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mysql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int bitcoin_wallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int crc32_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int seven_zip_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int gost2012sbog_256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int gost2012sbog_512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pbkdf2_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pbkdf2_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pbkdf2_sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ecryptfs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int bsdicrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int rar3hp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int rar5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cf10_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mywallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ms_drsr_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int bcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cisco4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int dcc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int dcc2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int descrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int episerver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ipb2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int joomla_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int postgresql_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int netscreen_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int keccak_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lm_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md4s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5half_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5pix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5asa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5apr1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int md5crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mssql2000_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mssql2005_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oracleh_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oracles_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oraclet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int osc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int osx1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int osx512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int phpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1linkedin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1b64_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha256s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha384_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int smf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int vb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int vb30_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int wpa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int psafe2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int psafe3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ikepsk_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ikepsk_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int androidpin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ripemd160_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int whirlpool_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int truecrypt_parse_hash_1k (char *input_buf, uint input_len, hash_t *hash_buf);
int truecrypt_parse_hash_2k (char *input_buf, uint input_len, hash_t *hash_buf);
int md5aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha256aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha1aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lastpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int gost_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha256crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mssql2012_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512osx_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int episerver4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512grub_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sha512b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmacsha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmacsha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmacsha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmacmd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sapb_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sapg_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int drupal7_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sybasease_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mysql323_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int rakp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int netscaler_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int chap_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int wbb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int racf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lotus5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lotus6_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int lotus8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int hmailserver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int phps_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mediawiki_b_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int peoplesoft_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int skype_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int scrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int juniper_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cisco8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cisco9_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int office2007_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int office2010_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int office2013_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice01_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice01cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice01cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice34_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice34cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int oldoffice34cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int radmin2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int djangosha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int djangopbkdf2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int siphash_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int crammd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int saph_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int redmine_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf11_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf11cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf11cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf14_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf17l3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pdf17l8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pbkdf2_sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int prestashop_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int postgresql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mysql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int bitcoin_wallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int crc32_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int seven_zip_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int gost2012sbog_256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int gost2012sbog_512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pbkdf2_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pbkdf2_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int pbkdf2_sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ecryptfs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int bsdicrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int rar3hp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int rar5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int cf10_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int mywallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int ms_drsr_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
int androidfde_samsung_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengths, const unsigned char **kernel_sources);
void writeProgramBin (char *dst, unsigned char *binary, size_t binary_size);
void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengths, const u8 **kernel_sources);
void writeProgramBin (char *dst, u8 *binary, size_t binary_size);
uint64_t get_lowest_words_done ();
u64 get_lowest_words_done ();
restore_data_t *init_restore (int argc, char **argv);
void read_restore (const char *eff_restore_file, restore_data_t *rd);
@@ -1906,10 +1896,10 @@ void hc_signal (void c (int));
#endif
bool class_num (char c);
bool class_lower (char c);
bool class_upper (char c);
bool class_alpha (char c);
bool class_num (u8 c);
bool class_lower (u8 c);
bool class_upper (u8 c);
bool class_alpha (u8 c);
int mangle_lrest (char arr[BLOCK_SIZE], int arr_len);
int mangle_urest (char arr[BLOCK_SIZE], int arr_len);
@@ -1936,21 +1926,21 @@ int mangle_dupechar_at (char arr[BLOCK_SIZE], int arr_len, int upos, int
int mangle_dupechar (char arr[BLOCK_SIZE], int arr_len);
int mangle_switch_at_check (char arr[BLOCK_SIZE], int arr_len, int upos, int upos2);
int mangle_switch_at (char arr[BLOCK_SIZE], int arr_len, int upos, int upos2);
int mangle_chr_shiftl (uint8_t arr[BLOCK_SIZE], int arr_len, int upos);
int mangle_chr_shiftr (uint8_t arr[BLOCK_SIZE], int arr_len, int upos);
int mangle_chr_incr (uint8_t arr[BLOCK_SIZE], int arr_len, int upos);
int mangle_chr_decr (uint8_t arr[BLOCK_SIZE], int arr_len, int upos);
int mangle_chr_shiftl (char arr[BLOCK_SIZE], int arr_len, int upos);
int mangle_chr_shiftr (char arr[BLOCK_SIZE], int arr_len, int upos);
int mangle_chr_incr (char arr[BLOCK_SIZE], int arr_len, int upos);
int mangle_chr_decr (char arr[BLOCK_SIZE], int arr_len, int upos);
int mangle_title (char arr[BLOCK_SIZE], int arr_len);
int generate_random_rule (char rule_buf[RP_RULE_BUFSIZ], uint32_t rp_gen_func_min, uint32_t rp_gen_func_max);
int generate_random_rule (char rule_buf[RP_RULE_BUFSIZ], u32 rp_gen_func_min, u32 rp_gen_func_max);
int _old_apply_rule (char *rule, int rule_len, char in[BLOCK_SIZE], int in_len, char out[BLOCK_SIZE]);
int cpu_rule_to_kernel_rule (char rule_buf[BUFSIZ], uint rule_len, kernel_rule_t *rule);
int kernel_rule_to_cpu_rule (char rule_buf[BUFSIZ], kernel_rule_t *rule);
void *thread_device_watch (void *p);
void *thread_keypress (void *p);
void *thread_runtime (void *p);
void *thread_keypress (void *p);
void *thread_runtime (void *p);
/**
* checksum for use on cpu
+84 -84
View File
@@ -161,7 +161,7 @@ typedef struct
typedef struct
{
uint8_t cipher[1040];
u8 cipher[1040];
} agilekey_t;
@@ -260,10 +260,10 @@ typedef struct
typedef struct
{
uint64_t l_alt_result[8];
u64 l_alt_result[8];
uint64_t l_p_bytes[2];
uint64_t l_s_bytes[2];
u64 l_p_bytes[2];
u64 l_s_bytes[2];
} sha512crypt_tmp_t;
@@ -288,7 +288,7 @@ typedef struct
typedef struct
{
uint64_t dgst[8];
u64 dgst[8];
} bitcoin_wallet_tmp_t;
@@ -362,11 +362,11 @@ typedef struct
typedef struct
{
uint64_t ipad[8];
uint64_t opad[8];
u64 ipad[8];
u64 opad[8];
uint64_t dgst[32];
uint64_t out[32];
u64 dgst[32];
u64 out[32];
} tc64_tmp_t;
@@ -415,11 +415,11 @@ typedef struct
typedef struct
{
uint64_t ipad[8];
uint64_t opad[8];
u64 ipad[8];
u64 opad[8];
uint64_t dgst[8];
uint64_t out[8];
u64 dgst[8];
u64 out[8];
} sha512aix_tmp_t;
@@ -435,7 +435,7 @@ typedef struct
typedef struct
{
uint64_t digest_buf[8];
u64 digest_buf[8];
} drupal7_tmp_t;
@@ -463,7 +463,7 @@ typedef struct
typedef struct
{
uint64_t out[8];
u64 out[8];
} office2013_tmp_t;
@@ -475,57 +475,57 @@ typedef struct
typedef struct
{
uint32_t ipad[4];
uint32_t opad[4];
u32 ipad[4];
u32 opad[4];
uint32_t dgst[32];
uint32_t out[32];
u32 dgst[32];
u32 out[32];
} pbkdf2_md5_tmp_t;
typedef struct
{
uint32_t ipad[5];
uint32_t opad[5];
u32 ipad[5];
u32 opad[5];
uint32_t dgst[32];
uint32_t out[32];
u32 dgst[32];
u32 out[32];
} pbkdf2_sha1_tmp_t;
typedef struct
{
uint32_t ipad[8];
uint32_t opad[8];
u32 ipad[8];
u32 opad[8];
uint32_t dgst[32];
uint32_t out[32];
u32 dgst[32];
u32 out[32];
} pbkdf2_sha256_tmp_t;
typedef struct
{
uint64_t ipad[8];
uint64_t opad[8];
u64 ipad[8];
u64 opad[8];
uint64_t dgst[16];
uint64_t out[16];
u64 dgst[16];
u64 out[16];
} pbkdf2_sha512_tmp_t;
typedef struct
{
uint64_t out[8];
u64 out[8];
} ecryptfs_tmp_t;
typedef struct
{
uint64_t ipad[8];
uint64_t opad[8];
u64 ipad[8];
u64 opad[8];
uint64_t dgst[16];
uint64_t out[16];
u64 dgst[16];
u64 out[16];
} oraclet_tmp_t;
@@ -605,7 +605,7 @@ typedef struct
typedef struct
{
uint key;
uint64_t val;
u64 val;
} hcstat_table_t;
@@ -636,9 +636,9 @@ typedef struct
typedef struct
{
char signature[4];
uint32_t salt_buf[8];
uint32_t iterations;
uint32_t hash_buf[8];
u32 salt_buf[8];
u32 iterations;
u32 hash_buf[8];
} psafe3_t;
@@ -653,7 +653,7 @@ typedef struct
typedef struct
{
uint64_t cnt;
u64 cnt;
#ifdef _POSIX
struct stat stat;
@@ -683,17 +683,17 @@ typedef struct
{
union
{
uint8_t hc4[4][ 64];
uint32_t hi4[4][ 16];
uint64_t hl4[4][ 8];
u8 hc4[4][ 64];
u32 hi4[4][ 16];
u64 hl4[4][ 8];
uint8_t hc2[2][128];
uint32_t hi2[2][ 32];
uint64_t hl2[2][ 16];
u8 hc2[2][128];
u32 hi2[2][ 32];
u64 hl2[2][ 16];
uint8_t hc1[1][256];
uint32_t hi1[1][ 64];
uint64_t hl1[1][ 32];
u8 hc1[1][256];
u32 hi1[1][ 64];
u64 hl1[1][ 32];
};
uint pw_len;
@@ -733,16 +733,16 @@ typedef struct
typedef struct
{
uint32_t version_bin;
u32 version_bin;
char cwd[256];
uint32_t pid;
u32 pid;
uint32_t dictpos;
uint32_t maskpos;
u32 dictpos;
u32 maskpos;
uint64_t words_cur;
u64 words_cur;
uint32_t argc;
u32 argc;
char **argv;
} restore_data_t;
@@ -758,10 +758,10 @@ typedef struct
typedef struct
{
char *buf;
uint32_t incr;
uint32_t avail;
uint32_t cnt;
uint32_t pos;
u32 incr;
u32 avail;
u32 cnt;
u32 pos;
} wl_data_t;
@@ -826,7 +826,7 @@ struct __hc_device_param
uint device_processors;
uint device_processor_cores;
uint64_t device_maxmem_alloc;
u64 device_maxmem_alloc;
uint kernel_threads;
uint kernel_accel;
@@ -846,7 +846,7 @@ struct __hc_device_param
uint size_results;
uint size_plains;
uint (*pw_add) (struct __hc_device_param *, const uint8_t *, const uint);
uint (*pw_add) (struct __hc_device_param *, const u8 *, const uint);
void (*pw_transpose) (const pw_t *, pw_t *);
@@ -859,10 +859,10 @@ struct __hc_device_param
pw_t *pws_buf;
uint pws_cnt;
uint64_t pw_cnt;
u64 pw_cnt;
uint64_t words_off;
uint64_t words_done;
u64 words_off;
u64 words_done;
uint *result;
@@ -873,7 +873,7 @@ struct __hc_device_param
uint innerloop_left;
uint speed_pos;
uint64_t speed_cnt[SPEED_CACHE];
u64 speed_cnt[SPEED_CACHE];
float speed_ms[SPEED_CACHE];
hc_timer_t speed_rec[SPEED_CACHE];
@@ -955,18 +955,18 @@ struct __hc_device_param
void *kernel_params_tb[PARAMCNT];
void *kernel_params_tm[PARAMCNT];
uint32_t kernel_params_buf32[PARAMCNT];
u32 kernel_params_buf32[PARAMCNT];
uint32_t kernel_params_mp_buf32[PARAMCNT];
uint64_t kernel_params_mp_buf64[PARAMCNT];
u32 kernel_params_mp_buf32[PARAMCNT];
u64 kernel_params_mp_buf64[PARAMCNT];
uint32_t kernel_params_mp_r_buf32[PARAMCNT];
uint64_t kernel_params_mp_r_buf64[PARAMCNT];
u32 kernel_params_mp_r_buf32[PARAMCNT];
u64 kernel_params_mp_r_buf64[PARAMCNT];
uint32_t kernel_params_mp_l_buf32[PARAMCNT];
uint64_t kernel_params_mp_l_buf64[PARAMCNT];
u32 kernel_params_mp_l_buf32[PARAMCNT];
u64 kernel_params_mp_l_buf64[PARAMCNT];
uint32_t kernel_params_amp_buf32[PARAMCNT];
u32 kernel_params_amp_buf32[PARAMCNT];
};
typedef struct __hc_device_param hc_device_param_t;
@@ -1076,7 +1076,7 @@ typedef struct
cpt_t cpt_buf[CPT_BUF];
int cpt_pos;
time_t cpt_start;
uint64_t cpt_total;
u64 cpt_total;
/**
* user
@@ -1161,12 +1161,12 @@ typedef struct
* used for restore
*/
uint64_t skip;
uint64_t limit;
u64 skip;
u64 limit;
restore_data_t *rd;
uint64_t checkpoint_cur_words; // used for the "stop at next checkpoint" feature
u64 checkpoint_cur_words; // used for the "stop at next checkpoint" feature
/**
* status, timer
@@ -1178,13 +1178,13 @@ typedef struct
time_t proc_start;
time_t proc_stop;
uint64_t words_cnt;
uint64_t words_cur;
uint64_t words_base;
u64 words_cnt;
u64 words_cur;
u64 words_base;
uint64_t *words_progress_done; // progress number of words done per salt
uint64_t *words_progress_rejected; // progress number of words rejected per salt
uint64_t *words_progress_restored; // progress number of words restored per salt
u64 *words_progress_done; // progress number of words done per salt
u64 *words_progress_rejected; // progress number of words rejected per salt
u64 *words_progress_restored; // progress number of words restored per salt
hc_timer_t timer_running; // timer on current dict
hc_timer_t timer_paused; // timer on current dict