mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-21 23:58:07 +00:00
VeraCrypt modules changes
This commit is contained in:
parent
f4e1bdf675
commit
fa78439181
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -58,7 +57,7 @@ typedef struct vc_tmp
|
||||
|
||||
} vc_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -80,11 +79,11 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key2[6] = key[14];
|
||||
key2[7] = key[15];
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -209,7 +208,7 @@ KERNEL_FQ void m13711_init (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
tmps[gid].opad[3] = ripemd160_hmac_ctx.opad.h[3];
|
||||
tmps[gid].opad[4] = ripemd160_hmac_ctx.opad.h[4];
|
||||
|
||||
ripemd160_hmac_update_global (&ripemd160_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, 64);
|
||||
ripemd160_hmac_update_global (&ripemd160_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 16; i += 5, j += 1)
|
||||
{
|
||||
@ -449,7 +448,7 @@ KERNEL_FQ void m13711_loop_extended (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -519,18 +518,18 @@ KERNEL_FQ void m13711_comp (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -58,7 +57,7 @@ typedef struct vc_tmp
|
||||
|
||||
} vc_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -80,16 +79,16 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key2[6] = key[14];
|
||||
key2[7] = key[15];
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -129,13 +128,13 @@ DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key4[6] = key[30];
|
||||
key4[7] = key[31];
|
||||
|
||||
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -260,7 +259,7 @@ KERNEL_FQ void m13712_init (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
tmps[gid].opad[3] = ripemd160_hmac_ctx.opad.h[3];
|
||||
tmps[gid].opad[4] = ripemd160_hmac_ctx.opad.h[4];
|
||||
|
||||
ripemd160_hmac_update_global (&ripemd160_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, 64);
|
||||
ripemd160_hmac_update_global (&ripemd160_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 32; i += 5, j += 1)
|
||||
{
|
||||
@ -500,12 +499,12 @@ KERNEL_FQ void m13712_loop_extended (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -575,26 +574,26 @@ KERNEL_FQ void m13712_comp (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -58,7 +57,7 @@ typedef struct vc_tmp
|
||||
|
||||
} vc_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -80,16 +79,16 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key2[6] = key[14];
|
||||
key2[7] = key[15];
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -129,18 +128,18 @@ DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key4[6] = key[30];
|
||||
key4[7] = key[31];
|
||||
|
||||
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -198,9 +197,9 @@ DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key6[6] = key[46];
|
||||
key6[7] = key[47];
|
||||
|
||||
if (verify_header_serpent_twofish_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_serpent_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6) == 1) return 0;
|
||||
if (verify_header_aes_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_twofish_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_serpent_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6) == 1) return 0;
|
||||
if (verify_header_aes_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -325,7 +324,7 @@ KERNEL_FQ void m13713_init (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
tmps[gid].opad[3] = ripemd160_hmac_ctx.opad.h[3];
|
||||
tmps[gid].opad[4] = ripemd160_hmac_ctx.opad.h[4];
|
||||
|
||||
ripemd160_hmac_update_global (&ripemd160_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, 64);
|
||||
ripemd160_hmac_update_global (&ripemd160_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 48; i += 5, j += 1)
|
||||
{
|
||||
@ -565,17 +564,17 @@ KERNEL_FQ void m13713_loop_extended (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1536 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1536 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -645,34 +644,34 @@ KERNEL_FQ void m13713_comp (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1536 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1536 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -58,7 +57,7 @@ typedef struct vc64_tmp
|
||||
|
||||
} vc64_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -80,11 +79,11 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64
|
||||
key2[6] = hc_swap32_S (h32_from_64_S (key[7]));
|
||||
key2[7] = hc_swap32_S (l32_from_64_S (key[7]));
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -237,7 +236,7 @@ KERNEL_FQ void m13721_init (KERN_ATTR_TMPS_ESALT (vc64_tmp_t, vc_t))
|
||||
tmps[gid].opad[6] = sha512_hmac_ctx.opad.h[6];
|
||||
tmps[gid].opad[7] = sha512_hmac_ctx.opad.h[7];
|
||||
|
||||
sha512_hmac_update_global_swap (&sha512_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, 64);
|
||||
sha512_hmac_update_global_swap (&sha512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 8; i += 8, j += 1)
|
||||
{
|
||||
@ -547,7 +546,7 @@ KERNEL_FQ void m13721_loop_extended (KERN_ATTR_TMPS_ESALT (vc64_tmp_t, vc_t))
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -617,18 +616,18 @@ KERNEL_FQ void m13721_comp (KERN_ATTR_TMPS_ESALT (vc64_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -58,7 +57,7 @@ typedef struct vc64_tmp
|
||||
|
||||
} vc64_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -80,16 +79,16 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64
|
||||
key2[6] = hc_swap32_S (h32_from_64_S (key[7]));
|
||||
key2[7] = hc_swap32_S (l32_from_64_S (key[7]));
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -129,13 +128,13 @@ DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64
|
||||
key4[6] = hc_swap32_S (h32_from_64_S (key[15]));
|
||||
key4[7] = hc_swap32_S (l32_from_64_S (key[15]));
|
||||
|
||||
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -288,7 +287,7 @@ KERNEL_FQ void m13722_init (KERN_ATTR_TMPS_ESALT (vc64_tmp_t, vc_t))
|
||||
tmps[gid].opad[6] = sha512_hmac_ctx.opad.h[6];
|
||||
tmps[gid].opad[7] = sha512_hmac_ctx.opad.h[7];
|
||||
|
||||
sha512_hmac_update_global_swap (&sha512_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, 64);
|
||||
sha512_hmac_update_global_swap (&sha512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 16; i += 8, j += 1)
|
||||
{
|
||||
@ -598,12 +597,12 @@ KERNEL_FQ void m13722_loop_extended (KERN_ATTR_TMPS_ESALT (vc64_tmp_t, vc_t))
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -673,26 +672,26 @@ KERNEL_FQ void m13722_comp (KERN_ATTR_TMPS_ESALT (vc64_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -58,7 +57,7 @@ typedef struct vc64_tmp
|
||||
|
||||
} vc64_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -80,16 +79,16 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64
|
||||
key2[6] = hc_swap32_S (h32_from_64_S (key[7]));
|
||||
key2[7] = hc_swap32_S (l32_from_64_S (key[7]));
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -129,18 +128,18 @@ DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64
|
||||
key4[6] = hc_swap32_S (h32_from_64_S (key[15]));
|
||||
key4[7] = hc_swap32_S (l32_from_64_S (key[15]));
|
||||
|
||||
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -198,9 +197,9 @@ DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64
|
||||
key6[6] = hc_swap32_S (h32_from_64_S (key[23]));
|
||||
key6[7] = hc_swap32_S (l32_from_64_S (key[23]));
|
||||
|
||||
if (verify_header_serpent_twofish_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_serpent_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6) == 1) return 0;
|
||||
if (verify_header_aes_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_twofish_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_serpent_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6) == 1) return 0;
|
||||
if (verify_header_aes_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -353,7 +352,7 @@ KERNEL_FQ void m13723_init (KERN_ATTR_TMPS_ESALT (vc64_tmp_t, vc_t))
|
||||
tmps[gid].opad[6] = sha512_hmac_ctx.opad.h[6];
|
||||
tmps[gid].opad[7] = sha512_hmac_ctx.opad.h[7];
|
||||
|
||||
sha512_hmac_update_global_swap (&sha512_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, 64);
|
||||
sha512_hmac_update_global_swap (&sha512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 24; i += 8, j += 1)
|
||||
{
|
||||
@ -663,17 +662,17 @@ KERNEL_FQ void m13723_loop_extended (KERN_ATTR_TMPS_ESALT (vc64_tmp_t, vc_t))
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1536 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1536 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -743,34 +742,34 @@ KERNEL_FQ void m13723_comp (KERN_ATTR_TMPS_ESALT (vc64_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1536 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1536 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -58,7 +57,7 @@ typedef struct vc_tmp
|
||||
|
||||
} vc_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -80,11 +79,11 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key2[6] = hc_swap32_S (key[14]);
|
||||
key2[7] = hc_swap32_S (key[15]);
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -333,7 +332,7 @@ KERNEL_FQ void m13731_init (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
tmps[gid].opad[14] = whirlpool_hmac_ctx.opad.h[14];
|
||||
tmps[gid].opad[15] = whirlpool_hmac_ctx.opad.h[15];
|
||||
|
||||
whirlpool_hmac_update_global_swap (&whirlpool_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, 64);
|
||||
whirlpool_hmac_update_global_swap (&whirlpool_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 16; i += 16, j += 1)
|
||||
{
|
||||
@ -727,7 +726,7 @@ KERNEL_FQ void m13731_loop_extended (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -797,18 +796,18 @@ KERNEL_FQ void m13731_comp (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -58,7 +57,7 @@ typedef struct vc_tmp
|
||||
|
||||
} vc_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -80,16 +79,16 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key2[6] = hc_swap32_S (key[14]);
|
||||
key2[7] = hc_swap32_S (key[15]);
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -129,13 +128,13 @@ DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key4[6] = hc_swap32_S (key[30]);
|
||||
key4[7] = hc_swap32_S (key[31]);
|
||||
|
||||
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -384,7 +383,7 @@ KERNEL_FQ void m13732_init (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
tmps[gid].opad[14] = whirlpool_hmac_ctx.opad.h[14];
|
||||
tmps[gid].opad[15] = whirlpool_hmac_ctx.opad.h[15];
|
||||
|
||||
whirlpool_hmac_update_global_swap (&whirlpool_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, 64);
|
||||
whirlpool_hmac_update_global_swap (&whirlpool_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 32; i += 16, j += 1)
|
||||
{
|
||||
@ -778,12 +777,12 @@ KERNEL_FQ void m13732_loop_extended (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -853,26 +852,26 @@ KERNEL_FQ void m13732_comp (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -58,7 +57,7 @@ typedef struct vc_tmp
|
||||
|
||||
} vc_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -80,16 +79,16 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key2[6] = hc_swap32_S (key[14]);
|
||||
key2[7] = hc_swap32_S (key[15]);
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -129,18 +128,18 @@ DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key4[6] = hc_swap32_S (key[30]);
|
||||
key4[7] = hc_swap32_S (key[31]);
|
||||
|
||||
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -198,9 +197,9 @@ DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key6[6] = hc_swap32_S (key[46]);
|
||||
key6[7] = hc_swap32_S (key[47]);
|
||||
|
||||
if (verify_header_serpent_twofish_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_serpent_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6) == 1) return 0;
|
||||
if (verify_header_aes_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_twofish_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_serpent_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6) == 1) return 0;
|
||||
if (verify_header_aes_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -449,7 +448,7 @@ KERNEL_FQ void m13733_init (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
tmps[gid].opad[14] = whirlpool_hmac_ctx.opad.h[14];
|
||||
tmps[gid].opad[15] = whirlpool_hmac_ctx.opad.h[15];
|
||||
|
||||
whirlpool_hmac_update_global_swap (&whirlpool_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, 64);
|
||||
whirlpool_hmac_update_global_swap (&whirlpool_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 48; i += 16, j += 1)
|
||||
{
|
||||
@ -843,17 +842,17 @@ KERNEL_FQ void m13733_loop_extended (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1536 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1536 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -923,34 +922,34 @@ KERNEL_FQ void m13733_comp (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1536 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1536 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -58,7 +57,7 @@ typedef struct vc_tmp
|
||||
|
||||
} vc_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -80,11 +79,11 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key2[6] = hc_swap32_S (key[14]);
|
||||
key2[7] = hc_swap32_S (key[15]);
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -221,7 +220,7 @@ KERNEL_FQ void m13751_init (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
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_HOST].salt_buf, 64);
|
||||
sha256_hmac_update_global_swap (&sha256_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 16; i += 8, j += 1)
|
||||
{
|
||||
@ -524,7 +523,7 @@ KERNEL_FQ void m13751_loop_extended (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -594,18 +593,18 @@ KERNEL_FQ void m13751_comp (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -58,7 +57,7 @@ typedef struct vc_tmp
|
||||
|
||||
} vc_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -80,16 +79,16 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key2[6] = hc_swap32_S (key[14]);
|
||||
key2[7] = hc_swap32_S (key[15]);
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -129,13 +128,13 @@ DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key4[6] = hc_swap32_S (key[30]);
|
||||
key4[7] = hc_swap32_S (key[31]);
|
||||
|
||||
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -272,7 +271,7 @@ KERNEL_FQ void m13752_init (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
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_HOST].salt_buf, 64);
|
||||
sha256_hmac_update_global_swap (&sha256_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 32; i += 8, j += 1)
|
||||
{
|
||||
@ -546,12 +545,12 @@ KERNEL_FQ void m13752_loop_extended (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -621,26 +620,26 @@ KERNEL_FQ void m13752_comp (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -58,7 +57,7 @@ typedef struct vc_tmp
|
||||
|
||||
} vc_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -80,16 +79,16 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key2[6] = hc_swap32_S (key[14]);
|
||||
key2[7] = hc_swap32_S (key[15]);
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -129,18 +128,18 @@ DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key4[6] = hc_swap32_S (key[30]);
|
||||
key4[7] = hc_swap32_S (key[31]);
|
||||
|
||||
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u32 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -198,9 +197,9 @@ DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u32
|
||||
key6[6] = hc_swap32_S (key[46]);
|
||||
key6[7] = hc_swap32_S (key[47]);
|
||||
|
||||
if (verify_header_serpent_twofish_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_serpent_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6) == 1) return 0;
|
||||
if (verify_header_aes_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_twofish_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_serpent_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6) == 1) return 0;
|
||||
if (verify_header_aes_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -337,7 +336,7 @@ KERNEL_FQ void m13753_init (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
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_HOST].salt_buf, 64);
|
||||
sha256_hmac_update_global_swap (&sha256_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 48; i += 8, j += 1)
|
||||
{
|
||||
@ -611,17 +610,17 @@ KERNEL_FQ void m13753_loop_extended (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1536 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1536 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -691,34 +690,34 @@ KERNEL_FQ void m13753_comp (KERN_ATTR_TMPS_ESALT (vc_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1536 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1536 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -61,7 +60,7 @@ typedef struct vc64_sbog_tmp
|
||||
|
||||
} vc64_sbog_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -83,11 +82,11 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64
|
||||
key2[6] = hc_swap32_S (h32_from_64_S (key[0]));
|
||||
key2[7] = hc_swap32_S (l32_from_64_S (key[0]));
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -305,7 +304,7 @@ KERNEL_FQ void m13771_init (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))
|
||||
tmps[gid].opad_raw[6] = streebog512_hmac_ctx.opad.s[6];
|
||||
tmps[gid].opad_raw[7] = streebog512_hmac_ctx.opad.s[7];
|
||||
|
||||
streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, 64);
|
||||
streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 8; i += 8, j += 1)
|
||||
{
|
||||
@ -626,7 +625,7 @@ KERNEL_FQ void m13771_loop_extended (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -696,18 +695,18 @@ KERNEL_FQ void m13771_comp (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -61,7 +60,7 @@ typedef struct vc64_sbog_tmp
|
||||
|
||||
} vc64_sbog_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -83,16 +82,16 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64
|
||||
key2[6] = hc_swap32_S (h32_from_64_S (key[0]));
|
||||
key2[7] = hc_swap32_S (l32_from_64_S (key[0]));
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -132,13 +131,13 @@ DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64
|
||||
key4[6] = hc_swap32_S (h32_from_64_S (key[ 8]));
|
||||
key4[7] = hc_swap32_S (l32_from_64_S (key[ 8]));
|
||||
|
||||
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -356,7 +355,7 @@ KERNEL_FQ void m13772_init (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))
|
||||
tmps[gid].opad_raw[6] = streebog512_hmac_ctx.opad.s[6];
|
||||
tmps[gid].opad_raw[7] = streebog512_hmac_ctx.opad.s[7];
|
||||
|
||||
streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, 64);
|
||||
streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 16; i += 8, j += 1)
|
||||
{
|
||||
@ -677,12 +676,12 @@ KERNEL_FQ void m13772_loop_extended (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -752,26 +751,26 @@ KERNEL_FQ void m13772_comp (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -61,7 +60,7 @@ typedef struct vc64_sbog_tmp
|
||||
|
||||
} vc64_sbog_tmp_t;
|
||||
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -83,16 +82,16 @@ DECLSPEC int check_header_0512 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64
|
||||
key2[6] = hc_swap32_S (h32_from_64_S (key[0]));
|
||||
key2[7] = hc_swap32_S (l32_from_64_S (key[0]));
|
||||
|
||||
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2) == 1) return 0;
|
||||
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -132,18 +131,18 @@ DECLSPEC int check_header_1024 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64
|
||||
key4[6] = hc_swap32_S (h32_from_64_S (key[ 8]));
|
||||
key4[7] = hc_swap32_S (l32_from_64_S (key[ 8]));
|
||||
|
||||
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_camellia_kuznyechik (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_camellia_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS const kernel_param_t *kernel_param, GLOBAL_AS u64 *key, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
|
||||
{
|
||||
u32 key1[8];
|
||||
u32 key2[8];
|
||||
@ -201,9 +200,9 @@ DECLSPEC int check_header_1536 (GLOBAL_AS const vc_t *esalt_bufs, GLOBAL_AS u64
|
||||
key6[6] = hc_swap32_S (h32_from_64_S (key[16]));
|
||||
key6[7] = hc_swap32_S (l32_from_64_S (key[16]));
|
||||
|
||||
if (verify_header_serpent_twofish_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_serpent_camellia (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6) == 1) return 0;
|
||||
if (verify_header_aes_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_serpent_twofish_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
if (verify_header_kuznyechik_serpent_camellia (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6) == 1) return 0;
|
||||
if (verify_header_aes_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, key1, key2, key3, key4, key5, key6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1) return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -421,7 +420,7 @@ KERNEL_FQ void m13773_init (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))
|
||||
tmps[gid].opad_raw[6] = streebog512_hmac_ctx.opad.s[6];
|
||||
tmps[gid].opad_raw[7] = streebog512_hmac_ctx.opad.s[7];
|
||||
|
||||
streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, esalt_bufs[DIGESTS_OFFSET_HOST].salt_buf, 64);
|
||||
streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64);
|
||||
|
||||
for (u32 i = 0, j = 1; i < 24; i += 8, j += 1)
|
||||
{
|
||||
@ -742,17 +741,17 @@ KERNEL_FQ void m13773_loop_extended (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t
|
||||
|
||||
if (pim_check)
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
|
||||
if (check_header_1536 (esalt_bufs, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1536 (esalt_bufs, kernel_param, tmps[gid].pim_key, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
tmps[gid].pim = pim_check;
|
||||
}
|
||||
@ -822,34 +821,34 @@ KERNEL_FQ void m13773_comp (KERN_ATTR_TMPS_ESALT (vc64_sbog_tmp_t, vc_t))
|
||||
|
||||
if (tmps[gid].pim)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (check_header_0512 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_0512 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1024 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1024 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_header_1536 (esalt_bufs, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
if (check_header_1536 (esalt_bufs, kernel_param, tmps[gid].out, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) != -1)
|
||||
{
|
||||
if (hc_atomic_inc (&hashes_shown[0]) == 0)
|
||||
if (hc_atomic_inc (&hashes_shown[DIGESTS_OFFSET_HOST]) == 0)
|
||||
{
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, 0, gid, 0, 0, 0);
|
||||
mark_hash (plains_buf, d_return_buf, SALT_POS_HOST, DIGESTS_CNT, 0, DIGESTS_OFFSET_HOST + 0, gid, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_5;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt RIPEMD160 + XTS 512 bit";
|
||||
static const u64 KERN_TYPE = 13711;
|
||||
@ -49,6 +49,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -65,7 +69,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -185,21 +188,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -252,8 +253,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -265,28 +265,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_655331;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_655331 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_5;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt RIPEMD160 + XTS 1024 bit";
|
||||
static const u64 KERN_TYPE = 13712;
|
||||
@ -49,6 +49,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -65,7 +69,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -185,21 +188,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -252,8 +253,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -265,28 +265,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_655331;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_655331 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_5;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt RIPEMD160 + XTS 1536 bit";
|
||||
static const u64 KERN_TYPE = 13713;
|
||||
@ -49,6 +49,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -65,7 +69,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -185,21 +188,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -252,8 +253,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -265,28 +265,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_655331;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_655331 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_8_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt SHA512 + XTS 512 bit";
|
||||
static const u64 KERN_TYPE = 13721;
|
||||
@ -50,7 +50,11 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
typedef struct tc64_tmp
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc64_tmp
|
||||
{
|
||||
u64 ipad[8];
|
||||
u64 opad[8];
|
||||
@ -66,7 +70,6 @@ typedef struct tc64_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -195,21 +198,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -262,8 +263,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -275,28 +275,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_8_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt SHA512 + XTS 1024 bit";
|
||||
static const u64 KERN_TYPE = 13722;
|
||||
@ -50,7 +50,11 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
typedef struct tc64_tmp
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc64_tmp
|
||||
{
|
||||
u64 ipad[8];
|
||||
u64 opad[8];
|
||||
@ -66,7 +70,6 @@ typedef struct tc64_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -195,21 +198,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -262,8 +263,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -275,28 +275,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_8_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt SHA512 + XTS 1536 bit";
|
||||
static const u64 KERN_TYPE = 13723;
|
||||
@ -50,7 +50,11 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
typedef struct tc64_tmp
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc64_tmp
|
||||
{
|
||||
u64 ipad[8];
|
||||
u64 opad[8];
|
||||
@ -66,7 +70,6 @@ typedef struct tc64_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -195,21 +198,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -262,8 +263,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -275,28 +275,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt Whirlpool + XTS 512 bit";
|
||||
static const u64 KERN_TYPE = 13731;
|
||||
@ -50,6 +50,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -66,7 +70,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -172,21 +175,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -239,8 +240,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -252,28 +252,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt Whirlpool + XTS 1024 bit";
|
||||
static const u64 KERN_TYPE = 13732;
|
||||
@ -50,6 +50,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -66,7 +70,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -172,21 +175,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -239,8 +240,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -252,28 +252,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt Whirlpool + XTS 1536 bit";
|
||||
static const u64 KERN_TYPE = 13733;
|
||||
@ -50,6 +50,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -66,7 +70,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -186,21 +189,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -253,8 +254,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -266,28 +266,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_5;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt RIPEMD160 + XTS 512 bit + boot-mode";
|
||||
static const u64 KERN_TYPE = 13711;
|
||||
@ -50,6 +50,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -66,7 +70,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -187,21 +190,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -254,8 +255,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 2048;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 2048 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -267,28 +267,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_327661;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_327661 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 2048;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_5;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt RIPEMD160 + XTS 1024 bit + boot-mode";
|
||||
static const u64 KERN_TYPE = 13712;
|
||||
@ -50,6 +50,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -66,7 +70,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -187,21 +190,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -254,8 +255,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 2048;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 2048 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -267,28 +267,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_327661;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_327661 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 2048;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_5;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt RIPEMD160 + XTS 1536 bit + boot-mode";
|
||||
static const u64 KERN_TYPE = 13713;
|
||||
@ -50,6 +50,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -66,7 +70,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -187,21 +190,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -254,8 +255,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 2048;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 2048 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -267,28 +267,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_327661;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_327661 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 2048;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt SHA256 + XTS 512 bit";
|
||||
static const u64 KERN_TYPE = 13751;
|
||||
@ -49,6 +49,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -65,7 +69,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -204,21 +207,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -271,8 +272,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -284,28 +284,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt SHA256 + XTS 1024 bit";
|
||||
static const u64 KERN_TYPE = 13752;
|
||||
@ -49,6 +49,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -65,7 +69,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -204,21 +207,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -271,8 +272,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -284,28 +284,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt SHA256 + XTS 1536 bit";
|
||||
static const u64 KERN_TYPE = 13753;
|
||||
@ -49,6 +49,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -65,7 +69,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -204,21 +207,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -271,8 +272,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -284,28 +284,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt SHA256 + XTS 512 bit + boot-mode";
|
||||
static const u64 KERN_TYPE = 13751;
|
||||
@ -50,6 +50,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -66,7 +70,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -206,21 +209,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -273,8 +274,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 2048;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 2048 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -286,28 +286,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_200000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_200000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 2048;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt SHA256 + XTS 1024 bit + boot-mode";
|
||||
static const u64 KERN_TYPE = 13752;
|
||||
@ -50,6 +50,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -66,7 +70,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -206,21 +209,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -273,8 +274,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 2048;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 2048 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -286,28 +286,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_200000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_200000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 2048;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt SHA256 + XTS 1536 bit + boot-mode";
|
||||
static const u64 KERN_TYPE = 13753;
|
||||
@ -50,6 +50,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc_tmp
|
||||
{
|
||||
u32 ipad[16];
|
||||
@ -66,7 +70,6 @@ typedef struct vc_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -206,21 +209,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -273,8 +274,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 2048;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 2048 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -286,28 +286,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_200000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_200000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 2048;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_8_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt Streebog-512 + XTS 512 bit";
|
||||
static const u64 KERN_TYPE = 13771;
|
||||
@ -51,6 +51,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc64_sbog_tmp
|
||||
{
|
||||
u64 ipad_raw[8];
|
||||
@ -70,7 +74,6 @@ typedef struct vc64_sbog_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -196,21 +199,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -263,8 +264,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -276,28 +276,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_8_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt Streebog-512 + XTS 1024 bit";
|
||||
static const u64 KERN_TYPE = 13772;
|
||||
@ -51,6 +51,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc64_sbog_tmp
|
||||
{
|
||||
u64 ipad_raw[8];
|
||||
@ -70,7 +74,6 @@ typedef struct vc64_sbog_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -196,21 +199,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -263,8 +264,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -276,28 +276,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_8_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt Streebog-512 + XTS 1536 bit";
|
||||
static const u64 KERN_TYPE = 13773;
|
||||
@ -51,6 +51,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc64_sbog_tmp
|
||||
{
|
||||
u64 ipad_raw[8];
|
||||
@ -70,7 +74,6 @@ typedef struct vc64_sbog_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -202,21 +205,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -269,8 +270,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = 15 + user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = 15 + user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 1000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 1000 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -282,28 +282,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_500000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 1000;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_8_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt Streebog-512 + XTS 512 bit + boot-mode";
|
||||
static const u64 KERN_TYPE = 13771;
|
||||
@ -52,6 +52,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc64_sbog_tmp
|
||||
{
|
||||
u64 ipad_raw[8];
|
||||
@ -71,7 +75,6 @@ typedef struct vc64_sbog_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -198,21 +201,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -265,8 +266,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 2048;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 2048 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -278,28 +278,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_200000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_200000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 2048;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_8_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt Streebog-512 + XTS 1024 bit + boot-mode";
|
||||
static const u64 KERN_TYPE = 13772;
|
||||
@ -52,6 +52,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc64_sbog_tmp
|
||||
{
|
||||
u64 ipad_raw[8];
|
||||
@ -71,7 +75,6 @@ typedef struct vc64_sbog_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -198,21 +201,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -265,8 +266,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 2048;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 2048 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -278,28 +278,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_200000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_200000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 2048;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ static const u32 DGST_POS0 = 0;
|
||||
static const u32 DGST_POS1 = 1;
|
||||
static const u32 DGST_POS2 = 2;
|
||||
static const u32 DGST_POS3 = 3;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_8_8;
|
||||
static const u32 DGST_SIZE = DGST_SIZE_4_32;
|
||||
static const u32 HASH_CATEGORY = HASH_CATEGORY_FDE;
|
||||
static const char *HASH_NAME = "VeraCrypt Streebog-512 + XTS 1536 bit + boot-mode";
|
||||
static const u64 KERN_TYPE = 13773;
|
||||
@ -52,6 +52,10 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
|
||||
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
|
||||
|
||||
#define VC_SALT_LEN 64
|
||||
#define VC_DATA_LEN 448
|
||||
#define VC_HEADER_LEN 512
|
||||
|
||||
typedef struct vc64_sbog_tmp
|
||||
{
|
||||
u64 ipad_raw[8];
|
||||
@ -71,7 +75,6 @@ typedef struct vc64_sbog_tmp
|
||||
|
||||
typedef struct vc
|
||||
{
|
||||
u32 salt_buf[32];
|
||||
u32 data_buf[112];
|
||||
u32 keyfile_buf16[16];
|
||||
u32 keyfile_buf32[32];
|
||||
@ -198,21 +201,19 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
if (hc_fopen (&fp, hashes->hashfile, "rb") == false) return (PARSER_HAVE_ERRNO);
|
||||
|
||||
#define VC_HEADER_SIZE 512
|
||||
char *in = (char *) hcmalloc (VC_HEADER_LEN);
|
||||
|
||||
char *in = (char *) hcmalloc (VC_HEADER_SIZE);
|
||||
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_SIZE, &fp);
|
||||
const size_t n = hc_fread (in, 1, VC_HEADER_LEN, &fp);
|
||||
|
||||
hc_fclose (&fp);
|
||||
|
||||
if (n != VC_HEADER_SIZE) return (PARSER_VC_FILE_SIZE);
|
||||
if (n != VC_HEADER_LEN) return (PARSER_VC_FILE_SIZE);
|
||||
|
||||
hash_t *hashes_buf = hashes->hashes_buf;
|
||||
|
||||
hash_t *hash = &hashes_buf[0];
|
||||
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_SIZE);
|
||||
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, VC_HEADER_LEN);
|
||||
|
||||
if (parser_status != PARSER_OK) return 0;
|
||||
|
||||
@ -265,8 +266,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
vc->pim_start = user_options->veracrypt_pim_start;
|
||||
vc->pim_stop = user_options->veracrypt_pim_stop;
|
||||
|
||||
salt->salt_iter = vc->pim_stop * 2048;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = vc->pim_stop * 2048 - 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -278,28 +278,39 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
vc_t *vc = (vc_t *) esalt_buf;
|
||||
|
||||
// entropy
|
||||
|
||||
const float entropy = get_entropy ((const u8 *) line_buf, line_len);
|
||||
|
||||
if (entropy < MIN_SUFFICIENT_ENTROPY_FILE) return (PARSER_INSUFFICIENT_ENTROPY);
|
||||
|
||||
memcpy (vc->salt_buf, line_buf, 64);
|
||||
// salt
|
||||
|
||||
memcpy (vc->data_buf, line_buf + 64, 512 - 64);
|
||||
memcpy (salt->salt_buf, line_buf, VC_SALT_LEN);
|
||||
|
||||
salt->salt_buf[0] = vc->salt_buf[0];
|
||||
salt->salt_len = VC_SALT_LEN;
|
||||
|
||||
salt->salt_len = 4;
|
||||
// iter
|
||||
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_200000;
|
||||
salt->salt_iter--;
|
||||
salt->salt_iter = ROUNDS_VERACRYPT_200000 - 1;
|
||||
|
||||
// pim
|
||||
|
||||
vc->pim_multi = 2048;
|
||||
vc->pim_start = 0;
|
||||
vc->pim_stop = 0;
|
||||
|
||||
// data
|
||||
|
||||
memcpy (vc->data_buf, line_buf + VC_SALT_LEN, VC_DATA_LEN);
|
||||
|
||||
// signature
|
||||
|
||||
vc->signature = 0x41524556; // "VERA"
|
||||
|
||||
digest[0] = vc->data_buf[0];
|
||||
// fake digest
|
||||
|
||||
memcpy (digest, vc->data_buf, 112);
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user