TrueCrypt modules changes

pull/3293/head
Konrad Goławski 2 years ago
parent af5edb06cc
commit 1c531780c1

@ -19,7 +19,6 @@
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -167,7 +166,7 @@ KERNEL_FQ void m06211_init (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_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)
{
@ -379,27 +378,27 @@ KERNEL_FQ void m06211_comp (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_t))
ukey2[6] = tmps[gid].out[14];
ukey2[7] = tmps[gid].out[15];
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, 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);
}
}
}

@ -19,7 +19,6 @@
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -167,7 +166,7 @@ KERNEL_FQ void m06212_init (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_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)
{
@ -379,27 +378,27 @@ KERNEL_FQ void m06212_comp (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_t))
ukey2[6] = tmps[gid].out[14];
ukey2[7] = tmps[gid].out[15];
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, 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);
}
}
@ -425,27 +424,27 @@ KERNEL_FQ void m06212_comp (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_t))
ukey4[6] = tmps[gid].out[30];
ukey4[7] = tmps[gid].out[31];
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, 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 (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4) == 1)
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4) == 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 (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, 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);
}
}
}

@ -19,7 +19,6 @@
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -167,7 +166,7 @@ KERNEL_FQ void m06213_init (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_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)
{
@ -379,27 +378,27 @@ KERNEL_FQ void m06213_comp (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_t))
ukey2[6] = tmps[gid].out[14];
ukey2[7] = tmps[gid].out[15];
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, 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);
}
}
@ -425,27 +424,27 @@ KERNEL_FQ void m06213_comp (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_t))
ukey4[6] = tmps[gid].out[30];
ukey4[7] = tmps[gid].out[31];
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, 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 (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4) == 1)
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4) == 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 (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, 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);
}
}
@ -471,19 +470,19 @@ KERNEL_FQ void m06213_comp (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_t))
ukey6[6] = tmps[gid].out[46];
ukey6[7] = tmps[gid].out[47];
if (verify_header_serpent_twofish_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, ukey5, ukey6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_serpent_twofish_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, ukey5, ukey6, 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 (verify_header_aes_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, ukey5, ukey6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, ukey5, ukey6, 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);
}
}
}

@ -19,7 +19,6 @@
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -195,7 +194,7 @@ KERNEL_FQ void m06221_init (KERN_ATTR_TMPS_ESALT (tc64_tmp_t, tc_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)
{
@ -474,27 +473,27 @@ KERNEL_FQ void m06221_comp (KERN_ATTR_TMPS_ESALT (tc64_tmp_t, tc_t))
ukey2[6] = hc_swap32_S (h32_from_64_S (tmps[gid].out[7]));
ukey2[7] = hc_swap32_S (l32_from_64_S (tmps[gid].out[7]));
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, 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);
}
}
}

@ -19,7 +19,6 @@
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -195,7 +194,7 @@ KERNEL_FQ void m06222_init (KERN_ATTR_TMPS_ESALT (tc64_tmp_t, tc_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)
{
@ -474,27 +473,27 @@ KERNEL_FQ void m06222_comp (KERN_ATTR_TMPS_ESALT (tc64_tmp_t, tc_t))
ukey2[6] = hc_swap32_S (h32_from_64_S (tmps[gid].out[7]));
ukey2[7] = hc_swap32_S (l32_from_64_S (tmps[gid].out[7]));
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, 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);
}
}
@ -520,27 +519,27 @@ KERNEL_FQ void m06222_comp (KERN_ATTR_TMPS_ESALT (tc64_tmp_t, tc_t))
ukey4[6] = hc_swap32_S (h32_from_64_S (tmps[gid].out[15]));
ukey4[7] = hc_swap32_S (l32_from_64_S (tmps[gid].out[15]));
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, 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 (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4) == 1)
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4) == 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 (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, 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);
}
}
}

@ -19,7 +19,6 @@
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -195,7 +194,7 @@ KERNEL_FQ void m06223_init (KERN_ATTR_TMPS_ESALT (tc64_tmp_t, tc_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)
{
@ -474,27 +473,27 @@ KERNEL_FQ void m06223_comp (KERN_ATTR_TMPS_ESALT (tc64_tmp_t, tc_t))
ukey2[6] = hc_swap32_S (h32_from_64_S (tmps[gid].out[7]));
ukey2[7] = hc_swap32_S (l32_from_64_S (tmps[gid].out[7]));
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, 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);
}
}
@ -520,27 +519,27 @@ KERNEL_FQ void m06223_comp (KERN_ATTR_TMPS_ESALT (tc64_tmp_t, tc_t))
ukey4[6] = hc_swap32_S (h32_from_64_S (tmps[gid].out[15]));
ukey4[7] = hc_swap32_S (l32_from_64_S (tmps[gid].out[15]));
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, 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 (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4) == 1)
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4) == 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 (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, 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);
}
}
@ -566,19 +565,19 @@ KERNEL_FQ void m06223_comp (KERN_ATTR_TMPS_ESALT (tc64_tmp_t, tc_t))
ukey6[6] = hc_swap32_S (h32_from_64_S (tmps[gid].out[23]));
ukey6[7] = hc_swap32_S (l32_from_64_S (tmps[gid].out[23]));
if (verify_header_serpent_twofish_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, ukey5, ukey6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_serpent_twofish_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, ukey5, ukey6, 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 (verify_header_aes_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, ukey5, ukey6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, ukey5, ukey6, 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);
}
}
}

@ -19,7 +19,6 @@
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -291,7 +290,7 @@ KERNEL_FQ void m06231_init (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_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)
{
@ -646,27 +645,27 @@ KERNEL_FQ void m06231_comp (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_t))
ukey2[6] = hc_swap32_S (tmps[gid].out[14]);
ukey2[7] = hc_swap32_S (tmps[gid].out[15]);
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, 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);
}
}
}

@ -19,7 +19,6 @@
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -291,7 +290,7 @@ KERNEL_FQ void m06232_init (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_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)
{
@ -646,27 +645,27 @@ KERNEL_FQ void m06232_comp (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_t))
ukey2[6] = hc_swap32_S (tmps[gid].out[14]);
ukey2[7] = hc_swap32_S (tmps[gid].out[15]);
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, 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);
}
}
@ -692,27 +691,27 @@ KERNEL_FQ void m06232_comp (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_t))
ukey4[6] = hc_swap32_S (tmps[gid].out[30]);
ukey4[7] = hc_swap32_S (tmps[gid].out[31]);
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, 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 (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4) == 1)
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4) == 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 (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, 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);
}
}
}

@ -19,7 +19,6 @@
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -291,7 +290,7 @@ KERNEL_FQ void m06233_init (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_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)
{
@ -646,27 +645,27 @@ KERNEL_FQ void m06233_comp (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_t))
ukey2[6] = hc_swap32_S (tmps[gid].out[14]);
ukey2[7] = hc_swap32_S (tmps[gid].out[15]);
if (verify_header_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2) == 1)
if (verify_header_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2) == 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 (verify_header_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, 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);
}
}
@ -692,27 +691,27 @@ KERNEL_FQ void m06233_comp (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_t))
ukey4[6] = hc_swap32_S (tmps[gid].out[30]);
ukey4[7] = hc_swap32_S (tmps[gid].out[31]);
if (verify_header_serpent_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_serpent_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, 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 (verify_header_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4) == 1)
if (verify_header_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4) == 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 (verify_header_aes_twofish (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes_twofish (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, 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);
}
}
@ -738,19 +737,19 @@ KERNEL_FQ void m06233_comp (KERN_ATTR_TMPS_ESALT (tc_tmp_t, tc_t))
ukey6[6] = hc_swap32_S (tmps[gid].out[46]);
ukey6[7] = hc_swap32_S (tmps[gid].out[47]);
if (verify_header_serpent_twofish_aes (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, ukey5, ukey6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_serpent_twofish_aes (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, ukey5, ukey6, 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 (verify_header_aes_twofish_serpent (esalt_bufs[0].data_buf, esalt_bufs[0].signature, ukey1, ukey2, ukey3, ukey4, ukey5, ukey6, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4) == 1)
if (verify_header_aes_twofish_serpent (esalt_bufs[DIGESTS_OFFSET_HOST].data_buf, esalt_bufs[DIGESTS_OFFSET_HOST].signature, ukey1, ukey2, ukey3, ukey4, ukey5, ukey6, 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 = "TrueCrypt RIPEMD160 + XTS 512 bit";
static const u64 KERN_TYPE = 6211;
@ -46,6 +46,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 TC_SALT_LEN 64
#define TC_DATA_LEN 448
#define TC_HEADER_LEN 512
typedef struct tc_tmp
{
u32 ipad[16];
@ -58,7 +62,6 @@ typedef struct tc_tmp
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -140,8 +143,6 @@ int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, tmpdata, st_hash_len / 2);
hcfree (tmpdata);
return parser_status;
@ -155,21 +156,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 TC_HEADER_SIZE 512
char *in = (char *) hcmalloc (TC_HEADER_LEN);
char *in = (char *) hcmalloc (TC_HEADER_SIZE);
const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp);
const size_t n = hc_fread (in, 1, TC_HEADER_LEN, &fp);
hc_fclose (&fp);
if (n != TC_HEADER_SIZE) return (PARSER_TC_FILE_SIZE);
if (n != TC_HEADER_LEN) return (PARSER_TC_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, TC_HEADER_SIZE);
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, TC_HEADER_LEN);
if (parser_status != PARSER_OK) return 0;
@ -222,23 +221,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tc_t *tc = (tc_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 (tc->salt_buf, line_buf, 64);
// salt
memcpy (tc->data_buf, line_buf + 64, 512 - 64);
memcpy (salt->salt_buf, line_buf, TC_SALT_LEN);
salt->salt_buf[0] = tc->salt_buf[0];
salt->salt_len = TC_SALT_LEN;
salt->salt_len = 4;
// iter
salt->salt_iter = ROUNDS_TRUECRYPT_2K - 1;
// data
memcpy (tc->data_buf, line_buf + TC_SALT_LEN, TC_DATA_LEN);
// signature
tc->signature = 0x45555254; // "TRUE"
digest[0] = tc->data_buf[0];
// fake digest
memcpy (digest, tc->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 = "TrueCrypt RIPEMD160 + XTS 1024 bit";
static const u64 KERN_TYPE = 6212;
@ -46,6 +46,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 TC_SALT_LEN 64
#define TC_DATA_LEN 448
#define TC_HEADER_LEN 512
typedef struct tc_tmp
{
u32 ipad[16];
@ -58,7 +62,6 @@ typedef struct tc_tmp
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -140,8 +143,6 @@ int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, tmpdata, st_hash_len / 2);
hcfree (tmpdata);
return parser_status;
@ -155,21 +156,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 TC_HEADER_SIZE 512
char *in = (char *) hcmalloc (TC_HEADER_LEN);
char *in = (char *) hcmalloc (TC_HEADER_SIZE);
const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp);
const size_t n = hc_fread (in, 1, TC_HEADER_LEN, &fp);
hc_fclose (&fp);
if (n != TC_HEADER_SIZE) return (PARSER_TC_FILE_SIZE);
if (n != TC_HEADER_LEN) return (PARSER_TC_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, TC_HEADER_SIZE);
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, TC_HEADER_LEN);
if (parser_status != PARSER_OK) return 0;
@ -222,23 +221,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tc_t *tc = (tc_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 (tc->salt_buf, line_buf, 64);
// salt
memcpy (tc->data_buf, line_buf + 64, 512 - 64);
memcpy (salt->salt_buf, line_buf, TC_SALT_LEN);
salt->salt_buf[0] = tc->salt_buf[0];
salt->salt_len = TC_SALT_LEN;
salt->salt_len = 4;
// iter
salt->salt_iter = ROUNDS_TRUECRYPT_2K - 1;
// data
memcpy (tc->data_buf, line_buf + TC_SALT_LEN, TC_DATA_LEN);
// signature
tc->signature = 0x45555254; // "TRUE"
digest[0] = tc->data_buf[0];
// fake digest
memcpy (digest, tc->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 = "TrueCrypt RIPEMD160 + XTS 1536 bit";
static const u64 KERN_TYPE = 6213;
@ -46,6 +46,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 TC_SALT_LEN 64
#define TC_DATA_LEN 448
#define TC_HEADER_LEN 512
typedef struct tc_tmp
{
u32 ipad[16];
@ -58,7 +62,6 @@ typedef struct tc_tmp
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -153,21 +156,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 TC_HEADER_SIZE 512
char *in = (char *) hcmalloc (TC_HEADER_SIZE);
char *in = (char *) hcmalloc (TC_HEADER_LEN);
const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp);
const size_t n = hc_fread (in, 1, TC_HEADER_LEN, &fp);
hc_fclose (&fp);
if (n != TC_HEADER_SIZE) return (PARSER_TC_FILE_SIZE);
if (n != TC_HEADER_LEN) return (PARSER_TC_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, TC_HEADER_SIZE);
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, in, TC_HEADER_LEN);
if (parser_status != PARSER_OK) return 0;
@ -220,23 +221,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tc_t *tc = (tc_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 (tc->salt_buf, line_buf, 64);
// salt
memcpy (tc->data_buf, line_buf + 64, 512 - 64);
memcpy (salt->salt_buf, line_buf, TC_SALT_LEN);
salt->salt_buf[0] = tc->salt_buf[0];
salt->salt_len = TC_SALT_LEN;
salt->salt_len = 4;
// iter
salt->salt_iter = ROUNDS_TRUECRYPT_2K - 1;
// data
memcpy (tc->data_buf, line_buf + TC_SALT_LEN, TC_DATA_LEN);
// signature
tc->signature = 0x45555254; // "TRUE"
digest[0] = tc->data_buf[0];
// fake digest
memcpy (digest, tc->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 = "TrueCrypt SHA512 + XTS 512 bit";
static const u64 KERN_TYPE = 6221;
@ -48,6 +48,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 TC_SALT_LEN 64
#define TC_DATA_LEN 448
#define TC_HEADER_LEN 512
typedef struct tc64_tmp
{
u64 ipad[8];
@ -60,7 +64,6 @@ typedef struct tc64_tmp
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -222,23 +225,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tc_t *tc = (tc_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 (tc->salt_buf, line_buf, 64);
// salt
memcpy (tc->data_buf, line_buf + 64, 512 - 64);
memcpy (salt->salt_buf, line_buf, TC_SALT_LEN);
salt->salt_buf[0] = tc->salt_buf[0];
salt->salt_len = TC_SALT_LEN;
salt->salt_len = 4;
// iter
salt->salt_iter = ROUNDS_TRUECRYPT_1K - 1;
// data
memcpy (tc->data_buf, line_buf + TC_SALT_LEN, TC_DATA_LEN);
// signature
tc->signature = 0x45555254; // "TRUE"
digest[0] = tc->data_buf[0];
// fake digest
memcpy (digest, tc->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 = "TrueCrypt SHA512 + XTS 1024 bit";
static const u64 KERN_TYPE = 6222;
@ -48,6 +48,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 TC_SALT_LEN 64
#define TC_DATA_LEN 448
#define TC_HEADER_LEN 512
typedef struct tc64_tmp
{
u64 ipad[8];
@ -60,7 +64,6 @@ typedef struct tc64_tmp
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -222,23 +225,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tc_t *tc = (tc_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 (tc->salt_buf, line_buf, 64);
// salt
memcpy (tc->data_buf, line_buf + 64, 512 - 64);
memcpy (salt->salt_buf, line_buf, TC_SALT_LEN);
salt->salt_buf[0] = tc->salt_buf[0];
salt->salt_len = TC_SALT_LEN;
salt->salt_len = 4;
// iter
salt->salt_iter = ROUNDS_TRUECRYPT_1K - 1;
// data
memcpy (tc->data_buf, line_buf + TC_SALT_LEN, TC_DATA_LEN);
// signature
tc->signature = 0x45555254; // "TRUE"
digest[0] = tc->data_buf[0];
// fake digest
memcpy (digest, tc->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 = "TrueCrypt SHA512 + XTS 1536 bit";
static const u64 KERN_TYPE = 6223;
@ -48,6 +48,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 TC_SALT_LEN 64
#define TC_DATA_LEN 448
#define TC_HEADER_LEN 512
typedef struct tc64_tmp
{
u64 ipad[8];
@ -60,7 +64,6 @@ typedef struct tc64_tmp
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -222,23 +225,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tc_t *tc = (tc_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 (tc->salt_buf, line_buf, 64);
// salt
memcpy (tc->data_buf, line_buf + 64, 512 - 64);
memcpy (salt->salt_buf, line_buf, TC_SALT_LEN);
salt->salt_buf[0] = tc->salt_buf[0];
salt->salt_len = TC_SALT_LEN;
salt->salt_len = 4;
// iter
salt->salt_iter = ROUNDS_TRUECRYPT_1K - 1;
// data
memcpy (tc->data_buf, line_buf + TC_SALT_LEN, TC_DATA_LEN);
// signature
tc->signature = 0x45555254; // "TRUE"
digest[0] = tc->data_buf[0];
// fake digest
memcpy (digest, tc->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 = "TrueCrypt Whirlpool + XTS 512 bit";
static const u64 KERN_TYPE = 6231;
@ -47,6 +47,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 TC_SALT_LEN 64
#define TC_DATA_LEN 448
#define TC_HEADER_LEN 512
typedef struct tc_tmp
{
u32 ipad[16];
@ -59,7 +63,6 @@ typedef struct tc_tmp
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -150,8 +153,6 @@ int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, tmpdata, st_hash_len / 2);
hcfree (tmpdata);
return parser_status;
@ -232,23 +233,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tc_t *tc = (tc_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 (tc->salt_buf, line_buf, 64);
// salt
memcpy (tc->data_buf, line_buf + 64, 512 - 64);
memcpy (salt->salt_buf, line_buf, TC_SALT_LEN);
salt->salt_buf[0] = tc->salt_buf[0];
salt->salt_len = TC_SALT_LEN;
salt->salt_len = 4;
// iter
salt->salt_iter = ROUNDS_TRUECRYPT_1K - 1;
// data
memcpy (tc->data_buf, line_buf + TC_SALT_LEN, TC_DATA_LEN);
// signature
tc->signature = 0x45555254; // "TRUE"
digest[0] = tc->data_buf[0];
// fake digest
memcpy (digest, tc->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 = "TrueCrypt Whirlpool + XTS 1024 bit";
static const u64 KERN_TYPE = 6232;
@ -47,6 +47,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 TC_SALT_LEN 64
#define TC_DATA_LEN 448
#define TC_HEADER_LEN 512
typedef struct tc_tmp
{
u32 ipad[16];
@ -59,7 +63,6 @@ typedef struct tc_tmp
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -150,8 +153,6 @@ int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, tmpdata, st_hash_len / 2);
hcfree (tmpdata);
return parser_status;
@ -232,23 +233,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tc_t *tc = (tc_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 (tc->salt_buf, line_buf, 64);
// salt
memcpy (tc->data_buf, line_buf + 64, 512 - 64);
memcpy (salt->salt_buf, line_buf, TC_SALT_LEN);
salt->salt_buf[0] = tc->salt_buf[0];
salt->salt_len = TC_SALT_LEN;
salt->salt_len = 4;
// iter
salt->salt_iter = ROUNDS_TRUECRYPT_1K - 1;
// data
memcpy (tc->data_buf, line_buf + TC_SALT_LEN, TC_DATA_LEN);
// signature
tc->signature = 0x45555254; // "TRUE"
digest[0] = tc->data_buf[0];
// fake digest
memcpy (digest, tc->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 = "TrueCrypt Whirlpool + XTS 1536 bit";
static const u64 KERN_TYPE = 6233;
@ -47,6 +47,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 TC_SALT_LEN 64
#define TC_DATA_LEN 448
#define TC_HEADER_LEN 512
typedef struct tc_tmp
{
u32 ipad[16];
@ -59,7 +63,6 @@ typedef struct tc_tmp
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -146,8 +149,6 @@ int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, tmpdata, st_hash_len / 2);
hcfree (tmpdata);
return parser_status;
@ -228,23 +229,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tc_t *tc = (tc_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 (tc->salt_buf, line_buf, 64);
// salt
memcpy (tc->data_buf, line_buf + 64, 512 - 64);
memcpy (salt->salt_buf, line_buf, TC_SALT_LEN);
salt->salt_buf[0] = tc->salt_buf[0];
salt->salt_len = TC_SALT_LEN;
salt->salt_len = 4;
// iter
salt->salt_iter = ROUNDS_TRUECRYPT_1K - 1;
// data
memcpy (tc->data_buf, line_buf + TC_SALT_LEN, TC_DATA_LEN);
// signature
tc->signature = 0x45555254; // "TRUE"
digest[0] = tc->data_buf[0];
// fake digest
memcpy (digest, tc->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 = "TrueCrypt RIPEMD160 + XTS 512 bit + boot-mode";
static const u64 KERN_TYPE = 6211;
@ -47,6 +47,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 TC_SALT_LEN 64
#define TC_DATA_LEN 448
#define TC_HEADER_LEN 512
typedef struct tc_tmp
{
u32 ipad[16];
@ -59,7 +63,6 @@ typedef struct tc_tmp
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -153,8 +156,6 @@ int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, tmpdata, st_hash_len / 2);
hcfree (tmpdata);
return parser_status;
@ -235,23 +236,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tc_t *tc = (tc_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 (tc->salt_buf, line_buf, 64);
// salt
memcpy (tc->data_buf, line_buf + 64, 512 - 64);
memcpy (salt->salt_buf, line_buf, TC_SALT_LEN);
salt->salt_buf[0] = tc->salt_buf[0];
salt->salt_len = TC_SALT_LEN;
salt->salt_len = 4;
// iter
salt->salt_iter = ROUNDS_TRUECRYPT_1K - 1;
// data
memcpy (tc->data_buf, line_buf + TC_SALT_LEN, TC_DATA_LEN);
// signature
tc->signature = 0x45555254; // "TRUE"
digest[0] = tc->data_buf[0];
// fake digest
memcpy (digest, tc->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 = "TrueCrypt RIPEMD160 + XTS 1024 bit + boot-mode";
static const u64 KERN_TYPE = 6212;
@ -47,6 +47,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 TC_SALT_LEN 64
#define TC_DATA_LEN 448
#define TC_HEADER_LEN 512
typedef struct tc_tmp
{
u32 ipad[16];
@ -59,7 +63,6 @@ typedef struct tc_tmp
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -153,8 +156,6 @@ int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, tmpdata, st_hash_len / 2);
hcfree (tmpdata);
return parser_status;
@ -235,23 +236,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tc_t *tc = (tc_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 (tc->salt_buf, line_buf, 64);
// salt
memcpy (tc->data_buf, line_buf + 64, 512 - 64);
memcpy (salt->salt_buf, line_buf, TC_SALT_LEN);
salt->salt_buf[0] = tc->salt_buf[0];
salt->salt_len = TC_SALT_LEN;
salt->salt_len = 4;
// iter
salt->salt_iter = ROUNDS_TRUECRYPT_1K - 1;
// data
memcpy (tc->data_buf, line_buf + TC_SALT_LEN, TC_DATA_LEN);
// signature
tc->signature = 0x45555254; // "TRUE"
digest[0] = tc->data_buf[0];
// fake digest
memcpy (digest, tc->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 = "TrueCrypt RIPEMD160 + XTS 1536 bit + boot-mode";
static const u64 KERN_TYPE = 6213;
@ -47,6 +47,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 TC_SALT_LEN 64
#define TC_DATA_LEN 448
#define TC_HEADER_LEN 512
typedef struct tc_tmp
{
u32 ipad[16];
@ -59,7 +63,6 @@ typedef struct tc_tmp
typedef struct tc
{
u32 salt_buf[32];
u32 data_buf[112];
u32 keyfile_buf16[16];
u32 keyfile_buf32[32];
@ -153,8 +156,6 @@ int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, tmpdata, st_hash_len / 2);
hcfree (tmpdata);
return parser_status;
@ -235,23 +236,33 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
tc_t *tc = (tc_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 (tc->salt_buf, line_buf, 64);
// salt
memcpy (tc->data_buf, line_buf + 64, 512 - 64);
memcpy (salt->salt_buf, line_buf, TC_SALT_LEN);
salt->salt_buf[0] = tc->salt_buf[0];
salt->salt_len = TC_SALT_LEN;
salt->salt_len = 4;
// iter
salt->salt_iter = ROUNDS_TRUECRYPT_1K - 1;
// data
memcpy (tc->data_buf, line_buf + TC_SALT_LEN, TC_DATA_LEN);
// signature
tc->signature = 0x45555254; // "TRUE"
digest[0] = tc->data_buf[0];
// fake digest
memcpy (digest, tc->data_buf, 112);
return (PARSER_OK);
}

Loading…
Cancel
Save